From 26817ff23f63d4ae3e9ac24dad470256ad196c0f Mon Sep 17 00:00:00 2001 From: "Sridhar.Mani" Date: Wed, 21 May 2025 19:08:52 +0530 Subject: [PATCH 01/12] Made the initial build for npm --- .gitignore | 3 + .npmignore | 7 + dist/feascript.cjs.js | 8 + dist/feascript.cjs.js.map | 1 + dist/feascript.esm.js | 7 + dist/feascript.esm.js.map | 1 + dist/feascript.umd.js | 8 + dist/feascript.umd.js.map | 1 + package-lock.json | 856 ++++++++++++++++++++++++++++++++++++++ package.json | 44 ++ rollup.config.js | 43 ++ tsconfig.json | 25 ++ 12 files changed, 1004 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 dist/feascript.cjs.js create mode 100644 dist/feascript.cjs.js.map create mode 100644 dist/feascript.esm.js create mode 100644 dist/feascript.esm.js.map create mode 100644 dist/feascript.umd.js create mode 100644 dist/feascript.umd.js.map create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 rollup.config.js create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c7c58b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/node_modules +node_modules +node_modules/ \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..e2f3270 --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +examples/ +test/ +.gitignore +README.md +LICENSE +dist/ +package-lock.json \ No newline at end of file diff --git a/dist/feascript.cjs.js b/dist/feascript.cjs.js new file mode 100644 index 0000000..6bc029a --- /dev/null +++ b/dist/feascript.cjs.js @@ -0,0 +1,8 @@ +Object.defineProperty(exports,"__esModule",{value:!0});class e{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let t="basic";function n(e){"debug"===t&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function s(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function o(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class i{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],i=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void o("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,i[0]=-1*r(e),i[1]=1*r(e),i[2]=-1*e,i[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),i[0]=a(e)*h(t),i[1]=a(e)*m(t),i[2]=a(e)*u(t),i[3]=l(e)*h(t),i[4]=l(e)*m(t),i[5]=l(e)*u(t),i[6]=d(e)*h(t),i[7]=d(e)*m(t),i[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:i}}}class r{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,n("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const s=t[0],i=t[1];n(`Processing boundary node pair: [${s}, ${i}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[s][0]){const o=this.boundaryConditions[s][1];n(`Boundary ${s}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[s].forEach((([s,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[s][0]){const o=this.boundaryConditions[s][1];n(`Boundary ${s}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[s].forEach((([s,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((s=>{if("convection"===this.boundaryConditions[s][0]){const o=d[s],i=h[s];n(`Boundary ${s}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[s].forEach((([s,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[s][a]-1;n(` - Applied convection boundary condition to node ${l+1} (element ${s+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((s=>{if("convection"===this.boundaryConditions[s][0]){const m=d[s],u=h[s];n(`Boundary ${s}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[s].forEach((([s,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=o[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=o[0],f=0,p=2,y=1):2===d?(h=o[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=o[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const N=this.nop[s].length;for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,f=new Map([["proxy",{canHandle:e=>c(e)&&e[l],serialize(e){const{port1:t,port2:n}=new MessageChannel;return p(e,t),[n,[n]]},deserialize:e=>(e.start(),g(e))}],["throw",{canHandle:e=>c(e)&&u in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function p(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),d=(o.data.argumentList||[]).map(S);let h;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":h=n;break;case"SET":t[a.slice(-1)[0]]=S(o.data.value),h=!0;break;case"APPLY":h=n.apply(t,d);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[l]:!0})}(new n(...d));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;p(e,n),h=function(e,t){return C.set(e,t),e}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(e){h={value:e,[u]:0}}Promise.resolve(h).catch((e=>({value:e,[u]:0}))).then((n=>{const[o,a]=N(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),y(t),m in e&&"function"==typeof e[m]&&e[m]())})).catch((e=>{const[n,s]=N({value:new TypeError("Unserializable return value"),[u]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function y(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function g(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),v(e,n,[],t)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function E(e){return x(e,new Map,{type:"RELEASE"}).then((()=>{y(e)}))}const M=new WeakMap,$="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(M.get(e)||0)-1;M.set(e,t),0===t&&E(e)}));function v(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(b(o),r===h)return()=>{!function(e){$&&$.unregister(e)}(i),E(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=x(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(S);return s.then.bind(s)}return v(e,t,[...n,r])},set(s,i,r){b(o);const[a,l]=N(r);return x(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(S)},apply(s,i,r){b(o);const a=n[n.length-1];if(a===d)return x(e,t,{type:"ENDPOINT"}).then(S);if("bind"===a)return v(e,t,n.slice(0,-1));const[l,h]=w(r);return x(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},h).then(S)},construct(s,i){b(o);const[r,a]=w(i);return x(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(S)}});return function(e,t){const n=(M.get(t)||0)+1;M.set(t,n),$&&$.register(e,t,e)}(i,e),i}function w(e){const t=e.map(N);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const C=new WeakMap;function N(e){for(const[t,n]of f)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},C.get(e)||[]]}function S(e){switch(e.type){case"HANDLER":return f.get(e.name).deserialize(e.value);case"RAW":return e.value}}function x(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}exports.FEAScriptModel=class{constructor(){this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",s("FEAScriptModel instance created")}setSolverConfig(e){this.solverConfig=e,n(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,n(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,n(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,n(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let t=[],o=[],l=[],d={};if(s("Beginning matrix assembly..."),console.time("assemblyMatrices"),"solidHeatTransferScript"===this.solverConfig&&(s(`Using solver: ${this.solverConfig}`),({jacobianMatrix:t,residualVector:o,nodesCoordinates:d}=function(t,o){s("Starting solid heat transfer matrix assembly...");const{meshDimension:l,numElementsX:d,numElementsY:h,maxX:m,maxY:u,elementOrder:c,parsedMesh:f}=t;n("Generating mesh...");const p=new r({numElementsX:d,numElementsY:h,maxX:m,maxY:u,meshDimension:l,elementOrder:c,parsedMesh:f}).generateMesh();let y,g,b=p.nodesXCoordinates,E=p.nodesYCoordinates,M=p.totalNodesX,$=p.totalNodesY,v=p.nodalNumbering,w=p.boundaryElements;null!=f?(y=v.length,g=b.length,n(`Using parsed mesh with ${y} elements and ${g} nodes`)):(y=d*("2D"===l?h:1),g=M*("2D"===l?$:1),n(`Using mesh generated from geometry with ${y} elements and ${g} nodes`));let C,N,S,x,D,O,A,F=[],T=[],k=[],X=[],P=[],R=[],Y=[],W=[],I=[],j=[];for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=g(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),s("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),s(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),s("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return s(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},exports.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},s=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(n[0]),t.ascii="0"===n[1],t.fltBytes=n[2];else if("physicalNames"===o){if(n.length>=3){if(!/^\d+$/.test(n[0])){i++;continue}const e=parseInt(n[0],10),s=parseInt(n[1],10);let o=n.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:s,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(n[0],10),a=parseInt(n[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),n(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},exports.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),t="basic"):(t=e,s(`Log level set to: ${e}`))},exports.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","fill","floor","random","Number","MAX_SAFE_INTEGER","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","worker","feaWorker","isReady","_initWorker","Worker","URL","document","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":"uDAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1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MAAMoV,KAAK9S,GAAoB,CAAC6U,EAAWC,IAG/EG,EAAmBtI,KAAKoI,QAAQrX,MAAMoV,KAAKxH,GAAiB,CAACuJ,EAAWC,IAGxEI,EAAqBvI,KAAKwI,UAAUF,GAGpCG,EAAmB,GACvB,IAAK,IAAIzW,EAAI,EAAGA,EAAIkW,EAAYC,EAAWnW,GAAKmW,EAAW,CACzD,IAAIO,EAAStV,EAAkBpB,GAC/ByW,EAAiB9W,KAAK+W,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHjP,KAAM,UACNuP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETtG,EAAGgI,EACHlD,EAAG8C,EAAqB,GACxB3V,KAAM,kBAIR4U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBlI,EAAGrN,EACHmS,EAAGlS,EACHuV,EAAGd,EACHxO,KAAM,UACNuP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETrU,KAAM,kBAIR4U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,uBVtGOnE,iBACL9T,EAAS,oDACT,IACE,MAAM0Z,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAna,EAAS,4BAA4B8Z,KAC9BA,CACR,CAAC,MAAOrO,GAEP,OADAxL,EAAS,wCAA0CwL,GAC5C,iCACR,CACH"} \ No newline at end of file diff --git a/dist/feascript.esm.js b/dist/feascript.esm.js new file mode 100644 index 0000000..ac62789 --- /dev/null +++ b/dist/feascript.esm.js @@ -0,0 +1,7 @@ +class e{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let t="basic";function n(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),t="basic"):(t=e,o(`Log level set to: ${e}`))}function s(e){"debug"===t&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function o(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function i(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}async function r(){o("Fetching latest FEAScript version information...");try{const e=await fetch("https://api.github.com/repos/FEAScript/FEAScript/commits/main"),t=await e.json(),n=new Date(t.commit.committer.date).toLocaleString();return o(`Latest FEAScript update: ${n}`),n}catch(e){return i("Failed to fetch version information: "+e),"Version information unavailable"}}class a{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void i("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,o[0]=-1*r(e),o[1]=1*r(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),o[0]=a(e)*h(t),o[1]=a(e)*m(t),o[2]=a(e)*u(t),o[3]=l(e)*h(t),o[4]=l(e)*m(t),o[5]=l(e)*u(t),o[6]=d(e)*h(t),o[7]=d(e)*m(t),o[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class l{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,s("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],o=t[1];s(`Processing boundary node pair: [${n}, ${o}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const o=d[n],i=h[n];s(`Boundary ${n}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;s(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((o=>{if("convection"===this.boundaryConditions[o][0]){const m=d[o],u=h[o];s(`Boundary ${o}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[o].forEach((([o,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=n[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=n[0],f=0,p=2,y=1):2===d?(h=n[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=n[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const N=this.nop[o].length;for(let e=0;e{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(s[0]),t.ascii="0"===s[1],t.fltBytes=s[2];else if("physicalNames"===o){if(s.length>=3){if(!/^\d+$/.test(s[0])){i++;continue}const e=parseInt(s[0],10),n=parseInt(s[1],10);let o=s.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(s[0],10),a=parseInt(s[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),s(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t};function u(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,E=new Map([["proxy",{canHandle:e=>b(e)&&e[c],serialize(e){const{port1:t,port2:n}=new MessageChannel;return M(e,t),[n,[n]]},deserialize:e=>(e.start(),v(e))}],["throw",{canHandle:e=>b(e)&&g in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function M(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(F);let d;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":d=n;break;case"SET":t[a.slice(-1)[0]]=F(o.data.value),d=!0;break;case"APPLY":d=n.apply(t,l);break;case"CONSTRUCT":d=function(e){return Object.assign(e,{[c]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;M(e,n),d=function(e,t){return x.set(e,t),e}(t,[t])}break;case"RELEASE":d=void 0;break;default:return}}catch(e){d={value:e,[g]:0}}Promise.resolve(d).catch((e=>({value:e,[g]:0}))).then((n=>{const[o,a]=A(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),$(t),y in e&&"function"==typeof e[y]&&e[y]())})).catch((e=>{const[n,s]=A({value:new TypeError("Unserializable return value"),[g]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function $(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function v(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),D(e,n,[],t)}function w(e){if(e)throw new Error("Proxy has been released and is not useable")}function C(e){return T(e,new Map,{type:"RELEASE"}).then((()=>{$(e)}))}const N=new WeakMap,S="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(N.get(e)||0)-1;N.set(e,t),0===t&&C(e)}));function D(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(w(o),r===p)return()=>{!function(e){S&&S.unregister(e)}(i),C(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=T(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(F);return s.then.bind(s)}return D(e,t,[...n,r])},set(s,i,r){w(o);const[a,l]=A(r);return T(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(F)},apply(s,i,r){w(o);const a=n[n.length-1];if(a===f)return T(e,t,{type:"ENDPOINT"}).then(F);if("bind"===a)return D(e,t,n.slice(0,-1));const[l,d]=O(r);return T(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(F)},construct(s,i){w(o);const[r,a]=O(i);return T(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(F)}});return function(e,t){const n=(N.get(t)||0)+1;N.set(t,n),S&&S.register(e,t,e)}(i,e),i}function O(e){const t=e.map(A);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const x=new WeakMap;function A(e){for(const[t,n]of E)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},x.get(e)||[]]}function F(e){switch(e.type){case"HANDLER":return E.get(e.name).deserialize(e.value);case"RAW":return e.value}}function T(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}class k{constructor(){this.worker=null,this.feaWorker=null,this.isReady=!1,this._initWorker()}async _initWorker(){try{this.worker=new Worker(new URL("./wrapperScript.js",import.meta.url),{type:"module"}),this.worker.onerror=e=>{console.error("FEAScriptWorker: Worker error:",e)};const e=v(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),o("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),o(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),o("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return o(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}}export{h as FEAScriptModel,k as FEAScriptWorker,m as importGmshQuadTri,n as logSystem,u as plotSolution,r as printVersion}; +//# sourceMappingURL=feascript.esm.js.map diff --git a/dist/feascript.esm.js.map b/dist/feascript.esm.js.map new file mode 100644 index 0000000..16e0e11 --- /dev/null +++ b/dist/feascript.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"feascript.esm.js","sources":["../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/vendor/comlink.mjs","../src/workers/workerScript.js"],"sourcesContent":["// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Class to handle numerical integration using Gauss quadrature\r\n */\r\nexport class numericalIntegration {\r\n /**\r\n * Constructor to initialize the numericalIntegration class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to return Gauss points and weights based on element configuration\r\n * @returns {object} An object containing:\r\n * - gaussPoints: Array of Gauss points\r\n * - gaussWeights: Array of Gauss weights\r\n */\r\n getGaussPointsAndWeights() {\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // For linear elements, use 1-point Gauss quadrature\r\n gaussPoints[0] = 0.5;\r\n gaussWeights[0] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // For quadratic elements, use 3-point Gauss quadrature\r\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\r\n gaussPoints[1] = 0.5;\r\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\r\n gaussWeights[0] = 5 / 18;\r\n gaussWeights[1] = 8 / 18;\r\n gaussWeights[2] = 5 / 18;\r\n }\r\n\r\n return { gaussPoints, gaussWeights };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Global logging level\r\nlet currentLogLevel = \"basic\";\r\n\r\n/**\r\n * Function to set the logging system level\r\n * @param {string} level - Logging level (basic, debug)\r\n */\r\nexport function logSystem(level) {\r\n if (level !== \"basic\" && level !== \"debug\") {\r\n console.log(\r\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\r\n \"color: #FFC107; font-weight: bold;\"\r\n ); // Yellow for warnings\r\n currentLogLevel = \"basic\";\r\n } else {\r\n currentLogLevel = level;\r\n basicLog(`Log level set to: ${level}`);\r\n }\r\n}\r\n\r\n/**\r\n * Function to log debug messages - only logs if level is 'debug'\r\n * @param {string} message - Message to log\r\n */\r\nexport function debugLog(message) {\r\n if (currentLogLevel === \"debug\") {\r\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\r\n }\r\n}\r\n\r\n/**\r\n * Function to log basic information - always logs\r\n * @param {string} message - Message to log\r\n */\r\nexport function basicLog(message) {\r\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\r\n}\r\n\r\n/**\r\n * Function to log error messages\r\n * @param {string} message - Message to log\r\n */\r\nexport function errorLog(message) {\r\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\r\n}\r\n\r\n/**\r\n * Function to handle version information and fetch the latest update date and release from GitHub\r\n */\r\nexport async function printVersion() {\r\n basicLog(\"Fetching latest FEAScript version information...\");\r\n try {\r\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\r\n const commitData = await commitResponse.json();\r\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\r\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\r\n return latestCommitDate;\r\n } catch (error) {\r\n errorLog(\"Failed to fetch version information: \" + error);\r\n return \"Version information unavailable\";\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle basis functions and their derivatives based on element configuration\r\n */\r\nexport class basisFunctions {\r\n /**\r\n * Constructor to initialize the basisFunctions class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to calculate basis functions and their derivatives based on the dimension and order\r\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\r\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\r\n * @returns {object} An object containing:\r\n * - basisFunction: Array of evaluated basis functions\r\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\r\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\r\n */\r\n getBasisFunctions(ksi, eta = null) {\r\n let basisFunction = [];\r\n let basisFunctionDerivKsi = [];\r\n let basisFunctionDerivEta = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 1D elements\r\n basisFunction[0] = 1 - ksi;\r\n basisFunction[1] = ksi;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -1;\r\n basisFunctionDerivKsi[1] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 1D elements\r\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\r\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\r\n basisFunction[2] = -ksi + 2 * ksi ** 2;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\r\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\r\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (eta === null) {\r\n errorLog(\"Eta coordinate is required for 2D elements\");\r\n return;\r\n }\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 2D elements\r\n function l1(c) {\r\n return 1 - c;\r\n }\r\n function l2(c) {\r\n return c;\r\n }\r\n function dl1() {\r\n return -1;\r\n }\r\n function dl2() {\r\n return 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l2(ksi) * l1(eta);\r\n basisFunction[3] = l2(ksi) * l2(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\r\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\r\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\r\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\r\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 2D elements\r\n function l1(c) {\r\n return 2 * c ** 2 - 3 * c + 1;\r\n }\r\n function l2(c) {\r\n return -4 * c ** 2 + 4 * c;\r\n }\r\n function l3(c) {\r\n return 2 * c ** 2 - c;\r\n }\r\n function dl1(c) {\r\n return 4 * c - 3;\r\n }\r\n function dl2(c) {\r\n return -8 * c + 4;\r\n }\r\n function dl3(c) {\r\n return 4 * c - 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l1(ksi) * l3(eta);\r\n basisFunction[3] = l2(ksi) * l1(eta);\r\n basisFunction[4] = l2(ksi) * l2(eta);\r\n basisFunction[5] = l2(ksi) * l3(eta);\r\n basisFunction[6] = l3(ksi) * l1(eta);\r\n basisFunction[7] = l3(ksi) * l2(eta);\r\n basisFunction[8] = l3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\r\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\r\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\r\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\r\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\r\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\r\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\r\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\r\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\r\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\r\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\r\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\r\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\r\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\r\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\r\n }\r\n }\r\n\r\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle the generation of structured finite element meshes\r\n */\r\nexport class meshGeneration {\r\n /**\r\n * Constructor to initialize the meshGeneration class\r\n * @param {object} config - Configuration object for the mesh\r\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\r\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\r\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\r\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\r\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\r\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\r\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\r\n */\r\n constructor({\r\n numElementsX = null,\r\n maxX = null,\r\n numElementsY = null,\r\n maxY = null,\r\n meshDimension = null,\r\n elementOrder = \"linear\",\r\n parsedMesh = null,\r\n }) {\r\n this.numElementsX = numElementsX;\r\n this.numElementsY = numElementsY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n this.parsedMesh = parsedMesh;\r\n }\r\n\r\n /**\r\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\r\n * @returns {object} The generated mesh containing node coordinates and total nodes\r\n */\r\n generateMesh() {\r\n // If pre-parsed mesh data is provided, use it directly\r\n if (this.parsedMesh) {\r\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\r\n if (this.parsedMesh.nodalNumbering) {\r\n if (\r\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\r\n !Array.isArray(this.parsedMesh.nodalNumbering)\r\n ) {\r\n // Store the nodal numbering structure before converting\r\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\r\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\r\n\r\n debugLog(\r\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Check if it has quadElements or triangleElements structure from gmshReader\r\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\r\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\r\n const mappedNodalNumbering = [];\r\n\r\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\r\n const gmshNodes = quadElements[elemIdx];\r\n const feaScriptNodes = new Array(gmshNodes.length);\r\n\r\n // Check for element type based on number of nodes\r\n if (gmshNodes.length === 4) {\r\n // Simple mapping for linear quad elements (4 nodes)\r\n // GMSH: FEAScript:\r\n // 3 --- 2 1 --- 3\r\n // | | --> | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","logSystem","level","console","log","basicLog","debugLog","message","errorLog","async","printVersion","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString","error","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","FEAScriptModel","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","Error","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","fill","importGmshQuadTri","file","result","gmshV","ascii","fltBytes","lines","text","split","map","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","test","parseInt","slice","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","plotSolution","plotType","plotDivId","meshType","yData","arr","xData","from","lineData","mode","type","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","r","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","val","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","isAllowedOrigin","warn","id","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","prototype","concat","handler","serializedValue","msg","floor","random","Number","MAX_SAFE_INTEGER","FEAScriptWorker","worker","feaWorker","isReady","_initWorker","Worker","URL","url","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate"],"mappings":"AAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CH,EAAY,GAAK,GACjBA,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CF,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,IAGjB,CAAED,cAAaC,eACvB,ECtCH,IAAIG,EAAkB,QAMf,SAASC,EAAUC,GACV,UAAVA,GAA+B,UAAVA,GACvBC,QAAQC,IACN,+BAAiCF,EAAQ,yBACzC,sCAEFF,EAAkB,UAElBA,EAAkBE,EAClBG,EAAS,qBAAqBH,KAElC,CAMO,SAASI,EAASC,GACC,UAApBP,GACFG,QAAQC,IAAI,aAAeG,EAAS,qCAExC,CAMO,SAASF,EAASE,GACvBJ,QAAQC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CAAgBL,GAGpB,aAFMnJ,KAAKia,eACXtZ,EAAS,8CAA8CwI,KAChDnJ,KAAKuZ,UAAU/P,gBAAgBL,EACvC,CAMD,WAAMM,SACEzJ,KAAKia,eACXtZ,EAAS,uDAET,MAAM2Z,EAAYC,YAAYC,MACxBhO,QAAexM,KAAKuZ,UAAU9P,QAIpC,OADA9I,EAAS,4CAFO4Z,YAAYC,MAEmCF,GAAa,KAAMG,QAAQ,OACnFjO,CACR,CAMD,kBAAMkO,GAEJ,aADM1a,KAAKia,eACJja,KAAKuZ,UAAUmB,cACvB,CAMD,UAAMC,GAEJ,aADM3a,KAAKia,eACJja,KAAKuZ,UAAUoB,MACvB,CAKD,SAAAC,GACM5a,KAAKsZ,SACPtZ,KAAKsZ,OAAOsB,YACZ5a,KAAKsZ,OAAS,KACdtZ,KAAKuZ,UAAY,KACjBvZ,KAAKwZ,SAAU,EAElB"} \ No newline at end of file diff --git a/dist/feascript.umd.js b/dist/feascript.umd.js new file mode 100644 index 0000000..bc5b6cb --- /dev/null +++ b/dist/feascript.umd.js @@ -0,0 +1,8 @@ +function _loadWasmModule(e,t,n){for(var s=t.length,o="="==t[s-2]?2:"="==t[s-1]?1:0,i=new Uint8Array(3*s/4-o),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(130),l=0;l<64;l++)a[r.charCodeAt(l)]=l;for(var d=0,h=0;d>4,i[h++]=(15&m)<<4|u>>2,i[h++]=(3&u)<<6|63&a[t.charCodeAt(d+3)]}if(n&&!e)return WebAssembly.instantiate(i,n);if(n||e){var c=new WebAssembly.Module(i);return n?new WebAssembly.Instance(c,n):c}return WebAssembly.compile(i)}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FEAScript={})}(this,(function(e){"use strict";class t{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let n="basic";function s(e){"debug"===n&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function o(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function i(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class r{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void i("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,o[0]=-1*r(e),o[1]=1*r(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),o[0]=a(e)*h(t),o[1]=a(e)*m(t),o[2]=a(e)*u(t),o[3]=l(e)*h(t),o[4]=l(e)*m(t),o[5]=l(e)*u(t),o[6]=d(e)*h(t),o[7]=d(e)*m(t),o[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class a{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,s("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],o=t[1];s(`Processing boundary node pair: [${n}, ${o}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const o=d[n],i=h[n];s(`Boundary ${n}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;s(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((o=>{if("convection"===this.boundaryConditions[o][0]){const m=d[o],u=h[o];s(`Boundary ${o}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[o].forEach((([o,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=n[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=n[0],f=0,p=2,y=1):2===d?(h=n[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=n[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const S=this.nop[o].length;for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,p=new Map([["proxy",{canHandle:e=>f(e)&&e[d],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),b(e))}],["throw",{canHandle:e=>f(e)&&c in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(A);let h;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":h=n;break;case"SET":t[a.slice(-1)[0]]=A(o.data.value),h=!0;break;case"APPLY":h=n.apply(t,l);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[d]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),h=function(e,t){return S.set(e,t),e}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(e){h={value:e,[c]:0}}Promise.resolve(h).catch((e=>({value:e,[c]:0}))).then((n=>{const[o,a]=N(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),g(t),u in e&&"function"==typeof e[u]&&e[u]())})).catch((e=>{const[n,s]=N({value:new TypeError("Unserializable return value"),[c]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function g(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function b(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),w(e,n,[],t)}function E(e){if(e)throw new Error("Proxy has been released and is not useable")}function M(e){return D(e,new Map,{type:"RELEASE"}).then((()=>{g(e)}))}const $=new WeakMap,v="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=($.get(e)||0)-1;$.set(e,t),0===t&&M(e)}));function w(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(E(o),r===m)return()=>{!function(e){v&&v.unregister(e)}(i),M(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=D(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(A);return s.then.bind(s)}return w(e,t,[...n,r])},set(s,i,r){E(o);const[a,l]=N(r);return D(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(A)},apply(s,i,r){E(o);const a=n[n.length-1];if(a===h)return D(e,t,{type:"ENDPOINT"}).then(A);if("bind"===a)return w(e,t,n.slice(0,-1));const[l,d]=C(r);return D(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(A)},construct(s,i){E(o);const[r,a]=C(i);return D(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(A)}});return function(e,t){const n=($.get(t)||0)+1;$.set(t,n),v&&v.register(e,t,e)}(i,e),i}function C(e){const t=e.map(N);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const S=new WeakMap;function N(e){for(const[t,n]of p)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},S.get(e)||[]]}function A(e){switch(e.type){case"HANDLER":return p.get(e.name).deserialize(e.value);case"RAW":return e.value}}function D(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}e.FEAScriptModel=class{constructor(){this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",o("FEAScriptModel instance created")}setSolverConfig(e){this.solverConfig=e,s(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,s(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,s(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,s(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let e=[],n=[],i=[],d={};if(o("Beginning matrix assembly..."),console.time("assemblyMatrices"),"solidHeatTransferScript"===this.solverConfig&&(o(`Using solver: ${this.solverConfig}`),({jacobianMatrix:e,residualVector:n,nodesCoordinates:d}=function(e,n){o("Starting solid heat transfer matrix assembly...");const{meshDimension:i,numElementsX:d,numElementsY:h,maxX:m,maxY:u,elementOrder:c,parsedMesh:f}=e;s("Generating mesh...");const p=new a({numElementsX:d,numElementsY:h,maxX:m,maxY:u,meshDimension:i,elementOrder:c,parsedMesh:f}).generateMesh();let y,g,b=p.nodesXCoordinates,E=p.nodesYCoordinates,M=p.totalNodesX,$=p.totalNodesY,v=p.nodalNumbering,w=p.boundaryElements;null!=f?(y=v.length,g=b.length,s(`Using parsed mesh with ${y} elements and ${g} nodes`)):(y=d*("2D"===i?h:1),g=M*("2D"===i?$:1),s(`Using mesh generated from geometry with ${y} elements and ${g} nodes`));let C,S,N,A,D,O,x,F=[],T=[],k=[],X=[],P=[],W=[],R=[],Y=[],I=[],j=[];for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=b(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),o("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),o(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),o("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return o(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},e.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(s[0]),t.ascii="0"===s[1],t.fltBytes=s[2];else if("physicalNames"===o){if(s.length>=3){if(!/^\d+$/.test(s[0])){i++;continue}const e=parseInt(s[0],10),n=parseInt(s[1],10);let o=s.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(s[0],10),a=parseInt(s[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),s(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},e.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),n="basic"):(n=e,o(`Log level set to: ${e}`))},e.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","fill","floor","random","Number","MAX_SAFE_INTEGER","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","worker","feaWorker","isReady","_initWorker","Worker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":"oyBAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,G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iCACR,CACH"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..05ecadb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,856 @@ +{ + "name": "feascript", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "feascript", + "version": "1.0.0", + "license": "AGPLv3", + "devDependencies": { + "@rollup/plugin-commonjs": "^28.0.3", + "@rollup/plugin-node-resolve": "^16.0.1", + "rollup": "^2.79.2", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-typescript2": "^0.36.0", + "rollup-plugin-wasm": "^3.0.0", + "typescript": "^5.8.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz", + "integrity": "sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.1.tgz", + "integrity": "sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.15.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", + "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "2.79.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", + "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-terser": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", + "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", + "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "jest-worker": "^26.2.1", + "serialize-javascript": "^4.0.0", + "terser": "^5.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0" + } + }, + "node_modules/rollup-plugin-typescript2": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", + "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^4.1.2", + "find-cache-dir": "^3.3.2", + "fs-extra": "^10.0.0", + "semver": "^7.5.4", + "tslib": "^2.6.2" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/rollup-plugin-wasm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-wasm/-/rollup-plugin-wasm-3.0.0.tgz", + "integrity": "sha512-ySzhd2MtHbORJdRmpID0j1N59QpjyQ27qxo6XfEH2Pv2ckhLLiD8E1QuhLQDIIw7dXZhQYMyLRGJsiZCewTK7g==", + "deprecated": "This module has moved and is now available at @rollup/plugin-wasm. Please update your dependencies. This version is no longer maintained.", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/terser": { + "version": "5.39.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", + "integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.14.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..ec3cd96 --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "feascript", + "version": "1.0.0", + "description": "\"FEAScript", + "main": "src/index.js", + "directories": { + "example": "examples" + }, + "scripts": { + "build": "rollup -c", + "prepublishOnly": "npm run build", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/FEAScript/FEAScript-core.git" + }, + "keywords": [ + "finite element", + "simulation", + "javascript", + "web", + "FEA", + "FEM", + "finite element analysis", + "finite element method" + ], + "author": "Nikolaos Chamakos", + "license": "AGPLv3", + "type": "commonjs", + "bugs": { + "url": "https://github.com/FEAScript/FEAScript-core/issues" + }, + "homepage": "https://github.com/FEAScript/FEAScript-core#readme", + "devDependencies": { + "@rollup/plugin-commonjs": "^28.0.3", + "@rollup/plugin-node-resolve": "^16.0.1", + "rollup": "^2.79.2", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-typescript2": "^0.36.0", + "rollup-plugin-wasm": "^3.0.0", + "typescript": "^5.8.3" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..5b61ecf --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,43 @@ +import typescript from "rollup-plugin-typescript2"; +import resolve from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import { terser } from "rollup-plugin-terser"; +import wasm from "rollup-plugin-wasm"; + +export default { + input: "src/index.js", + output: [ + { + file: "dist/feascript.cjs.js", + format: "cjs", + sourcemap: true, + }, + { + file: "dist/feascript.esm.js", + format: "esm", + sourcemap: true, + }, + { + file: "dist/feascript.umd.js", + format: "umd", + name: "FEAScript", + sourcemap: true, + }, + ], + plugins: [ + resolve({ + browser: true, + preferBuiltins: false, + }), + commonjs(), + wasm({ + maxFileSize: 14000000, + }), + typescript({ + useTsconfigDeclarationDir: true, + clean: true, + }), + terser(), + ], + external: [], +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3107ac8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "outDir": "./dist", + "rootDir": "./src", + "allowJs": true, + "declaration": true, + "declarationDir": "./dist/types", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable", + "WebWorker", + "ESNext.AsyncIterable" + ], + "sourceMap": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test"] +} From 21a795bce7a619010bbc358a19b49789b03ae492 Mon Sep 17 00:00:00 2001 From: "Sridhar.Mani" Date: Thu, 22 May 2025 12:40:04 +0530 Subject: [PATCH 02/12] Add Taichi.js support to Jacobi method for accelerated computation; update package.json and package-lock.json to include taichi.js dependency --- package-lock.json | 230 +++++++++++++++++++++++++++++- package.json | 3 + src/methods/jacobiMethodScript.js | 147 +++++++++++++------ 3 files changed, 339 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05ecadb..db3e1dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "feascript", "version": "1.0.0", "license": "AGPLv3", + "dependencies": { + "taichi.js": "^0.0.36" + }, "devDependencies": { "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", @@ -43,6 +46,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", @@ -107,6 +119,141 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@loaders.gl/core": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-3.4.15.tgz", + "integrity": "sha512-rPOOTuusWlRRNMWg7hymZBoFmPCXWThsA5ZYRfqqXnsgVeQIi8hzcAhJ7zDUIFAd/OSR8ravtqb0SH+3k6MOFQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "@probe.gl/log": "^3.5.0" + } + }, + "node_modules/@loaders.gl/draco": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/draco/-/draco-3.4.15.tgz", + "integrity": "sha512-SStmyP0ZnS4JbWZb2NhrfiHW65uy3pVTTzQDTgXfkR5cD9oDAEu4nCaHbQ8x38/m39FHliCPgS9b1xWvLKQo8w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/schema": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "draco3d": "1.5.5" + } + }, + "node_modules/@loaders.gl/gltf": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/gltf/-/gltf-3.4.15.tgz", + "integrity": "sha512-Y6kMNPLiHQPr6aWQw/4BMTxgPHWx3fcib4LPpZCbhyfM8PRn6pOqATVngUXdoOf5XY0QtdKVld6N1kxlr4pJtw==", + "license": "MIT", + "dependencies": { + "@loaders.gl/draco": "3.4.15", + "@loaders.gl/images": "3.4.15", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/textures": "3.4.15", + "@math.gl/core": "^3.5.1" + } + }, + "node_modules/@loaders.gl/images": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-3.4.15.tgz", + "integrity": "sha512-QpjYhEetHabY/z9mWZYJXZZp4XJAxa38f9Ii/DjPlnJErepzY5GLBUTDHMu4oZ6n99gGImtuGFicDnFV6mb60g==", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "3.4.15" + } + }, + "node_modules/@loaders.gl/loader-utils": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-3.4.15.tgz", + "integrity": "sha512-uUx6tCaky6QgCRkqCNuuXiUfpTzKV+ZlJOf6C9bKp62lpvFOv9AwqoXmL23j8nfsENdlzsX3vPhc3en6QQyksA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/worker-utils": "3.4.15", + "@probe.gl/stats": "^3.5.0" + } + }, + "node_modules/@loaders.gl/schema": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-3.4.15.tgz", + "integrity": "sha512-8oRtstz0IsqES7eZd2jQbmCnmExCMtL8T6jWd1+BfmnuyZnQ0B6TNccy++NHtffHdYuzEoQgSELwcdmhSApYew==", + "license": "MIT", + "dependencies": { + "@types/geojson": "^7946.0.7" + } + }, + "node_modules/@loaders.gl/textures": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/textures/-/textures-3.4.15.tgz", + "integrity": "sha512-QHnmxBYtLvTdG1uMz2KWcxVY8KPb1+XyPJUoZV9GMcQkulz+CwFB8BaX8nROfMDz9KKYoPfksCzjig0LZ0WBJQ==", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "3.4.15", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/schema": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "ktx-parse": "^0.0.4", + "texture-compressor": "^1.0.2" + } + }, + "node_modules/@loaders.gl/worker-utils": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-3.4.15.tgz", + "integrity": "sha512-zUUepOYRYmcYIcr/c4Mchox9h5fBFNkD81rsGnLlZyq19QvyHzN+93SVxrLc078gw93t2RKrVcOOZY13zT3t1w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1" + } + }, + "node_modules/@math.gl/core": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-3.6.3.tgz", + "integrity": "sha512-jBABmDkj5uuuE0dTDmwwss7Cup5ZwQ6Qb7h1pgvtkEutTrhkcv8SuItQNXmF45494yIHeoGue08NlyeY6wxq2A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.0", + "@math.gl/types": "3.6.3", + "gl-matrix": "^3.4.0" + } + }, + "node_modules/@math.gl/types": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-3.6.3.tgz", + "integrity": "sha512-3uWLVXHY3jQxsXCr/UCNPSc2BG0hNUljhmOBt9l+lNFDp7zHgm0cK2Tw4kj2XfkJy4TgwZTBGwRDQgWEbLbdTA==", + "license": "MIT" + }, + "node_modules/@probe.gl/env": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-3.6.0.tgz", + "integrity": "sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0" + } + }, + "node_modules/@probe.gl/log": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-3.6.0.tgz", + "integrity": "sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0", + "@probe.gl/env": "3.6.0" + } + }, + "node_modules/@probe.gl/stats": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.6.0.tgz", + "integrity": "sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0" + } + }, "node_modules/@rollup/plugin-commonjs": { "version": "28.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz", @@ -189,6 +336,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.15.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", @@ -206,6 +359,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@webgpu/types": { + "version": "0.1.60", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.60.tgz", + "integrity": "sha512-8B/tdfRFKdrnejqmvq95ogp8tf52oZ51p3f4QD5m5Paey/qlX4Rhhy5Y8tgFMi7Ms70HzcMMw3EQjH/jdhTwlA==", + "license": "BSD-3-Clause" + }, "node_modules/acorn": { "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", @@ -219,6 +378,15 @@ "node": ">=0.4.0" } }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -250,6 +418,12 @@ "node": ">=0.10.0" } }, + "node_modules/draco3d": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.5.tgz", + "integrity": "sha512-JVuNV0EJzD3LBYhGyIXJLeBID/EVtmFO1ZNhAYflTgiMiAJlbhXQmRRda/azjc8MRVMHh0gqGhiqHUo5dIXM8Q==", + "license": "Apache-2.0" + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -344,6 +518,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", + "license": "MIT" + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -374,6 +554,18 @@ "node": ">= 0.4" } }, + "node_modules/image-size": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz", + "integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==", + "license": "MIT", + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", @@ -442,6 +634,12 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/ktx-parse": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-0.0.4.tgz", + "integrity": "sha512-LY3nrmfXl+wZZdPxgJ3ZmLvG+wkOZZP3/dr4RbQj1Pk3Qwz44esOOSFFVQJcNWpXAtiNIC66WgXufX/SYgYz6A==", + "license": "MIT" + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -769,6 +967,12 @@ "source-map": "^0.6.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -795,6 +999,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/taichi.js": { + "version": "0.0.36", + "resolved": "https://registry.npmjs.org/taichi.js/-/taichi.js-0.0.36.tgz", + "integrity": "sha512-JPVI5SSXEOHSAw2YXcL2Y4jKdvBaOyzolCyB5iN/Mhj+vM8hDvi5xzR5YFogZQyuETb53v7/RErvI9BHiyUHRQ==", + "dependencies": { + "@loaders.gl/core": "^3.1.8", + "@loaders.gl/gltf": "^3.1.8", + "@webgpu/types": "^0.1.20", + "gl-matrix": "^3.4.3", + "tslib": "^2.4.0" + } + }, "node_modules/terser": { "version": "5.39.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", @@ -814,11 +1030,23 @@ "node": ">=10" } }, + "node_modules/texture-compressor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/texture-compressor/-/texture-compressor-1.0.2.tgz", + "integrity": "sha512-dStVgoaQ11mA5htJ+RzZ51ZxIZqNOgWKAIvtjLrW1AliQQLCmrDqNzQZ8Jh91YealQ95DXt4MEduLzJmbs6lig==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.10", + "image-size": "^0.7.4" + }, + "bin": { + "texture-compressor": "bin/texture-compressor.js" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, "license": "0BSD" }, "node_modules/typescript": { diff --git a/package.json b/package.json index ec3cd96..2bae4b1 100644 --- a/package.json +++ b/package.json @@ -40,5 +40,8 @@ "rollup-plugin-typescript2": "^0.36.0", "rollup-plugin-wasm": "^3.0.0", "typescript": "^5.8.3" + }, + "dependencies": { + "taichi.js": "^0.0.36" } } diff --git a/src/methods/jacobiMethodScript.js b/src/methods/jacobiMethodScript.js index 1a3e3df..889edf2 100644 --- a/src/methods/jacobiMethodScript.js +++ b/src/methods/jacobiMethodScript.js @@ -10,6 +10,7 @@ /** * Function to solve a system of linear equations using the Jacobi iterative method + * This version uses Taichi.js to accelerate the core computation * @param {array} A - The coefficient matrix (must be square) * @param {array} b - The right-hand side vector * @param {array} x0 - Initial guess for solution vector @@ -20,48 +21,114 @@ * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ -export function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) { - const n = A.length; // Size of the square matrix - let x = [...x0]; // Current solution (starts with initial guess) - let xNew = new Array(n); // Next iteration's solution - - for (let iteration = 0; iteration < maxIterations; iteration++) { - // Perform one iteration - for (let i = 0; i < n; i++) { - let sum = 0; - // Calculate sum of A[i][j] * x[j] for j ≠ i - for (let j = 0; j < n; j++) { - if (j !== i) { - sum += A[i][j] * x[j]; +export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { + // Initialize Taichi for each call to ensure clean state + const taichi = await import('taichi.js'); + await taichi.init(); + + const n = A.length; + + // Choose appropriate float type based on precision parameter + const FloatArray = useFloat64 ? Float64Array : Float32Array; + + // Declare fields outside try block so they can be referenced in finally + let fieldA, fieldB, fieldCurrent, fieldNext, fieldMaxDiff; + + try { + // Create fields with appropriate precision + fieldA = taichi.field(FloatArray, [n, n]); + fieldB = taichi.field(FloatArray, [n]); + fieldCurrent = taichi.field(FloatArray, [n]); + fieldNext = taichi.field(FloatArray, [n]); + fieldMaxDiff = taichi.field(FloatArray, [1]); + + // Set initial values + fieldA.set(A.flat()); + fieldB.set(b); + fieldCurrent.set(x0); + + // Create kernels inline (no caching to prevent memory issues) + const updateKernel = taichi.kernel(function(A, b, current, next, n) { + for (let i = 0; i < n; i++) { + let sum = 0; + for (let j = 0; j < n; j++) { + if (j !== i) { + sum += A[i][j] * current[j]; + } } + next[i] = (b[i] - sum) / A[i][i]; + } + }); + + const diffKernel = taichi.kernel(function(current, next, maxDiff, n) { + maxDiff[0] = 0; + for (let i = 0; i < n; i++) { + const diff = Math.abs(next[i] - current[i]); + if (diff > maxDiff[0]) { + maxDiff[0] = diff; + } + } + }); + + const copyKernel = taichi.kernel(function(src, dst, n) { + for (let i = 0; i < n; i++) { + dst[i] = src[i]; + } + }); + + // Store solution here so we can return it after cleanup + let solution; + let iterationsCompleted; + let hasConverged = false; + + // Main iteration loop + for (let iteration = 0; iteration < maxIterations; iteration++) { + // Compute next iteration values + updateKernel(fieldA, fieldB, fieldCurrent, fieldNext, n); + + // Compute max difference directly in Taichi + diffKernel(fieldCurrent, fieldNext, fieldMaxDiff, n); + const maxDiff = fieldMaxDiff.get()[0]; + + // Copy next values to current using Taichi + copyKernel(fieldNext, fieldCurrent, n); + + // Check for convergence + if (maxDiff < tolerance) { + solution = Array.from(fieldCurrent.get()); + iterationsCompleted = iteration + 1; + hasConverged = true; + break; + } + + // If we're approaching maximum iterations, get the current solution + if (iteration === maxIterations - 1) { + solution = Array.from(fieldCurrent.get()); + iterationsCompleted = maxIterations; } - // Update xNew[i] using the Jacobi formula - xNew[i] = (b[i] - sum) / A[i][i]; - } - - // Check convergence - let maxDiff = 0; - for (let i = 0; i < n; i++) { - maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i])); } - - // Update x for next iteration - x = [...xNew]; - - // Successfully converged if maxDiff is less than tolerance - if (maxDiff < tolerance) { - return { - solution: x, - iterations: iteration + 1, - converged: true, - }; + + return { + solution: solution, + iterations: iterationsCompleted, + converged: hasConverged, + }; + } catch (error) { + console.error("Error in Jacobi method:", error); + throw error; + } finally { + // Aggressive cleanup - destroy all fields and reset Taichi completely + try { + if (fieldA) fieldA.destroy(); + if (fieldB) fieldB.destroy(); + if (fieldCurrent) fieldCurrent.destroy(); + if (fieldNext) fieldNext.destroy(); + if (fieldMaxDiff) fieldMaxDiff.destroy(); + + // Reset Taichi completely + taichi.reset(); + } catch (cleanupError) { + console.error("Error during cleanup:", cleanupError); } } - - // maxIterations were reached without convergence - return { - solution: x, - iterations: maxIterations, - converged: false, - }; -} +} \ No newline at end of file From bf3a0d091993b6c1577c1fdcebe44f702f4f32c8 Mon Sep 17 00:00:00 2001 From: sridhar <2019309038@student.annauniv.edu> Date: Tue, 21 Oct 2025 09:57:11 +0000 Subject: [PATCH 03/12] Add WebGPU compute and Jacobi workers with comprehensive testing suite - Implemented WebGPUComputeWorker for various linear algebra operations including vector addition, matrix-vector multiplication, dot product, normalization, and more. - Created WebGPUJacobiWorker for solving linear systems using the Jacobi method. - Developed a test HTML page to validate the functionality of the compute engine with multiple test cases for each operation. - Included error handling and success messages for better user feedback during tests. - Ensured compatibility with Comlink for worker communication. --- dist/feascript.cjs.js | 4 +- dist/feascript.cjs.js.map | 2 +- dist/feascript.esm.js | 4 +- dist/feascript.esm.js.map | 2 +- dist/feascript.umd.js | 11 +- dist/feascript.umd.js.map | 2 +- .../HeatConduction2DFinCG.html | 96 ++ src/FEAScript.js | 48 + src/methods/jacobiMethodScript.js | 118 +-- src/utilities/webgpuComputeEngine.js | 836 ++++++++++++++++++ src/vendor/taichi.esm.js | 16 + src/visualization/plotSolutionScript.js | 3 + src/workers/webgpuComputeWorker.js | 188 ++++ src/workers/webgpuJacobiWorker.js | 109 +++ testWebGPU.html | 651 ++++++++++++++ 15 files changed, 1972 insertions(+), 118 deletions(-) create mode 100644 examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinCG.html create mode 100644 src/utilities/webgpuComputeEngine.js create mode 100644 src/vendor/taichi.esm.js create mode 100644 src/workers/webgpuComputeWorker.js create mode 100644 src/workers/webgpuJacobiWorker.js create mode 100644 testWebGPU.html diff --git a/dist/feascript.cjs.js b/dist/feascript.cjs.js index 6bc029a..9d90f51 100644 --- a/dist/feascript.cjs.js +++ b/dist/feascript.cjs.js @@ -1,8 +1,8 @@ -Object.defineProperty(exports,"__esModule",{value:!0});class e{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let t="basic";function n(e){"debug"===t&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function s(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function o(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class i{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],i=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void o("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,i[0]=-1*r(e),i[1]=1*r(e),i[2]=-1*e,i[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),i[0]=a(e)*h(t),i[1]=a(e)*m(t),i[2]=a(e)*u(t),i[3]=l(e)*h(t),i[4]=l(e)*m(t),i[5]=l(e)*u(t),i[6]=d(e)*h(t),i[7]=d(e)*m(t),i[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:i}}}class r{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,n("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const s=t[0],i=t[1];n(`Processing boundary node pair: [${s}, ${i}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[s][0]){const o=this.boundaryConditions[s][1];n(`Boundary ${s}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[s].forEach((([s,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[s][0]){const o=this.boundaryConditions[s][1];n(`Boundary ${s}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[s].forEach((([s,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[s][i]-1;n(` - Applied fixed temperature to node ${r+1} (element ${s+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((s=>{if("convection"===this.boundaryConditions[s][0]){const o=d[s],i=h[s];n(`Boundary ${s}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[s].forEach((([s,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[s][a]-1;n(` - Applied convection boundary condition to node ${l+1} (element ${s+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((s=>{if("convection"===this.boundaryConditions[s][0]){const m=d[s],u=h[s];n(`Boundary ${s}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[s].forEach((([s,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=o[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=o[0],f=0,p=2,y=1):2===d?(h=o[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=o[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const N=this.nop[s].length;for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,f=new Map([["proxy",{canHandle:e=>c(e)&&e[l],serialize(e){const{port1:t,port2:n}=new MessageChannel;return p(e,t),[n,[n]]},deserialize:e=>(e.start(),g(e))}],["throw",{canHandle:e=>c(e)&&u in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function p(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),d=(o.data.argumentList||[]).map(S);let h;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":h=n;break;case"SET":t[a.slice(-1)[0]]=S(o.data.value),h=!0;break;case"APPLY":h=n.apply(t,d);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[l]:!0})}(new n(...d));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;p(e,n),h=function(e,t){return C.set(e,t),e}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(e){h={value:e,[u]:0}}Promise.resolve(h).catch((e=>({value:e,[u]:0}))).then((n=>{const[o,a]=N(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),y(t),m in e&&"function"==typeof e[m]&&e[m]())})).catch((e=>{const[n,s]=N({value:new TypeError("Unserializable return value"),[u]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function y(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function g(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),v(e,n,[],t)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function E(e){return x(e,new Map,{type:"RELEASE"}).then((()=>{y(e)}))}const M=new WeakMap,$="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(M.get(e)||0)-1;M.set(e,t),0===t&&E(e)}));function v(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(b(o),r===h)return()=>{!function(e){$&&$.unregister(e)}(i),E(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=x(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(S);return s.then.bind(s)}return v(e,t,[...n,r])},set(s,i,r){b(o);const[a,l]=N(r);return x(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(S)},apply(s,i,r){b(o);const a=n[n.length-1];if(a===d)return x(e,t,{type:"ENDPOINT"}).then(S);if("bind"===a)return v(e,t,n.slice(0,-1));const[l,h]=w(r);return x(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},h).then(S)},construct(s,i){b(o);const[r,a]=w(i);return x(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(S)}});return function(e,t){const n=(M.get(t)||0)+1;M.set(t,n),$&&$.register(e,t,e)}(i,e),i}function w(e){const t=e.map(N);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const C=new WeakMap;function N(e){for(const[t,n]of f)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},C.get(e)||[]]}function S(e){switch(e.type){case"HANDLER":return f.get(e.name).deserialize(e.value);case"RAW":return e.value}}function x(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}exports.FEAScriptModel=class{constructor(){this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",s("FEAScriptModel instance created")}setSolverConfig(e){this.solverConfig=e,n(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,n(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,n(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,n(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let t=[],o=[],l=[],d={};if(s("Beginning matrix assembly..."),console.time("assemblyMatrices"),"solidHeatTransferScript"===this.solverConfig&&(s(`Using solver: ${this.solverConfig}`),({jacobianMatrix:t,residualVector:o,nodesCoordinates:d}=function(t,o){s("Starting solid heat transfer matrix assembly...");const{meshDimension:l,numElementsX:d,numElementsY:h,maxX:m,maxY:u,elementOrder:c,parsedMesh:f}=t;n("Generating mesh...");const p=new r({numElementsX:d,numElementsY:h,maxX:m,maxY:u,meshDimension:l,elementOrder:c,parsedMesh:f}).generateMesh();let y,g,b=p.nodesXCoordinates,E=p.nodesYCoordinates,M=p.totalNodesX,$=p.totalNodesY,v=p.nodalNumbering,w=p.boundaryElements;null!=f?(y=v.length,g=b.length,n(`Using parsed mesh with ${y} elements and ${g} nodes`)):(y=d*("2D"===l?h:1),g=M*("2D"===l?$:1),n(`Using mesh generated from geometry with ${y} elements and ${g} nodes`));let C,N,S,x,D,O,A,F=[],T=[],k=[],X=[],P=[],R=[],Y=[],W=[],I=[],j=[];for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=g(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),s("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),s(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),s("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return s(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},exports.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},s=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(n[0]),t.ascii="0"===n[1],t.fltBytes=n[2];else if("physicalNames"===o){if(n.length>=3){if(!/^\d+$/.test(n[0])){i++;continue}const e=parseInt(n[0],10),s=parseInt(n[1],10);let o=n.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:s,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(n[0],10),a=parseInt(n[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),n(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},exports.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),t="basic"):(t=e,s(`Log level set to: ${e}`))},exports.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,r=new Map([["proxy",{canHandle:t=>i(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return a(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e))}],["throw",{canHandle:e=>i(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function a(t,n=globalThis,i=["*"]){n.addEventListener("message",(function r(d){if(!d||!d.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(i,d.origin))return void console.warn(`Invalid origin '${d.origin}' for comlink proxy`);const{id:h,type:m,path:u}=Object.assign({path:[]},d.data),c=(d.data.argumentList||[]).map(b);let f;try{const n=u.slice(0,-1).reduce(((e,t)=>e[t]),t),s=u.reduce(((e,t)=>e[t]),t);switch(m){case"GET":f=s;break;case"SET":n[u.slice(-1)[0]]=b(d.data.value),f=!0;break;case"APPLY":f=s.apply(n,c);break;case"CONSTRUCT":f=function(t){return Object.assign(t,{[e]:!0})}(new s(...c));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;a(t,n),f=function(e,t){return y.set(e,t),e}(e,[e])}break;case"RELEASE":f=void 0;break;default:return}}catch(e){f={value:e,[o]:0}}Promise.resolve(f).catch((e=>({value:e,[o]:0}))).then((e=>{const[o,i]=g(e);n.postMessage(Object.assign(Object.assign({},o),{id:h}),i),"RELEASE"===m&&(n.removeEventListener("message",r),l(n),s in t&&"function"==typeof t[s]&&t[s]())})).catch((e=>{const[t,s]=g({value:new TypeError("Unserializable return value"),[o]:0});n.postMessage(Object.assign(Object.assign({},t),{id:h}),s)}))})),n.start&&n.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function d(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),f(e,n,[],t)}function h(e){if(e)throw new Error("Proxy has been released and is not useable")}function m(e){return E(e,new Map,{type:"RELEASE"}).then((()=>{l(e)}))}const u=new WeakMap,c="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(u.get(e)||0)-1;u.set(e,t),0===t&&m(e)}));function f(e,s,o=[],i=function(){}){let r=!1;const a=new Proxy(i,{get(t,i){if(h(r),i===n)return()=>{!function(e){c&&c.unregister(e)}(a),m(e),s.clear(),r=!0};if("then"===i){if(0===o.length)return{then:()=>a};const t=E(e,s,{type:"GET",path:o.map((e=>e.toString()))}).then(b);return t.then.bind(t)}return f(e,s,[...o,i])},set(t,n,i){h(r);const[a,l]=g(i);return E(e,s,{type:"SET",path:[...o,n].map((e=>e.toString())),value:a},l).then(b)},apply(n,i,a){h(r);const l=o[o.length-1];if(l===t)return E(e,s,{type:"ENDPOINT"}).then(b);if("bind"===l)return f(e,s,o.slice(0,-1));const[d,m]=p(a);return E(e,s,{type:"APPLY",path:o.map((e=>e.toString())),argumentList:d},m).then(b)},construct(t,n){h(r);const[i,a]=p(n);return E(e,s,{type:"CONSTRUCT",path:o.map((e=>e.toString())),argumentList:i},a).then(b)}});return function(e,t){const n=(u.get(t)||0)+1;u.set(t,n),c&&c.register(e,t,e)}(a,e),a}function p(e){const t=e.map(g);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const y=new WeakMap;function g(e){for(const[t,n]of r)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},y.get(e)||[]]}function b(e){switch(e.type){case"HANDLER":return r.get(e.name).deserialize(e.value);case"RAW":return e.value}}function E(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}class M{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let $="basic";function w(e){"debug"===$&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function v(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function C(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class N{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void C("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function i(e){return 1-e}n[0]=i(e)*i(t),n[1]=i(e)*t,n[2]=e*i(t),n[3]=e*t,s[0]=-1*i(t),s[1]=-1*t,s[2]=1*i(t),s[3]=1*t,o[0]=-1*i(e),o[1]=1*i(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function r(e){return 2*e**2-3*e+1}function a(e){return-4*e**2+4*e}function l(e){return 2*e**2-e}function d(e){return 4*e-3}function h(e){return-8*e+4}function m(e){return 4*e-1}n[0]=r(e)*r(t),n[1]=r(e)*a(t),n[2]=r(e)*l(t),n[3]=a(e)*r(t),n[4]=a(e)*a(t),n[5]=a(e)*l(t),n[6]=l(e)*r(t),n[7]=l(e)*a(t),n[8]=l(e)*l(t),s[0]=d(e)*r(t),s[1]=d(e)*a(t),s[2]=d(e)*l(t),s[3]=h(e)*r(t),s[4]=h(e)*a(t),s[5]=h(e)*l(t),s[6]=m(e)*r(t),s[7]=m(e)*a(t),s[8]=m(e)*l(t),o[0]=r(e)*d(t),o[1]=r(e)*h(t),o[2]=r(e)*m(t),o[3]=a(e)*d(t),o[4]=a(e)*h(t),o[5]=a(e)*m(t),o[6]=l(e)*d(t),o[7]=l(e)*h(t),o[8]=l(e)*m(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class S{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,w("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],s=t[1];w(`Processing boundary node pair: [${n}, ${s}] for boundary ${e.tag} (${e.name||"unnamed"})`);let o=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(a[e]=t[1],l[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const s=a[n],o=l[n];w(`Boundary ${n}: Applying convection with heat transfer coefficient h=${s} W/(m²·K) and external temperature T∞=${o} K`),this.boundaryElements[n].forEach((([n,i])=>{let r;"linear"===this.elementOrder?r=0===i?0:1:"quadratic"===this.elementOrder&&(r=0===i?0:2);const a=this.nop[n][r]-1;w(` - Applied convection boundary condition to node ${a+1} (element ${n+1}, local node ${r+1})`),e[a]+=-s*o,t[a][a]+=s}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((d=>{if("convection"===this.boundaryConditions[d][0]){const h=a[d],m=l[d];w(`Boundary ${d}: Applying convection with heat transfer coefficient h=${h} W/(m²·K) and external temperature T∞=${m} K`),this.boundaryElements[d].forEach((([a,l])=>{if("linear"===this.elementOrder){let d,u,c,f,p;0===l?(d=n[0],u=0,c=0,f=3,p=2):1===l?(d=0,u=n[0],c=0,f=2,p=1):2===l?(d=n[0],u=1,c=1,f=4,p=2):3===l&&(d=1,u=n[0],c=2,f=4,p=1);let y=r.getBasisFunctions(d,u),g=y.basisFunction,b=y.basisFunctionDerivKsi,E=y.basisFunctionDerivEta,M=0,$=0,v=0,C=0;const N=this.nop[a].length;for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=d(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),v(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),v("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),v(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),v(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),v("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return v(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},exports.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),s="",o=0,i=0,r=0,a=0,l={numNodes:0},d=0,h=[],m=0,u=0,c=0,f={dim:0,tag:0,elementType:0,numElements:0},p=0,y={};for(;o""!==e));if("meshFormat"===s)t.gmshV=parseFloat(g[0]),t.ascii="0"===g[1],t.fltBytes=g[2];else if("physicalNames"===s){if(g.length>=3){if(!/^\d+$/.test(g[0])){o++;continue}const e=parseInt(g[0],10),n=parseInt(g[1],10);let s=g.slice(2).join(" ");s=s.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:s})}}else if("nodes"===s){if(0===i){i=parseInt(g[0],10),r=parseInt(g[1],10),t.nodesXCoordinates=new Array(r).fill(0),t.nodesYCoordinates=new Array(r).fill(0),o++;continue}if(aparseInt(e,10)));if(1===f.elementType||8===f.elementType){const n=f.tag;y[n]||(y[n]=[]),y[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===f.elementType?t.nodalNumbering.triangleElements.push(e):(3===f.elementType||10===f.elementType)&&t.nodalNumbering.quadElements.push(e);p++,p===f.numElements&&(c++,f={numElements:0})}}o++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=y[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),w(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},exports.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),$="basic"):($=e,v(`Log level set to: ${e}`))},exports.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","fill","floor","random","Number","MAX_SAFE_INTEGER","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","worker","feaWorker","isReady","_initWorker","Worker","URL","document","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":"uDAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CH,EAAY,GAAK,GACjBA,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CF,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,IAGjB,CAAED,cAAaC,eACvB,ECtCH,IA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,IAAIzW,EAAI,EAAGA,EAAIkW,EAAYC,EAAWnW,GAAKmW,EAAW,CACzD,IAAIO,EAAStV,EAAkBpB,GAC/ByW,EAAiB9W,KAAK+W,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHjP,KAAM,UACNuP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETtG,EAAGgI,EACHlD,EAAG8C,EAAqB,GACxB3V,KAAM,kBAIR4U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBlI,EAAGrN,EACHmS,EAAGlS,EACHuV,EAAGd,EACHxO,KAAM,UACNuP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETrU,KAAM,kBAIR4U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,uBVtGOnE,iBACL9T,EAAS,oDACT,IACE,MAAM0Z,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAna,EAAS,4BAA4B8Z,KAC9BA,CACR,CAAC,MAAOrO,GAEP,OADAxL,EAAS,wCAA0CwL,GAC5C,iCACR,CACH"} \ No newline at end of file +{"version":3,"file":"feascript.cjs.js","sources":["../src/vendor/comlink.mjs","../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/workers/workerScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class numericalIntegration {\n /**\n * Constructor to initialize the numericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersion() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class basisFunctions {\n /**\n * Constructor to initialize the basisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle the generation of structured finite element meshes\n */\nexport class meshGeneration {\n /**\n * Constructor to initialize the meshGeneration class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n }\n\n /**\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\n * @returns {object} The generated mesh containing node coordinates and total nodes\n */\n generateMesh() {\n // If pre-parsed mesh data is provided, use it directly\n if (this.parsedMesh) {\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\n if (this.parsedMesh.nodalNumbering) {\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.parsedMesh.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n }\n\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\n\n return this.parsedMesh;\n } else {\n // Validate required geometry parameters based on mesh dimension\n if (this.meshDimension === \"1D\") {\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n } else if (this.meshDimension === \"2D\") {\n if (\n this.numElementsX === null ||\n this.maxX === null ||\n this.numElementsY === null ||\n this.maxY === null\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n // Generate mesh based on dimension\n return this.generateMeshFromGeometry();\n }\n }\n\n /**\n * Function to generate a structured mesh based on the geometry configuration\n * @returns {object} An object containing the coordinates of nodes,\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\n */\n generateMeshFromGeometry() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n null, // numElementsY (not used in 1D)\n totalNodesX,\n null, // totalNodesY (not used in 1D)\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n } else if (this.meshDimension === \"2D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesX,\n totalNodesY,\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n if (this.meshDimension === \"1D\") {\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n } else if (this.meshDimension === \"2D\") {\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n return boundaryElements;\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (this.meshDimension === \"1D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n } else if (this.meshDimension === \"2D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n }\n\n return nop;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n ) {\n basicLog(\"Applying convection boundary conditions (Robin type)\");\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n basicLog(\"FEAScriptModel instance created\");\n }\n\n setSolverConfig(solverConfig) {\n this.solverConfig = solverConfig;\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\n );\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let nodesCoordinates = {};\n\n // Assembly matrices\n basicLog(\"Beginning matrix assembly...\");\n console.time(\"assemblyMatrices\");\n if (this.solverConfig === \"solidHeatTransferScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\n this.meshConfig,\n this.boundaryConditions\n ));\n }\n console.timeEnd(\"assemblyMatrices\");\n basicLog(\"Matrix assembly completed\");\n\n // System solving\n basicLog(`Solving system using ${this.solverMethod}...`);\n console.time(\"systemSolving\");\n if (this.solverMethod === \"lusolve\") {\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\n } else if (this.solverMethod === \"jacobi\") {\n // Create initial guess of zeros\n const initialGuess = new Array(residualVector.length).fill(0);\n // Call Jacobi method with desired max iterations and tolerance\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\n\n // Log convergence information\n if (jacobiResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\n } else {\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\n }\n\n solutionVector = jacobiResult.solution;\n }\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the solid heat transfer matrix\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n * - nodesCoordinates: Object containing x and y coordinates of nodes\n */\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh details from the configuration object\n const {\n meshDimension, // The dimension of the mesh\n numElementsX, // Number of elements in x-direction\n numElementsY, // Number of elements in y-direction (only for 2D)\n maxX, // Max x-coordinate (m) of the domain\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\n elementOrder, // The order of elements\n parsedMesh, // The pre-parsed mesh data (if available)\n } = meshConfig;\n\n // Create a new instance of the meshGeneration class\n debugLog(\"Generating mesh...\");\n const meshGenerationData = new meshGeneration({\n numElementsX,\n numElementsY,\n maxX,\n maxY,\n meshDimension,\n elementOrder,\n parsedMesh, // Pass the parsed mesh to the mesh generator\n });\n\n // Generate the mesh\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n\n // Debug log for mesh size\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n // Debug log for mesh size\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n // Initialize variables for matrix assembly\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n let basisFunction = []; // Basis functions\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\n let basisFunctionDerivX = []; // The x-derivative of the basis function\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\n let residualVector = []; // Galerkin residuals\n let jacobianMatrix = []; // Jacobian matrix\n let xCoordinates; // x-coordinate (physical coordinates)\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\n let ksiDerivX; // ksi-derivative of xCoordinates\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\n let detJacobian; // The jacobian of the isoparametric mapping\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the basisFunctions class\n const basisFunctionsData = new basisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the numericalIntegration class\n const numIntegrationData = new numericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\n gaussPoints = gaussPointsAndWeights.gaussPoints;\n gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n xCoordinates = 0;\n ksiDerivX = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n detJacobian = ksiDerivX;\n }\n\n // Compute x-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n // 2D solid heat transfer\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Initialise variables for isoparametric mapping\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n xCoordinates = 0;\n yCoordinates = 0;\n ksiDerivX = 0;\n etaDerivX = 0;\n ksiDerivY = 0;\n etaDerivY = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\n }\n\n // Compute x-derivative and y-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian; // The x-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian; // The y-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Create an instance of ThermalBoundaryConditions\n debugLog(\"Applying thermal boundary conditions...\");\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n );\n debugLog(\"Convection boundary conditions applied\");\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n debugLog(\"Constant temperature boundary conditions applied\");\n\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n nodesCoordinates: {\n nodesXCoordinates,\n nodesYCoordinates,\n },\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport * as Comlink from \"../vendor/comlink.mjs\";\nimport { WebGPUComputeEngine } from \"../utilities/webgpuComputeEngine.js\";\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * This version uses the WebGPU compute engine for maximum performance and reusability\n * @param {array} A - The coefficient matrix (must be square)\n * @param {array} b - The right-hand side vector\n * @param {array} x0 - Initial guess for solution vector\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-7] - Convergence tolerance\n * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision\n * @returns {object} An object containing:\n * - solution: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) {\n // Use the dedicated worker file\n const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' });\n const jacobiWorker = Comlink.wrap(worker);\n\n try {\n const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64);\n return result;\n } catch (error) {\n console.error(\"Error in WebGPU Jacobi method:\", error);\n throw error;\n } finally {\n worker.terminate();\n }\n}","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n \n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n \n // Extract scalar values from solution vector\n let zValues = Array.isArray(solutionVector[0]) \n ? solutionVector.map(val => val[0]) \n : solutionVector;\n \n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n \n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: 'closest'\n };\n \n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: 'Solution Field'\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: 'contour',\n contours: {\n coloring: 'heatmap',\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n name: 'Solution Field'\n };\n \n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n"],"names":["proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","message","name","stack","Object","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","console","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","prop","rawValue","apply","proxy","transfers","transferCache","set","transfer","undefined","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","constructor","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","length","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","Array","prototype","concat","handler","serializedValue","msg","fill","Math","floor","random","Number","MAX_SAFE_INTEGER","join","numericalIntegration","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","sqrt","currentLogLevel","debugLog","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","dimension","tag","nodesPair","node1","node2","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","async","A","b","x0","maxIterations","tolerance","useFloat64","worker","Worker","jacobiWorker","Comlink.wrap","jacobiMethod","terminate","converged","iterations","solution","feaWorker","isReady","_initWorker","URL","document","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","x","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","max","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":";;;;;;AAKA,MAAMA,EAAcC,OAAO,iBACrBC,EAAiBD,OAAO,oBACxBE,EAAeF,OAAO,wBACtBG,EAAYH,OAAO,qBACnBI,EAAcJ,OAAO,kBACrBK,EAAYC,GAAwB,iBAARA,GAA4B,OAARA,GAAgC,mBAARA,EAgDxEC,EAAmB,IAAIC,IAAI,CAC7B,CAAC,QA7CwB,CACzBC,UAAYH,GAAQD,EAASC,IAAQA,EAAIP,GACzC,SAAAW,CAAUC,GACN,MAAMC,MAAEA,EAAKC,MAAEA,GAAU,IAAIC,eAE7B,OADAC,EAAOJ,EAAKC,GACL,CAACC,EAAO,CAACA,GACnB,EACDG,YAAYC,IAC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K,EAAGtK,EACH4N,EAAGd,EACHpW,KAAM,UACNmX,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETxW,KAAM,kBAIR+W,OAAOC,QAAQzB,EAAW,CAAC6C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,uBTtGOhH,iBACLhJ,EAAS,oDACT,IACE,MAAMyR,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAlS,EAAS,4BAA4B6R,KAC9BA,CACR,CAAC,MAAO/V,GAEP,OADAmE,EAAS,wCAA0CnE,GAC5C,iCACR,CACH"} \ No newline at end of file diff --git a/dist/feascript.esm.js b/dist/feascript.esm.js index ac62789..99fe07c 100644 --- a/dist/feascript.esm.js +++ b/dist/feascript.esm.js @@ -1,7 +1,7 @@ -class e{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let t="basic";function n(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),t="basic"):(t=e,o(`Log level set to: ${e}`))}function s(e){"debug"===t&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function o(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function i(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}async function r(){o("Fetching latest FEAScript version information...");try{const e=await fetch("https://api.github.com/repos/FEAScript/FEAScript/commits/main"),t=await e.json(),n=new Date(t.commit.committer.date).toLocaleString();return o(`Latest FEAScript update: ${n}`),n}catch(e){return i("Failed to fetch version information: "+e),"Version information unavailable"}}class a{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void i("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,o[0]=-1*r(e),o[1]=1*r(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),o[0]=a(e)*h(t),o[1]=a(e)*m(t),o[2]=a(e)*u(t),o[3]=l(e)*h(t),o[4]=l(e)*m(t),o[5]=l(e)*u(t),o[6]=d(e)*h(t),o[7]=d(e)*m(t),o[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class l{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,s("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],o=t[1];s(`Processing boundary node pair: [${n}, ${o}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const o=d[n],i=h[n];s(`Boundary ${n}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;s(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((o=>{if("convection"===this.boundaryConditions[o][0]){const m=d[o],u=h[o];s(`Boundary ${o}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[o].forEach((([o,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=n[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=n[0],f=0,p=2,y=1):2===d?(h=n[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=n[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const N=this.nop[o].length;for(let e=0;e{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(s[0]),t.ascii="0"===s[1],t.fltBytes=s[2];else if("physicalNames"===o){if(s.length>=3){if(!/^\d+$/.test(s[0])){i++;continue}const e=parseInt(s[0],10),n=parseInt(s[1],10);let o=s.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(s[0],10),a=parseInt(s[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),s(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t};function u(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,E=new Map([["proxy",{canHandle:e=>b(e)&&e[c],serialize(e){const{port1:t,port2:n}=new MessageChannel;return M(e,t),[n,[n]]},deserialize:e=>(e.start(),v(e))}],["throw",{canHandle:e=>b(e)&&g in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function M(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(F);let d;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":d=n;break;case"SET":t[a.slice(-1)[0]]=F(o.data.value),d=!0;break;case"APPLY":d=n.apply(t,l);break;case"CONSTRUCT":d=function(e){return Object.assign(e,{[c]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;M(e,n),d=function(e,t){return x.set(e,t),e}(t,[t])}break;case"RELEASE":d=void 0;break;default:return}}catch(e){d={value:e,[g]:0}}Promise.resolve(d).catch((e=>({value:e,[g]:0}))).then((n=>{const[o,a]=A(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),$(t),y in e&&"function"==typeof e[y]&&e[y]())})).catch((e=>{const[n,s]=A({value:new TypeError("Unserializable return value"),[g]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function $(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function v(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),D(e,n,[],t)}function w(e){if(e)throw new Error("Proxy has been released and is not useable")}function C(e){return T(e,new Map,{type:"RELEASE"}).then((()=>{$(e)}))}const N=new WeakMap,S="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(N.get(e)||0)-1;N.set(e,t),0===t&&C(e)}));function D(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(w(o),r===p)return()=>{!function(e){S&&S.unregister(e)}(i),C(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=T(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(F);return s.then.bind(s)}return D(e,t,[...n,r])},set(s,i,r){w(o);const[a,l]=A(r);return T(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(F)},apply(s,i,r){w(o);const a=n[n.length-1];if(a===f)return T(e,t,{type:"ENDPOINT"}).then(F);if("bind"===a)return D(e,t,n.slice(0,-1));const[l,d]=O(r);return T(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(F)},construct(s,i){w(o);const[r,a]=O(i);return T(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(F)}});return function(e,t){const n=(N.get(t)||0)+1;N.set(t,n),S&&S.register(e,t,e)}(i,e),i}function O(e){const t=e.map(A);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const x=new WeakMap;function A(e){for(const[t,n]of E)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},x.get(e)||[]]}function F(e){switch(e.type){case"HANDLER":return E.get(e.name).deserialize(e.value);case"RAW":return e.value}}function T(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}class k{constructor(){this.worker=null,this.feaWorker=null,this.isReady=!1,this._initWorker()}async _initWorker(){try{this.worker=new Worker(new URL("./wrapperScript.js",import.meta.url),{type:"module"}),this.worker.onerror=e=>{console.error("FEAScriptWorker: Worker error:",e)};const e=v(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),o("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),o(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),o("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return o(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}}export{h as FEAScriptModel,k as FEAScriptWorker,m as importGmshQuadTri,n as logSystem,u as plotSolution,r as printVersion}; + */const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.finalizer"),o=Symbol("Comlink.thrown"),i=e=>"object"==typeof e&&null!==e||"function"==typeof e,r=new Map([["proxy",{canHandle:t=>i(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return a(e,t),[n,[n]]},deserialize:e=>(e.start(),d(e))}],["throw",{canHandle:e=>i(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function a(t,n=globalThis,i=["*"]){n.addEventListener("message",(function r(d){if(!d||!d.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(i,d.origin))return void console.warn(`Invalid origin '${d.origin}' for comlink proxy`);const{id:h,type:m,path:u}=Object.assign({path:[]},d.data),c=(d.data.argumentList||[]).map(b);let f;try{const n=u.slice(0,-1).reduce(((e,t)=>e[t]),t),s=u.reduce(((e,t)=>e[t]),t);switch(m){case"GET":f=s;break;case"SET":n[u.slice(-1)[0]]=b(d.data.value),f=!0;break;case"APPLY":f=s.apply(n,c);break;case"CONSTRUCT":f=function(t){return Object.assign(t,{[e]:!0})}(new s(...c));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;a(t,n),f=function(e,t){return y.set(e,t),e}(e,[e])}break;case"RELEASE":f=void 0;break;default:return}}catch(e){f={value:e,[o]:0}}Promise.resolve(f).catch((e=>({value:e,[o]:0}))).then((e=>{const[o,i]=g(e);n.postMessage(Object.assign(Object.assign({},o),{id:h}),i),"RELEASE"===m&&(n.removeEventListener("message",r),l(n),s in t&&"function"==typeof t[s]&&t[s]())})).catch((e=>{const[t,s]=g({value:new TypeError("Unserializable return value"),[o]:0});n.postMessage(Object.assign(Object.assign({},t),{id:h}),s)}))})),n.start&&n.start()}function l(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function d(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),f(e,n,[],t)}function h(e){if(e)throw new Error("Proxy has been released and is not useable")}function m(e){return E(e,new Map,{type:"RELEASE"}).then((()=>{l(e)}))}const u=new WeakMap,c="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(u.get(e)||0)-1;u.set(e,t),0===t&&m(e)}));function f(e,s,o=[],i=function(){}){let r=!1;const a=new Proxy(i,{get(t,i){if(h(r),i===n)return()=>{!function(e){c&&c.unregister(e)}(a),m(e),s.clear(),r=!0};if("then"===i){if(0===o.length)return{then:()=>a};const t=E(e,s,{type:"GET",path:o.map((e=>e.toString()))}).then(b);return t.then.bind(t)}return f(e,s,[...o,i])},set(t,n,i){h(r);const[a,l]=g(i);return E(e,s,{type:"SET",path:[...o,n].map((e=>e.toString())),value:a},l).then(b)},apply(n,i,a){h(r);const l=o[o.length-1];if(l===t)return E(e,s,{type:"ENDPOINT"}).then(b);if("bind"===l)return f(e,s,o.slice(0,-1));const[d,m]=p(a);return E(e,s,{type:"APPLY",path:o.map((e=>e.toString())),argumentList:d},m).then(b)},construct(t,n){h(r);const[i,a]=p(n);return E(e,s,{type:"CONSTRUCT",path:o.map((e=>e.toString())),argumentList:i},a).then(b)}});return function(e,t){const n=(u.get(t)||0)+1;u.set(t,n),c&&c.register(e,t,e)}(a,e),a}function p(e){const t=e.map(g);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const y=new WeakMap;function g(e){for(const[t,n]of r)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},y.get(e)||[]]}function b(e){switch(e.type){case"HANDLER":return r.get(e.name).deserialize(e.value);case"RAW":return e.value}}function E(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}class M{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let $="basic";function v(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),$="basic"):($=e,C(`Log level set to: ${e}`))}function w(e){"debug"===$&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function C(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function N(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}async function S(){C("Fetching latest FEAScript version information...");try{const e=await fetch("https://api.github.com/repos/FEAScript/FEAScript/commits/main"),t=await e.json(),n=new Date(t.commit.committer.date).toLocaleString();return C(`Latest FEAScript update: ${n}`),n}catch(e){return N("Failed to fetch version information: "+e),"Version information unavailable"}}class D{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void N("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function i(e){return 1-e}n[0]=i(e)*i(t),n[1]=i(e)*t,n[2]=e*i(t),n[3]=e*t,s[0]=-1*i(t),s[1]=-1*t,s[2]=1*i(t),s[3]=1*t,o[0]=-1*i(e),o[1]=1*i(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function r(e){return 2*e**2-3*e+1}function a(e){return-4*e**2+4*e}function l(e){return 2*e**2-e}function d(e){return 4*e-3}function h(e){return-8*e+4}function m(e){return 4*e-1}n[0]=r(e)*r(t),n[1]=r(e)*a(t),n[2]=r(e)*l(t),n[3]=a(e)*r(t),n[4]=a(e)*a(t),n[5]=a(e)*l(t),n[6]=l(e)*r(t),n[7]=l(e)*a(t),n[8]=l(e)*l(t),s[0]=d(e)*r(t),s[1]=d(e)*a(t),s[2]=d(e)*l(t),s[3]=h(e)*r(t),s[4]=h(e)*a(t),s[5]=h(e)*l(t),s[6]=m(e)*r(t),s[7]=m(e)*a(t),s[8]=m(e)*l(t),o[0]=r(e)*d(t),o[1]=r(e)*h(t),o[2]=r(e)*m(t),o[3]=a(e)*d(t),o[4]=a(e)*h(t),o[5]=a(e)*m(t),o[6]=l(e)*d(t),o[7]=l(e)*h(t),o[8]=l(e)*m(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class O{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,w("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],s=t[1];w(`Processing boundary node pair: [${n}, ${s}] for boundary ${e.tag} (${e.name||"unnamed"})`);let o=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(a[e]=t[1],l[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const s=a[n],o=l[n];w(`Boundary ${n}: Applying convection with heat transfer coefficient h=${s} W/(m²·K) and external temperature T∞=${o} K`),this.boundaryElements[n].forEach((([n,i])=>{let r;"linear"===this.elementOrder?r=0===i?0:1:"quadratic"===this.elementOrder&&(r=0===i?0:2);const a=this.nop[n][r]-1;w(` - Applied convection boundary condition to node ${a+1} (element ${n+1}, local node ${r+1})`),e[a]+=-s*o,t[a][a]+=s}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((d=>{if("convection"===this.boundaryConditions[d][0]){const h=a[d],m=l[d];w(`Boundary ${d}: Applying convection with heat transfer coefficient h=${h} W/(m²·K) and external temperature T∞=${m} K`),this.boundaryElements[d].forEach((([a,l])=>{if("linear"===this.elementOrder){let d,u,c,f,p;0===l?(d=n[0],u=0,c=0,f=3,p=2):1===l?(d=0,u=n[0],c=0,f=2,p=1):2===l?(d=n[0],u=1,c=1,f=4,p=2):3===l&&(d=1,u=n[0],c=2,f=4,p=1);let y=r.getBasisFunctions(d,u),g=y.basisFunction,b=y.basisFunctionDerivKsi,E=y.basisFunctionDerivEta,M=0,$=0,v=0,C=0;const N=this.nop[a].length;for(let e=0;e{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),s="",o=0,i=0,r=0,a=0,l={numNodes:0},d=0,h=[],m=0,u=0,c=0,f={dim:0,tag:0,elementType:0,numElements:0},p=0,y={};for(;o""!==e));if("meshFormat"===s)t.gmshV=parseFloat(g[0]),t.ascii="0"===g[1],t.fltBytes=g[2];else if("physicalNames"===s){if(g.length>=3){if(!/^\d+$/.test(g[0])){o++;continue}const e=parseInt(g[0],10),n=parseInt(g[1],10);let s=g.slice(2).join(" ");s=s.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:s})}}else if("nodes"===s){if(0===i){i=parseInt(g[0],10),r=parseInt(g[1],10),t.nodesXCoordinates=new Array(r).fill(0),t.nodesYCoordinates=new Array(r).fill(0),o++;continue}if(aparseInt(e,10)));if(1===f.elementType||8===f.elementType){const n=f.tag;y[n]||(y[n]=[]),y[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===f.elementType?t.nodalNumbering.triangleElements.push(e):(3===f.elementType||10===f.elementType)&&t.nodalNumbering.quadElements.push(e);p++,p===f.numElements&&(c++,f={numElements:0})}}o++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=y[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),w(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t};function k(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=d(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),C(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),C("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),C(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),C(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),C("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return C(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}}export{A as FEAScriptModel,T as FEAScriptWorker,F as importGmshQuadTri,v as logSystem,k as plotSolution,S as printVersion}; //# sourceMappingURL=feascript.esm.js.map diff --git a/dist/feascript.esm.js.map b/dist/feascript.esm.js.map index 16e0e11..010c592 100644 --- a/dist/feascript.esm.js.map +++ b/dist/feascript.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"feascript.esm.js","sources":["../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/vendor/comlink.mjs","../src/workers/workerScript.js"],"sourcesContent":["// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Class to handle numerical integration using Gauss quadrature\r\n */\r\nexport class numericalIntegration {\r\n /**\r\n * Constructor to initialize the numericalIntegration class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to return Gauss points and weights based on element configuration\r\n * @returns {object} An object containing:\r\n * - gaussPoints: Array of Gauss points\r\n * - gaussWeights: Array of Gauss weights\r\n */\r\n getGaussPointsAndWeights() {\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // For linear elements, use 1-point Gauss quadrature\r\n gaussPoints[0] = 0.5;\r\n gaussWeights[0] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // For quadratic elements, use 3-point Gauss quadrature\r\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\r\n gaussPoints[1] = 0.5;\r\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\r\n gaussWeights[0] = 5 / 18;\r\n gaussWeights[1] = 8 / 18;\r\n gaussWeights[2] = 5 / 18;\r\n }\r\n\r\n return { gaussPoints, gaussWeights };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Global logging level\r\nlet currentLogLevel = \"basic\";\r\n\r\n/**\r\n * Function to set the logging system level\r\n * @param {string} level - Logging level (basic, debug)\r\n */\r\nexport function logSystem(level) {\r\n if (level !== \"basic\" && level !== \"debug\") {\r\n console.log(\r\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\r\n \"color: #FFC107; font-weight: bold;\"\r\n ); // Yellow for warnings\r\n currentLogLevel = \"basic\";\r\n } else {\r\n currentLogLevel = level;\r\n basicLog(`Log level set to: ${level}`);\r\n }\r\n}\r\n\r\n/**\r\n * Function to log debug messages - only logs if level is 'debug'\r\n * @param {string} message - Message to log\r\n */\r\nexport function debugLog(message) {\r\n if (currentLogLevel === \"debug\") {\r\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\r\n }\r\n}\r\n\r\n/**\r\n * Function to log basic information - always logs\r\n * @param {string} message - Message to log\r\n */\r\nexport function basicLog(message) {\r\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\r\n}\r\n\r\n/**\r\n * Function to log error messages\r\n * @param {string} message - Message to log\r\n */\r\nexport function errorLog(message) {\r\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\r\n}\r\n\r\n/**\r\n * Function to handle version information and fetch the latest update date and release from GitHub\r\n */\r\nexport async function printVersion() {\r\n basicLog(\"Fetching latest FEAScript version information...\");\r\n try {\r\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\r\n const commitData = await commitResponse.json();\r\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\r\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\r\n return latestCommitDate;\r\n } catch (error) {\r\n errorLog(\"Failed to fetch version information: \" + error);\r\n return \"Version information unavailable\";\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle basis functions and their derivatives based on element configuration\r\n */\r\nexport class basisFunctions {\r\n /**\r\n * Constructor to initialize the basisFunctions class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to calculate basis functions and their derivatives based on the dimension and order\r\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\r\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\r\n * @returns {object} An object containing:\r\n * - basisFunction: Array of evaluated basis functions\r\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\r\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\r\n */\r\n getBasisFunctions(ksi, eta = null) {\r\n let basisFunction = [];\r\n let basisFunctionDerivKsi = [];\r\n let basisFunctionDerivEta = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 1D elements\r\n basisFunction[0] = 1 - ksi;\r\n basisFunction[1] = ksi;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -1;\r\n basisFunctionDerivKsi[1] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 1D elements\r\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\r\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\r\n basisFunction[2] = -ksi + 2 * ksi ** 2;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\r\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\r\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (eta === null) {\r\n errorLog(\"Eta coordinate is required for 2D elements\");\r\n return;\r\n }\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 2D elements\r\n function l1(c) {\r\n return 1 - c;\r\n }\r\n function l2(c) {\r\n return c;\r\n }\r\n function dl1() {\r\n return -1;\r\n }\r\n function dl2() {\r\n return 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l2(ksi) * l1(eta);\r\n basisFunction[3] = l2(ksi) * l2(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\r\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\r\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\r\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\r\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 2D elements\r\n function l1(c) {\r\n return 2 * c ** 2 - 3 * c + 1;\r\n }\r\n function l2(c) {\r\n return -4 * c ** 2 + 4 * c;\r\n }\r\n function l3(c) {\r\n return 2 * c ** 2 - c;\r\n }\r\n function dl1(c) {\r\n return 4 * c - 3;\r\n }\r\n function dl2(c) {\r\n return -8 * c + 4;\r\n }\r\n function dl3(c) {\r\n return 4 * c - 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l1(ksi) * l3(eta);\r\n basisFunction[3] = l2(ksi) * l1(eta);\r\n basisFunction[4] = l2(ksi) * l2(eta);\r\n basisFunction[5] = l2(ksi) * l3(eta);\r\n basisFunction[6] = l3(ksi) * l1(eta);\r\n basisFunction[7] = l3(ksi) * l2(eta);\r\n basisFunction[8] = l3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\r\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\r\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\r\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\r\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\r\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\r\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\r\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\r\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\r\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\r\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\r\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\r\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\r\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\r\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\r\n }\r\n }\r\n\r\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle the generation of structured finite element meshes\r\n */\r\nexport class meshGeneration {\r\n /**\r\n * Constructor to initialize the meshGeneration class\r\n * @param {object} config - Configuration object for the mesh\r\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\r\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\r\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\r\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\r\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\r\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\r\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\r\n */\r\n constructor({\r\n numElementsX = null,\r\n maxX = null,\r\n numElementsY = null,\r\n maxY = null,\r\n meshDimension = null,\r\n elementOrder = \"linear\",\r\n parsedMesh = null,\r\n }) {\r\n this.numElementsX = numElementsX;\r\n this.numElementsY = numElementsY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n this.parsedMesh = parsedMesh;\r\n }\r\n\r\n /**\r\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\r\n * @returns {object} The generated mesh containing node coordinates and total nodes\r\n */\r\n generateMesh() {\r\n // If pre-parsed mesh data is provided, use it directly\r\n if (this.parsedMesh) {\r\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\r\n if (this.parsedMesh.nodalNumbering) {\r\n if (\r\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\r\n !Array.isArray(this.parsedMesh.nodalNumbering)\r\n ) {\r\n // Store the nodal numbering structure before converting\r\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\r\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\r\n\r\n debugLog(\r\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Check if it has quadElements or triangleElements structure from gmshReader\r\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\r\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\r\n const mappedNodalNumbering = [];\r\n\r\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\r\n const gmshNodes = quadElements[elemIdx];\r\n const feaScriptNodes = new Array(gmshNodes.length);\r\n\r\n // Check for element type based on number of nodes\r\n if (gmshNodes.length === 4) {\r\n // Simple mapping for linear quad elements (4 nodes)\r\n // GMSH: FEAScript:\r\n // 3 --- 2 1 --- 3\r\n // | | --> | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","logSystem","level","console","log","basicLog","debugLog","message","errorLog","async","printVersion","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString","error","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","FEAScriptModel","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","Error","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","fill","importGmshQuadTri","file","result","gmshV","ascii","fltBytes","lines","text","split","map","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","test","parseInt","slice","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","plotSolution","plotType","plotDivId","meshType","yData","arr","xData","from","lineData","mode","type","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","r","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","val","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","isAllowedOrigin","warn","id","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","prototype","concat","handler","serializedValue","msg","floor","random","Number","MAX_SAFE_INTEGER","FEAScriptWorker","worker","feaWorker","isReady","_initWorker","Worker","URL","url","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate"],"mappings":"AAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CH,EAAY,GAAK,GACjBA,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CF,EAAa,GAAK,EAAI,GACtBA,EAA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GpB,aAFMjJ,KAAKia,eACXtZ,EAAS,8CAA8CsI,KAChDjJ,KAAKuZ,UAAUnQ,gBAAgBH,EACvC,CAOD,mBAAMI,CAAcH,GAGlB,aAFMlJ,KAAKia,eACXtZ,EAAS,wCACFX,KAAKuZ,UAAUlQ,cAAcH,EACrC,CAQD,0BAAMI,CAAqBlC,EAAamC,GAGtC,aAFMvJ,KAAKia,eACXtZ,EAAS,4DAA4DyG,KAC9DpH,KAAKuZ,UAAUjQ,qBAAqBlC,EAAamC,EACzD,CAOD,qBAAMC,CAAgBL,GAGpB,aAFMnJ,KAAKia,eACXtZ,EAAS,8CAA8CwI,KAChDnJ,KAAKuZ,UAAU/P,gBAAgBL,EACvC,CAMD,WAAMM,SACEzJ,KAAKia,eACXtZ,EAAS,uDAET,MAAM2Z,EAAYC,YAAYC,MACxBhO,QAAexM,KAAKuZ,UAAU9P,QAIpC,OADA9I,EAAS,4CAFO4Z,YAAYC,MAEmCF,GAAa,KAAMG,QAAQ,OACnFjO,CACR,CAMD,kBAAMkO,GAEJ,aADM1a,KAAKia,eACJja,KAAKuZ,UAAUmB,cACvB,CAMD,UAAMC,GAEJ,aADM3a,KAAKia,eACJja,KAAKuZ,UAAUoB,MACvB,CAKD,SAAAC,GACM5a,KAAKsZ,SACPtZ,KAAKsZ,OAAOsB,YACZ5a,KAAKsZ,OAAS,KACdtZ,KAAKuZ,UAAY,KACjBvZ,KAAKwZ,SAAU,EAElB"} \ No newline at end of file +{"version":3,"file":"feascript.esm.js","sources":["../src/vendor/comlink.mjs","../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/workers/workerScript.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class numericalIntegration {\n /**\n * Constructor to initialize the numericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersion() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class basisFunctions {\n /**\n * Constructor to initialize the basisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle the generation of structured finite element meshes\n */\nexport class meshGeneration {\n /**\n * Constructor to initialize the meshGeneration class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n }\n\n /**\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\n * @returns {object} The generated mesh containing node coordinates and total nodes\n */\n generateMesh() {\n // If pre-parsed mesh data is provided, use it directly\n if (this.parsedMesh) {\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\n if (this.parsedMesh.nodalNumbering) {\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.parsedMesh.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n }\n\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\n\n return this.parsedMesh;\n } else {\n // Validate required geometry parameters based on mesh dimension\n if (this.meshDimension === \"1D\") {\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n } else if (this.meshDimension === \"2D\") {\n if (\n this.numElementsX === null ||\n this.maxX === null ||\n this.numElementsY === null ||\n this.maxY === null\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n // Generate mesh based on dimension\n return this.generateMeshFromGeometry();\n }\n }\n\n /**\n * Function to generate a structured mesh based on the geometry configuration\n * @returns {object} An object containing the coordinates of nodes,\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\n */\n generateMeshFromGeometry() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n null, // numElementsY (not used in 1D)\n totalNodesX,\n null, // totalNodesY (not used in 1D)\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n } else if (this.meshDimension === \"2D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesX,\n totalNodesY,\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n if (this.meshDimension === \"1D\") {\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n } else if (this.meshDimension === \"2D\") {\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n return boundaryElements;\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (this.meshDimension === \"1D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n } else if (this.meshDimension === \"2D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n }\n\n return nop;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n ) {\n basicLog(\"Applying convection boundary conditions (Robin type)\");\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n basicLog(\"FEAScriptModel instance created\");\n }\n\n setSolverConfig(solverConfig) {\n this.solverConfig = solverConfig;\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\n );\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let nodesCoordinates = {};\n\n // Assembly matrices\n basicLog(\"Beginning matrix assembly...\");\n console.time(\"assemblyMatrices\");\n if (this.solverConfig === \"solidHeatTransferScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\n this.meshConfig,\n this.boundaryConditions\n ));\n }\n console.timeEnd(\"assemblyMatrices\");\n basicLog(\"Matrix assembly completed\");\n\n // System solving\n basicLog(`Solving system using ${this.solverMethod}...`);\n console.time(\"systemSolving\");\n if (this.solverMethod === \"lusolve\") {\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\n } else if (this.solverMethod === \"jacobi\") {\n // Create initial guess of zeros\n const initialGuess = new Array(residualVector.length).fill(0);\n // Call Jacobi method with desired max iterations and tolerance\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\n\n // Log convergence information\n if (jacobiResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\n } else {\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\n }\n\n solutionVector = jacobiResult.solution;\n }\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the solid heat transfer matrix\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n * - nodesCoordinates: Object containing x and y coordinates of nodes\n */\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh details from the configuration object\n const {\n meshDimension, // The dimension of the mesh\n numElementsX, // Number of elements in x-direction\n numElementsY, // Number of elements in y-direction (only for 2D)\n maxX, // Max x-coordinate (m) of the domain\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\n elementOrder, // The order of elements\n parsedMesh, // The pre-parsed mesh data (if available)\n } = meshConfig;\n\n // Create a new instance of the meshGeneration class\n debugLog(\"Generating mesh...\");\n const meshGenerationData = new meshGeneration({\n numElementsX,\n numElementsY,\n maxX,\n maxY,\n meshDimension,\n elementOrder,\n parsedMesh, // Pass the parsed mesh to the mesh generator\n });\n\n // Generate the mesh\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n\n // Debug log for mesh size\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n // Debug log for mesh size\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n // Initialize variables for matrix assembly\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n let basisFunction = []; // Basis functions\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\n let basisFunctionDerivX = []; // The x-derivative of the basis function\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\n let residualVector = []; // Galerkin residuals\n let jacobianMatrix = []; // Jacobian matrix\n let xCoordinates; // x-coordinate (physical coordinates)\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\n let ksiDerivX; // ksi-derivative of xCoordinates\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\n let detJacobian; // The jacobian of the isoparametric mapping\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the basisFunctions class\n const basisFunctionsData = new basisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the numericalIntegration class\n const numIntegrationData = new numericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\n gaussPoints = gaussPointsAndWeights.gaussPoints;\n gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n xCoordinates = 0;\n ksiDerivX = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n detJacobian = ksiDerivX;\n }\n\n // Compute x-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n // 2D solid heat transfer\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Initialise variables for isoparametric mapping\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n xCoordinates = 0;\n yCoordinates = 0;\n ksiDerivX = 0;\n etaDerivX = 0;\n ksiDerivY = 0;\n etaDerivY = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\n }\n\n // Compute x-derivative and y-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian; // The x-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian; // The y-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Create an instance of ThermalBoundaryConditions\n debugLog(\"Applying thermal boundary conditions...\");\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n );\n debugLog(\"Convection boundary conditions applied\");\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n debugLog(\"Constant temperature boundary conditions applied\");\n\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n nodesCoordinates: {\n nodesXCoordinates,\n nodesYCoordinates,\n },\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport * as Comlink from \"../vendor/comlink.mjs\";\nimport { WebGPUComputeEngine } from \"../utilities/webgpuComputeEngine.js\";\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * This version uses the WebGPU compute engine for maximum performance and reusability\n * @param {array} A - The coefficient matrix (must be square)\n * @param {array} b - The right-hand side vector\n * @param {array} x0 - Initial guess for solution vector\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-7] - Convergence tolerance\n * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision\n * @returns {object} An object containing:\n * - solution: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) {\n // Use the dedicated worker file\n const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' });\n const jacobiWorker = Comlink.wrap(worker);\n\n try {\n const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64);\n return result;\n } catch (error) {\n console.error(\"Error in WebGPU Jacobi method:\", error);\n throw error;\n } finally {\n worker.terminate();\n }\n}","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n \n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n \n // Extract scalar values from solution vector\n let zValues = Array.isArray(solutionVector[0]) \n ? solutionVector.map(val => val[0]) \n : solutionVector;\n \n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n \n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: 'closest'\n };\n \n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: 'Solution Field'\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: 'contour',\n contours: {\n coloring: 'heatmap',\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n name: 'Solution Field'\n };\n \n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n"],"names":["proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","message","name","stack","Object","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","console","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","prop","rawValue","apply","proxy","transfers","transferCache","set","transfer","undefined","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","constructor","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","length","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","Array","prototype","concat","handler","serializedValue","msg","fill","Math","floor","random","Number","MAX_SAFE_INTEGER","join","numericalIntegration","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","sqrt","currentLogLevel","logSystem","level","log","basicLog","debugLog","errorLog","async","printVersion","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","dimension","tag","nodesPair","node1","node2","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","FEAScriptModel","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","useFloat64","worker","Worker","jacobiWorker","Comlink.wrap","jacobiMethod","terminate","converged","iterations","solution","importGmshQuadTri","file","result","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","x","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","plotSolution","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","max","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","FEAScriptWorker","feaWorker","isReady","_initWorker","URL","url","onerror","event","workerWrapper","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping"],"mappings":";;;;;GAKA,MAAMA,EAAcC,OAAO,iBACrBC,EAAiBD,OAAO,oBACxBE,EAAeF,OAAO,wBACtBG,EAAYH,OAAO,qBACnBI,EAAcJ,OAAO,kBACrBK,EAAYC,GAAwB,iBAARA,GAA4B,OAARA,GAAgC,mBAARA,EAgDxEC,EAAmB,IAAIC,IAAI,CAC7B,CAAC,QA7CwB,CACzBC,UAAYH,GAAQD,EAASC,IAAQA,EAAIP,GACzC,SAAAW,CAAUC,GACN,MAAMC,MAAEA,EAAKC,MAAEA,GAAU,IAAIC,eAE7B,OADAC,EAAOJ,EA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,YAAYC,MACxB7G,QAAexL,KAAKsR,UAAUxI,QAIpC,OADArI,EAAS,4CAFO2R,YAAYC,MAEmCF,GAAa,KAAMG,QAAQ,OACnF9G,CACR,CAMD,kBAAM+G,GAEJ,aADMvS,KAAK8R,eACJ9R,KAAKsR,UAAUiB,cACvB,CAMD,UAAMC,GAEJ,aADMxS,KAAK8R,eACJ9R,KAAKsR,UAAUkB,MACvB,CAKD,SAAAtH,GACMlL,KAAK6K,SACP7K,KAAK6K,OAAOK,YACZlL,KAAK6K,OAAS,KACd7K,KAAKsR,UAAY,KACjBtR,KAAKuR,SAAU,EAElB"} \ No newline at end of file diff --git a/dist/feascript.umd.js b/dist/feascript.umd.js index bc5b6cb..979a487 100644 --- a/dist/feascript.umd.js +++ b/dist/feascript.umd.js @@ -1,8 +1,7 @@ -function _loadWasmModule(e,t,n){for(var s=t.length,o="="==t[s-2]?2:"="==t[s-1]?1:0,i=new Uint8Array(3*s/4-o),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(130),l=0;l<64;l++)a[r.charCodeAt(l)]=l;for(var d=0,h=0;d>4,i[h++]=(15&m)<<4|u>>2,i[h++]=(3&u)<<6|63&a[t.charCodeAt(d+3)]}if(n&&!e)return WebAssembly.instantiate(i,n);if(n||e){var c=new WebAssembly.Module(i);return n?new WebAssembly.Instance(c,n):c}return WebAssembly.compile(i)}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FEAScript={})}(this,(function(e){"use strict";class t{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let n="basic";function s(e){"debug"===n&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function o(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function i(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class r{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void i("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function r(e){return 1-e}n[0]=r(e)*r(t),n[1]=r(e)*t,n[2]=e*r(t),n[3]=e*t,s[0]=-1*r(t),s[1]=-1*t,s[2]=1*r(t),s[3]=1*t,o[0]=-1*r(e),o[1]=1*r(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function a(e){return 2*e**2-3*e+1}function l(e){return-4*e**2+4*e}function d(e){return 2*e**2-e}function h(e){return 4*e-3}function m(e){return-8*e+4}function u(e){return 4*e-1}n[0]=a(e)*a(t),n[1]=a(e)*l(t),n[2]=a(e)*d(t),n[3]=l(e)*a(t),n[4]=l(e)*l(t),n[5]=l(e)*d(t),n[6]=d(e)*a(t),n[7]=d(e)*l(t),n[8]=d(e)*d(t),s[0]=h(e)*a(t),s[1]=h(e)*l(t),s[2]=h(e)*d(t),s[3]=m(e)*a(t),s[4]=m(e)*l(t),s[5]=m(e)*d(t),s[6]=u(e)*a(t),s[7]=u(e)*l(t),s[8]=u(e)*d(t),o[0]=a(e)*h(t),o[1]=a(e)*m(t),o[2]=a(e)*u(t),o[3]=l(e)*h(t),o[4]=l(e)*m(t),o[5]=l(e)*u(t),o[6]=d(e)*h(t),o[7]=d(e)*m(t),o[8]=d(e)*u(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class a{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,s("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],o=t[1];s(`Processing boundary node pair: [${n}, ${o}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const o=this.boundaryConditions[n][1];s(`Boundary ${n}: Applying constant temperature of ${o} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const r=this.nop[n][i]-1;s(` - Applied fixed temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=o;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(d[e]=t[1],h[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const o=d[n],i=h[n];s(`Boundary ${n}: Applying convection with heat transfer coefficient h=${o} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;s(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-o*i,t[l][l]+=o}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((o=>{if("convection"===this.boundaryConditions[o][0]){const m=d[o],u=h[o];s(`Boundary ${o}: Applying convection with heat transfer coefficient h=${m} W/(m²·K) and external temperature T∞=${u} K`),this.boundaryElements[o].forEach((([o,d])=>{if("linear"===this.elementOrder){let h,c,f,p,y;0===d?(h=n[0],c=0,f=0,p=3,y=2):1===d?(h=0,c=n[0],f=0,p=2,y=1):2===d?(h=n[0],c=1,f=1,p=4,y=2):3===d&&(h=1,c=n[0],f=2,p=4,y=1);let g=l.getBasisFunctions(h,c),b=g.basisFunction,E=g.basisFunctionDerivKsi,M=g.basisFunctionDerivEta,$=0,v=0,w=0,C=0;const S=this.nop[o].length;for(let e=0;e>4,i[h++]=(15&m)<<4|u>>2,i[h++]=(3&u)<<6|63&a[t.charCodeAt(d+3)]}if(n&&!e)return WebAssembly.instantiate(i,n);if(n||e){var c=new WebAssembly.Module(i);return n?new WebAssembly.Instance(c,n):c}return WebAssembly.compile(i)}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("https://cdn.jsdelivr.net/npm/taichi.js@latest/dist/taichi.esm.js")):"function"==typeof define&&define.amd?define(["exports","https://cdn.jsdelivr.net/npm/taichi.js@latest/dist/taichi.esm.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FEAScript={})}(this,(function(e){"use strict"; /** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -const d=Symbol("Comlink.proxy"),h=Symbol("Comlink.endpoint"),m=Symbol("Comlink.releaseProxy"),u=Symbol("Comlink.finalizer"),c=Symbol("Comlink.thrown"),f=e=>"object"==typeof e&&null!==e||"function"==typeof e,p=new Map([["proxy",{canHandle:e=>f(e)&&e[d],serialize(e){const{port1:t,port2:n}=new MessageChannel;return y(e,t),[n,[n]]},deserialize:e=>(e.start(),b(e))}],["throw",{canHandle:e=>f(e)&&c in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function y(e,t=globalThis,n=["*"]){t.addEventListener("message",(function s(o){if(!o||!o.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,o.origin))return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},o.data),l=(o.data.argumentList||[]).map(A);let h;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":h=n;break;case"SET":t[a.slice(-1)[0]]=A(o.data.value),h=!0;break;case"APPLY":h=n.apply(t,l);break;case"CONSTRUCT":h=function(e){return Object.assign(e,{[d]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;y(e,n),h=function(e,t){return S.set(e,t),e}(t,[t])}break;case"RELEASE":h=void 0;break;default:return}}catch(e){h={value:e,[c]:0}}Promise.resolve(h).catch((e=>({value:e,[c]:0}))).then((n=>{const[o,a]=N(n);t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",s),g(t),u in e&&"function"==typeof e[u]&&e[u]())})).catch((e=>{const[n,s]=N({value:new TypeError("Unserializable return value"),[c]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),s)}))})),t.start&&t.start()}function g(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function b(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),w(e,n,[],t)}function E(e){if(e)throw new Error("Proxy has been released and is not useable")}function M(e){return D(e,new Map,{type:"RELEASE"}).then((()=>{g(e)}))}const $=new WeakMap,v="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=($.get(e)||0)-1;$.set(e,t),0===t&&M(e)}));function w(e,t,n=[],s=function(){}){let o=!1;const i=new Proxy(s,{get(s,r){if(E(o),r===m)return()=>{!function(e){v&&v.unregister(e)}(i),M(e),t.clear(),o=!0};if("then"===r){if(0===n.length)return{then:()=>i};const s=D(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(A);return s.then.bind(s)}return w(e,t,[...n,r])},set(s,i,r){E(o);const[a,l]=N(r);return D(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(A)},apply(s,i,r){E(o);const a=n[n.length-1];if(a===h)return D(e,t,{type:"ENDPOINT"}).then(A);if("bind"===a)return w(e,t,n.slice(0,-1));const[l,d]=C(r);return D(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(A)},construct(s,i){E(o);const[r,a]=C(i);return D(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(A)}});return function(e,t){const n=($.get(t)||0)+1;$.set(t,n),v&&v.register(e,t,e)}(i,e),i}function C(e){const t=e.map(N);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const S=new WeakMap;function N(e){for(const[t,n]of p)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},S.get(e)||[]]}function A(e){switch(e.type){case"HANDLER":return p.get(e.name).deserialize(e.value);case"RAW":return e.value}}function D(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}e.FEAScriptModel=class{constructor(){this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",o("FEAScriptModel instance created")}setSolverConfig(e){this.solverConfig=e,s(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,s(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,s(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,s(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let e=[],n=[],i=[],d={};if(o("Beginning matrix assembly..."),console.time("assemblyMatrices"),"solidHeatTransferScript"===this.solverConfig&&(o(`Using solver: ${this.solverConfig}`),({jacobianMatrix:e,residualVector:n,nodesCoordinates:d}=function(e,n){o("Starting solid heat transfer matrix assembly...");const{meshDimension:i,numElementsX:d,numElementsY:h,maxX:m,maxY:u,elementOrder:c,parsedMesh:f}=e;s("Generating mesh...");const p=new a({numElementsX:d,numElementsY:h,maxX:m,maxY:u,meshDimension:i,elementOrder:c,parsedMesh:f}).generateMesh();let y,g,b=p.nodesXCoordinates,E=p.nodesYCoordinates,M=p.totalNodesX,$=p.totalNodesY,v=p.nodalNumbering,w=p.boundaryElements;null!=f?(y=v.length,g=b.length,s(`Using parsed mesh with ${y} elements and ${g} nodes`)):(y=d*("2D"===i?h:1),g=M*("2D"===i?$:1),s(`Using mesh generated from geometry with ${y} elements and ${g} nodes`));let C,S,N,A,D,O,x,F=[],T=[],k=[],X=[],P=[],W=[],R=[],Y=[],I=[],j=[];for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=b(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),o("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),o(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),o(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),o("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return o(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},e.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),o="",i=0,r=0,a=0,l=0,d={numNodes:0},h=0,m=[],u=0,c=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},y=0,g={};for(;i""!==e));if("meshFormat"===o)t.gmshV=parseFloat(s[0]),t.ascii="0"===s[1],t.fltBytes=s[2];else if("physicalNames"===o){if(s.length>=3){if(!/^\d+$/.test(s[0])){i++;continue}const e=parseInt(s[0],10),n=parseInt(s[1],10);let o=s.slice(2).join(" ");o=o.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:o})}}else if("nodes"===o){if(0===r){r=parseInt(s[0],10),a=parseInt(s[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;g[n]||(g[n]=[]),g[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);y++,y===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=g[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),s(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},e.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),n="basic"):(n=e,o(`Log level set to: ${e}`))},e.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,a=new Map([["proxy",{canHandle:e=>r(e)&&e[t],serialize(e){const{port1:t,port2:n}=new MessageChannel;return l(e,t),[n,[n]]},deserialize:e=>(e.start(),h(e))}],["throw",{canHandle:e=>r(e)&&i in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function l(e,n=globalThis,s=["*"]){n.addEventListener("message",(function r(a){if(!a||!a.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(s,a.origin))return void console.warn(`Invalid origin '${a.origin}' for comlink proxy`);const{id:h,type:m,path:u}=Object.assign({path:[]},a.data),c=(a.data.argumentList||[]).map(E);let f;try{const n=u.slice(0,-1).reduce(((e,t)=>e[t]),e),s=u.reduce(((e,t)=>e[t]),e);switch(m){case"GET":f=s;break;case"SET":n[u.slice(-1)[0]]=E(a.data.value),f=!0;break;case"APPLY":f=s.apply(n,c);break;case"CONSTRUCT":f=function(e){return Object.assign(e,{[t]:!0})}(new s(...c));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;l(e,n),f=function(e,t){return g.set(e,t),e}(t,[t])}break;case"RELEASE":f=void 0;break;default:return}}catch(e){f={value:e,[i]:0}}Promise.resolve(f).catch((e=>({value:e,[i]:0}))).then((t=>{const[s,i]=b(t);n.postMessage(Object.assign(Object.assign({},s),{id:h}),i),"RELEASE"===m&&(n.removeEventListener("message",r),d(n),o in e&&"function"==typeof e[o]&&e[o]())})).catch((e=>{const[t,s]=b({value:new TypeError("Unserializable return value"),[i]:0});n.postMessage(Object.assign(Object.assign({},t),{id:h}),s)}))})),n.start&&n.start()}function d(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function h(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const s=n.get(t.id);if(s)try{s(t)}finally{n.delete(t.id)}})),p(e,n,[],t)}function m(e){if(e)throw new Error("Proxy has been released and is not useable")}function u(e){return M(e,new Map,{type:"RELEASE"}).then((()=>{d(e)}))}const c=new WeakMap,f="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(c.get(e)||0)-1;c.set(e,t),0===t&&u(e)}));function p(e,t,o=[],i=function(){}){let r=!1;const a=new Proxy(i,{get(n,i){if(m(r),i===s)return()=>{!function(e){f&&f.unregister(e)}(a),u(e),t.clear(),r=!0};if("then"===i){if(0===o.length)return{then:()=>a};const n=M(e,t,{type:"GET",path:o.map((e=>e.toString()))}).then(E);return n.then.bind(n)}return p(e,t,[...o,i])},set(n,s,i){m(r);const[a,l]=b(i);return M(e,t,{type:"SET",path:[...o,s].map((e=>e.toString())),value:a},l).then(E)},apply(s,i,a){m(r);const l=o[o.length-1];if(l===n)return M(e,t,{type:"ENDPOINT"}).then(E);if("bind"===l)return p(e,t,o.slice(0,-1));const[d,h]=y(a);return M(e,t,{type:"APPLY",path:o.map((e=>e.toString())),argumentList:d},h).then(E)},construct(n,s){m(r);const[i,a]=y(s);return M(e,t,{type:"CONSTRUCT",path:o.map((e=>e.toString())),argumentList:i},a).then(E)}});return function(e,t){const n=(c.get(t)||0)+1;c.set(t,n),f&&f.register(e,t,e)}(a,e),a}function y(e){const t=e.map(b);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const g=new WeakMap;function b(e){for(const[t,n]of a)if(n.canHandle(e)){const[s,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:s},o]}return[{type:"RAW",value:e},g.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return a.get(e.name).deserialize(e.value);case"RAW":return e.value}}function M(e,t,n,s){return new Promise((o=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,o),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),s)}))}class ${constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getGaussPointsAndWeights(){let e=[],t=[];return"linear"===this.elementOrder?(e[0]=.5,t[0]=1):"quadratic"===this.elementOrder&&(e[0]=(1-Math.sqrt(.6))/2,e[1]=.5,e[2]=(1+Math.sqrt(.6))/2,t[0]=5/18,t[1]=8/18,t[2]=5/18),{gaussPoints:e,gaussWeights:t}}}let v="basic";function w(e){"debug"===v&&console.log("%c[DEBUG] "+e,"color: #2196F3; font-weight: bold;")}function C(e){console.log("%c[INFO] "+e,"color: #4CAF50; font-weight: bold;")}function S(e){console.log("%c[ERROR] "+e,"color: #F44336; font-weight: bold;")}class N{constructor({meshDimension:e,elementOrder:t}){this.meshDimension=e,this.elementOrder=t}getBasisFunctions(e,t=null){let n=[],s=[],o=[];if("1D"===this.meshDimension)"linear"===this.elementOrder?(n[0]=1-e,n[1]=e,s[0]=-1,s[1]=1):"quadratic"===this.elementOrder&&(n[0]=1-3*e+2*e**2,n[1]=4*e-4*e**2,n[2]=2*e**2-e,s[0]=4*e-3,s[1]=4-8*e,s[2]=4*e-1);else if("2D"===this.meshDimension){if(null===t)return void S("Eta coordinate is required for 2D elements");if("linear"===this.elementOrder){function i(e){return 1-e}n[0]=i(e)*i(t),n[1]=i(e)*t,n[2]=e*i(t),n[3]=e*t,s[0]=-1*i(t),s[1]=-1*t,s[2]=1*i(t),s[3]=1*t,o[0]=-1*i(e),o[1]=1*i(e),o[2]=-1*e,o[3]=1*e}else if("quadratic"===this.elementOrder){function r(e){return 2*e**2-3*e+1}function a(e){return-4*e**2+4*e}function l(e){return 2*e**2-e}function d(e){return 4*e-3}function h(e){return-8*e+4}function m(e){return 4*e-1}n[0]=r(e)*r(t),n[1]=r(e)*a(t),n[2]=r(e)*l(t),n[3]=a(e)*r(t),n[4]=a(e)*a(t),n[5]=a(e)*l(t),n[6]=l(e)*r(t),n[7]=l(e)*a(t),n[8]=l(e)*l(t),s[0]=d(e)*r(t),s[1]=d(e)*a(t),s[2]=d(e)*l(t),s[3]=h(e)*r(t),s[4]=h(e)*a(t),s[5]=h(e)*l(t),s[6]=m(e)*r(t),s[7]=m(e)*a(t),s[8]=m(e)*l(t),o[0]=r(e)*d(t),o[1]=r(e)*h(t),o[2]=r(e)*m(t),o[3]=a(e)*d(t),o[4]=a(e)*h(t),o[5]=a(e)*m(t),o[6]=l(e)*d(t),o[7]=l(e)*h(t),o[8]=l(e)*m(t)}}return{basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:o}}}class A{constructor({numElementsX:e=null,maxX:t=null,numElementsY:n=null,maxY:s=null,meshDimension:o=null,elementOrder:i="linear",parsedMesh:r=null}){this.numElementsX=e,this.numElementsY=n,this.maxX=t,this.maxY=s,this.meshDimension=o,this.elementOrder=i,this.parsedMesh=r}generateMesh(){if(this.parsedMesh){if(this.parsedMesh.nodalNumbering&&"object"==typeof this.parsedMesh.nodalNumbering&&!Array.isArray(this.parsedMesh.nodalNumbering)){const e=this.parsedMesh.nodalNumbering.quadElements||[];if(this.parsedMesh.nodalNumbering.triangleElements,w("Initial parsed mesh nodal numbering from GMSH format: "+JSON.stringify(this.parsedMesh.nodalNumbering)),this.parsedMesh.elementTypes[3]||this.parsedMesh.elementTypes[10]){const t=[];for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],s=t[1];w(`Processing boundary node pair: [${n}, ${s}] for boundary ${e.tag} (${e.name||"unnamed"})`);let o=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];w(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,o])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[o].forEach((o=>{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const i=this.nop[n][o]-1;w(` - Applied fixed temperature to node ${i+1} (element ${n+1}, local node ${o+1})`),e[i]=s;for(let n=0;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(a[e]=t[1],l[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const s=a[n],o=l[n];w(`Boundary ${n}: Applying convection with heat transfer coefficient h=${s} W/(m²·K) and external temperature T∞=${o} K`),this.boundaryElements[n].forEach((([n,i])=>{let r;"linear"===this.elementOrder?r=0===i?0:1:"quadratic"===this.elementOrder&&(r=0===i?0:2);const a=this.nop[n][r]-1;w(` - Applied convection boundary condition to node ${a+1} (element ${n+1}, local node ${r+1})`),e[a]+=-s*o,t[a][a]+=s}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((d=>{if("convection"===this.boundaryConditions[d][0]){const h=a[d],m=l[d];w(`Boundary ${d}: Applying convection with heat transfer coefficient h=${h} W/(m²·K) and external temperature T∞=${m} K`),this.boundaryElements[d].forEach((([a,l])=>{if("linear"===this.elementOrder){let d,u,c,f,p;0===l?(d=n[0],u=0,c=0,f=3,p=2):1===l?(d=0,u=n[0],c=0,f=2,p=1):2===l?(d=n[0],u=1,c=1,f=4,p=2):3===l&&(d=1,u=n[0],c=2,f=4,p=1);let y=r.getBasisFunctions(d,u),g=y.basisFunction,b=y.basisFunctionDerivKsi,E=y.basisFunctionDerivEta,M=0,$=0,v=0,C=0;const S=this.nop[a].length;for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=h(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const s=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(s,1e3)};s()}))}async setSolverConfig(e){return await this._ensureReady(),C(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),C("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),C(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),C(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),C("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return C(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},e.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),s="",o=0,i=0,r=0,a=0,l={numNodes:0},d=0,h=[],m=0,u=0,c=0,f={dim:0,tag:0,elementType:0,numElements:0},p=0,y={};for(;o""!==e));if("meshFormat"===s)t.gmshV=parseFloat(g[0]),t.ascii="0"===g[1],t.fltBytes=g[2];else if("physicalNames"===s){if(g.length>=3){if(!/^\d+$/.test(g[0])){o++;continue}const e=parseInt(g[0],10),n=parseInt(g[1],10);let s=g.slice(2).join(" ");s=s.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:s})}}else if("nodes"===s){if(0===i){i=parseInt(g[0],10),r=parseInt(g[1],10),t.nodesXCoordinates=new Array(r).fill(0),t.nodesYCoordinates=new Array(r).fill(0),o++;continue}if(aparseInt(e,10)));if(1===f.elementType||8===f.elementType){const n=f.tag;y[n]||(y[n]=[]),y[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===f.elementType?t.nodalNumbering.triangleElements.push(e):(3===f.elementType||10===f.elementType)&&t.nodalNumbering.quadElements.push(e);p++,p===f.numElements&&(c++,f={numElements:0})}}o++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=y[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),w(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},e.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),v="basic"):(v=e,C(`Log level set to: ${e}`))},e.plotSolution=function(e,t,n,s,o,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===s&&"line"===o){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let s=Array.from(a),o={x:s,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...s),d=r/l,h={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[o],h,{responsive:!0})}else if("2D"===s&&"contour"===o){const t="structured"===r,s=new Set(a).size,d=new Set(l).size;let h=Array.isArray(e[0])?e.map((e=>e[0])):e,m=Math.min(window.innerWidth,700),u=Math.max(...a),c=Math.max(...l)/u,f=Math.min(m,600),p={title:`${o} plot - ${n}`,width:f,height:f*c*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=s,n=d;math.reshape(Array.from(a),[t,n]);let o=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),h=math.transpose(r),m=[];for(let e=0;e | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","fill","floor","random","Number","MAX_SAFE_INTEGER","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","worker","feaWorker","isReady","_initWorker","Worker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":"oyBAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CH,EAAY,GAAK,GACjBA,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CF,EAAa,GAAK,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/EG,EAAmBvI,KAAKqI,QAAQtX,MAAMqV,KAAKzH,GAAiB,CAACwJ,EAAWC,IAGxEI,EAAqBxI,KAAKyI,UAAUF,GAGpCG,EAAmB,GACvB,IAAK,IAAI1W,EAAI,EAAGA,EAAImW,EAAYC,EAAWpW,GAAKoW,EAAW,CACzD,IAAIO,EAASvV,EAAkBpB,GAC/B0W,EAAiB/W,KAAKgX,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHlP,KAAM,UACNwP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETvG,EAAGiI,EACHlD,EAAG8C,EAAqB,GACxB5V,KAAM,kBAIR6U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBnI,EAAGrN,EACHoS,EAAGnS,EACHwV,EAAGd,EACHzO,KAAM,UACNwP,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETtU,KAAM,kBAIR6U,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,iBVtGOnE,iBACL/T,EAAS,oDACT,IACE,MAAM2Z,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADApa,EAAS,4BAA4B+Z,KAC9BA,CACR,CAAC,MAAOtO,GAEP,OADAxL,EAAS,wCAA0CwL,GAC5C,iCACR,CACH"} \ No newline at end of file +{"version":3,"file":"feascript.umd.js","sources":["../src/vendor/comlink.mjs","../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/workers/workerScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class numericalIntegration {\n /**\n * Constructor to initialize the numericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersion() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class basisFunctions {\n /**\n * Constructor to initialize the basisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle the generation of structured finite element meshes\n */\nexport class meshGeneration {\n /**\n * Constructor to initialize the meshGeneration class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n }\n\n /**\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\n * @returns {object} The generated mesh containing node coordinates and total nodes\n */\n generateMesh() {\n // If pre-parsed mesh data is provided, use it directly\n if (this.parsedMesh) {\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\n if (this.parsedMesh.nodalNumbering) {\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.parsedMesh.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n }\n\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\n\n return this.parsedMesh;\n } else {\n // Validate required geometry parameters based on mesh dimension\n if (this.meshDimension === \"1D\") {\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n } else if (this.meshDimension === \"2D\") {\n if (\n this.numElementsX === null ||\n this.maxX === null ||\n this.numElementsY === null ||\n this.maxY === null\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n // Generate mesh based on dimension\n return this.generateMeshFromGeometry();\n }\n }\n\n /**\n * Function to generate a structured mesh based on the geometry configuration\n * @returns {object} An object containing the coordinates of nodes,\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\n */\n generateMeshFromGeometry() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n null, // numElementsY (not used in 1D)\n totalNodesX,\n null, // totalNodesY (not used in 1D)\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n } else if (this.meshDimension === \"2D\") {\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generateNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesX,\n totalNodesY,\n this.elementOrder\n );\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n if (this.meshDimension === \"1D\") {\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n } else if (this.meshDimension === \"2D\") {\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n return boundaryElements;\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (this.meshDimension === \"1D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n } else if (this.meshDimension === \"2D\") {\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n }\n\n return nop;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n ) {\n basicLog(\"Applying convection boundary conditions (Robin type)\");\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoint1,\n gaussPoint2\n );\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n const tangentVectorLength =\n side === 0 || side === 2\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n basicLog(\"FEAScriptModel instance created\");\n }\n\n setSolverConfig(solverConfig) {\n this.solverConfig = solverConfig;\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\n );\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let nodesCoordinates = {};\n\n // Assembly matrices\n basicLog(\"Beginning matrix assembly...\");\n console.time(\"assemblyMatrices\");\n if (this.solverConfig === \"solidHeatTransferScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\n this.meshConfig,\n this.boundaryConditions\n ));\n }\n console.timeEnd(\"assemblyMatrices\");\n basicLog(\"Matrix assembly completed\");\n\n // System solving\n basicLog(`Solving system using ${this.solverMethod}...`);\n console.time(\"systemSolving\");\n if (this.solverMethod === \"lusolve\") {\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\n } else if (this.solverMethod === \"jacobi\") {\n // Create initial guess of zeros\n const initialGuess = new Array(residualVector.length).fill(0);\n // Call Jacobi method with desired max iterations and tolerance\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\n\n // Log convergence information\n if (jacobiResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\n } else {\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\n }\n\n solutionVector = jacobiResult.solution;\n }\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the solid heat transfer matrix\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n * - nodesCoordinates: Object containing x and y coordinates of nodes\n */\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh details from the configuration object\n const {\n meshDimension, // The dimension of the mesh\n numElementsX, // Number of elements in x-direction\n numElementsY, // Number of elements in y-direction (only for 2D)\n maxX, // Max x-coordinate (m) of the domain\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\n elementOrder, // The order of elements\n parsedMesh, // The pre-parsed mesh data (if available)\n } = meshConfig;\n\n // Create a new instance of the meshGeneration class\n debugLog(\"Generating mesh...\");\n const meshGenerationData = new meshGeneration({\n numElementsX,\n numElementsY,\n maxX,\n maxY,\n meshDimension,\n elementOrder,\n parsedMesh, // Pass the parsed mesh to the mesh generator\n });\n\n // Generate the mesh\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n\n // Debug log for mesh size\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n // Debug log for mesh size\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n // Initialize variables for matrix assembly\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n let basisFunction = []; // Basis functions\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\n let basisFunctionDerivX = []; // The x-derivative of the basis function\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\n let residualVector = []; // Galerkin residuals\n let jacobianMatrix = []; // Jacobian matrix\n let xCoordinates; // x-coordinate (physical coordinates)\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\n let ksiDerivX; // ksi-derivative of xCoordinates\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\n let detJacobian; // The jacobian of the isoparametric mapping\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the basisFunctions class\n const basisFunctionsData = new basisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the numericalIntegration class\n const numIntegrationData = new numericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\n gaussPoints = gaussPointsAndWeights.gaussPoints;\n gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n xCoordinates = 0;\n ksiDerivX = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n detJacobian = ksiDerivX;\n }\n\n // Compute x-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n // 2D solid heat transfer\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Initialise variables for isoparametric mapping\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n xCoordinates = 0;\n yCoordinates = 0;\n ksiDerivX = 0;\n etaDerivX = 0;\n ksiDerivY = 0;\n etaDerivY = 0;\n detJacobian = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX +=\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY +=\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\n }\n\n // Compute x-derivative and y-derivative of basis functions\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian; // The x-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian; // The y-derivative of the n basis function\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Create an instance of ThermalBoundaryConditions\n debugLog(\"Applying thermal boundary conditions...\");\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctionsData\n );\n debugLog(\"Convection boundary conditions applied\");\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n debugLog(\"Constant temperature boundary conditions applied\");\n\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n nodesCoordinates: {\n nodesXCoordinates,\n nodesYCoordinates,\n },\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport * as Comlink from \"../vendor/comlink.mjs\";\nimport { WebGPUComputeEngine } from \"../utilities/webgpuComputeEngine.js\";\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * This version uses the WebGPU compute engine for maximum performance and reusability\n * @param {array} A - The coefficient matrix (must be square)\n * @param {array} b - The right-hand side vector\n * @param {array} x0 - Initial guess for solution vector\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-7] - Convergence tolerance\n * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision\n * @returns {object} An object containing:\n * - solution: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) {\n // Use the dedicated worker file\n const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' });\n const jacobiWorker = Comlink.wrap(worker);\n\n try {\n const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64);\n return result;\n } catch (error) {\n console.error(\"Error in WebGPU Jacobi method:\", error);\n throw error;\n } finally {\n worker.terminate();\n }\n}","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n \n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n \n // Extract scalar values from solution vector\n let zValues = Array.isArray(solutionVector[0]) \n ? solutionVector.map(val => val[0]) \n : solutionVector;\n \n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n \n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: 'closest'\n };\n \n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: 'Solution Field'\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: 'contour',\n contours: {\n coloring: 'heatmap',\n showlabels: false\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: 'Solution'\n },\n name: 'Solution Field'\n };\n \n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n"],"names":["proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","Error","isError","message","name","stack","Object","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","console","warn","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","prop","rawValue","apply","proxy","transfers","transferCache","set","transfer","undefined","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","constructor","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","length","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","Array","prototype","concat","handler","serializedValue","msg","fill","Math","floor","random","Number","MAX_SAFE_INTEGER","join","numericalIntegration","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","sqrt","currentLogLevel","debugLog","log","basicLog","errorLog","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","dimension","tag","nodesPair","node1","node2","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","async","A","b","x0","maxIterations","tolerance","useFloat64","worker","Worker","jacobiWorker","Comlink.wrap","jacobiMethod","terminate","converged","iterations","solution","feaWorker","isReady","_initWorker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","result","toFixed","getModelInfo","ping","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","x","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","max","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString"],"mappings":";;;;;OAKA,MAAMA,EAAcC,OAAO,iBACrBC,EAAiBD,OAAO,oBACxBE,EAAeF,OAAO,wBACtBG,EAAYH,OAAO,qBACnBI,EAAcJ,OAAO,kBACrBK,EAAYC,GAAwB,iBAARA,GAA4B,OAARA,GAAgC,mBAARA,EAgDxEC,EAAmB,IAAIC,IAAI,CAC7B,CAAC,QA7CwB,CACzBC,UAAYH,GAAQD,EAASC,IAAQA,EAAIP,GACzC,SAAA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B,EAAGoD,EACHnD,EAAG+C,EAAqB,GACxB/X,KAAM,kBAIRgX,OAAOC,QAAQzB,EAAW,CAAC6C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBtD,EAAGvK,EACHwK,EAAGvK,EACH6N,EAAGd,EACHrW,KAAM,UACNoX,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETzW,KAAM,kBAIRgX,OAAOC,QAAQzB,EAAW,CAAC6C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,iBTtGOjH,iBACLhJ,EAAS,oDACT,IACE,MAAM0R,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAnS,EAAS,4BAA4B8R,KAC9BA,CACR,CAAC,MAAOhW,GAEP,OADAmE,EAAS,wCAA0CnE,GAC5C,iCACR,CACH"} \ No newline at end of file diff --git a/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinCG.html b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinCG.html new file mode 100644 index 0000000..cde12b3 --- /dev/null +++ b/examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinCG.html @@ -0,0 +1,96 @@ + + + + + + Heat Conduction 2D Fin - CG Solver + + + + + +

Heat Conduction in 2D Fin - Conjugate Gradient Solver

+
+
+ + + + \ No newline at end of file diff --git a/src/FEAScript.js b/src/FEAScript.js index e7a5dda..bab783f 100644 --- a/src/FEAScript.js +++ b/src/FEAScript.js @@ -51,6 +51,54 @@ export class FEAScriptModel { debugLog(`Solver method set to: ${solverMethod}`); } + async solveWithWebGPU(computeEngine) { + if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { + const error = "Solver config, mesh config, and boundary conditions must be set before solving."; + console.error(error); + throw new Error(error); + } + + let jacobianMatrix = []; + let residualVector = []; + let solutionVector = []; + let nodesCoordinates = {}; + + // Assembly matrices + basicLog("Beginning matrix assembly..."); + console.time("assemblyMatrices"); + if (this.solverConfig === "solidHeatTransferScript") { + basicLog(`Using solver: ${this.solverConfig}`); + ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat( + this.meshConfig, + this.boundaryConditions + )); + } + console.timeEnd("assemblyMatrices"); + basicLog("Matrix assembly completed"); + + // System solving with WebGPU CG + basicLog("Solving system using WebGPU Jacobi..."); + console.time("systemSolving"); + + // Convert matrices to arrays for WebGPU + const A = Array.isArray(jacobianMatrix) ? jacobianMatrix : jacobianMatrix.toArray(); + const b = Array.isArray(residualVector) ? residualVector : residualVector.toArray(); + + // For heat conduction FEM, the matrix might be negative definite + // Use Jacobi method instead of CG for better stability + console.log("Matrix diagonal sample:", A.slice(0, 5).map((row, i) => row[i])); + console.log("RHS sample:", b.slice(0, 5)); + + // Use WebGPU Jacobi method + const initialGuess = new Array(b.length).fill(0); + solutionVector = await computeEngine.jacobiSolve(A, b, initialGuess, 10000, 1e-3); + + console.timeEnd("systemSolving"); + basicLog("System solved successfully with WebGPU Jacobi"); + + return { solutionVector, nodesCoordinates }; + } + solve() { if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { const error = "Solver config, mesh config, and boundary conditions must be set before solving."; diff --git a/src/methods/jacobiMethodScript.js b/src/methods/jacobiMethodScript.js index 889edf2..b267dc6 100644 --- a/src/methods/jacobiMethodScript.js +++ b/src/methods/jacobiMethodScript.js @@ -8,127 +8,35 @@ // |_| | |_ // // Website: https://feascript.com/ \__| // +import * as Comlink from "../vendor/comlink.mjs"; +import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; + /** * Function to solve a system of linear equations using the Jacobi iterative method - * This version uses Taichi.js to accelerate the core computation + * This version uses the WebGPU compute engine for maximum performance and reusability * @param {array} A - The coefficient matrix (must be square) * @param {array} b - The right-hand side vector * @param {array} x0 - Initial guess for solution vector * @param {number} [maxIterations=100] - Maximum number of iterations * @param {number} [tolerance=1e-7] - Convergence tolerance + * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision * @returns {object} An object containing: * - solution: The solution vector * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { - // Initialize Taichi for each call to ensure clean state - const taichi = await import('taichi.js'); - await taichi.init(); - - const n = A.length; - - // Choose appropriate float type based on precision parameter - const FloatArray = useFloat64 ? Float64Array : Float32Array; - - // Declare fields outside try block so they can be referenced in finally - let fieldA, fieldB, fieldCurrent, fieldNext, fieldMaxDiff; - + // Use the dedicated worker file + const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' }); + const jacobiWorker = Comlink.wrap(worker); + try { - // Create fields with appropriate precision - fieldA = taichi.field(FloatArray, [n, n]); - fieldB = taichi.field(FloatArray, [n]); - fieldCurrent = taichi.field(FloatArray, [n]); - fieldNext = taichi.field(FloatArray, [n]); - fieldMaxDiff = taichi.field(FloatArray, [1]); - - // Set initial values - fieldA.set(A.flat()); - fieldB.set(b); - fieldCurrent.set(x0); - - // Create kernels inline (no caching to prevent memory issues) - const updateKernel = taichi.kernel(function(A, b, current, next, n) { - for (let i = 0; i < n; i++) { - let sum = 0; - for (let j = 0; j < n; j++) { - if (j !== i) { - sum += A[i][j] * current[j]; - } - } - next[i] = (b[i] - sum) / A[i][i]; - } - }); - - const diffKernel = taichi.kernel(function(current, next, maxDiff, n) { - maxDiff[0] = 0; - for (let i = 0; i < n; i++) { - const diff = Math.abs(next[i] - current[i]); - if (diff > maxDiff[0]) { - maxDiff[0] = diff; - } - } - }); - - const copyKernel = taichi.kernel(function(src, dst, n) { - for (let i = 0; i < n; i++) { - dst[i] = src[i]; - } - }); - - // Store solution here so we can return it after cleanup - let solution; - let iterationsCompleted; - let hasConverged = false; - - // Main iteration loop - for (let iteration = 0; iteration < maxIterations; iteration++) { - // Compute next iteration values - updateKernel(fieldA, fieldB, fieldCurrent, fieldNext, n); - - // Compute max difference directly in Taichi - diffKernel(fieldCurrent, fieldNext, fieldMaxDiff, n); - const maxDiff = fieldMaxDiff.get()[0]; - - // Copy next values to current using Taichi - copyKernel(fieldNext, fieldCurrent, n); - - // Check for convergence - if (maxDiff < tolerance) { - solution = Array.from(fieldCurrent.get()); - iterationsCompleted = iteration + 1; - hasConverged = true; - break; - } - - // If we're approaching maximum iterations, get the current solution - if (iteration === maxIterations - 1) { - solution = Array.from(fieldCurrent.get()); - iterationsCompleted = maxIterations; - } - } - - return { - solution: solution, - iterations: iterationsCompleted, - converged: hasConverged, - }; + const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64); + return result; } catch (error) { - console.error("Error in Jacobi method:", error); + console.error("Error in WebGPU Jacobi method:", error); throw error; } finally { - // Aggressive cleanup - destroy all fields and reset Taichi completely - try { - if (fieldA) fieldA.destroy(); - if (fieldB) fieldB.destroy(); - if (fieldCurrent) fieldCurrent.destroy(); - if (fieldNext) fieldNext.destroy(); - if (fieldMaxDiff) fieldMaxDiff.destroy(); - - // Reset Taichi completely - taichi.reset(); - } catch (cleanupError) { - console.error("Error during cleanup:", cleanupError); - } + worker.terminate(); } } \ No newline at end of file diff --git a/src/utilities/webgpuComputeEngine.js b/src/utilities/webgpuComputeEngine.js new file mode 100644 index 0000000..99537a9 --- /dev/null +++ b/src/utilities/webgpuComputeEngine.js @@ -0,0 +1,836 @@ +import * as ti from '../vendor/taichi.esm.js'; + +export class WebGPUComputeEngine { + constructor() { + this.initialized = false; + } + + /** + * Initialize Taichi + */ + async initialize() { + if (this.initialized) return; + + await ti.init(); + this.initialized = true; + } + + /** + * Read data from a buffer (compatibility method) + */ + async readBuffer(data, size, type = Float32Array) { + return data; + } + + /** + * Matrix-vector multiplication: y = A * x + */ + async matVecMul(A, x, resultBuffer = null) { + const n = A.length; + const m = A[0].length; + + const matrixField = ti.field(ti.f32, [n * m]); + const vectorField = ti.field(ti.f32, [m]); + const resultField = ti.field(ti.f32, [n]); + + const flatMatrix = A.flat(); + matrixField.fromArray(flatMatrix); + vectorField.fromArray(x); + + ti.addToKernelScope({matrixField, vectorField, resultField}); + + ti.kernel((n, m) => { + for (let i of ti.ndrange(n)) { + let sum = 0.0; + for (let j of ti.ndrange(m)) { + sum += matrixField[ti.i32(i) * ti.i32(m) + ti.i32(j)] * vectorField[j]; + } + resultField[i] = sum; + } + })(n, m); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector addition: result = a + b + */ + async vecAdd(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] + bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector subtraction: result = a - b + */ + async vecSub(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] - bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Element-wise vector multiplication: result = a * b + */ + async vecMul(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] * bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector division: result = a / b + */ + async vecDiv(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Find maximum value in vector + */ + async vecMax(vector) { + const n = vector.length; + const vectorField = ti.field(ti.f32, [n]); + const maxField = ti.field(ti.f32, [1]); + + vectorField.fromArray(vector); + maxField.fromArray([-1e10]); + + ti.addToKernelScope({vectorField, maxField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + // For max, we can use a simple approach since atomic_max might not exist + // Use a reduction pattern + } + })(n); + + // For simplicity, since atomic_max may not be available, let's use CPU for now + const result = await vectorField.toArray(); + return Math.max(...result); + } + + /** + * Jacobi update: x_new = D^(-1) * (b - R * x_old) + */ + async jacobiUpdate(A, b, x, omega = 1.0, resultBuffer = null) { + const n = x.length; + const AField = ti.field(ti.f32, [n * n]); + const bField = ti.field(ti.f32, [n]); + const xField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + const flatA = A.flat(); + AField.fromArray(flatA); + bField.fromArray(b); + xField.fromArray(x); + + ti.addToKernelScope({AField, bField, xField, resultField}); + + ti.kernel((n, omega) => { + for (let i = 0; i < n; i++) { + let sum = 0.0; + for (let j = 0; j < n; j++) { + if (i !== j) { + sum += AField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + } + resultField[i] = omega * (bField[i] - sum) / AField[ti.i32(i) * ti.i32(n) + ti.i32(i)] + (1 - omega) * xField[i]; + } + })(n, omega); + + const result = await resultField.toArray(); + return result; + } + + /** + * Element-wise operation on vector: result[i] = op(a[i]) + */ + async elementWiseOp(a, op, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, op) => { + for (let i of ti.ndrange(n)) { + if (op === 'abs') { + resultField[i] = ti.abs(aField[i]); + } else if (op === 'sqrt') { + resultField[i] = ti.sqrt(aField[i]); + } else if (op === 'exp') { + resultField[i] = ti.exp(aField[i]); + } else if (op === 'log') { + resultField[i] = ti.log(aField[i]); + } else if (op === 'sin') { + resultField[i] = ti.sin(aField[i]); + } else if (op === 'cos') { + resultField[i] = ti.cos(aField[i]); + } else if (op === 'tan') { + resultField[i] = ti.tan(aField[i]); + } else { + resultField[i] = aField[i]; + } + } + })(n, op); + + const result = await resultField.toArray(); + return result; + } + + /** + * Scalar operation on vector: result[i] = op(a[i], scalar) + */ + async scalarOp(a, scalar, op, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, scalar, op) => { + for (let i of ti.ndrange(n)) { + if (op === 'add') { + resultField[i] = aField[i] + scalar; + } else if (op === 'mul') { + resultField[i] = aField[i] * scalar; + } else if (op === 'div') { + resultField[i] = aField[i] / scalar; + } else if (op === 'pow') { + resultField[i] = ti.pow(aField[i], scalar); + } else { + resultField[i] = aField[i]; + } + } + })(n, scalar, op); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector L2 norm: result = ||a||_2 + */ + + /** + * Vector addition: c = a + b + */ + async vecAdd(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const cField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, cField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + cField[i] = aField[i] + bField[i]; + } + })(n); + + const result = await cField.toArray(); + return result; + } + + /** + * Element-wise vector multiplication: c = a .* b + */ + async vecMul(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const cField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, cField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + cField[i] = aField[i] * bField[i]; + } + })(n); + + const result = await cField.toArray(); + return result; + } + /** + * Vector dot product: result = a · b + */ + async dotProduct(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + bField.fromArray(b); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * bField[i]); + } + })(n); + + const result = await resultField.toArray(); + return result[0]; + } + + /** + * Vector L2 norm: result = ||a||_2 + */ + async norm(a) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel(() => { + resultField[0] = ti.sqrt(resultField[0]); + })(); + + const result = await resultField.toArray(); + return result[0]; + } + + async normalize(a) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + const tempField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + tempField.fromArray([0]); + + ti.addToKernelScope({aField, resultField, tempField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(tempField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel((n) => { + const normVal = ti.sqrt(tempField[0]); + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / normVal; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Matrix-matrix multiplication: C = A * B + */ + /** + * Matrix-vector multiplication: y = A * x + */ + async matVecMul(A, x) { + const m = A.length; + const n = A[0].length; + + const AField = ti.field(ti.f32, [m * n]); + const xField = ti.field(ti.f32, [n]); + const yField = ti.field(ti.f32, [m]); + + const flatA = A.flat(); + AField.fromArray(flatA); + xField.fromArray(x); + + ti.addToKernelScope({AField, xField, yField}); + + ti.kernel((m, n) => { + for (let i of ti.ndrange(m)) { + let sum = 0.0; + for (let j of ti.ndrange(n)) { + sum += AField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + yField[i] = sum; + } + })(m, n); + + const result = await yField.toArray(); + return result; + } + + /** + * Matrix transpose: B = A^T + */ + async transpose(A, resultBuffer = null) { + const m = A.length; + const n = A[0].length; + + const AField = ti.field(ti.f32, [m * n]); + const BField = ti.field(ti.f32, [n * m]); + + const flatA = A.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, BField}); + + ti.kernel((m, n) => { + for (let i of ti.ndrange(m)) { + for (let j of ti.ndrange(n)) { + BField[ti.i32(j) * ti.i32(m) + ti.i32(i)] = AField[ti.i32(i) * ti.i32(n) + ti.i32(j)]; + } + } + })(m, n); + + const result = await BField.toArray(); + // Reshape to n x m + const B = []; + for (let i = 0; i < n; i++) { + B.push(result.slice(i * m, (i + 1) * m)); + } + return B; + } + + /** + * Extract diagonal elements: result = diag(A) + */ + async diagonal(A, resultBuffer = null) { + const n = Math.min(A.length, A[0].length); + + const AField = ti.field(ti.f32, [A.length * A[0].length]); + const resultField = ti.field(ti.f32, [n]); + + const flatA = A.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((n, cols) => { + for (let i of ti.ndrange(n)) { + resultField[i] = AField[ti.i32(i) * ti.i32(cols) + ti.i32(i)]; + } + })(n, A[0].length); + + const result = await resultField.toArray(); + return result; + } + + /** + * Sparse matrix-vector multiplication using CSR format + * sparseMatrix should have: {values, col_indices, row_indices, rows, cols} + */ + async sparseMatVecMul(sparseMatrix, x, resultBuffer = null) { + const { values, col_indices, row_indices, rows, cols } = sparseMatrix; + const nnz = values.length; + + const valuesField = ti.field(ti.f32, [nnz]); + const colIndicesField = ti.field(ti.i32, [nnz]); + const rowIndicesField = ti.field(ti.i32, [nnz]); + const xField = ti.field(ti.f32, [cols]); + const resultField = ti.field(ti.f32, [rows]); + + valuesField.fromArray(values); + colIndicesField.fromArray(col_indices); + rowIndicesField.fromArray(row_indices); + xField.fromArray(x); + resultField.fromArray(new Array(rows).fill(0)); + + ti.addToKernelScope({valuesField, colIndicesField, rowIndicesField, xField, resultField}); + + ti.kernel((nnz) => { + for (let k of ti.ndrange(nnz)) { + ti.atomicAdd(resultField[rowIndicesField[k]], valuesField[k] * xField[colIndicesField[k]]); + } + })(nnz); + + const result = await resultField.toArray(); + return result; + } + + /** + * Deep copy vector or matrix + */ + async copy(data) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const AField = ti.field(ti.f32, [m * n]); + const resultField = ti.field(ti.f32, [m * n]); + + const flatA = data.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((total) => { + for (let i of ti.ndrange(total)) { + resultField[i] = AField[i]; + } + })(m * n); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(data); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Fill vector or matrix with constant value + */ + async fill(data, value) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const resultField = ti.field(ti.f32, [m * n]); + + ti.addToKernelScope({resultField}); + + ti.kernel((total, value) => { + for (let i of ti.ndrange(total)) { + resultField[i] = value; + } + })(m * n, value); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const resultField = ti.field(ti.f32, [n]); + + ti.addToKernelScope({resultField}); + + ti.kernel((n, value) => { + for (let i of ti.ndrange(n)) { + resultField[i] = value; + } + })(n, value); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Scale vector or matrix by scalar + */ + async scale(data, scalar) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const AField = ti.field(ti.f32, [m * n]); + const resultField = ti.field(ti.f32, [m * n]); + + const flatA = data.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((total, scalar) => { + for (let i of ti.ndrange(total)) { + resultField[i] = AField[i] * scalar; + } + })(m * n, scalar); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(data); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, scalar) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] * scalar; + } + })(n, scalar); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Compute residual vector: r = b - A * x + */ + async residual(A, x, b) { + const Ax = await this.matVecMul(A, x); + return this.vecSub(b, Ax); + } + + /** + * Apply preconditioner: solve M * z = r for z + * type: 'jacobi' or 'ssor' + */ + async preconditioner(A, r, type = 'jacobi', omega = 1.0) { + const n = r.length; + + if (type === 'jacobi') { + // Jacobi: M = diag(A), so z_i = r_i / A_ii + const diag = await this.diagonal(A); + const invDiag = diag.map(d => 1.0 / d); + return this.vecMul(invDiag, r); + } else if (type === 'ssor') { + // SSOR: Simplified Symmetric Successive Over-Relaxation + // This is a basic implementation; full SSOR would require forward/backward sweeps + const diag = await this.diagonal(A); + const invDiag = diag.map(d => omega / d); + + // For simplicity, approximate with Jacobi-like application + // Full SSOR would need iterative application or matrix splitting + return this.vecMul(invDiag, r); + } else { + throw new Error(`Unsupported preconditioner type: ${type}`); + } + } + + /** + * Conjugate Gradient solver: solve A * x = b + * Returns approximate solution x + */ + async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + const n = b.length; + let x = x0 ? await this.copy(x0) : new Array(n).fill(0.0); + + // Initial residual r = b - A*x + let r = await this.residual(A, x, b); + let rr = await this.dotProduct(r, r); + let rnorm0 = Math.sqrt(rr); + + console.log(`CG: Initial residual norm: ${rnorm0}`); + + if (rnorm0 < tol) { + console.log(`CG: Already converged`); + return x; + } + + // Initial search direction + let p = preconditionerType ? await this.preconditioner(A, r, preconditionerType) : await this.copy(r); + + for (let iter = 0; iter < maxIter; iter++) { + // Compute A*p + const Ap = await this.matVecMul(A, p); + + // Compute p·Ap + const pAp = await this.dotProduct(p, Ap); + + if (Math.abs(pAp) < 1e-16) { + console.log(`CG: p^T * A * p is too small (${pAp}), stopping`); + break; + } + + // Compute alpha = (r·r) / (p·Ap) + const alpha = rr / pAp; + + // Update solution: x = x + alpha*p + const alpha_p = await this.scale(p, alpha); + x = await this.vecAdd(x, alpha_p); + + // Update residual: r = r - alpha*A*p + const alpha_Ap = await this.scale(Ap, alpha); + r = await this.vecSub(r, alpha_Ap); + + // Compute new r·r + const rr_new = await this.dotProduct(r, r); + const rnorm = Math.sqrt(rr_new); + + console.log(`CG: Iteration ${iter + 1}, residual norm: ${rnorm}`); + + // Check convergence + if (rnorm < tol * rnorm0) { + console.log(`CG: Converged in ${iter + 1} iterations`); + break; + } + + // Compute beta = (r_new·r_new) / (r_old·r_old) + const beta = rr_new / rr; + + // Update search direction: p = r + beta*p (or z + beta*p if preconditioned) + if (preconditionerType) { + const z = await this.preconditioner(A, r, preconditionerType); + const beta_p = await this.scale(p, beta); + p = await this.vecAdd(z, beta_p); + } else { + const beta_p = await this.scale(p, beta); + p = await this.vecAdd(r, beta_p); + } + + // Update rr for next iteration + rr = rr_new; + } + + return x; + } + + /** + * Jacobi iterative solver: solve A * x = b + * Returns approximate solution x + */ + async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { + const n = b.length; + let x = await this.copy(x0); + let x_new = await this.copy(x0); + + const diag = await this.diagonal(A); + + for (let iter = 0; iter < maxIter; iter++) { + // Compute residual r = b - A*x + const Ax = await this.matVecMul(A, x); + const r = await this.vecSub(b, Ax); + + // Check convergence + const rnorm = await this.norm(r); + console.log(`Jacobi: Iteration ${iter + 1}, residual norm: ${rnorm}`); + + if (rnorm < tol) { + console.log(`Jacobi: Converged in ${iter + 1} iterations`); + return x; + } + + // Jacobi update: x_new[i] = x[i] + r[i] / A[i][i] + for (let i = 0; i < n; i++) { + x_new[i] = x[i] + r[i] / diag[i]; + } + + // Swap references + [x, x_new] = [x_new, x]; + } + + console.log(`Jacobi: Did not converge in ${maxIter} iterations`); + return x; + } + + async destroy() { + if (this.initialized) { + // Clean up Taichi.js resources and WebGPU context + if (typeof ti.destroy === 'function') { + await ti.destroy(); + } + this.initialized = false; + } + } + +} diff --git a/src/vendor/taichi.esm.js b/src/vendor/taichi.esm.js new file mode 100644 index 0000000..2efa091 --- /dev/null +++ b/src/vendor/taichi.esm.js @@ -0,0 +1,16 @@ +var e,t,r,n,i,a=Object.freeze({__proto__:null,get engine(){return Mc},get types(){return Jc},get init(){return ie},get texture(){return Sr},get canvasTexture(){return Dr},get depthTexture(){return Cr},get Texture(){return S},get CubeTexture(){return T},get WrapMode(){return n},get Canvas(){return Er},get Timer(){return kr},get runAllTests(){return Uc},get addToKernelScope(){return cr},get clearKernelScope(){return lr},get template(){return ur},get kernel(){return dr},get classKernel(){return _r},get func(){return pr},get sync(){return fr},get i32(){return mr},get f32(){return gr},get field(){return yr},get Vector(){return hr},get Matrix(){return vr},get Struct(){return br},get materializeFields(){return xr},get range(){return Nr},get ndrange(){return wr},get inputVertices(){return Fr},get inputFragments(){return Pr},get neg(){return Or},get add(){return Mr},get sub(){return Lr},get mul(){return Rr},get div(){return Br},get normSqr(){return Jr},get norm(){return jr},get normalized(){return Ur},get dot(){return Vr},get cross(){return Kr},get matmul(){return zr},get transpose(){return Gr},get inverse(){return qr},get polarDecompose2D(){return Wr},get outputVertex(){return Hr},get outputPosition(){return Qr},get clearColor(){return Xr},get useDepth(){return $r},get outputColor(){return Yr},get outputDepth(){return Zr},get discard(){return en},get textureSample(){return tn},get textureSampleLod(){return rn},get textureSampleCompare(){return nn},get textureLoad(){return an},get textureStore(){return on},get getVertexIndex(){return sn},get getInstanceIndex(){return cn},get getFragCoord(){return ln},get dpdx(){return un},get dpdy(){return dn},get lookAt(){return _n},get perspective(){return pn},get ortho(){return fn},get rotateAxisAngle(){return mn},get translate(){return gn},get scale(){return yn},get mergeStructs(){return hn},get bitcast_i32(){return vn},get bitcast_f32(){return bn},get not(){return xn},get rsqrt(){return Sn},get Static(){return Dn}});function o(...e){console.log(...e)}function s(...e){throw console.error("FATAL ERROR: ",...e),"Taichi JS ERROR "}function c(e,...t){e||s("Assertion failed",t)}!function(e){e.i32="i32",e.f32="f32"}(e||(e={})),function(e){e.Scalar="Scalar",e.Vector="Vector",e.Matrix="Matrix",e.Struct="Struct",e.Pointer="Pointer",e.Void="Void",e.Function="Function",e.HostObjectReference="HostObjectReference"}(t||(t={}));class l{constructor(){}getCategory(){return s("calling getCategory from Type2 base"),t.Scalar}equals(e){return s("calling equals from Type2 base"),!1}getPrimitivesList(){return s("calling getPrimitivesList from Type base"),[]}}class u extends l{constructor(e){super(),this.primitiveType_=e}getCategory(){return t.Scalar}getPrimitiveType(){return this.primitiveType_}getPrimitivesList(){return[this.primitiveType_]}equals(e){return e.getCategory()==this.getCategory()&&this.getPrimitiveType()===e.getPrimitiveType()}}class d extends l{constructor(e,t){super(),this.primitiveType_=e,this.numRows_=t}getCategory(){return t.Vector}getPrimitiveType(){return this.primitiveType_}getNumRows(){return this.numRows_}getPrimitivesList(){let e=[];for(let t=0;t=1,"texture dimensions must be >= 1 and <= 3"),c(1===e||2===e||4===e,"texture dimensions must be 1, 2, or 4"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(t,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!0,1),this.sampleCount>1&&(this.multiSampledRenderTexture=ne.getCurrentProgram().runtime.createGPUTexture(t,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,r)),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView(),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!1,n)}getGPUTextureFormat(){switch(this.numComponents){case 1:return"r16float";case 2:return"rg16float";case 4:return"rgba16float";default:return s("unsupported component count"),"rgba16float"}}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}getTextureDimensionality(){switch(this.dimensions.length){case 2:return r.Dim2d;case 3:return r.Dim3d;default:return s("unsupported dimensionality"),r.Dim2d}}async copyFrom(e){c(this.getTextureDimensionality()===e.getTextureDimensionality(),"texture dimensionality mismatch");for(let t=0;t1&&(this.multiSampledRenderTexture=ne.getCurrentProgram().runtime.createGPUTexture(this.dimensions,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,t))}getGPUTextureFormat(){return this.format}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.context.getCurrentTexture()}getGPUTextureView(){return this.context.getCurrentTexture().createView()}getGPUSampler(){return this.sampler}getTextureDimensionality(){return r.Dim2d}}class C extends x{constructor(e,t){super(),this.dimensions=e,c(2===e.length,"depth texture must be 2D"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(e,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,t),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView(),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!0,{}),this.sampleCount=t}getGPUTextureFormat(){return"depth32float"}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getTextureDimensionality(){return r.Dim2d}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}}class T extends x{constructor(e){super(),this.dimensions=e,c(2===e.length,"cube texture must be 2D"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(e,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,1),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView({dimension:"cube"}),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!1,{}),this.sampleCount=1}getGPUTextureFormat(){return"rgba16float"}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getTextureDimensionality(){return r.DimCube}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}static async createFromBitmap(e){for(let t of e)c(t.width===e[0].width&&t.height===e[0].height,"all 6 images in a cube texture must have identical dimensions");let t=[e[0].width,e[0].height],r=new T(t);return await ne.getCurrentProgram().runtime.copyImageBitmapsToCubeTexture(e,r.getGPUTexture()),r}static async createFromHtmlImage(e){let t=[];for(let r of e)t.push(await createImageBitmap(r));return await this.createFromBitmap(t)}static async createFromURL(e){let t=[];for(let r of e){let e=new Image;e.src=r,await e.decode(),t.push(e)}return await this.createFromHtmlImage(t)}}function E(e){return e instanceof S||e instanceof D||e instanceof C||e instanceof T}!function(e){e[e.Root=0]="Root",e[e.RootAtomic=1]="RootAtomic",e[e.GlobalTmps=2]="GlobalTmps",e[e.GlobalTmpsAtomic=3]="GlobalTmpsAtomic",e[e.Args=4]="Args",e[e.RandStates=5]="RandStates",e[e.Rets=6]="Rets",e[e.Texture=7]="Texture",e[e.Sampler=8]="Sampler",e[e.StorageTexture=9]="StorageTexture"}(i||(i={}));class k{constructor(e,t){this.resourceType=e,this.resourceID=t}equals(e){return this.resourceID===e.resourceID&&this.resourceType===e.resourceType}}class A{constructor(e,t){this.info=e,this.binding=t}equals(e){return this.info.equals(e.info)&&this.binding===e.binding}}class N{constructor(e,t,r,n=[]){this.code=e,this.workgroupSize=t,this.numWorkgroups=r,this.bindings=n}}class w{constructor(e="",t=[]){this.code=e,this.bindings=t}}class F{constructor(e="",t=[]){this.code=e,this.bindings=t}}class P{constructor(e,t,r=new f({}),n=null,i=null,a=null){this.vertex=e,this.fragment=t,this.interpolatedType=r,this.vertexBuffer=n,this.indexBuffer=i,this.indirectBuffer=a,this.indirectCount=1,this.bindings=this.getBindings()}getBindings(){let e=[],t=this.vertex.bindings.concat(this.fragment.bindings);for(let r of t){let t=!1;for(let n of e)if(r.equals(n)){t=!0;break}t||e.push(r)}return e}}class I{constructor(e,t,r,n=null){this.tasksParams=e,this.argTypes=t,this.returnType=r,this.renderPassParams=n}}class O{constructor(e,t){this.params=e,this.pipeline=null,this.bindGroup=null,this.createPipeline(t)}createPipeline(e){let t=this.params.code;this.pipeline=e.getGPUComputePipeline({compute:{module:e.getGPUShaderModule(t),entryPoint:"main"},layout:"auto"})}}class M{constructor(e,t,r){this.params=e,this.pipeline=null,this.bindGroup=null,this.createPipeline(r,t)}getGPUVertexBufferStates(){let t=[],r=this.params.vertexBuffer.elementType.getPrimitivesList();for(let i=0;i0?r=t.colorAttachments[0].texture.sampleCount:null!==t.depthAttachment&&(r=t.depthAttachment.texture.sampleCount);for(let e of t.colorAttachments)e.texture.sampleCount!=r&&s("all render target attachments (color or depth) must have the same sample count");null!==t.depthAttachment&&t.depthAttachment.texture.sampleCount!==r&&s("all render target attachments (color or depth) must have the same sample count");let n={vertex:{module:e.getGPUShaderModule(this.params.vertex.code),entryPoint:"main",buffers:[this.getGPUVertexBufferStates()]},fragment:{module:e.getGPUShaderModule(this.params.fragment.code),entryPoint:"main",targets:this.getGPUColorTargetStates(t)},primitive:{topology:"triangle-list",cullMode:"none"},multisample:{count:r},layout:"auto"};if(null!==t.depthAttachment){let e=!0;!1===t.depthAttachment.storeDepth&&(e=!1),n.depthStencil={depthWriteEnabled:e,depthCompare:"less-equal",format:t.depthAttachment.texture.getGPUTextureFormat()}}this.pipeline=e.getGPURenderPipeline(n)}}class L{constructor(e){this.params=e}getGPURenderPassDescriptor(){let e=[];for(let t of this.params.colorAttachments){let r,n=t.texture.getGPUTextureView();if(t.texture.sampleCount>1&&(t.texture instanceof D||t.texture instanceof S)&&(n=t.texture.multiSampledRenderTexture.createView(),r=t.texture.getGPUTextureView()),void 0===t.clearColor)e.push({view:n,resolveTarget:r,clearValue:{r:0,g:0,b:0,a:1},loadOp:"load",storeOp:"store"});else{let i={r:t.clearColor[0],g:t.clearColor[1],b:t.clearColor[2],a:t.clearColor[3]};e.push({view:n,resolveTarget:r,clearValue:i,loadOp:"clear",storeOp:"store"})}}let t=this.params.depthAttachment;return null===t?{colorAttachments:e}:{colorAttachments:e,depthStencilAttachment:{view:t.texture.getGPUTextureView(),depthClearValue:t.clearDepth,depthLoadOp:void 0===t.clearDepth?"load":"clear",depthStoreOp:!0===t.storeDepth?"store":"discard"}}}}class R{constructor(e=[],t=[],r=new m,n=null){this.tasks=e,this.argTypes=t,this.returnType=r,this.renderPassInfo=n}}function B(e,t){return Math.ceil(e/t)}function J(e){let t=0;if(e&&!(e&e-1))return e;for(;0!=e;)e>>=1,t+=1;return 1<1024)return!1;switch(typeof e){case"object":if(!e)return!1;if(Array.isArray(e)){for(let r of e)if(!q(r,t+1))return!1;return!0}for(let r in e)if(!q(e[r],t+1))return!1;return!0;case"number":case"boolean":return!0;default:return!1}}class W{constructor(e,t,r,n,i){this.snodeTree=e,this.offsetBytes=t,this.sizeBytes=r,this.dimensions=n,this.elementType=i}async toArray1D(){if(h.isTensorType(this.elementType)){let t=await ne.getCurrentProgram().runtime.deviceToHost(this);return h.getPrimitiveType(this.elementType)===e.f32?t.floatArray:t.intArray}return s("toArray1D can only be used for scalar/vector/matrix fields"),[]}async toInt32Array(){return(await ne.getCurrentProgram().runtime.deviceToHost(this)).intArray}ensureMaterialized(){ne.getCurrentProgram().materializeCurrentTree()}async toArray(){this.ensureMaterialized();let e=await ne.getCurrentProgram().runtime.deviceToHost(this),t=function(e,t,r){let n=r.getPrimitivesList().length,i=j(e,n),a=j(t,n),o=[];for(let e=0;e0;--e)r=j(r,t[e]);return r}(t,this.dimensions)}async get(e){this.ensureMaterialized(),e.length!==this.dimensions.length&&s(`indices dimensions mismatch, expecting ${this.dimensions.length}, received ${e.length}`);for(let t=0;t=e){t=r;break}return t?(this.buffers.delete(t),t):{buffer:this.device.createBuffer({size:e,usage:this.usage}),size:e}}returnBuffer(e){this.buffers.add(e)}}Q.pools=new Map;class X{constructor(){this.adapter=null,this.device=null,this.kernels=[],this.materializedTrees=[],this.textures=[],this.globalTmpsBuffer=null,this.randStatesBuffer=null,this.pipelineCache=null}async init(){await this.createDevice(),this.createGlobalTmpsBuffer(),this.createRandStatesBuffer()}async createDevice(){let e=()=>{alert("Webgpu not supported. Please ensure that you have Chrome v113+")};navigator.gpu||e();const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"});t||e();const r=[];t.features.has("indirect-first-instance")&&r.push("indirect-first-instance");const n=await t.requestDevice({requiredFeatures:r});n||e(),this.device=n,this.adapter=t,this.pipelineCache=new H(n)}createKernel(e){let t=new R;for(let r of e.tasksParams)if(r instanceof N){let e=new O(r,this);t.tasks.push(e)}else if(r instanceof P){c(null!==e.renderPassParams);let n=new M(r,e.renderPassParams,this);t.tasks.push(n)}return null!==e.renderPassParams&&(t.renderPassInfo=new L(e.renderPassParams)),t.argTypes=e.argTypes,t.returnType=e.returnType,t}async sync(){await this.device.queue.onSubmittedWorkDone()}async launchKernel(e,...r){c(r.length===e.argTypes.length,`Kernel requires ${e.argTypes.length} arguments, but ${r.length} is provided`);let n,a,o,s=!1,l=!1,u=0,d=0;for(let t of e.tasks)for(let e of t.params.bindings)e.info.resourceType===i.Args&&(s=!0),e.info.resourceType===i.Rets&&(l=!0);if(s){let t=0;for(let r of e.argTypes)t+=r.getPrimitivesList().length;let i=new Int32Array(t),a=0;for(let t=0;t{m&&m.end(),m=null,y=new ee},b=()=>{g&&g.end(),g=null,h=new ee},x=new Map;for(let t of e.tasks)if(t instanceof M&&t.params.indirectBuffer&&(1!==t.params.indirectCount||!this.supportsIndirectFirstInstance())){let e=new Z(t.params.indirectBuffer,t.params.indirectCount);await e.fillInfo(),x.set(t,e)}for(let t of e.tasks)if(t.bindGroup=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:this.getGPUBindGroupEntries(t.params.bindings,n,null==a?void 0:a.buffer)}),t instanceof O){b(),m||(m=f.beginComputePass(),y=new ee),y.computePipeline!==t.pipeline&&(m.setPipeline(t.pipeline),y.computePipeline=t.pipeline),m.setBindGroup(0,t.bindGroup),t.params.workgroupSize;let e=t.params.numWorkgroups;m.dispatchWorkgroups(e)}else if(t instanceof M){if(v(),g||(c(null!==e.renderPassInfo,"render pass info is null"),g=f.beginRenderPass(e.renderPassInfo.getGPURenderPassDescriptor()),h=new ee),h.renderPipeline!==t.pipeline&&(g.setPipeline(t.pipeline),h.renderPipeline=t.pipeline),g.setBindGroup(0,t.bindGroup),t.params.vertexBuffer){let e=this.materializedTrees[t.params.vertexBuffer.snodeTree.treeId];g.setVertexBuffer(0,e.rootBuffer,t.params.vertexBuffer.offsetBytes,t.params.vertexBuffer.sizeBytes)}if(t.params.indexBuffer){let e=this.materializedTrees[t.params.indexBuffer.snodeTree.treeId];g.setIndexBuffer(e.rootBuffer,"uint32",t.params.indexBuffer.offsetBytes,t.params.indexBuffer.sizeBytes)}if(t.params.indirectBuffer)if(1===t.params.indirectCount&&this.supportsIndirectFirstInstance()&&t.params.indirectBuffer instanceof W){let e=this.materializedTrees[t.params.indirectBuffer.snodeTree.treeId];g.drawIndexedIndirect(e.rootBuffer,t.params.indirectBuffer.offsetBytes)}else{c(x.has(t));let e=x.get(t);for(let t of e.commands)g.drawIndexed(t.indexCount,t.instanceCount,t.firstIndex,t.baseVertex,t.firstInstance)}else t.params.indexBuffer?g.drawIndexed(t.getVertexCount()):g.draw(t.getVertexCount())}if(v(),b(),this.device.queue.submit([f.finish()]),await this.sync(),n&&this.recycleArgsBuffer(n,u),e.returnType.getCategory()!==t.Void){c(null!==a&&null!==o,"missing rets buffer!");let t=this.device.createCommandEncoder();t.copyBufferToBuffer(a.buffer,0,o.buffer,0,d),this.device.queue.submit([t.finish()]),await this.device.queue.onSubmittedWorkDone(),await o.buffer.mapAsync(GPUMapMode.READ,0,d);let r=function(e,t){let r=new Float32Array(e.buffer);return U(Array.from(e),Array.from(r),t)}(new Int32Array(o.buffer.getMappedRange(0,d)),e.returnType);return o.buffer.unmap(),_.returnBuffer(a),p.returnBuffer(o),r}}addArgsBuffer(e){return this.device.createBuffer({size:e,usage:GPUBufferUsage.STORAGE,mappedAtCreation:!0})}recycleArgsBuffer(e,t){e.destroy()}createGlobalTmpsBuffer(){this.globalTmpsBuffer=this.device.createBuffer({size:65536,usage:GPUBufferUsage.STORAGE})}createRandStatesBuffer(){this.randStatesBuffer=this.device.createBuffer({size:1048576,usage:GPUBufferUsage.STORAGE})}getGPUBindGroupEntries(e,t,r){let n=[];for(let a of e){let e,o,l;switch(a.info.resourceType){case i.Root:case i.RootAtomic:e=this.materializedTrees[a.info.resourceID].rootBuffer;break;case i.GlobalTmps:case i.GlobalTmpsAtomic:e=this.globalTmpsBuffer;break;case i.Args:c(null!==t),e=t;break;case i.Rets:c(null!==r),e=r;break;case i.RandStates:e=this.randStatesBuffer;break;case i.StorageTexture:case i.Texture:o=this.textures[a.info.resourceID].getGPUTextureView();break;case i.Sampler:l=this.textures[a.info.resourceID].getGPUSampler()}e?n.push({binding:a.binding,resource:{buffer:e}}):o?n.push({binding:a.binding,resource:o}):l?n.push({binding:a.binding,resource:l}):s("couldn't identify resource")}return n}materializeTree(e){let t=e.size,r=this.device.createBuffer({size:t,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC|GPUBufferUsage.INDIRECT});e.rootBuffer=r,this.materializedTrees.push(e)}addTexture(e){this.textures.push(e)}createGPUTexture(e,t,n,i,a,o){return this.device.createTexture((()=>{let l=GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING;if(a&&(l|=GPUTextureUsage.STORAGE_BINDING),1===e.length)return s("1d texture not supported yet"),{size:{width:e[0]},dimension:"1d",format:n,usage:l};if(2===e.length){c(t===r.Dim2d||t===r.DimCube),i&&(l|=GPUTextureUsage.RENDER_ATTACHMENT);let a={width:e[0],height:e[1]};return t===r.DimCube&&(a.depthOrArrayLayers=6),{size:a,dimension:"2d",format:n,usage:l,sampleCount:o}}return{size:{width:e[0],height:e[1],depthOrArrayLayers:e[2]},dimension:"3d",format:n,usage:l}})())}createGPUSampler(e,t){let r={addressModeU:t.wrapModeU||"repeat",addressModeV:t.wrapModeV||"repeat",addressModeW:t.wrapModeW||"repeat",minFilter:"linear",magFilter:"linear",mipmapFilter:"linear",maxAnisotropy:16};return e&&(r.compare="less-equal"),this.device.createSampler(r)}createGPUCanvasContext(e){let t=e.getContext("webgpu");null===t&&s("canvas webgpu context is null");let r=navigator.gpu.getPreferredCanvasFormat();return t.configure({device:this.device,format:r,alphaMode:"opaque"}),[t,r]}async deviceToHost(e,t=0,r=0){0===r&&(r=e.sizeBytes);let n=Q.getPool(this.device,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);const i=n.getBuffer(r);let a=this.device.createCommandEncoder();a.copyBufferToBuffer(this.materializedTrees[e.snodeTree.treeId].rootBuffer,e.offsetBytes+t,i.buffer,0,r),this.device.queue.submit([a.finish()]),await this.sync(),await i.buffer.mapAsync(GPUMapMode.READ,0,r);let o=i.buffer.getMappedRange(0,r),s=Array.from(new Int32Array(o)),c=Array.from(new Float32Array(o));return i.buffer.unmap(),n.returnBuffer(i),new $(s,c)}async hostToDevice(e,t,r=0){const n=this.device.createBuffer({size:t.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0});new Int32Array(n.getMappedRange()).set(t),n.unmap();let i=this.device.createCommandEncoder();i.copyBufferToBuffer(n,0,this.materializedTrees[e.snodeTree.treeId].rootBuffer,e.offsetBytes+r,t.byteLength),this.device.queue.submit([i.finish()]),await this.device.queue.onSubmittedWorkDone(),n.destroy()}getRootBuffer(e){return this.materializedTrees[e].rootBuffer}async copyImageBitmapToTexture(e,t){let r={source:e},n={texture:t},i={width:e.width,height:e.height};this.device.queue.copyExternalImageToTexture(r,n,i),await this.device.queue.onSubmittedWorkDone()}async copyImageBitmapsToCubeTexture(e,t){for(let r=0;r<6;++r){let n=e[r],i={source:n},a={texture:t,origin:[0,0,r]},o={width:n.width,height:n.height};this.device.queue.copyExternalImageToTexture(i,a,o)}await this.device.queue.onSubmittedWorkDone()}async copyTextureToTexture(e,t,r){let n=this.device.createCommandEncoder();n.copyTextureToTexture({texture:e},{texture:t},r),this.device.queue.submit([n.finish()]),await this.device.queue.onSubmittedWorkDone()}getGPUShaderModule(e){return this.pipelineCache.getOrCreateShaderModule(e)}getGPUComputePipeline(e){return this.pipelineCache.getOrCreateComputePipeline(e)}getGPURenderPipeline(e){return this.pipelineCache.getOrCreateRenderPipeline(e)}supportsIndirectFirstInstance(){return this.adapter.features.has("indirect-first-instance")}}class ${constructor(e,t){this.intArray=e,this.floatArray=t}}class Y{constructor(e,t,r,n,i){this.indexCount=e,this.instanceCount=t,this.firstIndex=r,this.baseVertex=n,this.firstInstance=i}}class Z{constructor(e,t){this.indirectBuffer=e,this.indirectCount=t,this.commands=[]}async fillInfo(){this.indirectCount instanceof W&&(this.indirectCount=(await this.indirectCount.toInt32Array())[0]);let e=[];e=this.indirectBuffer instanceof W?await this.indirectBuffer.toInt32Array():await this.indirectBuffer,this.commands=[];for(let t=0;tFunction.apply(this.thisObj,[...Object.keys(e),"expr","return eval('expr = undefined;' + expr)"]).apply(this.thisObj,[...Object.values(e),t]);try{return t(this.obj,e)}catch(e){return}}clone(){let e={};for(let t in this.obj)e[t]=this.obj[t];let t=new re;return t.obj=e,t.thisObj=this.thisObj,t}}class ne{constructor(){this.options={printIR:!1,printWGSL:!1},this.runtime=null,this.partialTree=new te,this.partialTree.treeId=0,this.kernelScope=new re}async init(e){e&&void 0!==e.printIR&&(this.options.printIR=e.printIR),e&&void 0!==e.printWGSL&&(this.options.printWGSL=e.printWGSL),await this.materializeRuntime(),this.clearKernelScope()}static getCurrentProgram(){return ne.instance||(ne.instance=new ne),ne.instance}async materializeRuntime(){this.runtime||(this.runtime=new X,await this.runtime.init())}materializeCurrentTree(){if(0===this.partialTree.size)return;null==this.runtime&&this.materializeRuntime(),this.runtime.materializeTree(this.partialTree);let e=this.partialTree.treeId+1;this.partialTree=new te,this.partialTree.treeId=e}addTexture(e){let t=this.runtime.textures.length;e.textureId=t,this.runtime.addTexture(e)}addToKernelScope(e){for(let t in e)this.kernelScope.addStored(t,e[t])}clearKernelScope(){this.kernelScope=new re}}async function ie(e){await ne.getCurrentProgram().init(e)}var ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oe(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function se(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ce={exports:{}},le=Object.freeze({__proto__:null,default:{}}),ue=oe(le); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +!function(e){var t,r=ae&&ae.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0;for(var r=0,n=e;r>1);switch(i(r(e[c],c),t)){case-1:o=c+1;break;case 0:return c;case 1:s=c-1}}return~o}function g(e,t,r,n,i){if(e&&e.length>0){var a=e.length;if(a>0){var o=void 0===n||n<0?0:n,s=void 0===i||o+i>a-1?a-1:o+i,c=void 0;for(arguments.length<=2?(c=e[o],o++):c=r;o<=s;)c=t(c,e[o],o),o++;return c}}return r}e.getIterator=function(t){if(t){if(E(t))return p(t);if(t instanceof e.Map)return t.entries();if(t instanceof e.Set)return t.values();throw new Error("Iteration not supported.")}},e.emptyArray=[],e.emptyMap=new e.Map,e.emptySet=new e.Set,e.length=function(e){return e?e.length:0},e.forEach=function(e,t){if(e)for(var r=0;r=0;r--){var n=t(e[r],r);if(n)return n}},e.firstDefined=function(e,t){if(void 0!==e)for(var r=0;r=0;r--){var n=e[r];if(t(n,r))return n}},e.findIndex=function(e,t,r){for(var n=r||0;n=0;n--)if(t(e[n],n))return n;return-1},e.findMap=function(t,r){for(var n=0;n0&&e.Debug.assertGreaterThanOrEqual(n(r[o],r[o-1]),0);t:for(var s=a;as&&e.Debug.assertGreaterThanOrEqual(n(t[a],t[a-1]),0),n(r[o],t[a])){case-1:i.push(r[o]);continue e;case 0:continue e;case 1:continue t}}return i},e.sum=function(e,t){for(var r=0,n=0,i=e;nt?1:0}function R(e,t){return O(e,t)}e.toFileNameLowerCase=P,e.notImplemented=function(){throw new Error("Not implemented")},e.memoize=function(e){var t;return function(){return e&&(t=e(),e=void 0),t}},e.memoizeOne=function(t){var r=new e.Map;return function(e){var n="".concat(typeof e,":").concat(e),i=r.get(n);return void 0!==i||r.has(n)||(i=t(e),r.set(n,i)),i}},e.compose=function(e,t,r,n,i){if(i){for(var a=[],o=0;o0?1:0}function i(e){var t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant"}).compare;return function(e,r){return n(e,r,t)}}function a(e){return void 0!==e?o():function(e,r){return n(e,r,t)};function t(e,t){return e.localeCompare(t)}}function o(){return function(t,r){return n(t,r,e)};function e(e,r){return t(e.toUpperCase(),r.toUpperCase())||t(e,r)}function t(e,t){return et?1:0}}}();function U(e,t,r){for(var n=new Array(t.length+1),i=new Array(t.length+1),a=r+.01,o=0;o<=t.length;o++)n[o]=o;for(o=1;o<=e.length;o++){var s=e.charCodeAt(o-1),c=Math.ceil(o>r?o-r:1),l=Math.floor(t.length>r+o?r+o:t.length);i[0]=o;for(var u=o,d=1;dr)return;var f=n;n=i,i=f}var m=n[t.length];return m>r?void 0:m}function V(e,t){var r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function K(e,t){for(var r=t;r=r.length+n.length&&q(t,r)&&V(t,n)}function H(e,t,r,n){for(var i=0,a=e[n];i0;r--){var n=e.charCodeAt(r);if(n>=48&&n<=57)do{--r,n=e.charCodeAt(r)}while(r>0&&n>=48&&n<=57);else{if(!(r>4)||110!==n&&78!==n)break;if(--r,105!==(n=e.charCodeAt(r))&&73!==n)break;if(--r,109!==(n=e.charCodeAt(r))&&77!==n)break;--r,n=e.charCodeAt(r)}if(45!==n&&46!==n)break;t=r}return t===e.length?e:e.slice(0,t)},e.orderedRemoveItem=function(e,t){for(var r=0;ri&&(i=c.prefix.length,n=s)}return n},e.startsWith=q,e.removePrefix=function(e,t){return q(e,t)?e.substr(t.length):e},e.tryRemovePrefix=function(e,t,r){return void 0===r&&(r=A),q(r(e),r(t))?e.substring(t.length):void 0},e.and=function(e,t){return function(r){return e(r)&&t(r)}},e.or=function(){for(var e=[],t=0;t=0&&e.isWhiteSpaceLike(t.charCodeAt(r));)r--;return t.slice(0,r+1)},e.trimStringStart=String.prototype.trimStart?function(e){return e.trimStart()}:function(e){return e.replace(/^\s+/g,"")}}(c||(c={})),function(e){var t;!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose"}(t=e.LogLevel||(e.LogLevel={})),function(r){var n,i,a=0;function o(){return null!=n?n:n=new e.Version(e.version)}function s(e){return r.currentLogLevel<=e}function c(e,t){r.loggingHost&&s(e)&&r.loggingHost.log(e,t)}function l(e){c(t.Info,e)}r.currentLogLevel=t.Warning,r.isDebugging=!1,r.getTypeScriptVersion=o,r.shouldLog=s,r.log=l,i=l=r.log||(r.log={}),i.error=function(e){c(t.Error,e)},i.warn=function(e){c(t.Warning,e)},i.log=function(e){c(t.Info,e)},i.trace=function(e){c(t.Verbose,e)};var u={};function d(e){return a>=e}function _(t,n){return!!d(t)||(u[n]={level:t,assertion:r[n]},r[n]=e.noop,!1)}function p(e,t){var r=new Error(e?"Debug Failure. ".concat(e):"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(r,t||p),r}function f(e,t,r,n){e||(t=t?"False expression: ".concat(t):"False expression.",r&&(t+="\r\nVerbose Debug Information: "+("string"==typeof r?r:r())),p(t,n||f))}function m(e,t,r){null==e&&p(t,r||m)}function g(e,t,r){for(var n=0,i=e;n0&&0===i[0][0]?i[0][1]:"0";if(n){for(var a="",o=t,s=0,c=i;st)break;0!==u&&u&t&&(a="".concat(a).concat(a?"|":"").concat(d),o&=~u)}if(0===o)return a}else for(var _=0,p=i;_n)for(var i=0,o=e.getOwnKeys(u);i=c.level&&(r[s]=c,u[s]=void 0)}},r.shouldAssert=d,r.fail=p,r.failBadSyntaxKind=function e(t,r,n){return p("".concat(r||"Unexpected node.","\r\nNode ").concat(v(t.kind)," was unexpected."),n||e)},r.assert=f,r.assertEqual=function e(t,r,n,i,a){if(t!==r){var o=n?i?"".concat(n," ").concat(i):n:"";p("Expected ".concat(t," === ").concat(r,". ").concat(o),a||e)}},r.assertLessThan=function e(t,r,n,i){t>=r&&p("Expected ".concat(t," < ").concat(r,". ").concat(n||""),i||e)},r.assertLessThanOrEqual=function e(t,r,n){t>r&&p("Expected ".concat(t," <= ").concat(r),n||e)},r.assertGreaterThanOrEqual=function e(t,r,n){t= ").concat(r),n||e)},r.assertIsDefined=m,r.checkDefined=function e(t,r,n){return m(t,r,n||e),t},r.assertEachIsDefined=g,r.checkEachDefined=function e(t,r,n){return g(t,r,n||e),t},r.assertNever=function t(r,n,i){void 0===n&&(n="Illegal value:");var a="object"==typeof r&&e.hasProperty(r,"kind")&&e.hasProperty(r,"pos")?"SyntaxKind: "+v(r.kind):JSON.stringify(r);return p("".concat(n," ").concat(a),i||t)},r.assertEachNode=function t(r,n,i,a){_(1,"assertEachNode")&&f(void 0===n||e.every(r,n),i||"Unexpected node.",(function(){return"Node array did not pass test '".concat(y(n),"'.")}),a||t)},r.assertNode=function e(t,r,n,i){_(1,"assertNode")&&f(void 0!==t&&(void 0===r||r(t)),n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," did not pass test '").concat(y(r),"'.")}),i||e)},r.assertNotNode=function e(t,r,n,i){_(1,"assertNotNode")&&f(void 0===t||void 0===r||!r(t),n||"Unexpected node.",(function(){return"Node ".concat(v(t.kind)," should not have passed test '").concat(y(r),"'.")}),i||e)},r.assertOptionalNode=function e(t,r,n,i){_(1,"assertOptionalNode")&&f(void 0===r||void 0===t||r(t),n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," did not pass test '").concat(y(r),"'.")}),i||e)},r.assertOptionalToken=function e(t,r,n,i){_(1,"assertOptionalToken")&&f(void 0===r||void 0===t||t.kind===r,n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," was not a '").concat(v(r),"' token.")}),i||e)},r.assertMissingNode=function e(t,r,n){_(1,"assertMissingNode")&&f(void 0===t,r||"Unexpected node.",(function(){return"Node ".concat(v(t.kind)," was unexpected'.")}),n||e)},r.type=function(e){},r.getFunctionName=y,r.formatSymbol=function(t){return"{ name: ".concat(e.unescapeLeadingUnderscores(t.escapedName),"; flags: ").concat(C(t.flags),"; declarations: ").concat(e.map(t.declarations,(function(e){return v(e.kind)}))," }")},r.formatEnum=h,r.formatSyntaxKind=v,r.formatSnippetKind=function(t){return h(t,e.SnippetKind,!1)},r.formatNodeFlags=b,r.formatModifierFlags=x,r.formatTransformFlags=S,r.formatEmitFlags=D,r.formatSymbolFlags=C,r.formatTypeFlags=T,r.formatSignatureFlags=E,r.formatObjectFlags=k,r.formatFlowFlags=A;var N,w,F,P=!1;function I(e){return function(){if(L(),!N)throw new Error("Debugging helpers could not be loaded.");return N}().formatControlFlowGraph(e)}function O(t){"__debugFlowFlags"in t||Object.defineProperties(t,{__tsDebuggerDisplay:{value:function(){var e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return"".concat(e).concat(t?" (".concat(A(t),")"):"")}},__debugFlowFlags:{get:function(){return h(this.flags,e.FlowFlags,!0)}},__debugToString:{value:function(){return I(this)}}})}function M(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:function(e){return e=String(e).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),"NodeArray ".concat(e)}}})}function L(){if(!P){var t,r;Object.defineProperties(e.objectAllocator.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=33554432&this.flags?"TransientSymbol":"Symbol",r=-33554433&this.flags;return"".concat(t," '").concat(e.symbolName(this),"'").concat(r?" (".concat(C(r),")"):"")}},__debugFlags:{get:function(){return C(this.flags)}}}),Object.defineProperties(e.objectAllocator.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=98304&this.flags?"NullableType":384&this.flags?"LiteralType ".concat(JSON.stringify(this.value)):2048&this.flags?"LiteralType ".concat(this.value.negative?"-":"").concat(this.value.base10Value,"n"):8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":67359327&this.flags?"IntrinsicType ".concat(this.intrinsicName):1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",r=524288&this.flags?-1344&this.objectFlags:0;return"".concat(t).concat(this.symbol?" '".concat(e.symbolName(this.symbol),"'"):"").concat(r?" (".concat(k(r),")"):"")}},__debugFlags:{get:function(){return T(this.flags)}},__debugObjectFlags:{get:function(){return 524288&this.flags?k(this.objectFlags):""}},__debugTypeToString:{value:function(){var e=(void 0===t&&"function"==typeof WeakMap&&(t=new WeakMap),t),r=null==e?void 0:e.get(this);return void 0===r&&(r=this.checker.typeToString(this),null==e||e.set(this,r)),r}}}),Object.defineProperties(e.objectAllocator.getSignatureConstructor().prototype,{__debugFlags:{get:function(){return E(this.flags)}},__debugSignatureToString:{value:function(){var e;return null===(e=this.checker)||void 0===e?void 0:e.signatureToString(this)}}});for(var n=0,i=[e.objectAllocator.getNodeConstructor(),e.objectAllocator.getIdentifierConstructor(),e.objectAllocator.getTokenConstructor(),e.objectAllocator.getSourceFileConstructor()];n=0;return d?function(e,t,r,n){var i=R(e,!0,t,r,n);return function(){throw new TypeError(i)}}(t,s,u,r.message):_?function(e,t,r,n){var i=!1;return function(){i||(l.warn(R(e,!1,t,r,n)),i=!0)}}(t,s,u,r.message):e.noop}r.printControlFlowGraph=function(e){return console.log(I(e))},r.formatControlFlowGraph=I,r.attachFlowNodeDebugInfo=function(e){P&&("function"==typeof Object.setPrototypeOf?(w||O(w=Object.create(Object.prototype)),Object.setPrototypeOf(e,w)):O(e))},r.attachNodeArrayDebugInfo=function(e){P&&("function"==typeof Object.setPrototypeOf?(F||M(F=Object.create(Array.prototype)),Object.setPrototypeOf(e,F)):M(e))},r.enableDebugInfo=L,r.deprecate=function(e,t){return function(e,t){return function(){return e(),t.apply(this,arguments)}}(B(y(e),t),e)}}(e.Debug||(e.Debug={}))}(c||(c={})),function(e){var t=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,r=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,n=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,i=/^(0|[1-9]\d*)$/,a=function(){function t(t,i,a,s,c){if(void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=""),void 0===c&&(c=""),"string"==typeof t){var l=e.Debug.checkDefined(o(t),"Invalid version");t=l.major,i=l.minor,a=l.patch,s=l.prerelease,c=l.build}e.Debug.assert(t>=0,"Invalid argument: major"),e.Debug.assert(i>=0,"Invalid argument: minor"),e.Debug.assert(a>=0,"Invalid argument: patch"),e.Debug.assert(!s||r.test(s),"Invalid argument: prerelease"),e.Debug.assert(!c||n.test(c),"Invalid argument: build"),this.major=t,this.minor=i,this.patch=a,this.prerelease=s?s.split("."):e.emptyArray,this.build=c?c.split("."):e.emptyArray}return t.tryParse=function(e){var r=o(e);if(r)return new t(r.major,r.minor,r.patch,r.prerelease,r.build)},t.prototype.compareTo=function(t){return this===t?0:void 0===t?1:e.compareValues(this.major,t.major)||e.compareValues(this.minor,t.minor)||e.compareValues(this.patch,t.patch)||function(t,r){if(t===r)return 0;if(0===t.length)return 0===r.length?0:1;if(0===r.length)return-1;for(var n=Math.min(t.length,r.length),a=0;a|>=|=)?\s*([a-z0-9-+.*]+)$/i;function p(t){for(var r=[],n=0,i=e.trimString(t).split(c);n=",n.version)),y(i.major)||r.push(y(i.minor)?h("<",i.version.increment("major")):y(i.patch)?h("<",i.version.increment("minor")):h("<=",i.version)),!0)}function g(e,t,r){var n=f(t);if(!n)return!1;var i=n.version,o=n.major,s=n.minor,c=n.patch;if(y(o))"<"!==e&&">"!==e||r.push(h("<",a.zero));else switch(e){case"~":r.push(h(">=",i)),r.push(h("<",i.increment(y(s)?"major":"minor")));break;case"^":r.push(h(">=",i)),r.push(h("<",i.increment(i.major>0||y(s)?"major":i.minor>0||y(c)?"minor":"patch")));break;case"<":case">=":r.push(h(e,i));break;case"<=":case">":r.push(y(s)?h("<="===e?"<":">=",i.increment("major")):y(c)?h("<="===e?"<":">=",i.increment("minor")):h(e,i));break;case"=":case void 0:y(s)||y(c)?(r.push(h(">=",i)),r.push(h("<",i.increment(y(s)?"major":"minor")))):r.push(h("=",i));break;default:return!1}return!0}function y(e){return"*"===e||"x"===e||"X"===e}function h(e,t){return{operator:e,operand:t}}function v(e,t){for(var r=0,n=t;r":return i>0;case">=":return i>=0;case"=":return 0===i;default:return e.Debug.assertNever(r)}}function x(t){return e.map(t,S).join(" ")}function S(e){return"".concat(e.operator).concat(e.operand)}}(c||(c={})),function(e){function t(e,t){return"object"==typeof e&&"number"==typeof e.timeOrigin&&"function"==typeof e.mark&&"function"==typeof e.measure&&"function"==typeof e.now&&"function"==typeof t}var r=function(){if("object"==typeof performance&&"function"==typeof PerformanceObserver&&t(performance,PerformanceObserver))return{shouldWriteNativeEvents:!0,performance:performance,PerformanceObserver:PerformanceObserver}}()||function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)try{var r,n=require("perf_hooks"),i=n.performance,a=n.PerformanceObserver;if(t(i,a)){r=i;var o=new e.Version(process.versions.node);return new e.VersionRange("<12.16.3 || 13 <13.13").test(o)&&(r={get timeOrigin(){return i.timeOrigin},now:function(){return i.now()},mark:function(e){return i.mark(e)},measure:function(e,t,r){void 0===t&&(t="nodeStart"),void 0===r&&(r="__performance.measure-fix__",i.mark(r)),i.measure(e,t,r),"__performance.measure-fix__"===r&&i.clearMarks("__performance.measure-fix__")}}),{shouldWriteNativeEvents:!1,performance:r,PerformanceObserver:a}}}catch(e){}}(),n=null==r?void 0:r.performance;e.tryGetNativePerformanceHooks=function(){return r},e.timestamp=n?function(){return n.now()}:Date.now?Date.now:function(){return+new Date}}(c||(c={})),function(e){!function(t){var r,n;function i(t,r,n){var i=0;return{enter:function(){1==++i&&u(r)},exit:function(){0==--i?(u(n),d(t,r,n)):i<0&&e.Debug.fail("enter/exit count does not match.")}}}t.createTimerIf=function(e,r,n,a){return e?i(r,n,a):t.nullTimer},t.createTimer=i,t.nullTimer={enter:e.noop,exit:e.noop};var a=!1,o=e.timestamp(),s=new e.Map,c=new e.Map,l=new e.Map;function u(t){var r;if(a){var i=null!==(r=c.get(t))&&void 0!==r?r:0;c.set(t,i+1),s.set(t,e.timestamp()),null==n||n.mark(t)}}function d(t,r,i){var c,u;if(a){var d=null!==(c=void 0!==i?s.get(i):void 0)&&void 0!==c?c:e.timestamp(),_=null!==(u=void 0!==r?s.get(r):void 0)&&void 0!==u?u:o,p=l.get(t)||0;l.set(t,p+(d-_)),null==n||n.measure(t,r,i)}}t.mark=u,t.measure=d,t.getCount=function(e){return c.get(e)||0},t.getDuration=function(e){return l.get(e)||0},t.forEachMeasure=function(e){l.forEach((function(t,r){return e(r,t)}))},t.isEnabled=function(){return a},t.enable=function(t){var i;return void 0===t&&(t=e.sys),a||(a=!0,r||(r=e.tryGetNativePerformanceHooks()),r&&(o=r.performance.timeOrigin,(r.shouldWriteNativeEvents||(null===(i=null==t?void 0:t.cpuProfilingEnabled)||void 0===i?void 0:i.call(t))||(null==t?void 0:t.debugMode))&&(n=r.performance))),!0},t.disable=function(){a&&(s.clear(),c.clear(),l.clear(),n=void 0,a=!1)}}(e.performance||(e.performance={}))}(c||(c={})),function(e){var t,r,n={logEvent:e.noop,logErrEvent:e.noop,logPerfEvent:e.noop,logInfoEvent:e.noop,logStartCommand:e.noop,logStopCommand:e.noop,logStartUpdateProgram:e.noop,logStopUpdateProgram:e.noop,logStartUpdateGraph:e.noop,logStopUpdateGraph:e.noop,logStartResolveModule:e.noop,logStopResolveModule:e.noop,logStartParseSourceFile:e.noop,logStopParseSourceFile:e.noop,logStartReadFile:e.noop,logStopReadFile:e.noop,logStartBindFile:e.noop,logStopBindFile:e.noop,logStartScheduledOperation:e.noop,logStopScheduledOperation:e.noop};try{r=se(null!==(t=process.env.TS_ETW_MODULE_PATH)&&void 0!==t?t:"./node_modules/@microsoft/typescript-etw")}catch(e){r=void 0}e.perfLogger=r&&r.logEvent?r:n}(c||(c={})),function(e){var t;!function(t){var r,i,a,o,s=0,c=0,l=[],u=[];t.startTracing=function(o,d,_){if(e.Debug.assert(!e.tracing,"Tracing already started"),void 0===r)try{r=require("fs")}catch(e){throw new Error("tracing requires having fs\n(original error: ".concat(e.message||e,")"))}i=o,l.length=0,void 0===a&&(a=e.combinePaths(d,"legend.json")),r.existsSync(d)||r.mkdirSync(d,{recursive:!0});var p="build"===i?".".concat(process.pid,"-").concat(++s):"server"===i?".".concat(process.pid):"",f=e.combinePaths(d,"trace".concat(p,".json")),m=e.combinePaths(d,"types".concat(p,".json"));u.push({configFilePath:_,tracePath:f,typesPath:m}),c=r.openSync(f,"w"),e.tracing=t;var g={cat:"__metadata",ph:"M",ts:1e3*e.timestamp(),pid:1,tid:1};r.writeSync(c,"[\n"+[n({name:"process_name",args:{name:"tsc"}},g),n({name:"thread_name",args:{name:"Main"}},g),n(n({name:"TracingStartedInBrowser"},g),{cat:"disabled-by-default-devtools.timeline"})].map((function(e){return JSON.stringify(e)})).join(",\n"))},t.stopTracing=function(){e.Debug.assert(e.tracing,"Tracing is not in progress"),e.Debug.assert(!!l.length==("server"!==i)),r.writeSync(c,"\n]\n"),r.closeSync(c),e.tracing=void 0,l.length?function(t){var i,a,o,s,c,l,d,_,p,m,g,y,h,v,b,x,S,D,C,T,E,k;e.performance.mark("beginDumpTypes");var A=u[u.length-1].typesPath,N=r.openSync(A,"w"),w=new e.Map;r.writeSync(N,"[");for(var F=t.length,P=0;P0),_(d.length-1,1e3*e.timestamp()),d.length--},t.popAll=function(){for(var t=1e3*e.timestamp(),r=d.length-1;r>=0;r--)_(r,t);d.length=0};function _(e,t){var r=d[e],n=r.phase,i=r.name,a=r.args,o=r.time;r.separateBeginAndEnd?p("E",n,i,a,void 0,t):1e4-o%1e4<=t-o&&p("X",n,i,a,'"dur":'.concat(t-o),o)}function p(t,n,a,o,s,l){void 0===l&&(l=1e3*e.timestamp()),"server"===i&&"checkTypes"===n||(e.performance.mark("beginTracing"),r.writeSync(c,',\n{"pid":1,"tid":1,"ph":"'.concat(t,'","cat":"').concat(n,'","ts":').concat(l,',"name":"').concat(a,'"')),s&&r.writeSync(c,",".concat(s)),o&&r.writeSync(c,',"args":'.concat(JSON.stringify(o))),r.writeSync(c,"}"),e.performance.mark("endTracing"),e.performance.measure("Tracing","beginTracing","endTracing"))}function f(t){var r=e.getSourceFileOfNode(t);return r?{path:r.path,start:n(e.getLineAndCharacterOfPosition(r,t.pos)),end:n(e.getLineAndCharacterOfPosition(r,t.end))}:void 0;function n(e){return{line:e.line+1,character:e.character+1}}}t.dumpLegend=function(){a&&r.writeFileSync(a,JSON.stringify(u))}}(t||(t={})),e.startTracing=t.startTracing,e.dumpTracingLegend=t.dumpLegend}(c||(c={})),function(e){var t,r,n,i,a,o,s,c,l;(t=e.SyntaxKind||(e.SyntaxKind={}))[t.Unknown=0]="Unknown",t[t.EndOfFileToken=1]="EndOfFileToken",t[t.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",t[t.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",t[t.NewLineTrivia=4]="NewLineTrivia",t[t.WhitespaceTrivia=5]="WhitespaceTrivia",t[t.ShebangTrivia=6]="ShebangTrivia",t[t.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",t[t.NumericLiteral=8]="NumericLiteral",t[t.BigIntLiteral=9]="BigIntLiteral",t[t.StringLiteral=10]="StringLiteral",t[t.JsxText=11]="JsxText",t[t.JsxTextAllWhiteSpaces=12]="JsxTextAllWhiteSpaces",t[t.RegularExpressionLiteral=13]="RegularExpressionLiteral",t[t.NoSubstitutionTemplateLiteral=14]="NoSubstitutionTemplateLiteral",t[t.TemplateHead=15]="TemplateHead",t[t.TemplateMiddle=16]="TemplateMiddle",t[t.TemplateTail=17]="TemplateTail",t[t.OpenBraceToken=18]="OpenBraceToken",t[t.CloseBraceToken=19]="CloseBraceToken",t[t.OpenParenToken=20]="OpenParenToken",t[t.CloseParenToken=21]="CloseParenToken",t[t.OpenBracketToken=22]="OpenBracketToken",t[t.CloseBracketToken=23]="CloseBracketToken",t[t.DotToken=24]="DotToken",t[t.DotDotDotToken=25]="DotDotDotToken",t[t.SemicolonToken=26]="SemicolonToken",t[t.CommaToken=27]="CommaToken",t[t.QuestionDotToken=28]="QuestionDotToken",t[t.LessThanToken=29]="LessThanToken",t[t.LessThanSlashToken=30]="LessThanSlashToken",t[t.GreaterThanToken=31]="GreaterThanToken",t[t.LessThanEqualsToken=32]="LessThanEqualsToken",t[t.GreaterThanEqualsToken=33]="GreaterThanEqualsToken",t[t.EqualsEqualsToken=34]="EqualsEqualsToken",t[t.ExclamationEqualsToken=35]="ExclamationEqualsToken",t[t.EqualsEqualsEqualsToken=36]="EqualsEqualsEqualsToken",t[t.ExclamationEqualsEqualsToken=37]="ExclamationEqualsEqualsToken",t[t.EqualsGreaterThanToken=38]="EqualsGreaterThanToken",t[t.PlusToken=39]="PlusToken",t[t.MinusToken=40]="MinusToken",t[t.AsteriskToken=41]="AsteriskToken",t[t.AsteriskAsteriskToken=42]="AsteriskAsteriskToken",t[t.SlashToken=43]="SlashToken",t[t.PercentToken=44]="PercentToken",t[t.PlusPlusToken=45]="PlusPlusToken",t[t.MinusMinusToken=46]="MinusMinusToken",t[t.LessThanLessThanToken=47]="LessThanLessThanToken",t[t.GreaterThanGreaterThanToken=48]="GreaterThanGreaterThanToken",t[t.GreaterThanGreaterThanGreaterThanToken=49]="GreaterThanGreaterThanGreaterThanToken",t[t.AmpersandToken=50]="AmpersandToken",t[t.BarToken=51]="BarToken",t[t.CaretToken=52]="CaretToken",t[t.ExclamationToken=53]="ExclamationToken",t[t.TildeToken=54]="TildeToken",t[t.AmpersandAmpersandToken=55]="AmpersandAmpersandToken",t[t.BarBarToken=56]="BarBarToken",t[t.QuestionToken=57]="QuestionToken",t[t.ColonToken=58]="ColonToken",t[t.AtToken=59]="AtToken",t[t.QuestionQuestionToken=60]="QuestionQuestionToken",t[t.BacktickToken=61]="BacktickToken",t[t.HashToken=62]="HashToken",t[t.EqualsToken=63]="EqualsToken",t[t.PlusEqualsToken=64]="PlusEqualsToken",t[t.MinusEqualsToken=65]="MinusEqualsToken",t[t.AsteriskEqualsToken=66]="AsteriskEqualsToken",t[t.AsteriskAsteriskEqualsToken=67]="AsteriskAsteriskEqualsToken",t[t.SlashEqualsToken=68]="SlashEqualsToken",t[t.PercentEqualsToken=69]="PercentEqualsToken",t[t.LessThanLessThanEqualsToken=70]="LessThanLessThanEqualsToken",t[t.GreaterThanGreaterThanEqualsToken=71]="GreaterThanGreaterThanEqualsToken",t[t.GreaterThanGreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanGreaterThanEqualsToken",t[t.AmpersandEqualsToken=73]="AmpersandEqualsToken",t[t.BarEqualsToken=74]="BarEqualsToken",t[t.BarBarEqualsToken=75]="BarBarEqualsToken",t[t.AmpersandAmpersandEqualsToken=76]="AmpersandAmpersandEqualsToken",t[t.QuestionQuestionEqualsToken=77]="QuestionQuestionEqualsToken",t[t.CaretEqualsToken=78]="CaretEqualsToken",t[t.Identifier=79]="Identifier",t[t.PrivateIdentifier=80]="PrivateIdentifier",t[t.BreakKeyword=81]="BreakKeyword",t[t.CaseKeyword=82]="CaseKeyword",t[t.CatchKeyword=83]="CatchKeyword",t[t.ClassKeyword=84]="ClassKeyword",t[t.ConstKeyword=85]="ConstKeyword",t[t.ContinueKeyword=86]="ContinueKeyword",t[t.DebuggerKeyword=87]="DebuggerKeyword",t[t.DefaultKeyword=88]="DefaultKeyword",t[t.DeleteKeyword=89]="DeleteKeyword",t[t.DoKeyword=90]="DoKeyword",t[t.ElseKeyword=91]="ElseKeyword",t[t.EnumKeyword=92]="EnumKeyword",t[t.ExportKeyword=93]="ExportKeyword",t[t.ExtendsKeyword=94]="ExtendsKeyword",t[t.FalseKeyword=95]="FalseKeyword",t[t.FinallyKeyword=96]="FinallyKeyword",t[t.ForKeyword=97]="ForKeyword",t[t.FunctionKeyword=98]="FunctionKeyword",t[t.IfKeyword=99]="IfKeyword",t[t.ImportKeyword=100]="ImportKeyword",t[t.InKeyword=101]="InKeyword",t[t.InstanceOfKeyword=102]="InstanceOfKeyword",t[t.NewKeyword=103]="NewKeyword",t[t.NullKeyword=104]="NullKeyword",t[t.ReturnKeyword=105]="ReturnKeyword",t[t.SuperKeyword=106]="SuperKeyword",t[t.SwitchKeyword=107]="SwitchKeyword",t[t.ThisKeyword=108]="ThisKeyword",t[t.ThrowKeyword=109]="ThrowKeyword",t[t.TrueKeyword=110]="TrueKeyword",t[t.TryKeyword=111]="TryKeyword",t[t.TypeOfKeyword=112]="TypeOfKeyword",t[t.VarKeyword=113]="VarKeyword",t[t.VoidKeyword=114]="VoidKeyword",t[t.WhileKeyword=115]="WhileKeyword",t[t.WithKeyword=116]="WithKeyword",t[t.ImplementsKeyword=117]="ImplementsKeyword",t[t.InterfaceKeyword=118]="InterfaceKeyword",t[t.LetKeyword=119]="LetKeyword",t[t.PackageKeyword=120]="PackageKeyword",t[t.PrivateKeyword=121]="PrivateKeyword",t[t.ProtectedKeyword=122]="ProtectedKeyword",t[t.PublicKeyword=123]="PublicKeyword",t[t.StaticKeyword=124]="StaticKeyword",t[t.YieldKeyword=125]="YieldKeyword",t[t.AbstractKeyword=126]="AbstractKeyword",t[t.AsKeyword=127]="AsKeyword",t[t.AssertsKeyword=128]="AssertsKeyword",t[t.AssertKeyword=129]="AssertKeyword",t[t.AnyKeyword=130]="AnyKeyword",t[t.AsyncKeyword=131]="AsyncKeyword",t[t.AwaitKeyword=132]="AwaitKeyword",t[t.BooleanKeyword=133]="BooleanKeyword",t[t.ConstructorKeyword=134]="ConstructorKeyword",t[t.DeclareKeyword=135]="DeclareKeyword",t[t.GetKeyword=136]="GetKeyword",t[t.InferKeyword=137]="InferKeyword",t[t.IntrinsicKeyword=138]="IntrinsicKeyword",t[t.IsKeyword=139]="IsKeyword",t[t.KeyOfKeyword=140]="KeyOfKeyword",t[t.ModuleKeyword=141]="ModuleKeyword",t[t.NamespaceKeyword=142]="NamespaceKeyword",t[t.NeverKeyword=143]="NeverKeyword",t[t.OutKeyword=144]="OutKeyword",t[t.ReadonlyKeyword=145]="ReadonlyKeyword",t[t.RequireKeyword=146]="RequireKeyword",t[t.NumberKeyword=147]="NumberKeyword",t[t.ObjectKeyword=148]="ObjectKeyword",t[t.SetKeyword=149]="SetKeyword",t[t.StringKeyword=150]="StringKeyword",t[t.SymbolKeyword=151]="SymbolKeyword",t[t.TypeKeyword=152]="TypeKeyword",t[t.UndefinedKeyword=153]="UndefinedKeyword",t[t.UniqueKeyword=154]="UniqueKeyword",t[t.UnknownKeyword=155]="UnknownKeyword",t[t.FromKeyword=156]="FromKeyword",t[t.GlobalKeyword=157]="GlobalKeyword",t[t.BigIntKeyword=158]="BigIntKeyword",t[t.OverrideKeyword=159]="OverrideKeyword",t[t.OfKeyword=160]="OfKeyword",t[t.QualifiedName=161]="QualifiedName",t[t.ComputedPropertyName=162]="ComputedPropertyName",t[t.TypeParameter=163]="TypeParameter",t[t.Parameter=164]="Parameter",t[t.Decorator=165]="Decorator",t[t.PropertySignature=166]="PropertySignature",t[t.PropertyDeclaration=167]="PropertyDeclaration",t[t.MethodSignature=168]="MethodSignature",t[t.MethodDeclaration=169]="MethodDeclaration",t[t.ClassStaticBlockDeclaration=170]="ClassStaticBlockDeclaration",t[t.Constructor=171]="Constructor",t[t.GetAccessor=172]="GetAccessor",t[t.SetAccessor=173]="SetAccessor",t[t.CallSignature=174]="CallSignature",t[t.ConstructSignature=175]="ConstructSignature",t[t.IndexSignature=176]="IndexSignature",t[t.TypePredicate=177]="TypePredicate",t[t.TypeReference=178]="TypeReference",t[t.FunctionType=179]="FunctionType",t[t.ConstructorType=180]="ConstructorType",t[t.TypeQuery=181]="TypeQuery",t[t.TypeLiteral=182]="TypeLiteral",t[t.ArrayType=183]="ArrayType",t[t.TupleType=184]="TupleType",t[t.OptionalType=185]="OptionalType",t[t.RestType=186]="RestType",t[t.UnionType=187]="UnionType",t[t.IntersectionType=188]="IntersectionType",t[t.ConditionalType=189]="ConditionalType",t[t.InferType=190]="InferType",t[t.ParenthesizedType=191]="ParenthesizedType",t[t.ThisType=192]="ThisType",t[t.TypeOperator=193]="TypeOperator",t[t.IndexedAccessType=194]="IndexedAccessType",t[t.MappedType=195]="MappedType",t[t.LiteralType=196]="LiteralType",t[t.NamedTupleMember=197]="NamedTupleMember",t[t.TemplateLiteralType=198]="TemplateLiteralType",t[t.TemplateLiteralTypeSpan=199]="TemplateLiteralTypeSpan",t[t.ImportType=200]="ImportType",t[t.ObjectBindingPattern=201]="ObjectBindingPattern",t[t.ArrayBindingPattern=202]="ArrayBindingPattern",t[t.BindingElement=203]="BindingElement",t[t.ArrayLiteralExpression=204]="ArrayLiteralExpression",t[t.ObjectLiteralExpression=205]="ObjectLiteralExpression",t[t.PropertyAccessExpression=206]="PropertyAccessExpression",t[t.ElementAccessExpression=207]="ElementAccessExpression",t[t.CallExpression=208]="CallExpression",t[t.NewExpression=209]="NewExpression",t[t.TaggedTemplateExpression=210]="TaggedTemplateExpression",t[t.TypeAssertionExpression=211]="TypeAssertionExpression",t[t.ParenthesizedExpression=212]="ParenthesizedExpression",t[t.FunctionExpression=213]="FunctionExpression",t[t.ArrowFunction=214]="ArrowFunction",t[t.DeleteExpression=215]="DeleteExpression",t[t.TypeOfExpression=216]="TypeOfExpression",t[t.VoidExpression=217]="VoidExpression",t[t.AwaitExpression=218]="AwaitExpression",t[t.PrefixUnaryExpression=219]="PrefixUnaryExpression",t[t.PostfixUnaryExpression=220]="PostfixUnaryExpression",t[t.BinaryExpression=221]="BinaryExpression",t[t.ConditionalExpression=222]="ConditionalExpression",t[t.TemplateExpression=223]="TemplateExpression",t[t.YieldExpression=224]="YieldExpression",t[t.SpreadElement=225]="SpreadElement",t[t.ClassExpression=226]="ClassExpression",t[t.OmittedExpression=227]="OmittedExpression",t[t.ExpressionWithTypeArguments=228]="ExpressionWithTypeArguments",t[t.AsExpression=229]="AsExpression",t[t.NonNullExpression=230]="NonNullExpression",t[t.MetaProperty=231]="MetaProperty",t[t.SyntheticExpression=232]="SyntheticExpression",t[t.TemplateSpan=233]="TemplateSpan",t[t.SemicolonClassElement=234]="SemicolonClassElement",t[t.Block=235]="Block",t[t.EmptyStatement=236]="EmptyStatement",t[t.VariableStatement=237]="VariableStatement",t[t.ExpressionStatement=238]="ExpressionStatement",t[t.IfStatement=239]="IfStatement",t[t.DoStatement=240]="DoStatement",t[t.WhileStatement=241]="WhileStatement",t[t.ForStatement=242]="ForStatement",t[t.ForInStatement=243]="ForInStatement",t[t.ForOfStatement=244]="ForOfStatement",t[t.ContinueStatement=245]="ContinueStatement",t[t.BreakStatement=246]="BreakStatement",t[t.ReturnStatement=247]="ReturnStatement",t[t.WithStatement=248]="WithStatement",t[t.SwitchStatement=249]="SwitchStatement",t[t.LabeledStatement=250]="LabeledStatement",t[t.ThrowStatement=251]="ThrowStatement",t[t.TryStatement=252]="TryStatement",t[t.DebuggerStatement=253]="DebuggerStatement",t[t.VariableDeclaration=254]="VariableDeclaration",t[t.VariableDeclarationList=255]="VariableDeclarationList",t[t.FunctionDeclaration=256]="FunctionDeclaration",t[t.ClassDeclaration=257]="ClassDeclaration",t[t.InterfaceDeclaration=258]="InterfaceDeclaration",t[t.TypeAliasDeclaration=259]="TypeAliasDeclaration",t[t.EnumDeclaration=260]="EnumDeclaration",t[t.ModuleDeclaration=261]="ModuleDeclaration",t[t.ModuleBlock=262]="ModuleBlock",t[t.CaseBlock=263]="CaseBlock",t[t.NamespaceExportDeclaration=264]="NamespaceExportDeclaration",t[t.ImportEqualsDeclaration=265]="ImportEqualsDeclaration",t[t.ImportDeclaration=266]="ImportDeclaration",t[t.ImportClause=267]="ImportClause",t[t.NamespaceImport=268]="NamespaceImport",t[t.NamedImports=269]="NamedImports",t[t.ImportSpecifier=270]="ImportSpecifier",t[t.ExportAssignment=271]="ExportAssignment",t[t.ExportDeclaration=272]="ExportDeclaration",t[t.NamedExports=273]="NamedExports",t[t.NamespaceExport=274]="NamespaceExport",t[t.ExportSpecifier=275]="ExportSpecifier",t[t.MissingDeclaration=276]="MissingDeclaration",t[t.ExternalModuleReference=277]="ExternalModuleReference",t[t.JsxElement=278]="JsxElement",t[t.JsxSelfClosingElement=279]="JsxSelfClosingElement",t[t.JsxOpeningElement=280]="JsxOpeningElement",t[t.JsxClosingElement=281]="JsxClosingElement",t[t.JsxFragment=282]="JsxFragment",t[t.JsxOpeningFragment=283]="JsxOpeningFragment",t[t.JsxClosingFragment=284]="JsxClosingFragment",t[t.JsxAttribute=285]="JsxAttribute",t[t.JsxAttributes=286]="JsxAttributes",t[t.JsxSpreadAttribute=287]="JsxSpreadAttribute",t[t.JsxExpression=288]="JsxExpression",t[t.CaseClause=289]="CaseClause",t[t.DefaultClause=290]="DefaultClause",t[t.HeritageClause=291]="HeritageClause",t[t.CatchClause=292]="CatchClause",t[t.AssertClause=293]="AssertClause",t[t.AssertEntry=294]="AssertEntry",t[t.ImportTypeAssertionContainer=295]="ImportTypeAssertionContainer",t[t.PropertyAssignment=296]="PropertyAssignment",t[t.ShorthandPropertyAssignment=297]="ShorthandPropertyAssignment",t[t.SpreadAssignment=298]="SpreadAssignment",t[t.EnumMember=299]="EnumMember",t[t.UnparsedPrologue=300]="UnparsedPrologue",t[t.UnparsedPrepend=301]="UnparsedPrepend",t[t.UnparsedText=302]="UnparsedText",t[t.UnparsedInternalText=303]="UnparsedInternalText",t[t.UnparsedSyntheticReference=304]="UnparsedSyntheticReference",t[t.SourceFile=305]="SourceFile",t[t.Bundle=306]="Bundle",t[t.UnparsedSource=307]="UnparsedSource",t[t.InputFiles=308]="InputFiles",t[t.JSDocTypeExpression=309]="JSDocTypeExpression",t[t.JSDocNameReference=310]="JSDocNameReference",t[t.JSDocMemberName=311]="JSDocMemberName",t[t.JSDocAllType=312]="JSDocAllType",t[t.JSDocUnknownType=313]="JSDocUnknownType",t[t.JSDocNullableType=314]="JSDocNullableType",t[t.JSDocNonNullableType=315]="JSDocNonNullableType",t[t.JSDocOptionalType=316]="JSDocOptionalType",t[t.JSDocFunctionType=317]="JSDocFunctionType",t[t.JSDocVariadicType=318]="JSDocVariadicType",t[t.JSDocNamepathType=319]="JSDocNamepathType",t[t.JSDocComment=320]="JSDocComment",t[t.JSDocText=321]="JSDocText",t[t.JSDocTypeLiteral=322]="JSDocTypeLiteral",t[t.JSDocSignature=323]="JSDocSignature",t[t.JSDocLink=324]="JSDocLink",t[t.JSDocLinkCode=325]="JSDocLinkCode",t[t.JSDocLinkPlain=326]="JSDocLinkPlain",t[t.JSDocTag=327]="JSDocTag",t[t.JSDocAugmentsTag=328]="JSDocAugmentsTag",t[t.JSDocImplementsTag=329]="JSDocImplementsTag",t[t.JSDocAuthorTag=330]="JSDocAuthorTag",t[t.JSDocDeprecatedTag=331]="JSDocDeprecatedTag",t[t.JSDocClassTag=332]="JSDocClassTag",t[t.JSDocPublicTag=333]="JSDocPublicTag",t[t.JSDocPrivateTag=334]="JSDocPrivateTag",t[t.JSDocProtectedTag=335]="JSDocProtectedTag",t[t.JSDocReadonlyTag=336]="JSDocReadonlyTag",t[t.JSDocOverrideTag=337]="JSDocOverrideTag",t[t.JSDocCallbackTag=338]="JSDocCallbackTag",t[t.JSDocEnumTag=339]="JSDocEnumTag",t[t.JSDocParameterTag=340]="JSDocParameterTag",t[t.JSDocReturnTag=341]="JSDocReturnTag",t[t.JSDocThisTag=342]="JSDocThisTag",t[t.JSDocTypeTag=343]="JSDocTypeTag",t[t.JSDocTemplateTag=344]="JSDocTemplateTag",t[t.JSDocTypedefTag=345]="JSDocTypedefTag",t[t.JSDocSeeTag=346]="JSDocSeeTag",t[t.JSDocPropertyTag=347]="JSDocPropertyTag",t[t.SyntaxList=348]="SyntaxList",t[t.NotEmittedStatement=349]="NotEmittedStatement",t[t.PartiallyEmittedExpression=350]="PartiallyEmittedExpression",t[t.CommaListExpression=351]="CommaListExpression",t[t.MergeDeclarationMarker=352]="MergeDeclarationMarker",t[t.EndOfDeclarationMarker=353]="EndOfDeclarationMarker",t[t.SyntheticReferenceExpression=354]="SyntheticReferenceExpression",t[t.Count=355]="Count",t[t.FirstAssignment=63]="FirstAssignment",t[t.LastAssignment=78]="LastAssignment",t[t.FirstCompoundAssignment=64]="FirstCompoundAssignment",t[t.LastCompoundAssignment=78]="LastCompoundAssignment",t[t.FirstReservedWord=81]="FirstReservedWord",t[t.LastReservedWord=116]="LastReservedWord",t[t.FirstKeyword=81]="FirstKeyword",t[t.LastKeyword=160]="LastKeyword",t[t.FirstFutureReservedWord=117]="FirstFutureReservedWord",t[t.LastFutureReservedWord=125]="LastFutureReservedWord",t[t.FirstTypeNode=177]="FirstTypeNode",t[t.LastTypeNode=200]="LastTypeNode",t[t.FirstPunctuation=18]="FirstPunctuation",t[t.LastPunctuation=78]="LastPunctuation",t[t.FirstToken=0]="FirstToken",t[t.LastToken=160]="LastToken",t[t.FirstTriviaToken=2]="FirstTriviaToken",t[t.LastTriviaToken=7]="LastTriviaToken",t[t.FirstLiteralToken=8]="FirstLiteralToken",t[t.LastLiteralToken=14]="LastLiteralToken",t[t.FirstTemplateToken=14]="FirstTemplateToken",t[t.LastTemplateToken=17]="LastTemplateToken",t[t.FirstBinaryOperator=29]="FirstBinaryOperator",t[t.LastBinaryOperator=78]="LastBinaryOperator",t[t.FirstStatement=237]="FirstStatement",t[t.LastStatement=253]="LastStatement",t[t.FirstNode=161]="FirstNode",t[t.FirstJSDocNode=309]="FirstJSDocNode",t[t.LastJSDocNode=347]="LastJSDocNode",t[t.FirstJSDocTagNode=327]="FirstJSDocTagNode",t[t.LastJSDocTagNode=347]="LastJSDocTagNode",t[t.FirstContextualKeyword=126]="FirstContextualKeyword",t[t.LastContextualKeyword=160]="LastContextualKeyword",t[t.JSDoc=320]="JSDoc",(r=e.NodeFlags||(e.NodeFlags={}))[r.None=0]="None",r[r.Let=1]="Let",r[r.Const=2]="Const",r[r.NestedNamespace=4]="NestedNamespace",r[r.Synthesized=8]="Synthesized",r[r.Namespace=16]="Namespace",r[r.OptionalChain=32]="OptionalChain",r[r.ExportContext=64]="ExportContext",r[r.ContainsThis=128]="ContainsThis",r[r.HasImplicitReturn=256]="HasImplicitReturn",r[r.HasExplicitReturn=512]="HasExplicitReturn",r[r.GlobalAugmentation=1024]="GlobalAugmentation",r[r.HasAsyncFunctions=2048]="HasAsyncFunctions",r[r.DisallowInContext=4096]="DisallowInContext",r[r.YieldContext=8192]="YieldContext",r[r.DecoratorContext=16384]="DecoratorContext",r[r.AwaitContext=32768]="AwaitContext",r[r.DisallowConditionalTypesContext=65536]="DisallowConditionalTypesContext",r[r.ThisNodeHasError=131072]="ThisNodeHasError",r[r.JavaScriptFile=262144]="JavaScriptFile",r[r.ThisNodeOrAnySubNodesHasError=524288]="ThisNodeOrAnySubNodesHasError",r[r.HasAggregatedChildData=1048576]="HasAggregatedChildData",r[r.PossiblyContainsDynamicImport=2097152]="PossiblyContainsDynamicImport",r[r.PossiblyContainsImportMeta=4194304]="PossiblyContainsImportMeta",r[r.JSDoc=8388608]="JSDoc",r[r.Ambient=16777216]="Ambient",r[r.InWithStatement=33554432]="InWithStatement",r[r.JsonFile=67108864]="JsonFile",r[r.TypeCached=134217728]="TypeCached",r[r.Deprecated=268435456]="Deprecated",r[r.BlockScoped=3]="BlockScoped",r[r.ReachabilityCheckFlags=768]="ReachabilityCheckFlags",r[r.ReachabilityAndEmitFlags=2816]="ReachabilityAndEmitFlags",r[r.ContextFlags=50720768]="ContextFlags",r[r.TypeExcludesFlags=40960]="TypeExcludesFlags",r[r.PermanentlySetIncrementalFlags=6291456]="PermanentlySetIncrementalFlags",(n=e.ModifierFlags||(e.ModifierFlags={}))[n.None=0]="None",n[n.Export=1]="Export",n[n.Ambient=2]="Ambient",n[n.Public=4]="Public",n[n.Private=8]="Private",n[n.Protected=16]="Protected",n[n.Static=32]="Static",n[n.Readonly=64]="Readonly",n[n.Abstract=128]="Abstract",n[n.Async=256]="Async",n[n.Default=512]="Default",n[n.Const=2048]="Const",n[n.HasComputedJSDocModifiers=4096]="HasComputedJSDocModifiers",n[n.Deprecated=8192]="Deprecated",n[n.Override=16384]="Override",n[n.In=32768]="In",n[n.Out=65536]="Out",n[n.HasComputedFlags=536870912]="HasComputedFlags",n[n.AccessibilityModifier=28]="AccessibilityModifier",n[n.ParameterPropertyModifier=16476]="ParameterPropertyModifier",n[n.NonPublicAccessibilityModifier=24]="NonPublicAccessibilityModifier",n[n.TypeScriptModifier=116958]="TypeScriptModifier",n[n.ExportDefault=513]="ExportDefault",n[n.All=125951]="All",(i=e.JsxFlags||(e.JsxFlags={}))[i.None=0]="None",i[i.IntrinsicNamedElement=1]="IntrinsicNamedElement",i[i.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",i[i.IntrinsicElement=3]="IntrinsicElement",(a=e.RelationComparisonResult||(e.RelationComparisonResult={}))[a.Succeeded=1]="Succeeded",a[a.Failed=2]="Failed",a[a.Reported=4]="Reported",a[a.ReportsUnmeasurable=8]="ReportsUnmeasurable",a[a.ReportsUnreliable=16]="ReportsUnreliable",a[a.ReportsMask=24]="ReportsMask",(o=e.GeneratedIdentifierFlags||(e.GeneratedIdentifierFlags={}))[o.None=0]="None",o[o.Auto=1]="Auto",o[o.Loop=2]="Loop",o[o.Unique=3]="Unique",o[o.Node=4]="Node",o[o.KindMask=7]="KindMask",o[o.ReservedInNestedScopes=8]="ReservedInNestedScopes",o[o.Optimistic=16]="Optimistic",o[o.FileLevel=32]="FileLevel",o[o.AllowNameSubstitution=64]="AllowNameSubstitution",(s=e.TokenFlags||(e.TokenFlags={}))[s.None=0]="None",s[s.PrecedingLineBreak=1]="PrecedingLineBreak",s[s.PrecedingJSDocComment=2]="PrecedingJSDocComment",s[s.Unterminated=4]="Unterminated",s[s.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",s[s.Scientific=16]="Scientific",s[s.Octal=32]="Octal",s[s.HexSpecifier=64]="HexSpecifier",s[s.BinarySpecifier=128]="BinarySpecifier",s[s.OctalSpecifier=256]="OctalSpecifier",s[s.ContainsSeparator=512]="ContainsSeparator",s[s.UnicodeEscape=1024]="UnicodeEscape",s[s.ContainsInvalidEscape=2048]="ContainsInvalidEscape",s[s.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",s[s.NumericLiteralFlags=1008]="NumericLiteralFlags",s[s.TemplateLiteralLikeFlags=2048]="TemplateLiteralLikeFlags",(c=e.FlowFlags||(e.FlowFlags={}))[c.Unreachable=1]="Unreachable",c[c.Start=2]="Start",c[c.BranchLabel=4]="BranchLabel",c[c.LoopLabel=8]="LoopLabel",c[c.Assignment=16]="Assignment",c[c.TrueCondition=32]="TrueCondition",c[c.FalseCondition=64]="FalseCondition",c[c.SwitchClause=128]="SwitchClause",c[c.ArrayMutation=256]="ArrayMutation",c[c.Call=512]="Call",c[c.ReduceLabel=1024]="ReduceLabel",c[c.Referenced=2048]="Referenced",c[c.Shared=4096]="Shared",c[c.Label=12]="Label",c[c.Condition=96]="Condition",(l=e.CommentDirectiveType||(e.CommentDirectiveType={}))[l.ExpectError=0]="ExpectError",l[l.Ignore=1]="Ignore";var u,d,_,p,f,m,g,y,h,v,b,x,S,D,C,T,E,k,A,N,w,F,P,I,O,M,L,R,B,J,j,U,V,K,z,G,q,W,H,Q,X,$,Y,Z,ee,te,re,ne,ie,ae,oe,se,ce,le,ue,de,_e,pe,fe,me=function(){};e.OperationCanceledException=me,(u=e.FileIncludeKind||(e.FileIncludeKind={}))[u.RootFile=0]="RootFile",u[u.SourceFromProjectReference=1]="SourceFromProjectReference",u[u.OutputFromProjectReference=2]="OutputFromProjectReference",u[u.Import=3]="Import",u[u.ReferenceFile=4]="ReferenceFile",u[u.TypeReferenceDirective=5]="TypeReferenceDirective",u[u.LibFile=6]="LibFile",u[u.LibReferenceDirective=7]="LibReferenceDirective",u[u.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",(d=e.FilePreprocessingDiagnosticsKind||(e.FilePreprocessingDiagnosticsKind={}))[d.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",d[d.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",(_=e.StructureIsReused||(e.StructureIsReused={}))[_.Not=0]="Not",_[_.SafeModules=1]="SafeModules",_[_.Completely=2]="Completely",(p=e.ExitStatus||(e.ExitStatus={}))[p.Success=0]="Success",p[p.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",p[p.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",p[p.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",p[p.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",p[p.ProjectReferenceCycle_OutputsSkupped=4]="ProjectReferenceCycle_OutputsSkupped",(f=e.MemberOverrideStatus||(e.MemberOverrideStatus={}))[f.Ok=0]="Ok",f[f.NeedsOverride=1]="NeedsOverride",f[f.HasInvalidOverride=2]="HasInvalidOverride",(m=e.UnionReduction||(e.UnionReduction={}))[m.None=0]="None",m[m.Literal=1]="Literal",m[m.Subtype=2]="Subtype",(g=e.ContextFlags||(e.ContextFlags={}))[g.None=0]="None",g[g.Signature=1]="Signature",g[g.NoConstraints=2]="NoConstraints",g[g.Completions=4]="Completions",g[g.SkipBindingPatterns=8]="SkipBindingPatterns",(y=e.NodeBuilderFlags||(e.NodeBuilderFlags={}))[y.None=0]="None",y[y.NoTruncation=1]="NoTruncation",y[y.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",y[y.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",y[y.UseStructuralFallback=8]="UseStructuralFallback",y[y.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",y[y.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",y[y.UseFullyQualifiedType=64]="UseFullyQualifiedType",y[y.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",y[y.SuppressAnyReturnType=256]="SuppressAnyReturnType",y[y.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",y[y.MultilineObjectLiterals=1024]="MultilineObjectLiterals",y[y.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",y[y.UseTypeOfFunction=4096]="UseTypeOfFunction",y[y.OmitParameterModifiers=8192]="OmitParameterModifiers",y[y.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",y[y.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",y[y.NoTypeReduction=536870912]="NoTypeReduction",y[y.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",y[y.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",y[y.AllowQualifedNameInPlaceOfIdentifier=65536]="AllowQualifedNameInPlaceOfIdentifier",y[y.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",y[y.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",y[y.AllowEmptyTuple=524288]="AllowEmptyTuple",y[y.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",y[y.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",y[y.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",y[y.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",y[y.IgnoreErrors=70221824]="IgnoreErrors",y[y.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",y[y.InTypeAlias=8388608]="InTypeAlias",y[y.InInitialEntityName=16777216]="InInitialEntityName",(h=e.TypeFormatFlags||(e.TypeFormatFlags={}))[h.None=0]="None",h[h.NoTruncation=1]="NoTruncation",h[h.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",h[h.UseStructuralFallback=8]="UseStructuralFallback",h[h.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",h[h.UseFullyQualifiedType=64]="UseFullyQualifiedType",h[h.SuppressAnyReturnType=256]="SuppressAnyReturnType",h[h.MultilineObjectLiterals=1024]="MultilineObjectLiterals",h[h.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",h[h.UseTypeOfFunction=4096]="UseTypeOfFunction",h[h.OmitParameterModifiers=8192]="OmitParameterModifiers",h[h.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",h[h.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",h[h.NoTypeReduction=536870912]="NoTypeReduction",h[h.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",h[h.AddUndefined=131072]="AddUndefined",h[h.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",h[h.InArrayType=524288]="InArrayType",h[h.InElementType=2097152]="InElementType",h[h.InFirstTypeArgument=4194304]="InFirstTypeArgument",h[h.InTypeAlias=8388608]="InTypeAlias",h[h.WriteOwnNameForAnyLike=0]="WriteOwnNameForAnyLike",h[h.NodeBuilderFlagsMask=814775659]="NodeBuilderFlagsMask",(v=e.SymbolFormatFlags||(e.SymbolFormatFlags={}))[v.None=0]="None",v[v.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",v[v.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",v[v.AllowAnyNodeKind=4]="AllowAnyNodeKind",v[v.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",v[v.DoNotIncludeSymbolChain=16]="DoNotIncludeSymbolChain",(b=e.SymbolAccessibility||(e.SymbolAccessibility={}))[b.Accessible=0]="Accessible",b[b.NotAccessible=1]="NotAccessible",b[b.CannotBeNamed=2]="CannotBeNamed",(x=e.SyntheticSymbolKind||(e.SyntheticSymbolKind={}))[x.UnionOrIntersection=0]="UnionOrIntersection",x[x.Spread=1]="Spread",(S=e.TypePredicateKind||(e.TypePredicateKind={}))[S.This=0]="This",S[S.Identifier=1]="Identifier",S[S.AssertsThis=2]="AssertsThis",S[S.AssertsIdentifier=3]="AssertsIdentifier",(D=e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}))[D.Unknown=0]="Unknown",D[D.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",D[D.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",D[D.NumberLikeType=3]="NumberLikeType",D[D.BigIntLikeType=4]="BigIntLikeType",D[D.StringLikeType=5]="StringLikeType",D[D.BooleanType=6]="BooleanType",D[D.ArrayLikeType=7]="ArrayLikeType",D[D.ESSymbolType=8]="ESSymbolType",D[D.Promise=9]="Promise",D[D.TypeWithCallSignature=10]="TypeWithCallSignature",D[D.ObjectType=11]="ObjectType",(C=e.SymbolFlags||(e.SymbolFlags={}))[C.None=0]="None",C[C.FunctionScopedVariable=1]="FunctionScopedVariable",C[C.BlockScopedVariable=2]="BlockScopedVariable",C[C.Property=4]="Property",C[C.EnumMember=8]="EnumMember",C[C.Function=16]="Function",C[C.Class=32]="Class",C[C.Interface=64]="Interface",C[C.ConstEnum=128]="ConstEnum",C[C.RegularEnum=256]="RegularEnum",C[C.ValueModule=512]="ValueModule",C[C.NamespaceModule=1024]="NamespaceModule",C[C.TypeLiteral=2048]="TypeLiteral",C[C.ObjectLiteral=4096]="ObjectLiteral",C[C.Method=8192]="Method",C[C.Constructor=16384]="Constructor",C[C.GetAccessor=32768]="GetAccessor",C[C.SetAccessor=65536]="SetAccessor",C[C.Signature=131072]="Signature",C[C.TypeParameter=262144]="TypeParameter",C[C.TypeAlias=524288]="TypeAlias",C[C.ExportValue=1048576]="ExportValue",C[C.Alias=2097152]="Alias",C[C.Prototype=4194304]="Prototype",C[C.ExportStar=8388608]="ExportStar",C[C.Optional=16777216]="Optional",C[C.Transient=33554432]="Transient",C[C.Assignment=67108864]="Assignment",C[C.ModuleExports=134217728]="ModuleExports",C[C.All=67108863]="All",C[C.Enum=384]="Enum",C[C.Variable=3]="Variable",C[C.Value=111551]="Value",C[C.Type=788968]="Type",C[C.Namespace=1920]="Namespace",C[C.Module=1536]="Module",C[C.Accessor=98304]="Accessor",C[C.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",C[C.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",C[C.ParameterExcludes=111551]="ParameterExcludes",C[C.PropertyExcludes=0]="PropertyExcludes",C[C.EnumMemberExcludes=900095]="EnumMemberExcludes",C[C.FunctionExcludes=110991]="FunctionExcludes",C[C.ClassExcludes=899503]="ClassExcludes",C[C.InterfaceExcludes=788872]="InterfaceExcludes",C[C.RegularEnumExcludes=899327]="RegularEnumExcludes",C[C.ConstEnumExcludes=899967]="ConstEnumExcludes",C[C.ValueModuleExcludes=110735]="ValueModuleExcludes",C[C.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",C[C.MethodExcludes=103359]="MethodExcludes",C[C.GetAccessorExcludes=46015]="GetAccessorExcludes",C[C.SetAccessorExcludes=78783]="SetAccessorExcludes",C[C.TypeParameterExcludes=526824]="TypeParameterExcludes",C[C.TypeAliasExcludes=788968]="TypeAliasExcludes",C[C.AliasExcludes=2097152]="AliasExcludes",C[C.ModuleMember=2623475]="ModuleMember",C[C.ExportHasLocal=944]="ExportHasLocal",C[C.BlockScoped=418]="BlockScoped",C[C.PropertyOrAccessor=98308]="PropertyOrAccessor",C[C.ClassMember=106500]="ClassMember",C[C.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",C[C.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",C[C.Classifiable=2885600]="Classifiable",C[C.LateBindingContainer=6256]="LateBindingContainer",(T=e.EnumKind||(e.EnumKind={}))[T.Numeric=0]="Numeric",T[T.Literal=1]="Literal",(E=e.CheckFlags||(e.CheckFlags={}))[E.Instantiated=1]="Instantiated",E[E.SyntheticProperty=2]="SyntheticProperty",E[E.SyntheticMethod=4]="SyntheticMethod",E[E.Readonly=8]="Readonly",E[E.ReadPartial=16]="ReadPartial",E[E.WritePartial=32]="WritePartial",E[E.HasNonUniformType=64]="HasNonUniformType",E[E.HasLiteralType=128]="HasLiteralType",E[E.ContainsPublic=256]="ContainsPublic",E[E.ContainsProtected=512]="ContainsProtected",E[E.ContainsPrivate=1024]="ContainsPrivate",E[E.ContainsStatic=2048]="ContainsStatic",E[E.Late=4096]="Late",E[E.ReverseMapped=8192]="ReverseMapped",E[E.OptionalParameter=16384]="OptionalParameter",E[E.RestParameter=32768]="RestParameter",E[E.DeferredType=65536]="DeferredType",E[E.HasNeverType=131072]="HasNeverType",E[E.Mapped=262144]="Mapped",E[E.StripOptional=524288]="StripOptional",E[E.Unresolved=1048576]="Unresolved",E[E.Synthetic=6]="Synthetic",E[E.Discriminant=192]="Discriminant",E[E.Partial=48]="Partial",(k=e.InternalSymbolName||(e.InternalSymbolName={})).Call="__call",k.Constructor="__constructor",k.New="__new",k.Index="__index",k.ExportStar="__export",k.Global="__global",k.Missing="__missing",k.Type="__type",k.Object="__object",k.JSXAttributes="__jsxAttributes",k.Class="__class",k.Function="__function",k.Computed="__computed",k.Resolving="__resolving__",k.ExportEquals="export=",k.Default="default",k.This="this",(A=e.NodeCheckFlags||(e.NodeCheckFlags={}))[A.TypeChecked=1]="TypeChecked",A[A.LexicalThis=2]="LexicalThis",A[A.CaptureThis=4]="CaptureThis",A[A.CaptureNewTarget=8]="CaptureNewTarget",A[A.SuperInstance=256]="SuperInstance",A[A.SuperStatic=512]="SuperStatic",A[A.ContextChecked=1024]="ContextChecked",A[A.AsyncMethodWithSuper=2048]="AsyncMethodWithSuper",A[A.AsyncMethodWithSuperBinding=4096]="AsyncMethodWithSuperBinding",A[A.CaptureArguments=8192]="CaptureArguments",A[A.EnumValuesComputed=16384]="EnumValuesComputed",A[A.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",A[A.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",A[A.ContainsCapturedBlockScopeBinding=131072]="ContainsCapturedBlockScopeBinding",A[A.CapturedBlockScopedBinding=262144]="CapturedBlockScopedBinding",A[A.BlockScopedBindingInLoop=524288]="BlockScopedBindingInLoop",A[A.ClassWithBodyScopedClassBinding=1048576]="ClassWithBodyScopedClassBinding",A[A.BodyScopedClassBinding=2097152]="BodyScopedClassBinding",A[A.NeedsLoopOutParameter=4194304]="NeedsLoopOutParameter",A[A.AssignmentsMarked=8388608]="AssignmentsMarked",A[A.ClassWithConstructorReference=16777216]="ClassWithConstructorReference",A[A.ConstructorReferenceInClass=33554432]="ConstructorReferenceInClass",A[A.ContainsClassWithPrivateIdentifiers=67108864]="ContainsClassWithPrivateIdentifiers",A[A.ContainsSuperPropertyInStaticInitializer=134217728]="ContainsSuperPropertyInStaticInitializer",A[A.InCheckIdentifier=268435456]="InCheckIdentifier",(N=e.TypeFlags||(e.TypeFlags={}))[N.Any=1]="Any",N[N.Unknown=2]="Unknown",N[N.String=4]="String",N[N.Number=8]="Number",N[N.Boolean=16]="Boolean",N[N.Enum=32]="Enum",N[N.BigInt=64]="BigInt",N[N.StringLiteral=128]="StringLiteral",N[N.NumberLiteral=256]="NumberLiteral",N[N.BooleanLiteral=512]="BooleanLiteral",N[N.EnumLiteral=1024]="EnumLiteral",N[N.BigIntLiteral=2048]="BigIntLiteral",N[N.ESSymbol=4096]="ESSymbol",N[N.UniqueESSymbol=8192]="UniqueESSymbol",N[N.Void=16384]="Void",N[N.Undefined=32768]="Undefined",N[N.Null=65536]="Null",N[N.Never=131072]="Never",N[N.TypeParameter=262144]="TypeParameter",N[N.Object=524288]="Object",N[N.Union=1048576]="Union",N[N.Intersection=2097152]="Intersection",N[N.Index=4194304]="Index",N[N.IndexedAccess=8388608]="IndexedAccess",N[N.Conditional=16777216]="Conditional",N[N.Substitution=33554432]="Substitution",N[N.NonPrimitive=67108864]="NonPrimitive",N[N.TemplateLiteral=134217728]="TemplateLiteral",N[N.StringMapping=268435456]="StringMapping",N[N.AnyOrUnknown=3]="AnyOrUnknown",N[N.Nullable=98304]="Nullable",N[N.Literal=2944]="Literal",N[N.Unit=109440]="Unit",N[N.StringOrNumberLiteral=384]="StringOrNumberLiteral",N[N.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",N[N.DefinitelyFalsy=117632]="DefinitelyFalsy",N[N.PossiblyFalsy=117724]="PossiblyFalsy",N[N.Intrinsic=67359327]="Intrinsic",N[N.Primitive=131068]="Primitive",N[N.StringLike=402653316]="StringLike",N[N.NumberLike=296]="NumberLike",N[N.BigIntLike=2112]="BigIntLike",N[N.BooleanLike=528]="BooleanLike",N[N.EnumLike=1056]="EnumLike",N[N.ESSymbolLike=12288]="ESSymbolLike",N[N.VoidLike=49152]="VoidLike",N[N.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",N[N.DisjointDomains=469892092]="DisjointDomains",N[N.UnionOrIntersection=3145728]="UnionOrIntersection",N[N.StructuredType=3670016]="StructuredType",N[N.TypeVariable=8650752]="TypeVariable",N[N.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",N[N.InstantiablePrimitive=406847488]="InstantiablePrimitive",N[N.Instantiable=465829888]="Instantiable",N[N.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",N[N.ObjectFlagsType=3899393]="ObjectFlagsType",N[N.Simplifiable=25165824]="Simplifiable",N[N.Singleton=67358815]="Singleton",N[N.Narrowable=536624127]="Narrowable",N[N.IncludesMask=205258751]="IncludesMask",N[N.IncludesMissingType=262144]="IncludesMissingType",N[N.IncludesNonWideningType=4194304]="IncludesNonWideningType",N[N.IncludesWildcard=8388608]="IncludesWildcard",N[N.IncludesEmptyObject=16777216]="IncludesEmptyObject",N[N.IncludesInstantiable=33554432]="IncludesInstantiable",N[N.NotPrimitiveUnion=36323363]="NotPrimitiveUnion",(w=e.ObjectFlags||(e.ObjectFlags={}))[w.Class=1]="Class",w[w.Interface=2]="Interface",w[w.Reference=4]="Reference",w[w.Tuple=8]="Tuple",w[w.Anonymous=16]="Anonymous",w[w.Mapped=32]="Mapped",w[w.Instantiated=64]="Instantiated",w[w.ObjectLiteral=128]="ObjectLiteral",w[w.EvolvingArray=256]="EvolvingArray",w[w.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",w[w.ReverseMapped=1024]="ReverseMapped",w[w.JsxAttributes=2048]="JsxAttributes",w[w.JSLiteral=4096]="JSLiteral",w[w.FreshLiteral=8192]="FreshLiteral",w[w.ArrayLiteral=16384]="ArrayLiteral",w[w.PrimitiveUnion=32768]="PrimitiveUnion",w[w.ContainsWideningType=65536]="ContainsWideningType",w[w.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",w[w.NonInferrableType=262144]="NonInferrableType",w[w.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",w[w.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",w[w.ClassOrInterface=3]="ClassOrInterface",w[w.RequiresWidening=196608]="RequiresWidening",w[w.PropagatingFlags=458752]="PropagatingFlags",w[w.ObjectTypeKindMask=1343]="ObjectTypeKindMask",w[w.ContainsSpread=2097152]="ContainsSpread",w[w.ObjectRestType=4194304]="ObjectRestType",w[w.InstantiationExpressionType=8388608]="InstantiationExpressionType",w[w.IsClassInstanceClone=16777216]="IsClassInstanceClone",w[w.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",w[w.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",w[w.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",w[w.IsGenericObjectType=4194304]="IsGenericObjectType",w[w.IsGenericIndexType=8388608]="IsGenericIndexType",w[w.IsGenericType=12582912]="IsGenericType",w[w.ContainsIntersections=16777216]="ContainsIntersections",w[w.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",w[w.IsNeverIntersection=33554432]="IsNeverIntersection",(F=e.VarianceFlags||(e.VarianceFlags={}))[F.Invariant=0]="Invariant",F[F.Covariant=1]="Covariant",F[F.Contravariant=2]="Contravariant",F[F.Bivariant=3]="Bivariant",F[F.Independent=4]="Independent",F[F.VarianceMask=7]="VarianceMask",F[F.Unmeasurable=8]="Unmeasurable",F[F.Unreliable=16]="Unreliable",F[F.AllowsStructuralFallback=24]="AllowsStructuralFallback",(P=e.ElementFlags||(e.ElementFlags={}))[P.Required=1]="Required",P[P.Optional=2]="Optional",P[P.Rest=4]="Rest",P[P.Variadic=8]="Variadic",P[P.Fixed=3]="Fixed",P[P.Variable=12]="Variable",P[P.NonRequired=14]="NonRequired",P[P.NonRest=11]="NonRest",(I=e.AccessFlags||(e.AccessFlags={}))[I.None=0]="None",I[I.IncludeUndefined=1]="IncludeUndefined",I[I.NoIndexSignatures=2]="NoIndexSignatures",I[I.Writing=4]="Writing",I[I.CacheSymbol=8]="CacheSymbol",I[I.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",I[I.ExpressionPosition=32]="ExpressionPosition",I[I.ReportDeprecated=64]="ReportDeprecated",I[I.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",I[I.Contextual=256]="Contextual",I[I.Persistent=1]="Persistent",(O=e.JsxReferenceKind||(e.JsxReferenceKind={}))[O.Component=0]="Component",O[O.Function=1]="Function",O[O.Mixed=2]="Mixed",(M=e.SignatureKind||(e.SignatureKind={}))[M.Call=0]="Call",M[M.Construct=1]="Construct",(L=e.SignatureFlags||(e.SignatureFlags={}))[L.None=0]="None",L[L.HasRestParameter=1]="HasRestParameter",L[L.HasLiteralTypes=2]="HasLiteralTypes",L[L.Abstract=4]="Abstract",L[L.IsInnerCallChain=8]="IsInnerCallChain",L[L.IsOuterCallChain=16]="IsOuterCallChain",L[L.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",L[L.PropagatingFlags=39]="PropagatingFlags",L[L.CallChainFlags=24]="CallChainFlags",(R=e.IndexKind||(e.IndexKind={}))[R.String=0]="String",R[R.Number=1]="Number",(B=e.TypeMapKind||(e.TypeMapKind={}))[B.Simple=0]="Simple",B[B.Array=1]="Array",B[B.Function=2]="Function",B[B.Composite=3]="Composite",B[B.Merged=4]="Merged",(J=e.InferencePriority||(e.InferencePriority={}))[J.NakedTypeVariable=1]="NakedTypeVariable",J[J.SpeculativeTuple=2]="SpeculativeTuple",J[J.SubstituteSource=4]="SubstituteSource",J[J.HomomorphicMappedType=8]="HomomorphicMappedType",J[J.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",J[J.MappedTypeConstraint=32]="MappedTypeConstraint",J[J.ContravariantConditional=64]="ContravariantConditional",J[J.ReturnType=128]="ReturnType",J[J.LiteralKeyof=256]="LiteralKeyof",J[J.NoConstraints=512]="NoConstraints",J[J.AlwaysStrict=1024]="AlwaysStrict",J[J.MaxValue=2048]="MaxValue",J[J.PriorityImpliesCombination=416]="PriorityImpliesCombination",J[J.Circularity=-1]="Circularity",(j=e.InferenceFlags||(e.InferenceFlags={}))[j.None=0]="None",j[j.NoDefault=1]="NoDefault",j[j.AnyDefault=2]="AnyDefault",j[j.SkippedGenericFunction=4]="SkippedGenericFunction",(U=e.Ternary||(e.Ternary={}))[U.False=0]="False",U[U.Unknown=1]="Unknown",U[U.Maybe=3]="Maybe",U[U.True=-1]="True",(V=e.AssignmentDeclarationKind||(e.AssignmentDeclarationKind={}))[V.None=0]="None",V[V.ExportsProperty=1]="ExportsProperty",V[V.ModuleExports=2]="ModuleExports",V[V.PrototypeProperty=3]="PrototypeProperty",V[V.ThisProperty=4]="ThisProperty",V[V.Property=5]="Property",V[V.Prototype=6]="Prototype",V[V.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",V[V.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",V[V.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message"}(K=e.DiagnosticCategory||(e.DiagnosticCategory={})),e.diagnosticCategoryName=function(e,t){void 0===t&&(t=!0);var r=K[e.category];return t?r.toLowerCase():r},(z=e.ModuleResolutionKind||(e.ModuleResolutionKind={}))[z.Classic=1]="Classic",z[z.NodeJs=2]="NodeJs",z[z.Node16=3]="Node16",z[z.NodeNext=99]="NodeNext",(G=e.ModuleDetectionKind||(e.ModuleDetectionKind={}))[G.Legacy=1]="Legacy",G[G.Auto=2]="Auto",G[G.Force=3]="Force",(q=e.WatchFileKind||(e.WatchFileKind={}))[q.FixedPollingInterval=0]="FixedPollingInterval",q[q.PriorityPollingInterval=1]="PriorityPollingInterval",q[q.DynamicPriorityPolling=2]="DynamicPriorityPolling",q[q.FixedChunkSizePolling=3]="FixedChunkSizePolling",q[q.UseFsEvents=4]="UseFsEvents",q[q.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",(W=e.WatchDirectoryKind||(e.WatchDirectoryKind={}))[W.UseFsEvents=0]="UseFsEvents",W[W.FixedPollingInterval=1]="FixedPollingInterval",W[W.DynamicPriorityPolling=2]="DynamicPriorityPolling",W[W.FixedChunkSizePolling=3]="FixedChunkSizePolling",(H=e.PollingWatchKind||(e.PollingWatchKind={}))[H.FixedInterval=0]="FixedInterval",H[H.PriorityInterval=1]="PriorityInterval",H[H.DynamicPriority=2]="DynamicPriority",H[H.FixedChunkSize=3]="FixedChunkSize",(Q=e.ModuleKind||(e.ModuleKind={}))[Q.None=0]="None",Q[Q.CommonJS=1]="CommonJS",Q[Q.AMD=2]="AMD",Q[Q.UMD=3]="UMD",Q[Q.System=4]="System",Q[Q.ES2015=5]="ES2015",Q[Q.ES2020=6]="ES2020",Q[Q.ES2022=7]="ES2022",Q[Q.ESNext=99]="ESNext",Q[Q.Node16=100]="Node16",Q[Q.NodeNext=199]="NodeNext",(X=e.JsxEmit||(e.JsxEmit={}))[X.None=0]="None",X[X.Preserve=1]="Preserve",X[X.React=2]="React",X[X.ReactNative=3]="ReactNative",X[X.ReactJSX=4]="ReactJSX",X[X.ReactJSXDev=5]="ReactJSXDev",($=e.ImportsNotUsedAsValues||(e.ImportsNotUsedAsValues={}))[$.Remove=0]="Remove",$[$.Preserve=1]="Preserve",$[$.Error=2]="Error",(Y=e.NewLineKind||(e.NewLineKind={}))[Y.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",Y[Y.LineFeed=1]="LineFeed",(Z=e.ScriptKind||(e.ScriptKind={}))[Z.Unknown=0]="Unknown",Z[Z.JS=1]="JS",Z[Z.JSX=2]="JSX",Z[Z.TS=3]="TS",Z[Z.TSX=4]="TSX",Z[Z.External=5]="External",Z[Z.JSON=6]="JSON",Z[Z.Deferred=7]="Deferred",(ee=e.ScriptTarget||(e.ScriptTarget={}))[ee.ES3=0]="ES3",ee[ee.ES5=1]="ES5",ee[ee.ES2015=2]="ES2015",ee[ee.ES2016=3]="ES2016",ee[ee.ES2017=4]="ES2017",ee[ee.ES2018=5]="ES2018",ee[ee.ES2019=6]="ES2019",ee[ee.ES2020=7]="ES2020",ee[ee.ES2021=8]="ES2021",ee[ee.ES2022=9]="ES2022",ee[ee.ESNext=99]="ESNext",ee[ee.JSON=100]="JSON",ee[ee.Latest=99]="Latest",(te=e.LanguageVariant||(e.LanguageVariant={}))[te.Standard=0]="Standard",te[te.JSX=1]="JSX",(re=e.WatchDirectoryFlags||(e.WatchDirectoryFlags={}))[re.None=0]="None",re[re.Recursive=1]="Recursive",(ne=e.CharacterCodes||(e.CharacterCodes={}))[ne.nullCharacter=0]="nullCharacter",ne[ne.maxAsciiCharacter=127]="maxAsciiCharacter",ne[ne.lineFeed=10]="lineFeed",ne[ne.carriageReturn=13]="carriageReturn",ne[ne.lineSeparator=8232]="lineSeparator",ne[ne.paragraphSeparator=8233]="paragraphSeparator",ne[ne.nextLine=133]="nextLine",ne[ne.space=32]="space",ne[ne.nonBreakingSpace=160]="nonBreakingSpace",ne[ne.enQuad=8192]="enQuad",ne[ne.emQuad=8193]="emQuad",ne[ne.enSpace=8194]="enSpace",ne[ne.emSpace=8195]="emSpace",ne[ne.threePerEmSpace=8196]="threePerEmSpace",ne[ne.fourPerEmSpace=8197]="fourPerEmSpace",ne[ne.sixPerEmSpace=8198]="sixPerEmSpace",ne[ne.figureSpace=8199]="figureSpace",ne[ne.punctuationSpace=8200]="punctuationSpace",ne[ne.thinSpace=8201]="thinSpace",ne[ne.hairSpace=8202]="hairSpace",ne[ne.zeroWidthSpace=8203]="zeroWidthSpace",ne[ne.narrowNoBreakSpace=8239]="narrowNoBreakSpace",ne[ne.ideographicSpace=12288]="ideographicSpace",ne[ne.mathematicalSpace=8287]="mathematicalSpace",ne[ne.ogham=5760]="ogham",ne[ne._=95]="_",ne[ne.$=36]="$",ne[ne._0=48]="_0",ne[ne._1=49]="_1",ne[ne._2=50]="_2",ne[ne._3=51]="_3",ne[ne._4=52]="_4",ne[ne._5=53]="_5",ne[ne._6=54]="_6",ne[ne._7=55]="_7",ne[ne._8=56]="_8",ne[ne._9=57]="_9",ne[ne.a=97]="a",ne[ne.b=98]="b",ne[ne.c=99]="c",ne[ne.d=100]="d",ne[ne.e=101]="e",ne[ne.f=102]="f",ne[ne.g=103]="g",ne[ne.h=104]="h",ne[ne.i=105]="i",ne[ne.j=106]="j",ne[ne.k=107]="k",ne[ne.l=108]="l",ne[ne.m=109]="m",ne[ne.n=110]="n",ne[ne.o=111]="o",ne[ne.p=112]="p",ne[ne.q=113]="q",ne[ne.r=114]="r",ne[ne.s=115]="s",ne[ne.t=116]="t",ne[ne.u=117]="u",ne[ne.v=118]="v",ne[ne.w=119]="w",ne[ne.x=120]="x",ne[ne.y=121]="y",ne[ne.z=122]="z",ne[ne.A=65]="A",ne[ne.B=66]="B",ne[ne.C=67]="C",ne[ne.D=68]="D",ne[ne.E=69]="E",ne[ne.F=70]="F",ne[ne.G=71]="G",ne[ne.H=72]="H",ne[ne.I=73]="I",ne[ne.J=74]="J",ne[ne.K=75]="K",ne[ne.L=76]="L",ne[ne.M=77]="M",ne[ne.N=78]="N",ne[ne.O=79]="O",ne[ne.P=80]="P",ne[ne.Q=81]="Q",ne[ne.R=82]="R",ne[ne.S=83]="S",ne[ne.T=84]="T",ne[ne.U=85]="U",ne[ne.V=86]="V",ne[ne.W=87]="W",ne[ne.X=88]="X",ne[ne.Y=89]="Y",ne[ne.Z=90]="Z",ne[ne.ampersand=38]="ampersand",ne[ne.asterisk=42]="asterisk",ne[ne.at=64]="at",ne[ne.backslash=92]="backslash",ne[ne.backtick=96]="backtick",ne[ne.bar=124]="bar",ne[ne.caret=94]="caret",ne[ne.closeBrace=125]="closeBrace",ne[ne.closeBracket=93]="closeBracket",ne[ne.closeParen=41]="closeParen",ne[ne.colon=58]="colon",ne[ne.comma=44]="comma",ne[ne.dot=46]="dot",ne[ne.doubleQuote=34]="doubleQuote",ne[ne.equals=61]="equals",ne[ne.exclamation=33]="exclamation",ne[ne.greaterThan=62]="greaterThan",ne[ne.hash=35]="hash",ne[ne.lessThan=60]="lessThan",ne[ne.minus=45]="minus",ne[ne.openBrace=123]="openBrace",ne[ne.openBracket=91]="openBracket",ne[ne.openParen=40]="openParen",ne[ne.percent=37]="percent",ne[ne.plus=43]="plus",ne[ne.question=63]="question",ne[ne.semicolon=59]="semicolon",ne[ne.singleQuote=39]="singleQuote",ne[ne.slash=47]="slash",ne[ne.tilde=126]="tilde",ne[ne.backspace=8]="backspace",ne[ne.formFeed=12]="formFeed",ne[ne.byteOrderMark=65279]="byteOrderMark",ne[ne.tab=9]="tab",ne[ne.verticalTab=11]="verticalTab",(ie=e.Extension||(e.Extension={})).Ts=".ts",ie.Tsx=".tsx",ie.Dts=".d.ts",ie.Js=".js",ie.Jsx=".jsx",ie.Json=".json",ie.TsBuildInfo=".tsbuildinfo",ie.Mjs=".mjs",ie.Mts=".mts",ie.Dmts=".d.mts",ie.Cjs=".cjs",ie.Cts=".cts",ie.Dcts=".d.cts",(ae=e.TransformFlags||(e.TransformFlags={}))[ae.None=0]="None",ae[ae.ContainsTypeScript=1]="ContainsTypeScript",ae[ae.ContainsJsx=2]="ContainsJsx",ae[ae.ContainsESNext=4]="ContainsESNext",ae[ae.ContainsES2022=8]="ContainsES2022",ae[ae.ContainsES2021=16]="ContainsES2021",ae[ae.ContainsES2020=32]="ContainsES2020",ae[ae.ContainsES2019=64]="ContainsES2019",ae[ae.ContainsES2018=128]="ContainsES2018",ae[ae.ContainsES2017=256]="ContainsES2017",ae[ae.ContainsES2016=512]="ContainsES2016",ae[ae.ContainsES2015=1024]="ContainsES2015",ae[ae.ContainsGenerator=2048]="ContainsGenerator",ae[ae.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",ae[ae.ContainsTypeScriptClassSyntax=4096]="ContainsTypeScriptClassSyntax",ae[ae.ContainsLexicalThis=8192]="ContainsLexicalThis",ae[ae.ContainsRestOrSpread=16384]="ContainsRestOrSpread",ae[ae.ContainsObjectRestOrSpread=32768]="ContainsObjectRestOrSpread",ae[ae.ContainsComputedPropertyName=65536]="ContainsComputedPropertyName",ae[ae.ContainsBlockScopedBinding=131072]="ContainsBlockScopedBinding",ae[ae.ContainsBindingPattern=262144]="ContainsBindingPattern",ae[ae.ContainsYield=524288]="ContainsYield",ae[ae.ContainsAwait=1048576]="ContainsAwait",ae[ae.ContainsHoistedDeclarationOrCompletion=2097152]="ContainsHoistedDeclarationOrCompletion",ae[ae.ContainsDynamicImport=4194304]="ContainsDynamicImport",ae[ae.ContainsClassFields=8388608]="ContainsClassFields",ae[ae.ContainsPossibleTopLevelAwait=16777216]="ContainsPossibleTopLevelAwait",ae[ae.ContainsLexicalSuper=33554432]="ContainsLexicalSuper",ae[ae.ContainsUpdateExpressionForIdentifier=67108864]="ContainsUpdateExpressionForIdentifier",ae[ae.HasComputedFlags=536870912]="HasComputedFlags",ae[ae.AssertTypeScript=1]="AssertTypeScript",ae[ae.AssertJsx=2]="AssertJsx",ae[ae.AssertESNext=4]="AssertESNext",ae[ae.AssertES2022=8]="AssertES2022",ae[ae.AssertES2021=16]="AssertES2021",ae[ae.AssertES2020=32]="AssertES2020",ae[ae.AssertES2019=64]="AssertES2019",ae[ae.AssertES2018=128]="AssertES2018",ae[ae.AssertES2017=256]="AssertES2017",ae[ae.AssertES2016=512]="AssertES2016",ae[ae.AssertES2015=1024]="AssertES2015",ae[ae.AssertGenerator=2048]="AssertGenerator",ae[ae.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",ae[ae.OuterExpressionExcludes=536870912]="OuterExpressionExcludes",ae[ae.PropertyAccessExcludes=536870912]="PropertyAccessExcludes",ae[ae.NodeExcludes=536870912]="NodeExcludes",ae[ae.ArrowFunctionExcludes=557748224]="ArrowFunctionExcludes",ae[ae.FunctionExcludes=591310848]="FunctionExcludes",ae[ae.ConstructorExcludes=591306752]="ConstructorExcludes",ae[ae.MethodOrAccessorExcludes=574529536]="MethodOrAccessorExcludes",ae[ae.PropertyExcludes=570433536]="PropertyExcludes",ae[ae.ClassExcludes=536940544]="ClassExcludes",ae[ae.ModuleExcludes=589443072]="ModuleExcludes",ae[ae.TypeExcludes=-2]="TypeExcludes",ae[ae.ObjectLiteralExcludes=536973312]="ObjectLiteralExcludes",ae[ae.ArrayLiteralOrCallOrNewExcludes=536887296]="ArrayLiteralOrCallOrNewExcludes",ae[ae.VariableDeclarationListExcludes=537165824]="VariableDeclarationListExcludes",ae[ae.ParameterExcludes=536870912]="ParameterExcludes",ae[ae.CatchClauseExcludes=536903680]="CatchClauseExcludes",ae[ae.BindingPatternExcludes=536887296]="BindingPatternExcludes",ae[ae.ContainsLexicalThisOrSuper=33562624]="ContainsLexicalThisOrSuper",ae[ae.PropertyNamePropagatingFlags=33562624]="PropertyNamePropagatingFlags",(oe=e.SnippetKind||(e.SnippetKind={}))[oe.TabStop=0]="TabStop",oe[oe.Placeholder=1]="Placeholder",oe[oe.Choice=2]="Choice",oe[oe.Variable=3]="Variable",(se=e.EmitFlags||(e.EmitFlags={}))[se.None=0]="None",se[se.SingleLine=1]="SingleLine",se[se.AdviseOnEmitNode=2]="AdviseOnEmitNode",se[se.NoSubstitution=4]="NoSubstitution",se[se.CapturesThis=8]="CapturesThis",se[se.NoLeadingSourceMap=16]="NoLeadingSourceMap",se[se.NoTrailingSourceMap=32]="NoTrailingSourceMap",se[se.NoSourceMap=48]="NoSourceMap",se[se.NoNestedSourceMaps=64]="NoNestedSourceMaps",se[se.NoTokenLeadingSourceMaps=128]="NoTokenLeadingSourceMaps",se[se.NoTokenTrailingSourceMaps=256]="NoTokenTrailingSourceMaps",se[se.NoTokenSourceMaps=384]="NoTokenSourceMaps",se[se.NoLeadingComments=512]="NoLeadingComments",se[se.NoTrailingComments=1024]="NoTrailingComments",se[se.NoComments=1536]="NoComments",se[se.NoNestedComments=2048]="NoNestedComments",se[se.HelperName=4096]="HelperName",se[se.ExportName=8192]="ExportName",se[se.LocalName=16384]="LocalName",se[se.InternalName=32768]="InternalName",se[se.Indented=65536]="Indented",se[se.NoIndentation=131072]="NoIndentation",se[se.AsyncFunctionBody=262144]="AsyncFunctionBody",se[se.ReuseTempVariableScope=524288]="ReuseTempVariableScope",se[se.CustomPrologue=1048576]="CustomPrologue",se[se.NoHoisting=2097152]="NoHoisting",se[se.HasEndOfDeclarationMarker=4194304]="HasEndOfDeclarationMarker",se[se.Iterator=8388608]="Iterator",se[se.NoAsciiEscaping=16777216]="NoAsciiEscaping",se[se.TypeScriptClassWrapper=33554432]="TypeScriptClassWrapper",se[se.NeverApplyImportHelper=67108864]="NeverApplyImportHelper",se[se.IgnoreSourceNewlines=134217728]="IgnoreSourceNewlines",se[se.Immutable=268435456]="Immutable",se[se.IndirectCall=536870912]="IndirectCall",(ce=e.ExternalEmitHelpers||(e.ExternalEmitHelpers={}))[ce.Extends=1]="Extends",ce[ce.Assign=2]="Assign",ce[ce.Rest=4]="Rest",ce[ce.Decorate=8]="Decorate",ce[ce.Metadata=16]="Metadata",ce[ce.Param=32]="Param",ce[ce.Awaiter=64]="Awaiter",ce[ce.Generator=128]="Generator",ce[ce.Values=256]="Values",ce[ce.Read=512]="Read",ce[ce.SpreadArray=1024]="SpreadArray",ce[ce.Await=2048]="Await",ce[ce.AsyncGenerator=4096]="AsyncGenerator",ce[ce.AsyncDelegator=8192]="AsyncDelegator",ce[ce.AsyncValues=16384]="AsyncValues",ce[ce.ExportStar=32768]="ExportStar",ce[ce.ImportStar=65536]="ImportStar",ce[ce.ImportDefault=131072]="ImportDefault",ce[ce.MakeTemplateObject=262144]="MakeTemplateObject",ce[ce.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",ce[ce.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",ce[ce.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",ce[ce.CreateBinding=4194304]="CreateBinding",ce[ce.FirstEmitHelper=1]="FirstEmitHelper",ce[ce.LastEmitHelper=4194304]="LastEmitHelper",ce[ce.ForOfIncludes=256]="ForOfIncludes",ce[ce.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",ce[ce.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",ce[ce.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",ce[ce.SpreadIncludes=1536]="SpreadIncludes",(le=e.EmitHint||(e.EmitHint={}))[le.SourceFile=0]="SourceFile",le[le.Expression=1]="Expression",le[le.IdentifierName=2]="IdentifierName",le[le.MappedTypeParameter=3]="MappedTypeParameter",le[le.Unspecified=4]="Unspecified",le[le.EmbeddedStatement=5]="EmbeddedStatement",le[le.JsxAttributeValue=6]="JsxAttributeValue",(ue=e.OuterExpressionKinds||(e.OuterExpressionKinds={}))[ue.Parentheses=1]="Parentheses",ue[ue.TypeAssertions=2]="TypeAssertions",ue[ue.NonNullAssertions=4]="NonNullAssertions",ue[ue.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",ue[ue.Assertions=6]="Assertions",ue[ue.All=15]="All",ue[ue.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",(de=e.LexicalEnvironmentFlags||(e.LexicalEnvironmentFlags={}))[de.None=0]="None",de[de.InParameters=1]="InParameters",de[de.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",(_e=e.BundleFileSectionKind||(e.BundleFileSectionKind={})).Prologue="prologue",_e.EmitHelpers="emitHelpers",_e.NoDefaultLib="no-default-lib",_e.Reference="reference",_e.Type="type",_e.TypeResolutionModeRequire="type-require",_e.TypeResolutionModeImport="type-import",_e.Lib="lib",_e.Prepend="prepend",_e.Text="text",_e.Internal="internal",(pe=e.ListFormat||(e.ListFormat={}))[pe.None=0]="None",pe[pe.SingleLine=0]="SingleLine",pe[pe.MultiLine=1]="MultiLine",pe[pe.PreserveLines=2]="PreserveLines",pe[pe.LinesMask=3]="LinesMask",pe[pe.NotDelimited=0]="NotDelimited",pe[pe.BarDelimited=4]="BarDelimited",pe[pe.AmpersandDelimited=8]="AmpersandDelimited",pe[pe.CommaDelimited=16]="CommaDelimited",pe[pe.AsteriskDelimited=32]="AsteriskDelimited",pe[pe.DelimitersMask=60]="DelimitersMask",pe[pe.AllowTrailingComma=64]="AllowTrailingComma",pe[pe.Indented=128]="Indented",pe[pe.SpaceBetweenBraces=256]="SpaceBetweenBraces",pe[pe.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",pe[pe.Braces=1024]="Braces",pe[pe.Parenthesis=2048]="Parenthesis",pe[pe.AngleBrackets=4096]="AngleBrackets",pe[pe.SquareBrackets=8192]="SquareBrackets",pe[pe.BracketsMask=15360]="BracketsMask",pe[pe.OptionalIfUndefined=16384]="OptionalIfUndefined",pe[pe.OptionalIfEmpty=32768]="OptionalIfEmpty",pe[pe.Optional=49152]="Optional",pe[pe.PreferNewLine=65536]="PreferNewLine",pe[pe.NoTrailingNewLine=131072]="NoTrailingNewLine",pe[pe.NoInterveningComments=262144]="NoInterveningComments",pe[pe.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",pe[pe.SingleElement=1048576]="SingleElement",pe[pe.SpaceAfterList=2097152]="SpaceAfterList",pe[pe.Modifiers=262656]="Modifiers",pe[pe.HeritageClauses=512]="HeritageClauses",pe[pe.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",pe[pe.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",pe[pe.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",pe[pe.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",pe[pe.UnionTypeConstituents=516]="UnionTypeConstituents",pe[pe.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",pe[pe.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",pe[pe.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",pe[pe.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",pe[pe.ImportClauseEntries=526226]="ImportClauseEntries",pe[pe.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",pe[pe.CommaListElements=528]="CommaListElements",pe[pe.CallExpressionArguments=2576]="CallExpressionArguments",pe[pe.NewExpressionArguments=18960]="NewExpressionArguments",pe[pe.TemplateExpressionSpans=262144]="TemplateExpressionSpans",pe[pe.SingleLineBlockStatements=768]="SingleLineBlockStatements",pe[pe.MultiLineBlockStatements=129]="MultiLineBlockStatements",pe[pe.VariableDeclarationList=528]="VariableDeclarationList",pe[pe.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",pe[pe.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",pe[pe.ClassHeritageClauses=0]="ClassHeritageClauses",pe[pe.ClassMembers=129]="ClassMembers",pe[pe.InterfaceMembers=129]="InterfaceMembers",pe[pe.EnumMembers=145]="EnumMembers",pe[pe.CaseBlockClauses=129]="CaseBlockClauses",pe[pe.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",pe[pe.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",pe[pe.JsxElementAttributes=262656]="JsxElementAttributes",pe[pe.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",pe[pe.HeritageClauseTypes=528]="HeritageClauseTypes",pe[pe.SourceFileStatements=131073]="SourceFileStatements",pe[pe.Decorators=2146305]="Decorators",pe[pe.TypeArguments=53776]="TypeArguments",pe[pe.TypeParameters=53776]="TypeParameters",pe[pe.Parameters=2576]="Parameters",pe[pe.IndexSignatureParameters=8848]="IndexSignatureParameters",pe[pe.JSDocComment=33]="JSDocComment",(fe=e.PragmaKindFlags||(e.PragmaKindFlags={}))[fe.None=0]="None",fe[fe.TripleSlashXML=1]="TripleSlashXML",fe[fe.SingleLine=2]="SingleLine",fe[fe.MultiLine=4]="MultiLine",fe[fe.All=7]="All",fe[fe.Default=7]="Default",e.commentPragmas={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}}}(c||(c={})),function(e){function t(e){for(var t=5381,r=0;r=4,m="linux"===process.platform||"darwin"===process.platform,g=l.platform(),y="win32"!==g&&"win64"!==g&&!M(__filename.replace(/\w/g,(function(e){var t=e.toUpperCase();return e===t?e.toLowerCase():t}))),v=null!==(n=s.realpathSync.native)&&void 0!==n?n:s.realpathSync,x=p&&("win32"===process.platform||"darwin"===process.platform),D=e.memoize((function(){return process.cwd()})),C=T({pollingWatchFile:f((function(e,t,n){var i;return s.watchFile(e,{persistent:!0,interval:n},a),{close:function(){return s.unwatchFile(e,a)}};function a(n,a){var o=0==+a.mtime||i===r.Deleted;if(0==+n.mtime){if(o)return;i=r.Deleted}else if(o)i=r.Created;else{if(+n.mtime==+a.mtime)return;i=r.Changed}t(e,i)}}),y),getModifiedTime:B,setTimeout:setTimeout,clearTimeout:clearTimeout,fsWatch:function(t,n,i,a,o,c){var l,u,_;m&&(u=t.substr(t.lastIndexOf(e.directorySeparator)),_=u.slice(e.directorySeparator.length));var p=O(t,n)?g():v();return{close:function(){p.close(),p=void 0}};function f(e){b("sysLog:: ".concat(t,":: Changing watcher to ").concat(e===g?"Present":"Missing","FileSystemEntryWatcher")),i("rename",""),p&&(p.close(),p=e())}function g(){if(void 0===l&&(l=x?{persistent:!0,recursive:!!a}:{persistent:!0}),d)return b("sysLog:: ".concat(t,":: Defaulting to fsWatchFile")),h();try{var e=s.watch(t,l,m?y:i);return e.on("error",(function(){return f(v)})),e}catch(e){return d||(d="ENOSPC"===e.code),b("sysLog:: ".concat(t,":: Changing to fsWatchFile")),h()}}function y(e,r){return"rename"!==e||r&&r!==_&&(-1===r.lastIndexOf(u)||r.lastIndexOf(u)!==r.length-u.length)||O(t,n)?i(e,r):f(v)}function h(){return E(t,S(i),o,c)}function v(){return E(t,(function(e,i){i===r.Created&&O(t,n)&&f(g)}),o,c)}},useCaseSensitiveFileNames:y,getCurrentDirectory:D,fileExists:M,fsSupportsRecursiveFsWatch:x,directoryExists:L,getAccessibleSortedChildDirectories:function(e){return I(e).directories},realpath:R,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,defaultWatchFileKind:function(){var e,t;return null===(t=(e=h).defaultWatchFileKind)||void 0===t?void 0:t.call(e)}}),E=C.watchFile,A=C.watchDirectory,N={args:process.argv.slice(2),newLine:l.EOL,useCaseSensitiveFileNames:y,write:function(e){process.stdout.write(e)},getWidthOfTerminal:function(){return process.stdout.columns},writeOutputIsTTY:function(){return process.stdout.isTTY},readFile:function(t,r){e.perfLogger.logStartReadFile(t);var n=function(e,t){var r;try{r=s.readFileSync(e)}catch(e){return}var n=r.length;if(n>=2&&254===r[0]&&255===r[1]){n&=-2;for(var i=0;i=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):n>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")}(t);return e.perfLogger.logStopReadFile(),n},writeFile:function(t,r,n){var i;e.perfLogger.logEvent("WriteFile: "+t),n&&(r="\ufeff"+r);try{i=s.openSync(t,"w"),s.writeSync(i,r,void 0,"utf8")}finally{void 0!==i&&s.closeSync(i)}},watchFile:E,watchDirectory:A,resolvePath:function(e){return c.resolve(e)},fileExists:M,directoryExists:L,createDirectory:function(e){if(!N.directoryExists(e))try{s.mkdirSync(e)}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:function(){return __filename},getCurrentDirectory:D,getDirectories:function(e){return I(e).directories.slice()},getEnvironmentVariable:function(e){return process.env[e]||""},readDirectory:function(t,r,n,i,a){return e.matchFiles(t,r,n,i,y,process.cwd(),a,I,R)},getModifiedTime:B,setModifiedTime:function(e,t){try{s.utimesSync(e,t,t)}catch(e){return}},deleteFile:function(e){try{return s.unlinkSync(e)}catch(e){return}},createHash:i?J:t,createSHA256Hash:i?J:void 0,getMemoryUsage:function(){return ae.gc&&ae.gc(),process.memoryUsage().heapUsed},getFileSize:function(e){try{var t=w(e);if(null==t?void 0:t.isFile())return t.size}catch(e){}return 0},exit:function(e){F((function(){return process.exit(e)}))},enableCPUProfiler:function(e,t){if(a)return t(),!1;var r=ue;if(!r||!r.Session)return t(),!1;var n=new r.Session;return n.connect(),n.post("Profiler.enable",(function(){n.post("Profiler.start",(function(){a=n,u=e,t()}))})),!0},disableCPUProfiler:F,cpuProfilingEnabled:function(){return!!a||e.contains(process.execArgv,"--cpu-prof")||e.contains(process.execArgv,"--prof")},realpath:R,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||e.some(process.execArgv,(function(e){return/^--(inspect|debug)(-brk)?(=\d+)?$/i.test(e)})),tryEnableSourceMapsForHost:function(){},setTimeout:setTimeout,clearTimeout:clearTimeout,clearScreen:function(){process.stdout.write("c")},setBlocking:function(){process.stdout&&process.stdout._handle&&process.stdout._handle.setBlocking&&process.stdout._handle.setBlocking(!0)},bufferFrom:P,base64decode:function(e){return P(e,"base64").toString("utf8")},base64encode:function(e){return P(e).toString("base64")},require:function(t,r){try{var n=e.resolveJSModule(r,t,N);return{module:se(n),modulePath:n,error:void 0}}catch(e){return{module:void 0,modulePath:void 0,error:e}}}};return N;function w(e){return s.statSync(e,{throwIfNoEntry:!1})}function F(t){if(a&&"stopping"!==a){var r=a;return a.post("Profiler.stop",(function(n,i){var l,d=i.profile;if(!n){try{(null===(l=w(u))||void 0===l?void 0:l.isDirectory())&&(u=c.join(u,"".concat((new Date).toISOString().replace(/:/g,"-"),"+P").concat(process.pid,".cpuprofile")))}catch(e){}try{s.mkdirSync(c.dirname(u),{recursive:!0})}catch(e){}s.writeFileSync(u,JSON.stringify(function(t){for(var r=0,n=new e.Map,i=e.normalizeSlashes(__dirname),a="file://".concat(1===e.getRootLength(i)?"":"/").concat(i),s=0,c=t.nodes;s0}function a(e){return 0!==u(e)}function o(e){return/^\.\.?($|[\\/])/.test(e)}function s(t,r){return t.length>r.length&&e.endsWith(t,r)}function c(e){return e.length>0&&n(e.charCodeAt(e.length-1))}function l(e){return e>=97&&e<=122||e>=65&&e<=90}function u(t){if(!t)return 0;var r=t.charCodeAt(0);if(47===r||92===r){if(t.charCodeAt(1)!==r)return 1;var n=t.indexOf(47===r?e.directorySeparator:e.altDirectorySeparator,2);return n<0?t.length:n+1}if(l(r)&&58===t.charCodeAt(1)){var i=t.charCodeAt(2);if(47===i||92===i)return 3;if(2===t.length)return 2}var a=t.indexOf("://");if(-1!==a){var o=a+"://".length,s=t.indexOf(e.directorySeparator,o);if(-1!==s){var c=t.slice(0,a),u=t.slice(o,s);if("file"===c&&(""===u||"localhost"===u)&&l(t.charCodeAt(s+1))){var d=function(e,t){var r=e.charCodeAt(t);if(58===r)return t+1;if(37===r&&51===e.charCodeAt(t+1)){var n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return-1}(t,s+2);if(-1!==d){if(47===t.charCodeAt(d))return~(d+1);if(d===t.length)return~d}}return~(s+1)}return~t.length}return 0}function d(e){var t=u(e);return t<0?~t:t}function _(t){var r=d(t=h(t));return r===t.length?t:(t=T(t)).slice(0,Math.max(r,t.lastIndexOf(e.directorySeparator)))}function p(t,r,n){if(d(t=h(t))===t.length)return"";var i=(t=T(t)).slice(Math.max(d(t),t.lastIndexOf(e.directorySeparator)+1)),a=void 0!==r&&void 0!==n?m(i,r,n):void 0;return a?i.slice(0,i.length-a.length):i}function f(t,r,n){if(e.startsWith(r,".")||(r="."+r),t.length>=r.length&&46===t.charCodeAt(t.length-r.length)){var i=t.slice(t.length-r.length);if(n(i,r))return i}}function m(t,r,n){if(r)return function(e,t,r){if("string"==typeof t)return f(e,t,r)||"";for(var n=0,i=t;n=0?i.substring(a):""}function g(t,n){return void 0===n&&(n=""),function(t,n){var i=t.substring(0,n),a=t.substring(n).split(e.directorySeparator);return a.length&&!e.lastOrUndefined(a)&&a.pop(),r([i],a,!0)}(t=b(n,t),d(t))}function y(t){return 0===t.length?"":(t[0]&&E(t[0]))+t.slice(1).join(e.directorySeparator)}function h(r){var n=r.indexOf("\\");return-1===n?r:(t.lastIndex=n,r.replace(t,e.directorySeparator))}function v(t){if(!e.some(t))return[];for(var r=[t[0]],n=1;n1){if(".."!==r[r.length-1]){r.pop();continue}}else if(r[0])continue;r.push(i)}}return r}function b(e){for(var t=[],r=1;r0&&t===e.length},e.pathIsAbsolute=a,e.pathIsRelative=o,e.pathIsBareSpecifier=function(e){return!a(e)&&!o(e)},e.hasExtension=function(t){return e.stringContains(p(t),".")},e.fileExtensionIs=s,e.fileExtensionIsOneOf=function(e,t){for(var r=0,n=t;r0==d(r)>0,"Paths must either both be absolute or both be relative");var i="function"==typeof n?n:e.identity;return y(w(t,r,"boolean"==typeof n&&n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,i))}function P(t,r,n,a,o){var s=w(x(n,t),x(n,r),e.equateStringsCaseSensitive,a),c=s[0];if(o&&i(c)){var l=c.charAt(0)===e.directorySeparator?"file://":"file:///";s[0]=l+c}return y(s)}e.comparePathsCaseSensitive=function(t,r){return N(t,r,e.compareStringsCaseSensitive)},e.comparePathsCaseInsensitive=function(t,r){return N(t,r,e.compareStringsCaseInsensitive)},e.comparePaths=function(t,r,n,i){return"string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),N(t,r,e.getStringComparer(i))},e.containsPath=function(t,r,n,i){if("string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),void 0===t||void 0===r)return!1;if(t===r)return!0;var a=v(g(t)),o=v(g(r));if(o.length type. Did you mean to write 'Promise<{0}>'?"),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:t(1066,e.DiagnosticCategory.Error,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:t(1068,e.DiagnosticCategory.Error,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:t(1069,e.DiagnosticCategory.Error,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:t(1070,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:t(1071,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:t(1079,e.DiagnosticCategory.Error,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:t(1084,e.DiagnosticCategory.Error,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:t(1085,e.DiagnosticCategory.Error,"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085","Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."),_0_modifier_cannot_appear_on_a_constructor_declaration:t(1089,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:t(1090,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:t(1091,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:t(1092,e.DiagnosticCategory.Error,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:t(1093,e.DiagnosticCategory.Error,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:t(1094,e.DiagnosticCategory.Error,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:t(1095,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:t(1096,e.DiagnosticCategory.Error,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:t(1097,e.DiagnosticCategory.Error,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:t(1098,e.DiagnosticCategory.Error,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:t(1099,e.DiagnosticCategory.Error,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:t(1100,e.DiagnosticCategory.Error,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:t(1101,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:t(1102,e.DiagnosticCategory.Error,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1103,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:t(1104,e.DiagnosticCategory.Error,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:t(1105,e.DiagnosticCategory.Error,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:t(1106,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:t(1107,e.DiagnosticCategory.Error,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:t(1108,e.DiagnosticCategory.Error,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:t(1109,e.DiagnosticCategory.Error,"Expression_expected_1109","Expression expected."),Type_expected:t(1110,e.DiagnosticCategory.Error,"Type_expected_1110","Type expected."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:t(1113,e.DiagnosticCategory.Error,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:t(1114,e.DiagnosticCategory.Error,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:t(1115,e.DiagnosticCategory.Error,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:t(1116,e.DiagnosticCategory.Error,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:t(1117,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:t(1118,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:t(1119,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:t(1120,e.DiagnosticCategory.Error,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_in_strict_mode:t(1121,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_strict_mode_1121","Octal literals are not allowed in strict mode."),Variable_declaration_list_cannot_be_empty:t(1123,e.DiagnosticCategory.Error,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:t(1124,e.DiagnosticCategory.Error,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:t(1125,e.DiagnosticCategory.Error,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:t(1126,e.DiagnosticCategory.Error,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:t(1127,e.DiagnosticCategory.Error,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:t(1128,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:t(1129,e.DiagnosticCategory.Error,"Statement_expected_1129","Statement expected."),case_or_default_expected:t(1130,e.DiagnosticCategory.Error,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:t(1131,e.DiagnosticCategory.Error,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:t(1132,e.DiagnosticCategory.Error,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:t(1134,e.DiagnosticCategory.Error,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:t(1135,e.DiagnosticCategory.Error,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:t(1136,e.DiagnosticCategory.Error,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:t(1137,e.DiagnosticCategory.Error,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:t(1138,e.DiagnosticCategory.Error,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:t(1139,e.DiagnosticCategory.Error,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:t(1140,e.DiagnosticCategory.Error,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:t(1141,e.DiagnosticCategory.Error,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:t(1142,e.DiagnosticCategory.Error,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:t(1144,e.DiagnosticCategory.Error,"or_expected_1144","'{' or ';' expected."),Declaration_expected:t(1146,e.DiagnosticCategory.Error,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:t(1147,e.DiagnosticCategory.Error,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:t(1148,e.DiagnosticCategory.Error,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:t(1149,e.DiagnosticCategory.Error,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),const_declarations_must_be_initialized:t(1155,e.DiagnosticCategory.Error,"const_declarations_must_be_initialized_1155","'const' declarations must be initialized."),const_declarations_can_only_be_declared_inside_a_block:t(1156,e.DiagnosticCategory.Error,"const_declarations_can_only_be_declared_inside_a_block_1156","'const' declarations can only be declared inside a block."),let_declarations_can_only_be_declared_inside_a_block:t(1157,e.DiagnosticCategory.Error,"let_declarations_can_only_be_declared_inside_a_block_1157","'let' declarations can only be declared inside a block."),Unterminated_template_literal:t(1160,e.DiagnosticCategory.Error,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:t(1161,e.DiagnosticCategory.Error,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:t(1162,e.DiagnosticCategory.Error,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:t(1163,e.DiagnosticCategory.Error,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:t(1164,e.DiagnosticCategory.Error,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1165,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:t(1166,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1168,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1169,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1170,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:t(1171,e.DiagnosticCategory.Error,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:t(1172,e.DiagnosticCategory.Error,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:t(1173,e.DiagnosticCategory.Error,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:t(1174,e.DiagnosticCategory.Error,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:t(1175,e.DiagnosticCategory.Error,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:t(1176,e.DiagnosticCategory.Error,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:t(1177,e.DiagnosticCategory.Error,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:t(1178,e.DiagnosticCategory.Error,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:t(1179,e.DiagnosticCategory.Error,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:t(1180,e.DiagnosticCategory.Error,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:t(1181,e.DiagnosticCategory.Error,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:t(1182,e.DiagnosticCategory.Error,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:t(1183,e.DiagnosticCategory.Error,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:t(1184,e.DiagnosticCategory.Error,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:t(1185,e.DiagnosticCategory.Error,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:t(1186,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:t(1187,e.DiagnosticCategory.Error,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:t(1188,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:t(1189,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:t(1190,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:t(1191,e.DiagnosticCategory.Error,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:t(1192,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:t(1193,e.DiagnosticCategory.Error,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:t(1194,e.DiagnosticCategory.Error,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:t(1195,e.DiagnosticCategory.Error,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:t(1196,e.DiagnosticCategory.Error,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:t(1197,e.DiagnosticCategory.Error,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:t(1198,e.DiagnosticCategory.Error,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:t(1199,e.DiagnosticCategory.Error,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:t(1200,e.DiagnosticCategory.Error,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:t(1202,e.DiagnosticCategory.Error,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:t(1203,e.DiagnosticCategory.Error,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:t(1205,e.DiagnosticCategory.Error,"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205","Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."),Decorators_are_not_valid_here:t(1206,e.DiagnosticCategory.Error,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:t(1207,e.DiagnosticCategory.Error,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module:t(1208,e.DiagnosticCategory.Error,"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208","'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t(1210,e.DiagnosticCategory.Error,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:t(1211,e.DiagnosticCategory.Error,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:t(1212,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t(1213,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:t(1214,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:t(1215,e.DiagnosticCategory.Error,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:t(1216,e.DiagnosticCategory.Error,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:t(1218,e.DiagnosticCategory.Error,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning:t(1219,e.DiagnosticCategory.Error,"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219","Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),Generators_are_not_allowed_in_an_ambient_context:t(1221,e.DiagnosticCategory.Error,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:t(1222,e.DiagnosticCategory.Error,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:t(1223,e.DiagnosticCategory.Error,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:t(1224,e.DiagnosticCategory.Error,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:t(1225,e.DiagnosticCategory.Error,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:t(1226,e.DiagnosticCategory.Error,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:t(1227,e.DiagnosticCategory.Error,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:t(1228,e.DiagnosticCategory.Error,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:t(1229,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:t(1230,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1231,e.DiagnosticCategory.Error,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1232,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1233,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:t(1234,e.DiagnosticCategory.Error,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:t(1235,e.DiagnosticCategory.Error,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:t(1236,e.DiagnosticCategory.Error,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:t(1237,e.DiagnosticCategory.Error,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:t(1238,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:t(1239,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:t(1240,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:t(1241,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:t(1242,e.DiagnosticCategory.Error,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:t(1243,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:t(1244,e.DiagnosticCategory.Error,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:t(1245,e.DiagnosticCategory.Error,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:t(1246,e.DiagnosticCategory.Error,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:t(1247,e.DiagnosticCategory.Error,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:t(1248,e.DiagnosticCategory.Error,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:t(1249,e.DiagnosticCategory.Error,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:t(1250,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t(1251,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:t(1252,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:t(1254,e.DiagnosticCategory.Error,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:t(1255,e.DiagnosticCategory.Error,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:t(1257,e.DiagnosticCategory.Error,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1258,e.DiagnosticCategory.Error,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:t(1259,e.DiagnosticCategory.Error,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:t(1260,e.DiagnosticCategory.Error,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:t(1261,e.DiagnosticCategory.Error,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:t(1262,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t(1263,e.DiagnosticCategory.Error,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:t(1264,e.DiagnosticCategory.Error,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:t(1265,e.DiagnosticCategory.Error,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:t(1266,e.DiagnosticCategory.Error,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:t(1267,e.DiagnosticCategory.Error,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:t(1268,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided:t(1269,e.DiagnosticCategory.Error,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269","Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),Decorator_function_return_type_0_is_not_assignable_to_type_1:t(1270,e.DiagnosticCategory.Error,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:t(1271,e.DiagnosticCategory.Error,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:t(1272,e.DiagnosticCategory.Error,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:t(1273,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:t(1274,e.DiagnosticCategory.Error,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),with_statements_are_not_allowed_in_an_async_function_block:t(1300,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1308,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:t(1309,e.DiagnosticCategory.Error,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:t(1312,e.DiagnosticCategory.Error,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:t(1313,e.DiagnosticCategory.Error,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:t(1314,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:t(1315,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:t(1316,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:t(1317,e.DiagnosticCategory.Error,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:t(1318,e.DiagnosticCategory.Error,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:t(1319,e.DiagnosticCategory.Error,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1320,e.DiagnosticCategory.Error,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1321,e.DiagnosticCategory.Error,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1322,e.DiagnosticCategory.Error,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:t(1323,e.DiagnosticCategory.Error,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext:t(1324,e.DiagnosticCategory.Error,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),Argument_of_dynamic_import_cannot_be_spread_element:t(1325,e.DiagnosticCategory.Error,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:t(1326,e.DiagnosticCategory.Error,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:t(1327,e.DiagnosticCategory.Error,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:t(1328,e.DiagnosticCategory.Error,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:t(1329,e.DiagnosticCategory.Error,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:t(1330,e.DiagnosticCategory.Error,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:t(1331,e.DiagnosticCategory.Error,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:t(1332,e.DiagnosticCategory.Error,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:t(1333,e.DiagnosticCategory.Error,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:t(1334,e.DiagnosticCategory.Error,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:t(1335,e.DiagnosticCategory.Error,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:t(1337,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:t(1338,e.DiagnosticCategory.Error,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:t(1339,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:t(1340,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Type_arguments_cannot_be_used_here:t(1342,e.DiagnosticCategory.Error,"Type_arguments_cannot_be_used_here_1342","Type arguments cannot be used here."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:t(1343,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:t(1344,e.DiagnosticCategory.Error,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:t(1345,e.DiagnosticCategory.Error,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:t(1346,e.DiagnosticCategory.Error,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:t(1347,e.DiagnosticCategory.Error,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:t(1348,e.DiagnosticCategory.Error,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:t(1349,e.DiagnosticCategory.Error,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:t(1350,e.DiagnosticCategory.Message,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:t(1351,e.DiagnosticCategory.Error,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:t(1352,e.DiagnosticCategory.Error,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:t(1353,e.DiagnosticCategory.Error,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:t(1354,e.DiagnosticCategory.Error,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:t(1355,e.DiagnosticCategory.Error,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:t(1356,e.DiagnosticCategory.Error,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:t(1357,e.DiagnosticCategory.Error,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:t(1358,e.DiagnosticCategory.Error,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:t(1359,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:t(1361,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:t(1362,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:t(1363,e.DiagnosticCategory.Error,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:t(1364,e.DiagnosticCategory.Message,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:t(1365,e.DiagnosticCategory.Message,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:t(1366,e.DiagnosticCategory.Message,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:t(1367,e.DiagnosticCategory.Message,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Did_you_mean_0:t(1369,e.DiagnosticCategory.Message,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:t(1371,e.DiagnosticCategory.Error,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),Convert_to_type_only_import:t(1373,e.DiagnosticCategory.Message,"Convert_to_type_only_import_1373","Convert to type-only import"),Convert_all_imports_not_used_as_a_value_to_type_only_imports:t(1374,e.DiagnosticCategory.Message,"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374","Convert all imports not used as a value to type-only imports"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1375,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:t(1376,e.DiagnosticCategory.Message,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:t(1377,e.DiagnosticCategory.Message,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1378,e.DiagnosticCategory.Error,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:t(1379,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:t(1380,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:t(1381,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:t(1382,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Only_named_exports_may_use_export_type:t(1383,e.DiagnosticCategory.Error,"Only_named_exports_may_use_export_type_1383","Only named exports may use 'export type'."),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1385,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1386,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1387,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1388,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:t(1389,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:t(1390,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:t(1392,e.DiagnosticCategory.Error,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:t(1393,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:t(1394,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:t(1395,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:t(1396,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:t(1397,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:t(1398,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:t(1399,e.DiagnosticCategory.Message,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:t(1400,e.DiagnosticCategory.Message,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:t(1401,e.DiagnosticCategory.Message,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:t(1402,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:t(1403,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:t(1404,e.DiagnosticCategory.Message,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:t(1405,e.DiagnosticCategory.Message,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:t(1406,e.DiagnosticCategory.Message,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:t(1407,e.DiagnosticCategory.Message,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:t(1408,e.DiagnosticCategory.Message,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:t(1409,e.DiagnosticCategory.Message,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:t(1410,e.DiagnosticCategory.Message,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:t(1411,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:t(1412,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:t(1413,e.DiagnosticCategory.Message,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:t(1414,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:t(1415,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:t(1416,e.DiagnosticCategory.Message,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:t(1417,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:t(1418,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:t(1419,e.DiagnosticCategory.Message,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:t(1420,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:t(1421,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:t(1422,e.DiagnosticCategory.Message,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:t(1423,e.DiagnosticCategory.Message,"File_is_library_specified_here_1423","File is library specified here."),Default_library:t(1424,e.DiagnosticCategory.Message,"Default_library_1424","Default library"),Default_library_for_target_0:t(1425,e.DiagnosticCategory.Message,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:t(1426,e.DiagnosticCategory.Message,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:t(1427,e.DiagnosticCategory.Message,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:t(1428,e.DiagnosticCategory.Message,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:t(1429,e.DiagnosticCategory.Message,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:t(1430,e.DiagnosticCategory.Message,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1431,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1432,e.DiagnosticCategory.Error,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Decorators_may_not_be_applied_to_this_parameters:t(1433,e.DiagnosticCategory.Error,"Decorators_may_not_be_applied_to_this_parameters_1433","Decorators may not be applied to 'this' parameters."),Unexpected_keyword_or_identifier:t(1434,e.DiagnosticCategory.Error,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:t(1435,e.DiagnosticCategory.Error,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:t(1436,e.DiagnosticCategory.Error,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:t(1437,e.DiagnosticCategory.Error,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:t(1438,e.DiagnosticCategory.Error,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:t(1439,e.DiagnosticCategory.Error,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:t(1440,e.DiagnosticCategory.Error,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:t(1441,e.DiagnosticCategory.Error,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:t(1442,e.DiagnosticCategory.Error,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:t(1443,e.DiagnosticCategory.Error,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1444,e.DiagnosticCategory.Error,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1446,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled:t(1448,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:t(1449,e.DiagnosticCategory.Message,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments:t(1450,e.DiagnosticCategory.Message,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional assertion as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:t(1451,e.DiagnosticCategory.Error,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext:t(1452,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452","'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),resolution_mode_should_be_either_require_or_import:t(1453,e.DiagnosticCategory.Error,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:t(1454,e.DiagnosticCategory.Error,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:t(1455,e.DiagnosticCategory.Error,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:t(1456,e.DiagnosticCategory.Error,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:t(1470,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead:t(1471,e.DiagnosticCategory.Error,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),catch_or_finally_expected:t(1472,e.DiagnosticCategory.Error,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1473,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1474,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:t(1475,e.DiagnosticCategory.Message,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:t(1476,e.DiagnosticCategory.Message,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),The_types_of_0_are_incompatible_between_these_types:t(2200,e.DiagnosticCategory.Error,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:t(2201,e.DiagnosticCategory.Error,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:t(2202,e.DiagnosticCategory.Error,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:t(2203,e.DiagnosticCategory.Error,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2204,e.DiagnosticCategory.Error,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2205,e.DiagnosticCategory.Error,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:t(2206,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:t(2207,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2209,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2210,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Duplicate_identifier_0:t(2300,e.DiagnosticCategory.Error,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2301,e.DiagnosticCategory.Error,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:t(2302,e.DiagnosticCategory.Error,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:t(2303,e.DiagnosticCategory.Error,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:t(2304,e.DiagnosticCategory.Error,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:t(2305,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:t(2306,e.DiagnosticCategory.Error,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:t(2307,e.DiagnosticCategory.Error,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:t(2308,e.DiagnosticCategory.Error,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:t(2309,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:t(2310,e.DiagnosticCategory.Error,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:t(2311,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2312,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:t(2313,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:t(2314,e.DiagnosticCategory.Error,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:t(2315,e.DiagnosticCategory.Error,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:t(2316,e.DiagnosticCategory.Error,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:t(2317,e.DiagnosticCategory.Error,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:t(2318,e.DiagnosticCategory.Error,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:t(2319,e.DiagnosticCategory.Error,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:t(2320,e.DiagnosticCategory.Error,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:t(2321,e.DiagnosticCategory.Error,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:t(2322,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:t(2323,e.DiagnosticCategory.Error,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:t(2324,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:t(2325,e.DiagnosticCategory.Error,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:t(2326,e.DiagnosticCategory.Error,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:t(2327,e.DiagnosticCategory.Error,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:t(2328,e.DiagnosticCategory.Error,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:t(2329,e.DiagnosticCategory.Error,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:t(2330,e.DiagnosticCategory.Error,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:t(2331,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:t(2332,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:t(2333,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:t(2334,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:t(2335,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:t(2336,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:t(2337,e.DiagnosticCategory.Error,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:t(2338,e.DiagnosticCategory.Error,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:t(2339,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:t(2340,e.DiagnosticCategory.Error,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:t(2341,e.DiagnosticCategory.Error,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:t(2343,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:t(2344,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:t(2345,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Call_target_does_not_contain_any_signatures:t(2346,e.DiagnosticCategory.Error,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:t(2347,e.DiagnosticCategory.Error,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:t(2348,e.DiagnosticCategory.Error,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:t(2349,e.DiagnosticCategory.Error,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:t(2350,e.DiagnosticCategory.Error,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:t(2351,e.DiagnosticCategory.Error,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:t(2352,e.DiagnosticCategory.Error,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:t(2353,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:t(2354,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:t(2355,e.DiagnosticCategory.Error,"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'void' nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:t(2356,e.DiagnosticCategory.Error,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:t(2357,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:t(2358,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:t(2359,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359","The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol:t(2360,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360","The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),The_right_hand_side_of_an_in_expression_must_not_be_a_primitive:t(2361,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361","The right-hand side of an 'in' expression must not be a primitive."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2362,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2363,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:t(2364,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:t(2365,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:t(2366,e.DiagnosticCategory.Error,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap:t(2367,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367","This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap."),Type_parameter_name_cannot_be_0:t(2368,e.DiagnosticCategory.Error,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:t(2369,e.DiagnosticCategory.Error,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:t(2370,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:t(2371,e.DiagnosticCategory.Error,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:t(2372,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:t(2373,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:t(2374,e.DiagnosticCategory.Error,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2375,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2376,e.DiagnosticCategory.Error,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:t(2377,e.DiagnosticCategory.Error,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:t(2378,e.DiagnosticCategory.Error,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2379,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type:t(2380,e.DiagnosticCategory.Error,"The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380","The return type of a 'get' accessor must be assignable to its 'set' accessor type"),Overload_signatures_must_all_be_exported_or_non_exported:t(2383,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:t(2384,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:t(2385,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:t(2386,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:t(2387,e.DiagnosticCategory.Error,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:t(2388,e.DiagnosticCategory.Error,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:t(2389,e.DiagnosticCategory.Error,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:t(2390,e.DiagnosticCategory.Error,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:t(2391,e.DiagnosticCategory.Error,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:t(2392,e.DiagnosticCategory.Error,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:t(2393,e.DiagnosticCategory.Error,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:t(2394,e.DiagnosticCategory.Error,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:t(2395,e.DiagnosticCategory.Error,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:t(2396,e.DiagnosticCategory.Error,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:t(2397,e.DiagnosticCategory.Error,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:t(2398,e.DiagnosticCategory.Error,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:t(2399,e.DiagnosticCategory.Error,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:t(2400,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2401,e.DiagnosticCategory.Error,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:t(2402,e.DiagnosticCategory.Error,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:t(2403,e.DiagnosticCategory.Error,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:t(2404,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:t(2405,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:t(2406,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:t(2407,e.DiagnosticCategory.Error,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:t(2408,e.DiagnosticCategory.Error,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:t(2409,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:t(2410,e.DiagnosticCategory.Error,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:t(2412,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:t(2411,e.DiagnosticCategory.Error,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:t(2413,e.DiagnosticCategory.Error,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:t(2414,e.DiagnosticCategory.Error,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:t(2415,e.DiagnosticCategory.Error,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:t(2416,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:t(2417,e.DiagnosticCategory.Error,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:t(2418,e.DiagnosticCategory.Error,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:t(2419,e.DiagnosticCategory.Error,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:t(2420,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2422,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:t(2423,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:t(2425,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:t(2426,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:t(2427,e.DiagnosticCategory.Error,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:t(2428,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:t(2430,e.DiagnosticCategory.Error,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:t(2431,e.DiagnosticCategory.Error,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:t(2432,e.DiagnosticCategory.Error,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:t(2433,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:t(2434,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:t(2435,e.DiagnosticCategory.Error,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:t(2436,e.DiagnosticCategory.Error,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:t(2437,e.DiagnosticCategory.Error,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:t(2438,e.DiagnosticCategory.Error,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:t(2439,e.DiagnosticCategory.Error,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:t(2440,e.DiagnosticCategory.Error,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:t(2441,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:t(2442,e.DiagnosticCategory.Error,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:t(2443,e.DiagnosticCategory.Error,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:t(2444,e.DiagnosticCategory.Error,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:t(2445,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:t(2446,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:t(2447,e.DiagnosticCategory.Error,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:t(2448,e.DiagnosticCategory.Error,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:t(2449,e.DiagnosticCategory.Error,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:t(2450,e.DiagnosticCategory.Error,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:t(2451,e.DiagnosticCategory.Error,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:t(2452,e.DiagnosticCategory.Error,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:t(2454,e.DiagnosticCategory.Error,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:t(2456,e.DiagnosticCategory.Error,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:t(2457,e.DiagnosticCategory.Error,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:t(2458,e.DiagnosticCategory.Error,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:t(2459,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:t(2460,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:t(2461,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:t(2462,e.DiagnosticCategory.Error,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:t(2463,e.DiagnosticCategory.Error,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:t(2464,e.DiagnosticCategory.Error,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:t(2465,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:t(2466,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:t(2467,e.DiagnosticCategory.Error,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:t(2468,e.DiagnosticCategory.Error,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:t(2469,e.DiagnosticCategory.Error,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:t(2472,e.DiagnosticCategory.Error,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:t(2473,e.DiagnosticCategory.Error,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values:t(2474,e.DiagnosticCategory.Error,"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474","const enum member initializers can only contain literal values and other computed enum values."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:t(2475,e.DiagnosticCategory.Error,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:t(2476,e.DiagnosticCategory.Error,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:t(2477,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:t(2478,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:t(2480,e.DiagnosticCategory.Error,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:t(2481,e.DiagnosticCategory.Error,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:t(2483,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:t(2484,e.DiagnosticCategory.Error,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:t(2487,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2488,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:t(2489,e.DiagnosticCategory.Error,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:t(2490,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:t(2491,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:t(2492,e.DiagnosticCategory.Error,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:t(2493,e.DiagnosticCategory.Error,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:t(2494,e.DiagnosticCategory.Error,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:t(2495,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:t(2496,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:t(2497,e.DiagnosticCategory.Error,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:t(2498,e.DiagnosticCategory.Error,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2499,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2500,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:t(2501,e.DiagnosticCategory.Error,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:t(2502,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:t(2503,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:t(2504,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:t(2505,e.DiagnosticCategory.Error,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:t(2506,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:t(2507,e.DiagnosticCategory.Error,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:t(2508,e.DiagnosticCategory.Error,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2509,e.DiagnosticCategory.Error,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:t(2510,e.DiagnosticCategory.Error,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:t(2511,e.DiagnosticCategory.Error,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:t(2512,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:t(2513,e.DiagnosticCategory.Error,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:t(2515,e.DiagnosticCategory.Error,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:t(2516,e.DiagnosticCategory.Error,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:t(2517,e.DiagnosticCategory.Error,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:t(2518,e.DiagnosticCategory.Error,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:t(2519,e.DiagnosticCategory.Error,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:t(2520,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:t(2522,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:t(2523,e.DiagnosticCategory.Error,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:t(2524,e.DiagnosticCategory.Error,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:t(2525,e.DiagnosticCategory.Error,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:t(2526,e.DiagnosticCategory.Error,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:t(2527,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:t(2528,e.DiagnosticCategory.Error,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:t(2529,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:t(2530,e.DiagnosticCategory.Error,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:t(2531,e.DiagnosticCategory.Error,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:t(2532,e.DiagnosticCategory.Error,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:t(2533,e.DiagnosticCategory.Error,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:t(2534,e.DiagnosticCategory.Error,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Enum_type_0_has_members_with_initializers_that_are_not_literals:t(2535,e.DiagnosticCategory.Error,"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535","Enum type '{0}' has members with initializers that are not literals."),Type_0_cannot_be_used_to_index_type_1:t(2536,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:t(2537,e.DiagnosticCategory.Error,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:t(2538,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:t(2539,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:t(2540,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:t(2542,e.DiagnosticCategory.Error,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:t(2543,e.DiagnosticCategory.Error,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:t(2544,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:t(2545,e.DiagnosticCategory.Error,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:t(2547,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2548,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2549,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:t(2550,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:t(2551,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:t(2552,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:t(2553,e.DiagnosticCategory.Error,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:t(2554,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:t(2555,e.DiagnosticCategory.Error,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:t(2556,e.DiagnosticCategory.Error,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:t(2558,e.DiagnosticCategory.Error,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:t(2559,e.DiagnosticCategory.Error,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:t(2560,e.DiagnosticCategory.Error,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:t(2561,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:t(2562,e.DiagnosticCategory.Error,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:t(2563,e.DiagnosticCategory.Error,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:t(2564,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:t(2565,e.DiagnosticCategory.Error,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:t(2566,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:t(2567,e.DiagnosticCategory.Error,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:t(2568,e.DiagnosticCategory.Error,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:t(2570,e.DiagnosticCategory.Error,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:t(2571,e.DiagnosticCategory.Error,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:t(2574,e.DiagnosticCategory.Error,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:t(2575,e.DiagnosticCategory.Error,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:t(2576,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:t(2577,e.DiagnosticCategory.Error,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:t(2578,e.DiagnosticCategory.Error,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:t(2580,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:t(2581,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:t(2582,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:t(2583,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:t(2584,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:t(2585,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:t(2588,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:t(2589,e.DiagnosticCategory.Error,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:t(2590,e.DiagnosticCategory.Error,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:t(2591,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:t(2592,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:t(2593,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:t(2594,e.DiagnosticCategory.Error,"This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594","This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:t(2595,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2596,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:t(2597,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2598,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:t(2602,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:t(2603,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:t(2604,e.DiagnosticCategory.Error,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:t(2606,e.DiagnosticCategory.Error,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:t(2607,e.DiagnosticCategory.Error,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:t(2608,e.DiagnosticCategory.Error,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:t(2609,e.DiagnosticCategory.Error,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:t(2610,e.DiagnosticCategory.Error,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:t(2611,e.DiagnosticCategory.Error,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:t(2612,e.DiagnosticCategory.Error,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:t(2613,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:t(2614,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:t(2615,e.DiagnosticCategory.Error,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:t(2616,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2617,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:t(2618,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:t(2619,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:t(2620,e.DiagnosticCategory.Error,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:t(2621,e.DiagnosticCategory.Error,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:t(2623,e.DiagnosticCategory.Error,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:t(2624,e.DiagnosticCategory.Error,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:t(2625,e.DiagnosticCategory.Error,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:t(2626,e.DiagnosticCategory.Error,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:t(2627,e.DiagnosticCategory.Error,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:t(2628,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:t(2629,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:t(2630,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:t(2631,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:t(2632,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:t(2633,e.DiagnosticCategory.Error,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:t(2634,e.DiagnosticCategory.Error,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:t(2635,e.DiagnosticCategory.Error,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:t(2636,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:t(2637,e.DiagnosticCategory.Error,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:t(2649,e.DiagnosticCategory.Error,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:t(2651,e.DiagnosticCategory.Error,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:t(2652,e.DiagnosticCategory.Error,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:t(2653,e.DiagnosticCategory.Error,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:t(2657,e.DiagnosticCategory.Error,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:t(2658,e.DiagnosticCategory.Error,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:t(2659,e.DiagnosticCategory.Error,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:t(2660,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:t(2661,e.DiagnosticCategory.Error,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:t(2662,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:t(2663,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:t(2664,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:t(2665,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:t(2666,e.DiagnosticCategory.Error,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:t(2667,e.DiagnosticCategory.Error,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:t(2668,e.DiagnosticCategory.Error,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:t(2669,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:t(2670,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:t(2671,e.DiagnosticCategory.Error,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:t(2672,e.DiagnosticCategory.Error,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:t(2673,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:t(2674,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:t(2675,e.DiagnosticCategory.Error,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:t(2676,e.DiagnosticCategory.Error,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:t(2677,e.DiagnosticCategory.Error,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:t(2678,e.DiagnosticCategory.Error,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:t(2679,e.DiagnosticCategory.Error,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:t(2680,e.DiagnosticCategory.Error,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:t(2681,e.DiagnosticCategory.Error,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:t(2683,e.DiagnosticCategory.Error,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:t(2684,e.DiagnosticCategory.Error,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:t(2685,e.DiagnosticCategory.Error,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:t(2686,e.DiagnosticCategory.Error,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:t(2687,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:t(2688,e.DiagnosticCategory.Error,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:t(2689,e.DiagnosticCategory.Error,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:t(2690,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead:t(2691,e.DiagnosticCategory.Error,"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691","An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:t(2692,e.DiagnosticCategory.Error,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:t(2693,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:t(2694,e.DiagnosticCategory.Error,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:t(2695,e.DiagnosticCategory.Error,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:t(2696,e.DiagnosticCategory.Error,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2697,e.DiagnosticCategory.Error,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:t(2698,e.DiagnosticCategory.Error,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:t(2699,e.DiagnosticCategory.Error,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:t(2700,e.DiagnosticCategory.Error,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:t(2701,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:t(2702,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:t(2703,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:t(2704,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2705,e.DiagnosticCategory.Error,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:t(2706,e.DiagnosticCategory.Error,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:t(2707,e.DiagnosticCategory.Error,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:t(2708,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:t(2709,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:t(2710,e.DiagnosticCategory.Error,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2711,e.DiagnosticCategory.Error,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2712,e.DiagnosticCategory.Error,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:t(2713,e.DiagnosticCategory.Error,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\"{1}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:t(2714,e.DiagnosticCategory.Error,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:t(2715,e.DiagnosticCategory.Error,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:t(2716,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:t(2717,e.DiagnosticCategory.Error,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:t(2718,e.DiagnosticCategory.Error,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:t(2719,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:t(2720,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:t(2721,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:t(2722,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:t(2723,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:t(2724,e.DiagnosticCategory.Error,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:t(2725,e.DiagnosticCategory.Error,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:t(2726,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:t(2727,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:t(2728,e.DiagnosticCategory.Message,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:t(2729,e.DiagnosticCategory.Error,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:t(2730,e.DiagnosticCategory.Error,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:t(2731,e.DiagnosticCategory.Error,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:t(2732,e.DiagnosticCategory.Error,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:t(2733,e.DiagnosticCategory.Error,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:t(2734,e.DiagnosticCategory.Error,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:t(2735,e.DiagnosticCategory.Error,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:t(2736,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:t(2737,e.DiagnosticCategory.Error,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:t(2738,e.DiagnosticCategory.Message,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:t(2739,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:t(2740,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:t(2741,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:t(2742,e.DiagnosticCategory.Error,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:t(2743,e.DiagnosticCategory.Error,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:t(2744,e.DiagnosticCategory.Error,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:t(2745,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:t(2746,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:t(2747,e.DiagnosticCategory.Error,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided:t(2748,e.DiagnosticCategory.Error,"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748","Cannot access ambient const enums when the '--isolatedModules' flag is provided."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:t(2749,e.DiagnosticCategory.Error,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:t(2750,e.DiagnosticCategory.Error,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:t(2751,e.DiagnosticCategory.Error,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:t(2752,e.DiagnosticCategory.Error,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:t(2753,e.DiagnosticCategory.Error,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:t(2754,e.DiagnosticCategory.Error,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:t(2755,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:t(2756,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:t(2757,e.DiagnosticCategory.Error,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2758,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:t(2759,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:t(2760,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:t(2761,e.DiagnosticCategory.Error,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2762,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:t(2763,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:t(2764,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:t(2765,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:t(2766,e.DiagnosticCategory.Error,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:t(2767,e.DiagnosticCategory.Error,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:t(2768,e.DiagnosticCategory.Error,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:t(2769,e.DiagnosticCategory.Error,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:t(2770,e.DiagnosticCategory.Error,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:t(2771,e.DiagnosticCategory.Error,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:t(2772,e.DiagnosticCategory.Error,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:t(2773,e.DiagnosticCategory.Error,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:t(2774,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:t(2775,e.DiagnosticCategory.Error,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:t(2776,e.DiagnosticCategory.Error,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:t(2777,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:t(2778,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:t(2779,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:t(2780,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:t(2781,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:t(2782,e.DiagnosticCategory.Message,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:t(2783,e.DiagnosticCategory.Error,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:t(2784,e.DiagnosticCategory.Error,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:t(2785,e.DiagnosticCategory.Error,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:t(2786,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:t(2787,e.DiagnosticCategory.Error,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:t(2788,e.DiagnosticCategory.Error,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:t(2789,e.DiagnosticCategory.Error,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:t(2790,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:t(2791,e.DiagnosticCategory.Error,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:t(2792,e.DiagnosticCategory.Error,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:t(2793,e.DiagnosticCategory.Error,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:t(2794,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:t(2795,e.DiagnosticCategory.Error,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:t(2796,e.DiagnosticCategory.Error,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:t(2797,e.DiagnosticCategory.Error,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:t(2798,e.DiagnosticCategory.Error,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:t(2799,e.DiagnosticCategory.Error,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:t(2800,e.DiagnosticCategory.Error,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:t(2801,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:t(2802,e.DiagnosticCategory.Error,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:t(2803,e.DiagnosticCategory.Error,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:t(2804,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:t(2806,e.DiagnosticCategory.Error,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:t(2807,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:t(2808,e.DiagnosticCategory.Error,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses:t(2809,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:t(2810,e.DiagnosticCategory.Error,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:t(2811,e.DiagnosticCategory.Error,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:t(2812,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:t(2813,e.DiagnosticCategory.Error,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:t(2814,e.DiagnosticCategory.Error,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:t(2815,e.DiagnosticCategory.Error,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:t(2816,e.DiagnosticCategory.Error,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:t(2817,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:t(2818,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:t(2819,e.DiagnosticCategory.Error,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:t(2820,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:t(2821,e.DiagnosticCategory.Error,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821","Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:t(2822,e.DiagnosticCategory.Error,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Cannot_find_namespace_0_Did_you_mean_1:t(2833,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:t(2834,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:t(2835,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls:t(2836,e.DiagnosticCategory.Error,"Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836","Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:t(2837,e.DiagnosticCategory.Error,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:t(2838,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(2841,e.DiagnosticCategory.Error,"The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841","The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Import_declaration_0_is_using_private_name_1:t(4e3,e.DiagnosticCategory.Error,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:t(4002,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:t(4004,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4006,e.DiagnosticCategory.Error,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4008,e.DiagnosticCategory.Error,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4010,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4012,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4014,e.DiagnosticCategory.Error,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4016,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4019,e.DiagnosticCategory.Error,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4020,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:t(4021,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:t(4022,e.DiagnosticCategory.Error,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4023,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:t(4024,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:t(4025,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4026,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4027,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:t(4028,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4029,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4030,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:t(4031,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4032,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:t(4033,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4034,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4035,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4036,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4037,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4038,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4039,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4040,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4041,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4042,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4043,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4044,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:t(4045,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4046,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:t(4047,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4048,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:t(4049,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4050,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4051,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:t(4052,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4053,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4054,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t(4055,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4056,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:t(4057,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4058,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:t(4059,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:t(4060,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4061,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4062,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:t(4063,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4064,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4065,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4066,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4067,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4068,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4069,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4070,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4071,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4072,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4073,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4074,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4075,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4076,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:t(4077,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4078,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:t(4081,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:t(4082,e.DiagnosticCategory.Error,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:t(4083,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:t(4084,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:t(4090,e.DiagnosticCategory.Error,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4091,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:t(4092,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:t(4094,e.DiagnosticCategory.Error,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4095,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4096,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:t(4097,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4098,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4099,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:t(4100,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4101,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:t(4102,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:t(4103,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:t(4104,e.DiagnosticCategory.Error,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:t(4105,e.DiagnosticCategory.Error,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:t(4106,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:t(4107,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4108,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:t(4109,e.DiagnosticCategory.Error,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:t(4110,e.DiagnosticCategory.Error,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:t(4111,e.DiagnosticCategory.Error,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:t(4112,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:t(4113,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:t(4114,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:t(4115,e.DiagnosticCategory.Error,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:t(4116,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4117,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:t(4118,e.DiagnosticCategory.Error,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4119,e.DiagnosticCategory.Error,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4120,e.DiagnosticCategory.Error,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:t(4121,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:t(4122,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4123,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4124,e.DiagnosticCategory.Error,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4125,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125","'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:t(5001,e.DiagnosticCategory.Error,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:t(5009,e.DiagnosticCategory.Error,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5010,e.DiagnosticCategory.Error,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:t(5012,e.DiagnosticCategory.Error,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:t(5014,e.DiagnosticCategory.Error,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:t(5023,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:t(5024,e.DiagnosticCategory.Error,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:t(5025,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:t(5033,e.DiagnosticCategory.Error,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:t(5042,e.DiagnosticCategory.Error,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:t(5047,e.DiagnosticCategory.Error,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:t(5048,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:t(5051,e.DiagnosticCategory.Error,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:t(5052,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:t(5053,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:t(5054,e.DiagnosticCategory.Error,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:t(5055,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:t(5056,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:t(5057,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:t(5058,e.DiagnosticCategory.Error,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:t(5059,e.DiagnosticCategory.Error,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:t(5061,e.DiagnosticCategory.Error,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:t(5062,e.DiagnosticCategory.Error,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:t(5063,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:t(5064,e.DiagnosticCategory.Error,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5065,e.DiagnosticCategory.Error,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:t(5066,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:t(5067,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:t(5068,e.DiagnosticCategory.Error,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:t(5069,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy:t(5070,e.DiagnosticCategory.Error,"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070","Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:t(5071,e.DiagnosticCategory.Error,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:t(5072,e.DiagnosticCategory.Error,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:t(5073,e.DiagnosticCategory.Error,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:t(5074,e.DiagnosticCategory.Error,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:t(5075,e.DiagnosticCategory.Error,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:t(5076,e.DiagnosticCategory.Error,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:t(5077,e.DiagnosticCategory.Error,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:t(5078,e.DiagnosticCategory.Error,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:t(5079,e.DiagnosticCategory.Error,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:t(5080,e.DiagnosticCategory.Error,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:t(5081,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:t(5082,e.DiagnosticCategory.Error,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:t(5083,e.DiagnosticCategory.Error,"Cannot_read_file_0_5083","Cannot read file '{0}'."),Tuple_members_must_all_have_names_or_all_not_have_names:t(5084,e.DiagnosticCategory.Error,"Tuple_members_must_all_have_names_or_all_not_have_names_5084","Tuple members must all have names or all not have names."),A_tuple_member_cannot_be_both_optional_and_rest:t(5085,e.DiagnosticCategory.Error,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:t(5086,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:t(5087,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:t(5088,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:t(5089,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:t(5090,e.DiagnosticCategory.Error,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled:t(5091,e.DiagnosticCategory.Error,"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),The_root_value_of_a_0_file_must_be_an_object:t(5092,e.DiagnosticCategory.Error,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:t(5093,e.DiagnosticCategory.Error,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:t(5094,e.DiagnosticCategory.Error,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later:t(5095,e.DiagnosticCategory.Error,"Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:t(6e3,e.DiagnosticCategory.Message,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:t(6001,e.DiagnosticCategory.Message,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:t(6002,e.DiagnosticCategory.Message,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:t(6004,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:t(6005,e.DiagnosticCategory.Message,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:t(6006,e.DiagnosticCategory.Message,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:t(6007,e.DiagnosticCategory.Message,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:t(6008,e.DiagnosticCategory.Message,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:t(6009,e.DiagnosticCategory.Message,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:t(6010,e.DiagnosticCategory.Message,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:t(6011,e.DiagnosticCategory.Message,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:t(6012,e.DiagnosticCategory.Message,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:t(6013,e.DiagnosticCategory.Message,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:t(6014,e.DiagnosticCategory.Message,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:t(6015,e.DiagnosticCategory.Message,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:t(6016,e.DiagnosticCategory.Message,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:t(6017,e.DiagnosticCategory.Message,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:t(6019,e.DiagnosticCategory.Message,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:t(6020,e.DiagnosticCategory.Message,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:t(6023,e.DiagnosticCategory.Message,"Syntax_Colon_0_6023","Syntax: {0}"),options:t(6024,e.DiagnosticCategory.Message,"options_6024","options"),file:t(6025,e.DiagnosticCategory.Message,"file_6025","file"),Examples_Colon_0:t(6026,e.DiagnosticCategory.Message,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:t(6027,e.DiagnosticCategory.Message,"Options_Colon_6027","Options:"),Version_0:t(6029,e.DiagnosticCategory.Message,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:t(6030,e.DiagnosticCategory.Message,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:t(6031,e.DiagnosticCategory.Message,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:t(6032,e.DiagnosticCategory.Message,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:t(6034,e.DiagnosticCategory.Message,"KIND_6034","KIND"),FILE:t(6035,e.DiagnosticCategory.Message,"FILE_6035","FILE"),VERSION:t(6036,e.DiagnosticCategory.Message,"VERSION_6036","VERSION"),LOCATION:t(6037,e.DiagnosticCategory.Message,"LOCATION_6037","LOCATION"),DIRECTORY:t(6038,e.DiagnosticCategory.Message,"DIRECTORY_6038","DIRECTORY"),STRATEGY:t(6039,e.DiagnosticCategory.Message,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:t(6040,e.DiagnosticCategory.Message,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:t(6041,e.DiagnosticCategory.Message,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:t(6043,e.DiagnosticCategory.Message,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:t(6044,e.DiagnosticCategory.Error,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:t(6045,e.DiagnosticCategory.Error,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:t(6046,e.DiagnosticCategory.Error,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:t(6048,e.DiagnosticCategory.Error,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:t(6050,e.DiagnosticCategory.Error,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:t(6051,e.DiagnosticCategory.Error,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:t(6052,e.DiagnosticCategory.Message,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:t(6053,e.DiagnosticCategory.Error,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:t(6054,e.DiagnosticCategory.Error,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:t(6055,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:t(6056,e.DiagnosticCategory.Message,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:t(6058,e.DiagnosticCategory.Message,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:t(6059,e.DiagnosticCategory.Error,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:t(6060,e.DiagnosticCategory.Message,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:t(6061,e.DiagnosticCategory.Message,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:t(6064,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:t(6065,e.DiagnosticCategory.Message,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:t(6066,e.DiagnosticCategory.Message,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:t(6069,e.DiagnosticCategory.Message,"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069","Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:t(6070,e.DiagnosticCategory.Message,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:t(6071,e.DiagnosticCategory.Message,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:t(6072,e.DiagnosticCategory.Message,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:t(6073,e.DiagnosticCategory.Message,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:t(6074,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:t(6075,e.DiagnosticCategory.Message,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:t(6076,e.DiagnosticCategory.Message,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:t(6077,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:t(6078,e.DiagnosticCategory.Message,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:t(6079,e.DiagnosticCategory.Message,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:t(6080,e.DiagnosticCategory.Message,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:t(6081,e.DiagnosticCategory.Message,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:t(6082,e.DiagnosticCategory.Error,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:t(6083,e.DiagnosticCategory.Message,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:t(6084,e.DiagnosticCategory.Message,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:t(6085,e.DiagnosticCategory.Message,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:t(6086,e.DiagnosticCategory.Message,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:t(6087,e.DiagnosticCategory.Message,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:t(6088,e.DiagnosticCategory.Message,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:t(6089,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:t(6090,e.DiagnosticCategory.Message,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:t(6091,e.DiagnosticCategory.Message,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:t(6092,e.DiagnosticCategory.Message,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:t(6093,e.DiagnosticCategory.Message,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:t(6094,e.DiagnosticCategory.Message,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1:t(6095,e.DiagnosticCategory.Message,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095","Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),File_0_does_not_exist:t(6096,e.DiagnosticCategory.Message,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exist_use_it_as_a_name_resolution_result:t(6097,e.DiagnosticCategory.Message,"File_0_exist_use_it_as_a_name_resolution_result_6097","File '{0}' exist - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_type_1:t(6098,e.DiagnosticCategory.Message,"Loading_module_0_from_node_modules_folder_target_file_type_1_6098","Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),Found_package_json_at_0:t(6099,e.DiagnosticCategory.Message,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:t(6100,e.DiagnosticCategory.Message,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:t(6101,e.DiagnosticCategory.Message,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:t(6102,e.DiagnosticCategory.Message,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:t(6104,e.DiagnosticCategory.Message,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:t(6105,e.DiagnosticCategory.Message,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:t(6106,e.DiagnosticCategory.Message,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:t(6107,e.DiagnosticCategory.Message,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:t(6108,e.DiagnosticCategory.Message,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:t(6109,e.DiagnosticCategory.Message,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:t(6110,e.DiagnosticCategory.Message,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:t(6111,e.DiagnosticCategory.Message,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:t(6112,e.DiagnosticCategory.Message,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:t(6113,e.DiagnosticCategory.Message,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:t(6114,e.DiagnosticCategory.Error,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:t(6115,e.DiagnosticCategory.Message,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:t(6116,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:t(6119,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:t(6120,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:t(6121,e.DiagnosticCategory.Message,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:t(6122,e.DiagnosticCategory.Message,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:t(6123,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:t(6124,e.DiagnosticCategory.Message,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:t(6125,e.DiagnosticCategory.Message,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:t(6126,e.DiagnosticCategory.Message,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:t(6127,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:t(6128,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:t(6130,e.DiagnosticCategory.Message,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:t(6131,e.DiagnosticCategory.Error,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:t(6132,e.DiagnosticCategory.Message,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:t(6133,e.DiagnosticCategory.Error,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:t(6134,e.DiagnosticCategory.Message,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:t(6135,e.DiagnosticCategory.Message,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:t(6136,e.DiagnosticCategory.Message,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:t(6137,e.DiagnosticCategory.Error,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:t(6138,e.DiagnosticCategory.Error,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:t(6139,e.DiagnosticCategory.Message,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:t(6140,e.DiagnosticCategory.Error,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:t(6141,e.DiagnosticCategory.Message,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:t(6142,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:t(6144,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:t(6145,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:t(6146,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:t(6147,e.DiagnosticCategory.Message,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:t(6148,e.DiagnosticCategory.Message,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:t(6149,e.DiagnosticCategory.Message,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:t(6150,e.DiagnosticCategory.Message,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:t(6151,e.DiagnosticCategory.Message,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:t(6152,e.DiagnosticCategory.Message,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:t(6153,e.DiagnosticCategory.Message,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:t(6154,e.DiagnosticCategory.Message,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:t(6155,e.DiagnosticCategory.Message,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:t(6156,e.DiagnosticCategory.Message,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:t(6157,e.DiagnosticCategory.Message,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:t(6158,e.DiagnosticCategory.Message,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:t(6159,e.DiagnosticCategory.Message,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:t(6160,e.DiagnosticCategory.Message,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:t(6161,e.DiagnosticCategory.Message,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:t(6162,e.DiagnosticCategory.Message,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:t(6163,e.DiagnosticCategory.Message,"The_character_set_of_the_input_files_6163","The character set of the input files."),Do_not_truncate_error_messages:t(6165,e.DiagnosticCategory.Message,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:t(6166,e.DiagnosticCategory.Message,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:t(6167,e.DiagnosticCategory.Message,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:t(6168,e.DiagnosticCategory.Message,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:t(6169,e.DiagnosticCategory.Message,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:t(6170,e.DiagnosticCategory.Message,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:t(6171,e.DiagnosticCategory.Message,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:t(6179,e.DiagnosticCategory.Message,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:t(6180,e.DiagnosticCategory.Message,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:t(6182,e.DiagnosticCategory.Message,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6183,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6184,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:t(6186,e.DiagnosticCategory.Message,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:t(6187,e.DiagnosticCategory.Message,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:t(6188,e.DiagnosticCategory.Error,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:t(6189,e.DiagnosticCategory.Error,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:t(6191,e.DiagnosticCategory.Message,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:t(6192,e.DiagnosticCategory.Error,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:t(6193,e.DiagnosticCategory.Message,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:t(6194,e.DiagnosticCategory.Message,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:t(6195,e.DiagnosticCategory.Message,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:t(6196,e.DiagnosticCategory.Error,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:t(6197,e.DiagnosticCategory.Message,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:t(6198,e.DiagnosticCategory.Error,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:t(6199,e.DiagnosticCategory.Error,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:t(6200,e.DiagnosticCategory.Error,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:t(6201,e.DiagnosticCategory.Message,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:t(6202,e.DiagnosticCategory.Error,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:t(6203,e.DiagnosticCategory.Message,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:t(6204,e.DiagnosticCategory.Message,"and_here_6204","and here."),All_type_parameters_are_unused:t(6205,e.DiagnosticCategory.Error,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:t(6206,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:t(6207,e.DiagnosticCategory.Message,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:t(6208,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:t(6209,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:t(6210,e.DiagnosticCategory.Message,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:t(6211,e.DiagnosticCategory.Message,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:t(6212,e.DiagnosticCategory.Message,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:t(6213,e.DiagnosticCategory.Message,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:t(6214,e.DiagnosticCategory.Message,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:t(6215,e.DiagnosticCategory.Message,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:t(6216,e.DiagnosticCategory.Message,"Found_1_error_6216","Found 1 error."),Found_0_errors:t(6217,e.DiagnosticCategory.Message,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:t(6218,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:t(6219,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:t(6220,e.DiagnosticCategory.Message,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:t(6221,e.DiagnosticCategory.Message,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:t(6222,e.DiagnosticCategory.Message,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:t(6223,e.DiagnosticCategory.Message,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:t(6224,e.DiagnosticCategory.Message,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:t(6225,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:t(6226,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:t(6227,e.DiagnosticCategory.Message,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:t(6229,e.DiagnosticCategory.Error,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:t(6230,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:t(6231,e.DiagnosticCategory.Error,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:t(6232,e.DiagnosticCategory.Error,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:t(6233,e.DiagnosticCategory.Error,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:t(6234,e.DiagnosticCategory.Error,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:t(6235,e.DiagnosticCategory.Message,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:t(6236,e.DiagnosticCategory.Error,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:t(6237,e.DiagnosticCategory.Message,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:t(6238,e.DiagnosticCategory.Error,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:t(6239,e.DiagnosticCategory.Message,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:t(6240,e.DiagnosticCategory.Message,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:t(6241,e.DiagnosticCategory.Message,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:t(6242,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:t(6243,e.DiagnosticCategory.Message,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:t(6244,e.DiagnosticCategory.Message,"Modules_6244","Modules"),File_Management:t(6245,e.DiagnosticCategory.Message,"File_Management_6245","File Management"),Emit:t(6246,e.DiagnosticCategory.Message,"Emit_6246","Emit"),JavaScript_Support:t(6247,e.DiagnosticCategory.Message,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:t(6248,e.DiagnosticCategory.Message,"Type_Checking_6248","Type Checking"),Editor_Support:t(6249,e.DiagnosticCategory.Message,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:t(6250,e.DiagnosticCategory.Message,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:t(6251,e.DiagnosticCategory.Message,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:t(6252,e.DiagnosticCategory.Message,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:t(6253,e.DiagnosticCategory.Message,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:t(6254,e.DiagnosticCategory.Message,"Language_and_Environment_6254","Language and Environment"),Projects:t(6255,e.DiagnosticCategory.Message,"Projects_6255","Projects"),Output_Formatting:t(6256,e.DiagnosticCategory.Message,"Output_Formatting_6256","Output Formatting"),Completeness:t(6257,e.DiagnosticCategory.Message,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:t(6258,e.DiagnosticCategory.Error,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_1:t(6259,e.DiagnosticCategory.Message,"Found_1_error_in_1_6259","Found 1 error in {1}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:t(6260,e.DiagnosticCategory.Message,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:t(6261,e.DiagnosticCategory.Message,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:t(6270,e.DiagnosticCategory.Message,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6271,e.DiagnosticCategory.Message,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:t(6272,e.DiagnosticCategory.Message,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:t(6273,e.DiagnosticCategory.Message,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:t(6274,e.DiagnosticCategory.Message,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:t(6275,e.DiagnosticCategory.Message,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6276,e.DiagnosticCategory.Message,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Enable_project_compilation:t(6302,e.DiagnosticCategory.Message,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:t(6304,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:t(6305,e.DiagnosticCategory.Error,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:t(6306,e.DiagnosticCategory.Error,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:t(6307,e.DiagnosticCategory.Error,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:t(6308,e.DiagnosticCategory.Error,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:t(6309,e.DiagnosticCategory.Error,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:t(6310,e.DiagnosticCategory.Error,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2:t(6350,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350","Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2:t(6351,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:t(6352,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:t(6353,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:t(6354,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:t(6355,e.DiagnosticCategory.Message,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:t(6356,e.DiagnosticCategory.Message,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:t(6357,e.DiagnosticCategory.Message,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:t(6358,e.DiagnosticCategory.Message,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:t(6359,e.DiagnosticCategory.Message,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:t(6361,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:t(6362,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:t(6363,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:t(6364,e.DiagnosticCategory.Message,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:t(6365,e.DiagnosticCategory.Message,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:t(6367,e.DiagnosticCategory.Message,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:t(6369,e.DiagnosticCategory.Error,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:t(6370,e.DiagnosticCategory.Error,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:t(6371,e.DiagnosticCategory.Message,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:t(6372,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:t(6373,e.DiagnosticCategory.Message,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:t(6374,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:t(6375,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:t(6376,e.DiagnosticCategory.Message,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:t(6377,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:t(6379,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:t(6380,e.DiagnosticCategory.Message,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:t(6381,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:t(6382,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:t(6383,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6384,e.DiagnosticCategory.Message,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:t(6385,e.DiagnosticCategory.Suggestion,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:t(6386,e.DiagnosticCategory.Message,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:t(6387,e.DiagnosticCategory.Suggestion,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:t(6388,e.DiagnosticCategory.Message,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:t(6389,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6390,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6391,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:t(6392,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6393,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6394,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6395,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6396,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6397,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6398,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:t(6500,e.DiagnosticCategory.Message,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:t(6501,e.DiagnosticCategory.Message,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:t(6502,e.DiagnosticCategory.Message,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:t(6503,e.DiagnosticCategory.Message,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:t(6504,e.DiagnosticCategory.Error,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:t(6505,e.DiagnosticCategory.Message,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:t(6506,e.DiagnosticCategory.Message,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:t(6600,e.DiagnosticCategory.Message,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:t(6601,e.DiagnosticCategory.Message,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:t(6602,e.DiagnosticCategory.Message,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:t(6603,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:t(6604,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:t(6605,e.DiagnosticCategory.Message,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6606,e.DiagnosticCategory.Message,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:t(6607,e.DiagnosticCategory.Message,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:t(6608,e.DiagnosticCategory.Message,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:t(6609,e.DiagnosticCategory.Message,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:t(6611,e.DiagnosticCategory.Message,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:t(6612,e.DiagnosticCategory.Message,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:t(6613,e.DiagnosticCategory.Message,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:t(6614,e.DiagnosticCategory.Message,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:t(6615,e.DiagnosticCategory.Message,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:t(6616,e.DiagnosticCategory.Message,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:t(6617,e.DiagnosticCategory.Message,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:t(6618,e.DiagnosticCategory.Message,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:t(6619,e.DiagnosticCategory.Message,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:t(6620,e.DiagnosticCategory.Message,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:t(6621,e.DiagnosticCategory.Message,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:t(6622,e.DiagnosticCategory.Message,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:t(6623,e.DiagnosticCategory.Message,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:t(6624,e.DiagnosticCategory.Message,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:t(6625,e.DiagnosticCategory.Message,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:t(6626,e.DiagnosticCategory.Message,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:t(6627,e.DiagnosticCategory.Message,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:t(6628,e.DiagnosticCategory.Message,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:t(6629,e.DiagnosticCategory.Message,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_TC39_stage_2_draft_decorators:t(6630,e.DiagnosticCategory.Message,"Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630","Enable experimental support for TC39 stage 2 draft decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:t(6631,e.DiagnosticCategory.Message,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:t(6632,e.DiagnosticCategory.Message,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:t(6633,e.DiagnosticCategory.Message,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:t(6634,e.DiagnosticCategory.Message,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:t(6635,e.DiagnosticCategory.Message,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:t(6636,e.DiagnosticCategory.Message,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:t(6637,e.DiagnosticCategory.Message,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:t(6638,e.DiagnosticCategory.Message,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:t(6639,e.DiagnosticCategory.Message,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:t(6641,e.DiagnosticCategory.Message,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:t(6642,e.DiagnosticCategory.Message,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:t(6643,e.DiagnosticCategory.Message,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:t(6644,e.DiagnosticCategory.Message,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:t(6645,e.DiagnosticCategory.Message,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:t(6646,e.DiagnosticCategory.Message,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:t(6647,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:t(6648,e.DiagnosticCategory.Message,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:t(6649,e.DiagnosticCategory.Message,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:t(6650,e.DiagnosticCategory.Message,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:t(6651,e.DiagnosticCategory.Message,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:t(6652,e.DiagnosticCategory.Message,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:t(6653,e.DiagnosticCategory.Message,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:t(6654,e.DiagnosticCategory.Message,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:t(6655,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:t(6656,e.DiagnosticCategory.Message,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:t(6657,e.DiagnosticCategory.Message,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:t(6658,e.DiagnosticCategory.Message,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:t(6659,e.DiagnosticCategory.Message,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:t(6660,e.DiagnosticCategory.Message,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:t(6661,e.DiagnosticCategory.Message,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:t(6662,e.DiagnosticCategory.Message,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:t(6663,e.DiagnosticCategory.Message,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:t(6664,e.DiagnosticCategory.Message,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:t(6665,e.DiagnosticCategory.Message,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:t(6666,e.DiagnosticCategory.Message,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:t(6667,e.DiagnosticCategory.Message,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:t(6668,e.DiagnosticCategory.Message,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:t(6669,e.DiagnosticCategory.Message,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:t(6670,e.DiagnosticCategory.Message,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:t(6671,e.DiagnosticCategory.Message,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:t(6672,e.DiagnosticCategory.Message,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:t(6673,e.DiagnosticCategory.Message,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:t(6674,e.DiagnosticCategory.Message,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:t(6675,e.DiagnosticCategory.Message,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:t(6676,e.DiagnosticCategory.Message,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:t(6677,e.DiagnosticCategory.Message,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:t(6678,e.DiagnosticCategory.Message,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:t(6679,e.DiagnosticCategory.Message,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:t(6680,e.DiagnosticCategory.Message,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:t(6681,e.DiagnosticCategory.Message,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:t(6682,e.DiagnosticCategory.Message,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:t(6683,e.DiagnosticCategory.Message,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:t(6684,e.DiagnosticCategory.Message,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:t(6685,e.DiagnosticCategory.Message,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:t(6686,e.DiagnosticCategory.Message,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:t(6687,e.DiagnosticCategory.Message,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:t(6688,e.DiagnosticCategory.Message,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:t(6689,e.DiagnosticCategory.Message,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:t(6690,e.DiagnosticCategory.Message,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:t(6691,e.DiagnosticCategory.Message,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:t(6692,e.DiagnosticCategory.Message,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:t(6693,e.DiagnosticCategory.Message,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:t(6694,e.DiagnosticCategory.Message,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:t(6695,e.DiagnosticCategory.Message,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:t(6697,e.DiagnosticCategory.Message,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:t(6698,e.DiagnosticCategory.Message,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:t(6699,e.DiagnosticCategory.Message,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:t(6700,e.DiagnosticCategory.Message,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:t(6701,e.DiagnosticCategory.Message,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:t(6702,e.DiagnosticCategory.Message,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:t(6703,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:t(6704,e.DiagnosticCategory.Message,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:t(6705,e.DiagnosticCategory.Message,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:t(6706,e.DiagnosticCategory.Message,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:t(6707,e.DiagnosticCategory.Message,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:t(6709,e.DiagnosticCategory.Message,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:t(6710,e.DiagnosticCategory.Message,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:t(6711,e.DiagnosticCategory.Message,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:t(6712,e.DiagnosticCategory.Message,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:t(6713,e.DiagnosticCategory.Message,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:t(6714,e.DiagnosticCategory.Message,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:t(6715,e.DiagnosticCategory.Message,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:t(6717,e.DiagnosticCategory.Message,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:t(6718,e.DiagnosticCategory.Message,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Default_catch_clause_variables_as_unknown_instead_of_any:t(6803,e.DiagnosticCategory.Message,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),one_of_Colon:t(6900,e.DiagnosticCategory.Message,"one_of_Colon_6900","one of:"),one_or_more_Colon:t(6901,e.DiagnosticCategory.Message,"one_or_more_Colon_6901","one or more:"),type_Colon:t(6902,e.DiagnosticCategory.Message,"type_Colon_6902","type:"),default_Colon:t(6903,e.DiagnosticCategory.Message,"default_Colon_6903","default:"),module_system_or_esModuleInterop:t(6904,e.DiagnosticCategory.Message,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:t(6905,e.DiagnosticCategory.Message,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:t(6906,e.DiagnosticCategory.Message,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:t(6907,e.DiagnosticCategory.Message,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:t(6908,e.DiagnosticCategory.Message,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:t(6909,e.DiagnosticCategory.Message,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:t(69010,e.DiagnosticCategory.Message,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:t(6911,e.DiagnosticCategory.Message,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:t(6912,e.DiagnosticCategory.Message,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:t(6913,e.DiagnosticCategory.Message,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:t(6914,e.DiagnosticCategory.Message,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:t(6915,e.DiagnosticCategory.Message,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:t(6916,e.DiagnosticCategory.Message,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:t(6917,e.DiagnosticCategory.Message,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:t(6918,e.DiagnosticCategory.Message,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:t(6919,e.DiagnosticCategory.Message,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:t(6920,e.DiagnosticCategory.Message,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:t(6921,e.DiagnosticCategory.Message,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:t(6922,e.DiagnosticCategory.Message,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:t(6923,e.DiagnosticCategory.Message,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:t(6924,e.DiagnosticCategory.Message,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:t(6925,e.DiagnosticCategory.Message,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:t(6926,e.DiagnosticCategory.Message,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:t(6927,e.DiagnosticCategory.Message,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:t(6928,e.DiagnosticCategory.Message,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:t(6929,e.DiagnosticCategory.Message,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:t(6930,e.DiagnosticCategory.Message,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:t(6931,e.DiagnosticCategory.Error,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:t(7005,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:t(7006,e.DiagnosticCategory.Error,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:t(7008,e.DiagnosticCategory.Error,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:t(7009,e.DiagnosticCategory.Error,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:t(7010,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7011,e.DiagnosticCategory.Error,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7013,e.DiagnosticCategory.Error,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7014,e.DiagnosticCategory.Error,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:t(7015,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:t(7016,e.DiagnosticCategory.Error,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:t(7017,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:t(7018,e.DiagnosticCategory.Error,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:t(7019,e.DiagnosticCategory.Error,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7020,e.DiagnosticCategory.Error,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:t(7022,e.DiagnosticCategory.Error,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7023,e.DiagnosticCategory.Error,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7024,e.DiagnosticCategory.Error,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:t(7025,e.DiagnosticCategory.Error,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:t(7026,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:t(7027,e.DiagnosticCategory.Error,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:t(7028,e.DiagnosticCategory.Error,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:t(7029,e.DiagnosticCategory.Error,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:t(7030,e.DiagnosticCategory.Error,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:t(7031,e.DiagnosticCategory.Error,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:t(7032,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:t(7033,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:t(7034,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:t(7035,e.DiagnosticCategory.Error,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:t(7036,e.DiagnosticCategory.Error,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:t(7037,e.DiagnosticCategory.Message,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:t(7038,e.DiagnosticCategory.Message,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:t(7039,e.DiagnosticCategory.Error,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:t(7040,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:t(7041,e.DiagnosticCategory.Error,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:t(7042,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7043,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7044,e.DiagnosticCategory.Suggestion,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7045,e.DiagnosticCategory.Suggestion,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:t(7046,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:t(7047,e.DiagnosticCategory.Suggestion,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:t(7048,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:t(7049,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:t(7050,e.DiagnosticCategory.Suggestion,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:t(7051,e.DiagnosticCategory.Error,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:t(7052,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:t(7053,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:t(7054,e.DiagnosticCategory.Error,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:t(7055,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:t(7056,e.DiagnosticCategory.Error,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:t(7057,e.DiagnosticCategory.Error,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:t(7058,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:t(7059,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:t(7060,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:t(7061,e.DiagnosticCategory.Error,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:t(8e3,e.DiagnosticCategory.Error,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:t(8001,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:t(8002,e.DiagnosticCategory.Error,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:t(8003,e.DiagnosticCategory.Error,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:t(8004,e.DiagnosticCategory.Error,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:t(8005,e.DiagnosticCategory.Error,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:t(8006,e.DiagnosticCategory.Error,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:t(8008,e.DiagnosticCategory.Error,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:t(8009,e.DiagnosticCategory.Error,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:t(8010,e.DiagnosticCategory.Error,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:t(8011,e.DiagnosticCategory.Error,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:t(8012,e.DiagnosticCategory.Error,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:t(8013,e.DiagnosticCategory.Error,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:t(8016,e.DiagnosticCategory.Error,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:t(8017,e.DiagnosticCategory.Error,"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017","Octal literal types must use ES2015 syntax. Use the syntax '{0}'."),Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0:t(8018,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018","Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."),Report_errors_in_js_files:t(8019,e.DiagnosticCategory.Message,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:t(8020,e.DiagnosticCategory.Error,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:t(8021,e.DiagnosticCategory.Error,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:t(8022,e.DiagnosticCategory.Error,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:t(8023,e.DiagnosticCategory.Error,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:t(8024,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:t(8025,e.DiagnosticCategory.Error,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:t(8026,e.DiagnosticCategory.Error,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:t(8027,e.DiagnosticCategory.Error,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:t(8028,e.DiagnosticCategory.Error,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:t(8029,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:t(8030,e.DiagnosticCategory.Error,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:t(8031,e.DiagnosticCategory.Error,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:t(8032,e.DiagnosticCategory.Error,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:t(8033,e.DiagnosticCategory.Error,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:t(8034,e.DiagnosticCategory.Error,"The_tag_was_first_specified_here_8034","The tag was first specified here."),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:t(9005,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:t(9006,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:t(17e3,e.DiagnosticCategory.Error,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:t(17001,e.DiagnosticCategory.Error,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:t(17002,e.DiagnosticCategory.Error,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:t(17004,e.DiagnosticCategory.Error,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:t(17005,e.DiagnosticCategory.Error,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17006,e.DiagnosticCategory.Error,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17007,e.DiagnosticCategory.Error,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:t(17008,e.DiagnosticCategory.Error,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:t(17009,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:t(17010,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:t(17011,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:t(17012,e.DiagnosticCategory.Error,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:t(17013,e.DiagnosticCategory.Error,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:t(17014,e.DiagnosticCategory.Error,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:t(17015,e.DiagnosticCategory.Error,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:t(17016,e.DiagnosticCategory.Error,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:t(17017,e.DiagnosticCategory.Error,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:t(17018,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),Circularity_detected_while_resolving_configuration_Colon_0:t(18e3,e.DiagnosticCategory.Error,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:t(18002,e.DiagnosticCategory.Error,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:t(18003,e.DiagnosticCategory.Error,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:t(80001,e.DiagnosticCategory.Suggestion,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:t(80002,e.DiagnosticCategory.Suggestion,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:t(80003,e.DiagnosticCategory.Suggestion,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:t(80004,e.DiagnosticCategory.Suggestion,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:t(80005,e.DiagnosticCategory.Suggestion,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:t(80006,e.DiagnosticCategory.Suggestion,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:t(80007,e.DiagnosticCategory.Suggestion,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:t(80008,e.DiagnosticCategory.Suggestion,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),Add_missing_super_call:t(90001,e.DiagnosticCategory.Message,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:t(90002,e.DiagnosticCategory.Message,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:t(90003,e.DiagnosticCategory.Message,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:t(90004,e.DiagnosticCategory.Message,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:t(90005,e.DiagnosticCategory.Message,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:t(90006,e.DiagnosticCategory.Message,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:t(90007,e.DiagnosticCategory.Message,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:t(90008,e.DiagnosticCategory.Message,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:t(90010,e.DiagnosticCategory.Message,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:t(90011,e.DiagnosticCategory.Message,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:t(90012,e.DiagnosticCategory.Message,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:t(90013,e.DiagnosticCategory.Message,"Import_0_from_1_90013","Import '{0}' from \"{1}\""),Change_0_to_1:t(90014,e.DiagnosticCategory.Message,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:t(90016,e.DiagnosticCategory.Message,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:t(90017,e.DiagnosticCategory.Message,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:t(90018,e.DiagnosticCategory.Message,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:t(90019,e.DiagnosticCategory.Message,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:t(90020,e.DiagnosticCategory.Message,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:t(90021,e.DiagnosticCategory.Message,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:t(90022,e.DiagnosticCategory.Message,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:t(90023,e.DiagnosticCategory.Message,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:t(90024,e.DiagnosticCategory.Message,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:t(90025,e.DiagnosticCategory.Message,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:t(90026,e.DiagnosticCategory.Message,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:t(90027,e.DiagnosticCategory.Message,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:t(90028,e.DiagnosticCategory.Message,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:t(90029,e.DiagnosticCategory.Message,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:t(90030,e.DiagnosticCategory.Message,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:t(90031,e.DiagnosticCategory.Message,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:t(90034,e.DiagnosticCategory.Message,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:t(90035,e.DiagnosticCategory.Message,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:t(90036,e.DiagnosticCategory.Message,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:t(90037,e.DiagnosticCategory.Message,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:t(90038,e.DiagnosticCategory.Message,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:t(90039,e.DiagnosticCategory.Message,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:t(90041,e.DiagnosticCategory.Message,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:t(90053,e.DiagnosticCategory.Message,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:t(90054,e.DiagnosticCategory.Message,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:t(90055,e.DiagnosticCategory.Message,"Remove_type_from_import_declaration_from_0_90055","Remove 'type' from import declaration from \"{0}\""),Remove_type_from_import_of_0_from_1:t(90056,e.DiagnosticCategory.Message,"Remove_type_from_import_of_0_from_1_90056","Remove 'type' from import of '{0}' from \"{1}\""),Add_import_from_0:t(90057,e.DiagnosticCategory.Message,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:t(90058,e.DiagnosticCategory.Message,"Update_import_from_0_90058",'Update import from "{0}"'),Convert_function_to_an_ES2015_class:t(95001,e.DiagnosticCategory.Message,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:t(95003,e.DiagnosticCategory.Message,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:t(95004,e.DiagnosticCategory.Message,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:t(95005,e.DiagnosticCategory.Message,"Extract_function_95005","Extract function"),Extract_constant:t(95006,e.DiagnosticCategory.Message,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:t(95007,e.DiagnosticCategory.Message,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:t(95008,e.DiagnosticCategory.Message,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:t(95009,e.DiagnosticCategory.Message,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:t(95011,e.DiagnosticCategory.Message,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:t(95012,e.DiagnosticCategory.Message,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:t(95013,e.DiagnosticCategory.Message,"Convert_to_default_import_95013","Convert to default import"),Install_0:t(95014,e.DiagnosticCategory.Message,"Install_0_95014","Install '{0}'"),Replace_import_with_0:t(95015,e.DiagnosticCategory.Message,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:t(95016,e.DiagnosticCategory.Message,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:t(95017,e.DiagnosticCategory.Message,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:t(95018,e.DiagnosticCategory.Message,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:t(95019,e.DiagnosticCategory.Message,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:t(95020,e.DiagnosticCategory.Message,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:t(95021,e.DiagnosticCategory.Message,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:t(95022,e.DiagnosticCategory.Message,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:t(95023,e.DiagnosticCategory.Message,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:t(95024,e.DiagnosticCategory.Message,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:t(95025,e.DiagnosticCategory.Message,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:t(95026,e.DiagnosticCategory.Message,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:t(95027,e.DiagnosticCategory.Message,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:t(95028,e.DiagnosticCategory.Message,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:t(95029,e.DiagnosticCategory.Message,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:t(95030,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:t(95031,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:t(95032,e.DiagnosticCategory.Message,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:t(95033,e.DiagnosticCategory.Message,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:t(95034,e.DiagnosticCategory.Message,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:t(95035,e.DiagnosticCategory.Message,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:t(95036,e.DiagnosticCategory.Message,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:t(95037,e.DiagnosticCategory.Message,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:t(95038,e.DiagnosticCategory.Message,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:t(95039,e.DiagnosticCategory.Message,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:t(95040,e.DiagnosticCategory.Message,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:t(95041,e.DiagnosticCategory.Message,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:t(95042,e.DiagnosticCategory.Message,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:t(95043,e.DiagnosticCategory.Message,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:t(95044,e.DiagnosticCategory.Message,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:t(95045,e.DiagnosticCategory.Message,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:t(95046,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:t(95047,e.DiagnosticCategory.Message,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:t(95048,e.DiagnosticCategory.Message,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:t(95049,e.DiagnosticCategory.Message,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:t(95050,e.DiagnosticCategory.Message,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:t(95051,e.DiagnosticCategory.Message,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:t(95052,e.DiagnosticCategory.Message,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:t(95053,e.DiagnosticCategory.Message,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:t(95054,e.DiagnosticCategory.Message,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:t(95055,e.DiagnosticCategory.Message,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:t(95056,e.DiagnosticCategory.Message,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:t(95057,e.DiagnosticCategory.Message,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:t(95058,e.DiagnosticCategory.Message,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:t(95059,e.DiagnosticCategory.Message,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:t(95060,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:t(95061,e.DiagnosticCategory.Message,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:t(95062,e.DiagnosticCategory.Message,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:t(95063,e.DiagnosticCategory.Message,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:t(95064,e.DiagnosticCategory.Message,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:t(95065,e.DiagnosticCategory.Message,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:t(95066,e.DiagnosticCategory.Message,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:t(95067,e.DiagnosticCategory.Message,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:t(95068,e.DiagnosticCategory.Message,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:t(95069,e.DiagnosticCategory.Message,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:t(95070,e.DiagnosticCategory.Message,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:t(95071,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:t(95072,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:t(95073,e.DiagnosticCategory.Message,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:t(95074,e.DiagnosticCategory.Message,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:t(95075,e.DiagnosticCategory.Message,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:t(95077,e.DiagnosticCategory.Message,"Extract_type_95077","Extract type"),Extract_to_type_alias:t(95078,e.DiagnosticCategory.Message,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:t(95079,e.DiagnosticCategory.Message,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:t(95080,e.DiagnosticCategory.Message,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:t(95081,e.DiagnosticCategory.Message,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:t(95082,e.DiagnosticCategory.Message,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:t(95083,e.DiagnosticCategory.Message,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:t(95084,e.DiagnosticCategory.Message,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:t(95085,e.DiagnosticCategory.Message,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:t(95086,e.DiagnosticCategory.Message,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:t(95087,e.DiagnosticCategory.Message,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:t(95088,e.DiagnosticCategory.Message,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:t(95089,e.DiagnosticCategory.Message,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:t(95090,e.DiagnosticCategory.Message,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:t(95091,e.DiagnosticCategory.Message,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:t(95092,e.DiagnosticCategory.Message,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:t(95093,e.DiagnosticCategory.Message,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:t(95094,e.DiagnosticCategory.Message,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:t(95095,e.DiagnosticCategory.Message,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:t(95096,e.DiagnosticCategory.Message,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:t(95097,e.DiagnosticCategory.Message,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:t(95098,e.DiagnosticCategory.Message,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:t(95099,e.DiagnosticCategory.Message,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:t(95100,e.DiagnosticCategory.Message,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:t(95101,e.DiagnosticCategory.Message,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_function_expression_0_to_arrow_function:t(95105,e.DiagnosticCategory.Message,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:t(95106,e.DiagnosticCategory.Message,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:t(95107,e.DiagnosticCategory.Message,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:t(95108,e.DiagnosticCategory.Message,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:t(95109,e.DiagnosticCategory.Message,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:t(95110,e.DiagnosticCategory.Message,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:t(95111,e.DiagnosticCategory.Message,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:t(95112,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:t(95113,e.DiagnosticCategory.Message,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:t(95114,e.DiagnosticCategory.Message,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:t(95115,e.DiagnosticCategory.Message,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:t(95116,e.DiagnosticCategory.Message,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:t(95117,e.DiagnosticCategory.Message,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:t(95118,e.DiagnosticCategory.Message,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:t(95119,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:t(95120,e.DiagnosticCategory.Message,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:t(95121,e.DiagnosticCategory.Message,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:t(95122,e.DiagnosticCategory.Message,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:t(95123,e.DiagnosticCategory.Message,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:t(95124,e.DiagnosticCategory.Message,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:t(95125,e.DiagnosticCategory.Message,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:t(95126,e.DiagnosticCategory.Message,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:t(95127,e.DiagnosticCategory.Message,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:t(95128,e.DiagnosticCategory.Message,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:t(95129,e.DiagnosticCategory.Message,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:t(95130,e.DiagnosticCategory.Message,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:t(95131,e.DiagnosticCategory.Message,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:t(95132,e.DiagnosticCategory.Message,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:t(95133,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:t(95134,e.DiagnosticCategory.Message,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:t(95135,e.DiagnosticCategory.Message,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:t(95136,e.DiagnosticCategory.Message,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:t(95137,e.DiagnosticCategory.Message,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:t(95138,e.DiagnosticCategory.Message,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:t(95139,e.DiagnosticCategory.Message,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:t(95140,e.DiagnosticCategory.Message,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:t(95141,e.DiagnosticCategory.Message,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:t(95142,e.DiagnosticCategory.Message,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:t(95143,e.DiagnosticCategory.Message,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:t(95144,e.DiagnosticCategory.Message,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:t(95145,e.DiagnosticCategory.Message,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:t(95146,e.DiagnosticCategory.Message,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:t(95147,e.DiagnosticCategory.Message,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:t(95148,e.DiagnosticCategory.Message,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:t(95149,e.DiagnosticCategory.Message,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:t(95150,e.DiagnosticCategory.Message,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:t(95151,e.DiagnosticCategory.Message,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:t(95152,e.DiagnosticCategory.Message,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:t(95153,e.DiagnosticCategory.Message,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenation:t(95154,e.DiagnosticCategory.Message,"Can_only_convert_string_concatenation_95154","Can only convert string concatenation"),Selection_is_not_a_valid_statement_or_statements:t(95155,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:t(95156,e.DiagnosticCategory.Message,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:t(95157,e.DiagnosticCategory.Message,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:t(95158,e.DiagnosticCategory.Message,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:t(95159,e.DiagnosticCategory.Message,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:t(95160,e.DiagnosticCategory.Message,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:t(95161,e.DiagnosticCategory.Message,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:t(95162,e.DiagnosticCategory.Message,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:t(95163,e.DiagnosticCategory.Message,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:t(95164,e.DiagnosticCategory.Message,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:t(95165,e.DiagnosticCategory.Message,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:t(95166,e.DiagnosticCategory.Message,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:t(95167,e.DiagnosticCategory.Message,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:t(95168,e.DiagnosticCategory.Message,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:t(95169,e.DiagnosticCategory.Message,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:t(95170,e.DiagnosticCategory.Message,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:t(95171,e.DiagnosticCategory.Message,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:t(95172,e.DiagnosticCategory.Message,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:t(95173,e.DiagnosticCategory.Message,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:t(18004,e.DiagnosticCategory.Error,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:t(18006,e.DiagnosticCategory.Error,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:t(18007,e.DiagnosticCategory.Error,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:t(18009,e.DiagnosticCategory.Error,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:t(18010,e.DiagnosticCategory.Error,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:t(18011,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:t(18012,e.DiagnosticCategory.Error,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:t(18013,e.DiagnosticCategory.Error,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:t(18014,e.DiagnosticCategory.Error,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:t(18015,e.DiagnosticCategory.Error,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:t(18016,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:t(18017,e.DiagnosticCategory.Error,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:t(18018,e.DiagnosticCategory.Error,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:t(18019,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:t(18024,e.DiagnosticCategory.Error,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:t(18026,e.DiagnosticCategory.Error,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:t(18027,e.DiagnosticCategory.Error,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18028,e.DiagnosticCategory.Error,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:t(18029,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:t(18030,e.DiagnosticCategory.Error,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:t(18031,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:t(18032,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead:t(18033,e.DiagnosticCategory.Error,"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033","Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:t(18034,e.DiagnosticCategory.Message,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:t(18035,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:t(18036,e.DiagnosticCategory.Error,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),Await_expression_cannot_be_used_inside_a_class_static_block:t(18037,e.DiagnosticCategory.Error,"Await_expression_cannot_be_used_inside_a_class_static_block_18037","Await expression cannot be used inside a class static block."),For_await_loops_cannot_be_used_inside_a_class_static_block:t(18038,e.DiagnosticCategory.Error,"For_await_loops_cannot_be_used_inside_a_class_static_block_18038","'For await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:t(18039,e.DiagnosticCategory.Error,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:t(18041,e.DiagnosticCategory.Error,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block.")}}(c||(c={})),function(e){var t;function r(e){return e>=79}e.tokenIsIdentifierOrKeyword=r,e.tokenIsIdentifierOrKeywordOrGreaterThan=function(e){return 31===e||r(e)},e.textToKeywordObj=((t={abstract:126,any:130,as:127,asserts:128,assert:129,bigint:158,boolean:133,break:81,case:82,catch:83,class:84,continue:86,const:85}).constructor=134,t.debugger=87,t.declare=135,t.default=88,t.delete=89,t.do=90,t.else=91,t.enum=92,t.export=93,t.extends=94,t.false=95,t.finally=96,t.for=97,t.from=156,t.function=98,t.get=136,t.if=99,t.implements=117,t.import=100,t.in=101,t.infer=137,t.instanceof=102,t.interface=118,t.intrinsic=138,t.is=139,t.keyof=140,t.let=119,t.module=141,t.namespace=142,t.never=143,t.new=103,t.null=104,t.number=147,t.object=148,t.package=120,t.private=121,t.protected=122,t.public=123,t.override=159,t.out=144,t.readonly=145,t.require=146,t.global=157,t.return=105,t.set=149,t.static=124,t.string=150,t.super=106,t.switch=107,t.symbol=151,t.this=108,t.throw=109,t.true=110,t.try=111,t.type=152,t.typeof=112,t.undefined=153,t.unique=154,t.unknown=155,t.var=113,t.void=114,t.while=115,t.with=116,t.yield=125,t.async=131,t.await=132,t.of=160,t);var i=new e.Map(e.getEntries(e.textToKeywordObj)),a=new e.Map(e.getEntries(n(n({},e.textToKeywordObj),{"{":18,"}":19,"(":20,")":21,"[":22,"]":23,".":24,"...":25,";":26,",":27,"<":29,">":31,"<=":32,">=":33,"==":34,"!=":35,"===":36,"!==":37,"=>":38,"+":39,"-":40,"**":42,"*":41,"/":43,"%":44,"++":45,"--":46,"<<":47,">":48,">>>":49,"&":50,"|":51,"^":52,"!":53,"~":54,"&&":55,"||":56,"?":57,"??":60,"?.":28,":":58,"=":63,"+=":64,"-=":65,"*=":66,"**=":67,"/=":68,"%=":69,"<<=":70,">>=":71,">>>=":72,"&=":73,"|=":74,"^=":78,"||=":75,"&&=":76,"??=":77,"@":59,"#":62,"`":61}))),o=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],s=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],c=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],l=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],u=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],d=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],_=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,p=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;function f(e,t){if(e=2?u:1===t?c:o)}e.isUnicodeIdentifierStart=m;var g,y=(g=[],a.forEach((function(e,t){g[e]=t})),g);function h(e){for(var t=new Array,r=0,n=0;r127&&T(i)&&(t.push(n),n=r)}}return t.push(n),t}function v(t,r,n,i,a){(r<0||r>=t.length)&&(a?r=r<0?0:r>=t.length?t.length-1:r:e.Debug.fail("Bad line number. Line: ".concat(r,", lineStarts.length: ").concat(t.length," , line map is correct? ").concat(void 0!==i?e.arraysEqual(t,h(i)):"unknown")));var o=t[r]+n;return a?o>t[r+1]?t[r+1]:"string"==typeof i&&o>i.length?i.length:o:(r=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function T(e){return 10===e||13===e||8232===e||8233===e}function E(e){return e>=48&&e<=57}function k(e){return E(e)||e>=65&&e<=70||e>=97&&e<=102}function A(e){return e>=48&&e<=55}e.tokenToString=function(e){return y[e]},e.stringToToken=function(e){return a.get(e)},e.computeLineStarts=h,e.getPositionOfLineAndCharacter=function(e,t,r,n){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,n):v(b(e),t,r,e.text,n)},e.computePositionOfLineAndCharacter=v,e.getLineStarts=b,e.computeLineAndCharacterOfPosition=x,e.computeLineOfPosition=S,e.getLinesBetweenPositions=function(e,t,r){if(t===r)return 0;var n=b(e),i=Math.min(t,r),a=i===r,o=a?t:r,s=S(n,i),c=S(n,o,s);return a?s-c:c-s},e.getLineAndCharacterOfPosition=function(e,t){return x(b(e),t)},e.isWhiteSpaceLike=D,e.isWhiteSpaceSingleLine=C,e.isLineBreak=T,e.isOctalDigit=A,e.couldStartTrivia=function(e,t){var r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return!0;case 35:return 0===t;default:return r>127}},e.skipTrivia=function(t,r,n,i,a){if(e.positionIsSynthesized(r))return r;for(var o=!1;;){var s=t.charCodeAt(r);switch(s){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)return r;o=!!a;continue;case 9:case 11:case 12:case 32:r++;continue;case 47:if(i)break;if(47===t.charCodeAt(r+1)){for(r+=2;r127&&D(s)){r++;continue}}return r}};var N="<<<<<<<".length;function w(t,r){if(e.Debug.assert(r>=0),0===r||T(t.charCodeAt(r-1))){var n=t.charCodeAt(r);if(r+N=0&&r127&&D(m)){d&&T(m)&&(u=!0),r++;continue}break e}}return d&&(p=i(s,c,l,u,a,p)),p}function L(e,t,r,n,i){return M(!0,e,t,!1,r,n,i)}function R(e,t,r,n,i){return M(!0,e,t,!0,r,n,i)}function B(e,t,r,n,i,a){return a||(a=[]),a.push({kind:r,pos:e,end:t,hasTrailingNewLine:n}),a}function J(e){var t=P.exec(e);if(t)return t[0]}function j(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&m(e,t)}function U(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||1===r&&(45===e||58===e)||e>127&&function(e,t){return f(e,t>=2?d:1===t?l:s)}(e,t)}e.isShebangTrivia=I,e.scanShebangTrivia=O,e.forEachLeadingCommentRange=function(e,t,r,n){return M(!1,e,t,!1,r,n)},e.forEachTrailingCommentRange=function(e,t,r,n){return M(!1,e,t,!0,r,n)},e.reduceEachLeadingCommentRange=L,e.reduceEachTrailingCommentRange=R,e.getLeadingCommentRanges=function(e,t){return L(e,t,B,void 0,void 0)},e.getTrailingCommentRanges=function(e,t){return R(e,t,B,void 0,void 0)},e.getShebang=J,e.isIdentifierStart=j,e.isIdentifierPart=U,e.isIdentifierText=function(e,t,r){var n=V(e,0);if(!j(n,t))return!1;for(var i=K(n);i116},isReservedWord:function(){return g>=81&&g<=116},isUnterminated:function(){return 0!=(4&h)},getCommentDirectives:function(){return v},getNumericLiteralFlags:function(){return 1008&h},getTokenFlags:function(){return h},reScanGreaterToken:function(){if(31===g){if(62===b.charCodeAt(u))return 62===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,g=72):(u+=2,g=49):61===b.charCodeAt(u+1)?(u+=2,g=71):(u++,g=48);if(61===b.charCodeAt(u))return u++,g=33}return g},reScanAsteriskEqualsToken:function(){return e.Debug.assert(66===g,"'reScanAsteriskEqualsToken' should only be called on a '*='"),u=m+1,g=63},reScanSlashToken:function(){if(43===g||68===g){for(var r=m+1,n=!1,i=!1;;){if(r>=d){h|=4,N(e.Diagnostics.Unterminated_regular_expression_literal);break}var a=b.charCodeAt(r);if(T(a)){h|=4,N(e.Diagnostics.Unterminated_regular_expression_literal);break}if(n)n=!1;else{if(47===a&&!i){r++;break}91===a?i=!0:92===a?n=!0:93===a&&(i=!1)}r++}for(;r=d)return g=1;var e=V(b,u);switch(u+=K(e),e){case 9:case 11:case 12:case 32:for(;u=0&&j(r,t))return u+=3,h|=8,y=X()+Z(),g=ee();var n=$();return n>=0&&j(n,t)?(u+=6,h|=1024,y=String.fromCharCode(n)+Z(),g=ee()):(u++,g=0)}if(j(e,t)){for(var i=e;u=65&&s<=70)s+=32;else if(!(s>=48&&s<=57||s>=97&&s<=102))break;i.push(s),u++,o=!1}}return i.length=d){n+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_string_literal);break}var a=b.charCodeAt(u);if(a===r){n+=b.substring(i,u),u++;break}if(92!==a||t){if(T(a)&&!t){n+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_string_literal);break}u++}else n+=b.substring(i,u),n+=H(),i=u}return n}function W(t){for(var r,n=96===b.charCodeAt(u),i=++u,a="";;){if(u>=d){a+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_template_literal),r=n?14:17;break}var o=b.charCodeAt(u);if(96===o){a+=b.substring(i,u),u++,r=n?14:17;break}if(36===o&&u+1=d)return N(e.Diagnostics.Unexpected_end_of_text),"";var n=b.charCodeAt(u);switch(u++,n){case 48:return t&&u=0?String.fromCharCode(r):(N(e.Diagnostics.Hexadecimal_digit_expected),"")}function X(){var t=J(1,!1),r=t?parseInt(t,16):-1,n=!1;return r<0?(N(e.Diagnostics.Hexadecimal_digit_expected),n=!0):r>1114111&&(N(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),u>=d?(N(e.Diagnostics.Unexpected_end_of_text),n=!0):125===b.charCodeAt(u)?u++:(N(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":G(r)}function $(){if(u+5=2&&117===V(b,u+1)&&123===V(b,u+2)){var e=u;u+=3;var r=J(1,!1),n=r?parseInt(r,16):-1;return u=e,n}return-1}function Z(){for(var e="",r=u;u=0&&U(n,t)){u+=3,h|=8,e+=X(),r=u;continue}if(!((n=$())>=0&&U(n,t)))break;h|=1024,e+=b.substring(r,u),e+=G(n),r=u+=6}}return e+=b.substring(r,u)}function ee(){var e=y.length;if(e>=2&&e<=12){var t=y.charCodeAt(0);if(t>=97&&t<=122){var r=i.get(y);if(void 0!==r)return g=r}}return g=79}function te(t){for(var r="",n=!1,i=!1;;){var a=b.charCodeAt(u);if(95!==a){if(n=!0,!E(a)||a-48>=t)break;r+=b[u],u++,i=!1}else h|=512,n?(n=!1,i=!0):N(i?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++}return 95===b.charCodeAt(u-1)&&N(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),r}function re(){if(110===b.charCodeAt(u))return y+="n",384&h&&(y=e.parsePseudoBigInt(y)+"n"),u++,9;var t=128&h?parseInt(y.slice(2),2):256&h?parseInt(y.slice(2),8):+y;return y=""+t,8}function ne(){var r;f=u,h=0;for(var i=!1;;){if(m=u,u>=d)return g=1;var o=V(b,u);if(35===o&&0===u&&I(b,u)){if(u=O(b,u),n)continue;return g=6}switch(o){case 10:case 13:if(h|=1,n){u++;continue}return 13===o&&u+1=0&&j(S,t))return u+=3,h|=8,y=X()+Z(),g=ee();var D=$();return D>=0&&j(D,t)?(u+=6,h|=1024,y=String.fromCharCode(D)+Z(),g=ee()):(N(e.Diagnostics.Invalid_character),u++,g=0);case 35:return 0!==u&&"!"===b[u+1]?(N(e.Diagnostics.can_only_be_used_at_the_start_of_a_file),u++,g=0):(j(V(b,u+1),t)?(u++,ie(V(b,u),t)):(y=String.fromCharCode(V(b,u)),N(e.Diagnostics.Invalid_character,u++,K(o))),g=80);default:var k=ie(o,t);if(k)return g=k;if(C(o)){u+=K(o);continue}if(T(o)){h|=1,u+=K(o);continue}var P=K(o);return N(e.Diagnostics.Invalid_character,u,P),u+=P,g=0}}}function ie(e,t){var r=e;if(j(r,t)){for(u+=K(r);u=d)return g=1;var r=b.charCodeAt(u);if(60===r)return 47===b.charCodeAt(u+1)?(u+=2,g=30):(u++,g=29);if(123===r)return u++,g=18;for(var n=0;u0)break;D(r)||(n=u)}u++}return y=b.substring(f,u),-1===n?12:11}function se(){switch(f=u,b.charCodeAt(u)){case 34:case 39:return y=q(!0),g=10;default:return ne()}}function ce(e,t){var r=u,n=f,i=m,a=g,o=y,s=h,c=e();return c&&!t||(u=r,f=n,m=i,g=a,y=o,h=s),c}function le(e,t,r){b=e||"",d=void 0===r?b.length:t+r,ue(t||0)}function ue(t){e.Debug.assert(t>=0),u=t,f=t,m=t,g=0,y=void 0,h=0}};var V=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n=e.charCodeAt(t);if(n>=55296&&n<=56319&&r>t+1){var i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return 1024*(n-55296)+i-56320+65536}return n}};function K(e){return e>=65536?2:1}var z=String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var r=Math.floor((t-65536)/1024)+55296,n=(t-65536)%1024+56320;return String.fromCharCode(r,n)};function G(e){return z(e)}e.utf16EncodeAsString=G}(c||(c={})),function(e){function t(e){return e.start+e.length}function r(e){return 0===e.length}function n(e,t){var r=a(e,t);return r&&0===r.length?void 0:r}function i(e,t,r,n){return r<=e+t&&r+n>=e}function a(e,r){var n=Math.max(e.start,r.start),i=Math.min(t(e),t(r));return n<=i?s(n,i):void 0}function o(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function s(e,t){return o(e,t-e)}function c(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}function l(t){return!!Y(t)&&e.every(t.elements,u)}function u(t){return!!e.isOmittedExpression(t)||l(t.name)}function d(t){for(var r=t.parent;e.isBindingElement(r.parent);)r=r.parent.parent;return r.parent}function _(t,r){e.isBindingElement(t)&&(t=d(t));var n=r(t);return 254===t.kind&&(t=t.parent),t&&255===t.kind&&(n|=r(t),t=t.parent),t&&237===t.kind&&(n|=r(t)),n}function p(e){return 0==(8&e.flags)}function f(e){var t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function m(e){return f(e.escapedText)}function g(t){var r=t.parent.parent;if(r){if(se(r))return y(r);switch(r.kind){case 237:if(r.declarationList&&r.declarationList.declarations[0])return y(r.declarationList.declarations[0]);break;case 238:var n=r.expression;switch(221===n.kind&&63===n.operatorToken.kind&&(n=n.left),n.kind){case 206:return n.name;case 207:var i=n.argumentExpression;if(e.isIdentifier(i))return i}break;case 212:return y(r.expression);case 250:if(se(r.statement)||ne(r.statement))return y(r.statement)}}}function y(t){var r=x(t);return r&&e.isIdentifier(r)?r:void 0}function h(e){return e.name||g(e)}function v(e){return!!e.name}function b(t){switch(t.kind){case 79:return t;case 347:case 340:var r=t.name;if(161===r.kind)return r.right;break;case 208:case 221:var n=t;switch(e.getAssignmentDeclarationKind(n)){case 1:case 4:case 5:case 3:return e.getElementOrPropertyAccessArgumentExpressionOrName(n.left);case 7:case 8:case 9:return n.arguments[1];default:return}case 345:return h(t);case 339:return g(t);case 271:var i=t.expression;return e.isIdentifier(i)?i:void 0;case 207:var a=t;if(e.isBindableStaticElementAccessExpression(a))return a.argumentExpression}return t.name}function x(t){if(void 0!==t)return b(t)||(e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t)?S(t):void 0)}function S(t){if(t.parent){if(e.isPropertyAssignment(t.parent)||e.isBindingElement(t.parent))return t.parent.name;if(e.isBinaryExpression(t.parent)&&t===t.parent.right){if(e.isIdentifier(t.parent.left))return t.parent.left;if(e.isAccessExpression(t.parent.left))return e.getElementOrPropertyAccessArgumentExpressionOrName(t.parent.left)}else if(e.isVariableDeclaration(t.parent)&&e.isIdentifier(t.parent.name))return t.parent.name}}function D(t,r){if(t.name){if(e.isIdentifier(t.name)){var n=t.name.escapedText;return N(t.parent,r).filter((function(t){return e.isJSDocParameterTag(t)&&e.isIdentifier(t.name)&&t.name.escapedText===n}))}var i=t.parent.parameters.indexOf(t);e.Debug.assert(i>-1,"Parameters should always be in their parents' parameter list");var a=N(t.parent,r).filter(e.isJSDocParameterTag);if(i=161}function B(e){return e>=0&&e<=160}function J(e){return 8<=e&&e<=14}function j(e){return 14<=e&&e<=17}function U(t){return(e.isPropertyDeclaration(t)||Q(t))&&e.isPrivateIdentifier(t.name)}function V(e){switch(e){case 126:case 131:case 85:case 135:case 88:case 93:case 101:case 123:case 121:case 122:case 145:case 124:case 144:case 159:return!0}return!1}function K(t){return!!(16476&e.modifierToFlag(t))}function z(e){return!!e&&q(e.kind)}function G(e){switch(e){case 256:case 169:case 171:case 172:case 173:case 213:case 214:return!0;default:return!1}}function q(e){switch(e){case 168:case 174:case 323:case 175:case 176:case 179:case 317:case 180:return!0;default:return G(e)}}function W(e){var t=e.kind;return 171===t||167===t||169===t||172===t||173===t||176===t||170===t||234===t}function H(e){return e&&(257===e.kind||226===e.kind)}function Q(e){switch(e.kind){case 169:case 172:case 173:return!0;default:return!1}}function X(e){var t=e.kind;return 175===t||174===t||166===t||168===t||176===t||172===t||173===t}function $(e){var t=e.kind;return 296===t||297===t||298===t||169===t||172===t||173===t}function Y(e){if(e){var t=e.kind;return 202===t||201===t}return!1}function Z(e){switch(e.kind){case 201:case 205:return!0}return!1}function ee(e){switch(e.kind){case 202:case 204:return!0}return!1}function te(e){switch(e){case 206:case 207:case 209:case 208:case 278:case 279:case 282:case 210:case 204:case 212:case 205:case 226:case 213:case 79:case 80:case 13:case 8:case 9:case 10:case 14:case 223:case 95:case 104:case 108:case 110:case 106:case 230:case 228:case 231:case 100:return!0;default:return!1}}function re(e){switch(e){case 219:case 220:case 215:case 216:case 217:case 218:case 211:return!0;default:return te(e)}}function ne(e){return function(e){switch(e){case 222:case 224:case 214:case 221:case 225:case 229:case 227:case 351:case 350:return!0;default:return re(e)}}(M(e).kind)}function ie(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function ae(e){return 256===e||276===e||257===e||258===e||259===e||260===e||261===e||266===e||265===e||272===e||271===e||264===e}function oe(e){return 246===e||245===e||253===e||240===e||238===e||236===e||243===e||244===e||242===e||239===e||250===e||247===e||249===e||251===e||252===e||237===e||241===e||248===e||349===e||353===e||352===e}function se(t){return 163===t.kind?t.parent&&344!==t.parent.kind||e.isInJSFile(t):214===(r=t.kind)||203===r||257===r||226===r||170===r||171===r||260===r||299===r||275===r||256===r||213===r||172===r||267===r||265===r||270===r||258===r||285===r||169===r||168===r||261===r||264===r||268===r||274===r||164===r||296===r||167===r||166===r||173===r||297===r||259===r||163===r||254===r||345===r||338===r||347===r;var r}function ce(e){return e.kind>=327&&e.kind<=347}e.isExternalModuleNameRelative=function(t){return e.pathIsRelative(t)||e.isRootedDiskPath(t)},e.sortAndDeduplicateDiagnostics=function(t){return e.sortAndDeduplicate(t,e.compareDiagnostics)},e.getDefaultLibFileName=function(t){switch(e.getEmitScriptTarget(t)){case 99:return"lib.esnext.full.d.ts";case 9:return"lib.es2022.full.d.ts";case 8:return"lib.es2021.full.d.ts";case 7:return"lib.es2020.full.d.ts";case 6:return"lib.es2019.full.d.ts";case 5:return"lib.es2018.full.d.ts";case 4:return"lib.es2017.full.d.ts";case 3:return"lib.es2016.full.d.ts";case 2:return"lib.es6.d.ts";default:return"lib.d.ts"}},e.textSpanEnd=t,e.textSpanIsEmpty=r,e.textSpanContainsPosition=function(e,r){return r>=e.start&&r=e.pos&&t<=e.end},e.textSpanContainsTextSpan=function(e,r){return r.start>=e.start&&t(r)<=t(e)},e.textSpanOverlapsWith=function(e,t){return void 0!==n(e,t)},e.textSpanOverlap=n,e.textSpanIntersectsWithTextSpan=function(e,t){return i(e.start,e.length,t.start,t.length)},e.textSpanIntersectsWith=function(e,t,r){return i(e.start,e.length,t,r)},e.decodedTextSpanIntersectsWith=i,e.textSpanIntersectsWithPosition=function(e,r){return r<=t(e)&&r>=e.start},e.textSpanIntersection=a,e.createTextSpan=o,e.createTextSpanFromBounds=s,e.textChangeRangeNewSpan=function(e){return o(e.span.start,e.newLength)},e.textChangeRangeIsUnchanged=function(e){return r(e.span)&&0===e.newLength},e.createTextChangeRange=c,e.unchangedTextChangeRange=c(o(0,0),0),e.collapseTextChangeRangesAcrossMultipleVersions=function(r){if(0===r.length)return e.unchangedTextChangeRange;if(1===r.length)return r[0];for(var n=r[0],i=n.span.start,a=t(n.span),o=i+n.newLength,l=1;l=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e},e.unescapeLeadingUnderscores=f,e.idText=m,e.symbolName=function(e){return e.valueDeclaration&&U(e.valueDeclaration)?m(e.valueDeclaration.name):f(e.escapedName)},e.nodeHasName=function t(r,n){return!(!v(r)||!e.isIdentifier(r.name)||m(r.name)!==m(n))||!(!e.isVariableStatement(r)||!e.some(r.declarationList.declarations,(function(e){return t(e,n)})))},e.getNameOfJSDocTypedef=h,e.isNamedDeclaration=v,e.getNonAssignedNameOfDeclaration=b,e.getNameOfDeclaration=x,e.getAssignedName=S,e.getJSDocParameterTags=C,e.getJSDocParameterTagsNoCache=function(e){return D(e,!0)},e.getJSDocTypeParameterTags=function(e){return T(e,!1)},e.getJSDocTypeParameterTagsNoCache=function(e){return T(e,!0)},e.hasJSDocParameterTags=function(t){return!!F(t,e.isJSDocParameterTag)},e.getJSDocAugmentsTag=function(t){return F(t,e.isJSDocAugmentsTag)},e.getJSDocImplementsTags=function(t){return P(t,e.isJSDocImplementsTag)},e.getJSDocClassTag=function(t){return F(t,e.isJSDocClassTag)},e.getJSDocPublicTag=function(t){return F(t,e.isJSDocPublicTag)},e.getJSDocPublicTagNoCache=function(t){return F(t,e.isJSDocPublicTag,!0)},e.getJSDocPrivateTag=function(t){return F(t,e.isJSDocPrivateTag)},e.getJSDocPrivateTagNoCache=function(t){return F(t,e.isJSDocPrivateTag,!0)},e.getJSDocProtectedTag=function(t){return F(t,e.isJSDocProtectedTag)},e.getJSDocProtectedTagNoCache=function(t){return F(t,e.isJSDocProtectedTag,!0)},e.getJSDocReadonlyTag=function(t){return F(t,e.isJSDocReadonlyTag)},e.getJSDocReadonlyTagNoCache=function(t){return F(t,e.isJSDocReadonlyTag,!0)},e.getJSDocOverrideTagNoCache=function(t){return F(t,e.isJSDocOverrideTag,!0)},e.getJSDocDeprecatedTag=function(t){return F(t,e.isJSDocDeprecatedTag)},e.getJSDocDeprecatedTagNoCache=function(t){return F(t,e.isJSDocDeprecatedTag,!0)},e.getJSDocEnumTag=function(t){return F(t,e.isJSDocEnumTag)},e.getJSDocThisTag=function(t){return F(t,e.isJSDocThisTag)},e.getJSDocReturnTag=E,e.getJSDocTemplateTag=function(t){return F(t,e.isJSDocTemplateTag)},e.getJSDocTypeTag=k,e.getJSDocType=A,e.getJSDocReturnType=function(t){var r=E(t);if(r&&r.typeExpression)return r.typeExpression.type;var n=k(t);if(n&&n.typeExpression){var i=n.typeExpression.type;if(e.isTypeLiteralNode(i)){var a=e.find(i.members,e.isCallSignatureDeclaration);return a&&a.type}if(e.isFunctionTypeNode(i)||e.isJSDocFunctionType(i))return i.type}},e.getJSDocTags=w,e.getJSDocTagsNoCache=function(e){return N(e,!0)},e.getAllJSDocTags=P,e.getAllJSDocTagsOfKind=function(e,t){return w(e).filter((function(e){return e.kind===t}))},e.getTextOfJSDocComment=function(t){return"string"==typeof t?t:null==t?void 0:t.map((function(t){return 321===t.kind?t.text:function(t){var r=324===t.kind?"link":325===t.kind?"linkcode":"linkplain",n=t.name?e.entityNameToString(t.name):"",i=t.name&&t.text.startsWith("://")?"":" ";return"{@".concat(r," ").concat(n).concat(i).concat(t.text,"}")}(t)})).join("")},e.getEffectiveTypeParameterDeclarations=function(t){if(e.isJSDocSignature(t))return e.emptyArray;if(e.isJSDocTypeAlias(t))return e.Debug.assert(320===t.parent.kind),e.flatMap(t.parent.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}));if(t.typeParameters)return t.typeParameters;if(e.isInJSFile(t)){var r=e.getJSDocTypeParameterDeclarations(t);if(r.length)return r;var n=A(t);if(n&&e.isFunctionTypeNode(n)&&n.typeParameters)return n.typeParameters}return e.emptyArray},e.getEffectiveConstraintOfTypeParameter=function(t){return t.constraint?t.constraint:e.isJSDocTemplateTag(t.parent)&&t===t.parent.typeParameters[0]?t.parent.constraint:void 0},e.isMemberName=function(e){return 79===e.kind||80===e.kind},e.isGetOrSetAccessorDeclaration=function(e){return 173===e.kind||172===e.kind},e.isPropertyAccessChain=function(t){return e.isPropertyAccessExpression(t)&&!!(32&t.flags)},e.isElementAccessChain=function(t){return e.isElementAccessExpression(t)&&!!(32&t.flags)},e.isCallChain=function(t){return e.isCallExpression(t)&&!!(32&t.flags)},e.isOptionalChain=I,e.isOptionalChainRoot=O,e.isExpressionOfOptionalChainRoot=function(e){return O(e.parent)&&e.parent.expression===e},e.isOutermostOptionalChain=function(e){return!I(e.parent)||O(e.parent)||e!==e.parent.expression},e.isNullishCoalesce=function(e){return 221===e.kind&&60===e.operatorToken.kind},e.isConstTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"const"===t.typeName.escapedText&&!t.typeArguments},e.skipPartiallyEmittedExpressions=M,e.isNonNullChain=function(t){return e.isNonNullExpression(t)&&!!(32&t.flags)},e.isBreakOrContinueStatement=function(e){return 246===e.kind||245===e.kind},e.isNamedExportBindings=function(e){return 274===e.kind||273===e.kind},e.isUnparsedTextLike=L,e.isUnparsedNode=function(e){return L(e)||300===e.kind||304===e.kind},e.isJSDocPropertyLikeTag=function(e){return 347===e.kind||340===e.kind},e.isNode=function(e){return R(e.kind)},e.isNodeKind=R,e.isTokenKind=B,e.isToken=function(e){return B(e.kind)},e.isNodeArray=function(e){return e.hasOwnProperty("pos")&&e.hasOwnProperty("end")},e.isLiteralKind=J,e.isLiteralExpression=function(e){return J(e.kind)},e.isTemplateLiteralKind=j,e.isTemplateLiteralToken=function(e){return j(e.kind)},e.isTemplateMiddleOrTemplateTail=function(e){var t=e.kind;return 16===t||17===t},e.isImportOrExportSpecifier=function(t){return e.isImportSpecifier(t)||e.isExportSpecifier(t)},e.isTypeOnlyImportOrExportDeclaration=function(e){switch(e.kind){case 270:case 275:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 268:return e.parent.isTypeOnly;case 267:case 265:return e.isTypeOnly;default:return!1}},e.isAssertionKey=function(t){return e.isStringLiteral(t)||e.isIdentifier(t)},e.isStringTextContainingNode=function(e){return 10===e.kind||j(e.kind)},e.isGeneratedIdentifier=function(t){return e.isIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isPrivateIdentifierClassElementDeclaration=U,e.isPrivateIdentifierPropertyAccessExpression=function(t){return e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name)},e.isModifierKind=V,e.isParameterPropertyModifier=K,e.isClassMemberModifier=function(e){return K(e)||124===e||159===e},e.isModifier=function(e){return V(e.kind)},e.isEntityName=function(e){var t=e.kind;return 161===t||79===t},e.isPropertyName=function(e){var t=e.kind;return 79===t||80===t||10===t||8===t||162===t},e.isBindingName=function(e){var t=e.kind;return 79===t||201===t||202===t},e.isFunctionLike=z,e.isFunctionLikeOrClassStaticBlockDeclaration=function(t){return!!t&&(q(t.kind)||e.isClassStaticBlockDeclaration(t))},e.isFunctionLikeDeclaration=function(e){return e&&G(e.kind)},e.isBooleanLiteral=function(e){return 110===e.kind||95===e.kind},e.isFunctionLikeKind=q,e.isFunctionOrModuleBlock=function(t){return e.isSourceFile(t)||e.isModuleBlock(t)||e.isBlock(t)&&z(t.parent)},e.isClassElement=W,e.isClassLike=H,e.isAccessor=function(e){return e&&(172===e.kind||173===e.kind)},e.isMethodOrAccessor=Q,e.isTypeElement=X,e.isClassOrTypeElement=function(e){return X(e)||W(e)},e.isObjectLiteralElementLike=$,e.isTypeNode=function(t){return e.isTypeNodeKind(t.kind)},e.isFunctionOrConstructorTypeNode=function(e){switch(e.kind){case 179:case 180:return!0}return!1},e.isBindingPattern=Y,e.isAssignmentPattern=function(e){var t=e.kind;return 204===t||205===t},e.isArrayBindingElement=function(e){var t=e.kind;return 203===t||227===t},e.isDeclarationBindingElement=function(e){switch(e.kind){case 254:case 164:case 203:return!0}return!1},e.isBindingOrAssignmentPattern=function(e){return Z(e)||ee(e)},e.isObjectBindingOrAssignmentPattern=Z,e.isObjectBindingOrAssignmentElement=function(e){switch(e.kind){case 203:case 296:case 297:case 298:return!0}return!1},e.isArrayBindingOrAssignmentPattern=ee,e.isPropertyAccessOrQualifiedNameOrImportTypeNode=function(e){var t=e.kind;return 206===t||161===t||200===t},e.isPropertyAccessOrQualifiedName=function(e){var t=e.kind;return 206===t||161===t},e.isCallLikeExpression=function(e){switch(e.kind){case 280:case 279:case 208:case 209:case 210:case 165:return!0;default:return!1}},e.isCallOrNewExpression=function(e){return 208===e.kind||209===e.kind},e.isTemplateLiteral=function(e){var t=e.kind;return 223===t||14===t},e.isLeftHandSideExpression=function(e){return te(M(e).kind)},e.isUnaryExpression=function(e){return re(M(e).kind)},e.isUnaryExpressionWithWrite=function(e){switch(e.kind){case 220:return!0;case 219:return 45===e.operator||46===e.operator;default:return!1}},e.isExpression=ne,e.isAssertionExpression=function(e){var t=e.kind;return 211===t||229===t},e.isNotEmittedOrPartiallyEmittedNode=function(t){return e.isNotEmittedStatement(t)||e.isPartiallyEmittedExpression(t)},e.isIterationStatement=function e(t,r){switch(t.kind){case 242:case 243:case 244:case 240:case 241:return!0;case 250:return r&&e(t.statement,r)}return!1},e.isScopeMarker=ie,e.hasScopeMarker=function(t){return e.some(t,ie)},e.needsScopeMarker=function(t){return!(e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)||e.isAmbientModule(t))},e.isExternalModuleIndicator=function(t){return e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)},e.isForInOrOfStatement=function(e){return 243===e.kind||244===e.kind},e.isConciseBody=function(t){return e.isBlock(t)||ne(t)},e.isFunctionBody=function(t){return e.isBlock(t)},e.isForInitializer=function(t){return e.isVariableDeclarationList(t)||ne(t)},e.isModuleBody=function(e){var t=e.kind;return 262===t||261===t||79===t},e.isNamespaceBody=function(e){var t=e.kind;return 262===t||261===t},e.isJSDocNamespaceBody=function(e){var t=e.kind;return 79===t||261===t},e.isNamedImportBindings=function(e){var t=e.kind;return 269===t||268===t},e.isModuleOrEnumDeclaration=function(e){return 261===e.kind||260===e.kind},e.isDeclaration=se,e.isDeclarationStatement=function(e){return ae(e.kind)},e.isStatementButNotDeclaration=function(e){return oe(e.kind)},e.isStatement=function(t){var r=t.kind;return oe(r)||ae(r)||function(t){if(235!==t.kind)return!1;if(void 0!==t.parent&&(252===t.parent.kind||292===t.parent.kind))return!1;return!e.isFunctionBlock(t)}(t)},e.isStatementOrBlock=function(e){var t=e.kind;return oe(t)||ae(t)||235===t},e.isModuleReference=function(e){var t=e.kind;return 277===t||161===t||79===t},e.isJsxTagNameExpression=function(e){var t=e.kind;return 108===t||79===t||206===t},e.isJsxChild=function(e){var t=e.kind;return 278===t||288===t||279===t||11===t||282===t},e.isJsxAttributeLike=function(e){var t=e.kind;return 285===t||287===t},e.isStringLiteralOrJsxExpression=function(e){var t=e.kind;return 10===t||288===t},e.isJsxOpeningLikeElement=function(e){var t=e.kind;return 280===t||279===t},e.isCaseOrDefaultClause=function(e){var t=e.kind;return 289===t||290===t},e.isJSDocNode=function(e){return e.kind>=309&&e.kind<=347},e.isJSDocCommentContainingNode=function(t){return 320===t.kind||319===t.kind||321===t.kind||ue(t)||ce(t)||e.isJSDocTypeLiteral(t)||e.isJSDocSignature(t)},e.isJSDocTag=ce,e.isSetAccessor=function(e){return 173===e.kind},e.isGetAccessor=function(e){return 172===e.kind},e.hasJSDocNodes=function(e){var t=e.jsDoc;return!!t&&t.length>0},e.hasType=function(e){return!!e.type},e.hasInitializer=function(e){return!!e.initializer},e.hasOnlyExpressionInitializer=function(e){switch(e.kind){case 254:case 164:case 203:case 166:case 167:case 296:case 299:return!0;default:return!1}},e.isObjectLiteralElement=function(e){return 285===e.kind||287===e.kind||$(e)},e.isTypeReferenceType=function(e){return 178===e.kind||228===e.kind};var le=1073741823;function ue(e){return 324===e.kind||325===e.kind||326===e.kind}e.guessIndentation=function(t){for(var r=le,n=0,i=t;n=0);var n=e.getLineStarts(r),i=t,a=r.text;if(i+1===n.length)return a.length-1;var o=n[i],s=n[i+1]-1;for(e.Debug.assert(e.isLineBreak(a.charCodeAt(s)));o<=s&&e.isLineBreak(a.charCodeAt(s));)s--;return s}function _(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function p(e){return!_(e)}function f(e,t,n){if(void 0===t||0===t.length)return e;for(var i=0;i0?h(t._children[0],r,n):e.skipTrivia((r||u(t)).text,t.pos,!1,!1,De(t))}function v(e,t,r){return void 0===r&&(r=!1),b(e.text,t,r)}function b(t,r,n){if(void 0===n&&(n=!1),_(r))return"";var i=t.substring(n?r.pos:e.skipTrivia(t,r.pos),r.end);return function(t){return!!e.findAncestor(t,e.isJSDocTypeExpression)}(r)&&(i=i.split(/\r\n|\n|\r/).map((function(t){return e.trimStringStart(t.replace(/^\s*\*/,""))})).join("\n")),i}function x(e,t){return void 0===t&&(t=!1),v(u(e),e,t)}function S(e){return e.pos}function D(e){var t=e.emitNode;return t&&t.flags||0}function C(e){var t=Ft(e);return 254===t.kind&&292===t.parent.kind}function T(t){return e.isModuleDeclaration(t)&&(10===t.name.kind||k(t))}function E(t){return e.isModuleDeclaration(t)||e.isIdentifier(t)}function k(e){return!!(1024&e.flags)}function A(e){return T(e)&&N(e)}function N(t){switch(t.parent.kind){case 305:return e.isExternalModule(t.parent);case 262:return T(t.parent.parent)&&e.isSourceFile(t.parent.parent.parent)&&!e.isExternalModule(t.parent.parent.parent)}return!1}function w(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find((function(t){return!(A(t)||e.isModuleDeclaration(t)&&k(t))}))}function F(t,r){switch(t.kind){case 305:case 263:case 292:case 261:case 242:case 243:case 244:case 171:case 169:case 172:case 173:case 256:case 213:case 214:case 167:case 170:return!0;case 235:return!e.isFunctionLikeOrClassStaticBlockDeclaration(r)}return!1}function P(t){switch(t.kind){case 174:case 175:case 168:case 176:case 179:case 180:case 317:case 257:case 226:case 258:case 259:case 344:case 256:case 169:case 171:case 172:case 173:case 213:case 214:return!0;default:return e.assertType(t),!1}}function I(e){switch(e.kind){case 266:case 265:return!0;default:return!1}}function O(t){return I(t)||e.isExportDeclaration(t)}function M(t){return e.findAncestor(t.parent,(function(e){return F(e,e.parent)}))}function L(e){return e&&0!==s(e)?x(e):"(Missing)"}function R(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:case 14:return e.escapeLeadingUnderscores(t.text);case 162:return Ct(t.expression)?e.escapeLeadingUnderscores(t.expression.text):void 0;default:return e.Debug.assertNever(t)}}function B(t){switch(t.kind){case 108:return"this";case 80:case 79:return 0===s(t)?e.idText(t):x(t);case 161:return B(t.left)+"."+B(t.right);case 206:return e.isIdentifier(t.name)||e.isPrivateIdentifier(t.name)?B(t.expression)+"."+B(t.name):e.Debug.assertNever(t.name);case 311:return B(t.left)+B(t.right);default:return e.Debug.assertNever(t)}}function J(e,t,r,n,i,a,o){var s=K(e,t);return Dn(e,s.start,s.length,r,n,i,a,o)}function j(t,r,n){e.Debug.assertGreaterThanOrEqual(r,0),e.Debug.assertGreaterThanOrEqual(n,0),t&&(e.Debug.assertLessThanOrEqual(r,t.text.length),e.Debug.assertLessThanOrEqual(r+n,t.text.length))}function U(e,t,r,n,i){return j(e,t,r),{file:e,start:t,length:r,code:n.code,category:n.category,messageText:n.next?n:n.messageText,relatedInformation:i}}function V(t,r){var n=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,r);n.scan();var i=n.getTokenPos();return e.createTextSpanFromBounds(i,n.getTextPos())}function K(t,r){var n=r;switch(r.kind){case 305:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):V(t,i);case 254:case 203:case 257:case 226:case 258:case 261:case 260:case 299:case 256:case 213:case 169:case 172:case 173:case 259:case 167:case 166:case 268:n=r.name;break;case 214:return function(t,r){var n=e.skipTrivia(t.text,r.pos);if(r.body&&235===r.body.kind){var i=e.getLineAndCharacterOfPosition(t,r.body.pos).line;if(i0?r.statements[0].pos:r.end;return e.createTextSpanFromBounds(a,o)}if(void 0===n)return V(t,r.pos);e.Debug.assert(!e.isJSDoc(n));var s=_(n),c=s||e.isJsxText(r)?n.pos:e.skipTrivia(t.text,n.pos);return s?(e.Debug.assert(c===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(e.Debug.assert(c>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),e.createTextSpanFromBounds(c,n.end)}function z(e){return 6===e.scriptKind}function G(t){return!!(2&e.getCombinedNodeFlags(t))}function q(e){return 208===e.kind&&100===e.expression.kind}function W(t){return e.isImportTypeNode(t)&&e.isLiteralTypeNode(t.argument)&&e.isStringLiteral(t.argument.literal)}function H(e){return 238===e.kind&&10===e.expression.kind}function Q(e){return!!(1048576&D(e))}function X(t){return e.isIdentifier(t.name)&&!t.initializer}e.changesAffectModuleResolution=function(e,t){return e.configFilePath!==t.configFilePath||a(e,t)},e.optionsHaveModuleResolutionChanges=a,e.changesAffectingProgramStructure=function(t,r){return o(t,r,e.optionsAffectingProgramStructure)},e.optionsHaveChanges=o,e.forEachAncestor=function(t,r){for(;;){var n=r(t);if("quit"===n)return;if(void 0!==n)return n;if(e.isSourceFile(t))return;t=t.parent}},e.forEachEntry=function(e,t){for(var r=e.entries(),n=r.next();!n.done;n=r.next()){var i=n.value,a=i[0],o=t(i[1],a);if(o)return o}},e.forEachKey=function(e,t){for(var r=e.keys(),n=r.next();!n.done;n=r.next()){var i=t(n.value);if(i)return i}},e.copyEntries=function(e,t){e.forEach((function(e,r){t.set(r,e)}))},e.usingSingleLineStringWriter=function(e){var t=i.getText();try{return e(i),i.getText()}finally{i.clear(),i.writeKeyword(t)}},e.getFullWidth=s,e.getResolvedModule=function(e,t,r){return e&&e.resolvedModules&&e.resolvedModules.get(t,r)},e.setResolvedModule=function(t,r,n,i){t.resolvedModules||(t.resolvedModules=e.createModeAwareCache()),t.resolvedModules.set(r,i,n)},e.setResolvedTypeReferenceDirective=function(t,r,n){t.resolvedTypeReferenceDirectiveNames||(t.resolvedTypeReferenceDirectiveNames=e.createModeAwareCache()),t.resolvedTypeReferenceDirectiveNames.set(r,void 0,n)},e.projectReferenceIsEqualTo=function(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular},e.moduleResolutionIsEqualTo=function(e,t){return e.isExternalLibraryImport===t.isExternalLibraryImport&&e.extension===t.extension&&e.resolvedFileName===t.resolvedFileName&&e.originalPath===t.originalPath&&function(e,t){return e===t||!!e&&!!t&&e.name===t.name&&e.subModuleName===t.subModuleName&&e.version===t.version}(e.packageId,t.packageId)},e.packageIdToPackageName=c,e.packageIdToString=function(e){return"".concat(c(e),"@").concat(e.version)},e.typeDirectiveIsEqualTo=function(e,t){return e.resolvedFileName===t.resolvedFileName&&e.primary===t.primary&&e.originalPath===t.originalPath},e.hasChangesInResolutions=function(t,r,n,i,a){e.Debug.assert(t.length===r.length);for(var o=0;o=0),e.getLineStarts(r)[t]},e.nodePosToString=function(t){var r=u(t),n=e.getLineAndCharacterOfPosition(r,t.pos);return"".concat(r.fileName,"(").concat(n.line+1,",").concat(n.character+1,")")},e.getEndLinePosition=d,e.isFileLevelUniqueName=function(e,t,r){return!(r&&r(t)||e.identifiers.has(t))},e.nodeIsMissing=_,e.nodeIsPresent=p,e.insertStatementsAfterStandardPrologue=function(e,t){return f(e,t,H)},e.insertStatementsAfterCustomPrologue=function(e,t){return f(e,t,g)},e.insertStatementAfterStandardPrologue=function(e,t){return m(e,t,H)},e.insertStatementAfterCustomPrologue=function(e,t){return m(e,t,g)},e.isRecognizedTripleSlashComment=function(t,r,n){if(47===t.charCodeAt(r+1)&&r+2=e.ModuleKind.ES2015||!r.noImplicitUseStrict)))},e.isBlockScope=F,e.isDeclarationWithTypeParameters=function(t){switch(t.kind){case 338:case 345:case 323:return!0;default:return e.assertType(t),P(t)}},e.isDeclarationWithTypeParameterChildren=P,e.isAnyImportSyntax=I,e.isAnyImportOrBareOrAccessedRequire=function(e){return I(e)||Ee(e)},e.isLateVisibilityPaintedStatement=function(e){switch(e.kind){case 266:case 265:case 237:case 257:case 256:case 261:case 259:case 258:case 260:return!0;default:return!1}},e.hasPossibleExternalModuleReference=function(t){return O(t)||e.isModuleDeclaration(t)||e.isImportTypeNode(t)||q(t)},e.isAnyImportOrReExport=O,e.getEnclosingBlockScopeContainer=M,e.forEachEnclosingBlockScopeContainer=function(e,t){for(var r=M(e);r;)t(r),r=M(r)},e.declarationNameToString=L,e.getNameFromIndexInfo=function(e){return e.declaration?L(e.declaration.parameters[0].name):void 0},e.isComputedNonLiteralName=function(e){return 162===e.kind&&!Ct(e.expression)},e.tryGetTextOfPropertyName=R,e.getTextOfPropertyName=function(t){return e.Debug.checkDefined(R(t))},e.entityNameToString=B,e.createDiagnosticForNode=function(e,t,r,n,i,a){return J(u(e),e,t,r,n,i,a)},e.createDiagnosticForNodeArray=function(t,r,n,i,a,o,s){var c=e.skipTrivia(t.text,r.pos);return Dn(t,c,r.end-c,n,i,a,o,s)},e.createDiagnosticForNodeInSourceFile=J,e.createDiagnosticForNodeFromMessageChain=function(e,t,r){var n=u(e),i=K(n,e);return U(n,i.start,i.length,t,r)},e.createFileDiagnosticFromMessageChain=U,e.createDiagnosticForFileFromMessageChain=function(e,t,r){return{file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}},e.createDiagnosticMessageChainFromDiagnostic=function(e){return"string"==typeof e.messageText?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText},e.createDiagnosticForRange=function(e,t,r){return{file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}},e.getSpanOfTokenAtPosition=V,e.getErrorSpanForNode=K,e.isExternalOrCommonJsModule=function(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)},e.isJsonSourceFile=z,e.isEnumConst=function(t){return!!(2048&e.getCombinedModifierFlags(t))},e.isDeclarationReadonly=function(t){return!(!(64&e.getCombinedModifierFlags(t))||e.isParameterPropertyDeclaration(t,t.parent))},e.isVarConst=G,e.isLet=function(t){return!!(1&e.getCombinedNodeFlags(t))},e.isSuperCall=function(e){return 208===e.kind&&106===e.expression.kind},e.isImportCall=q,e.isImportMeta=function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText},e.isLiteralImportTypeNode=W,e.isPrologueDirective=H,e.isCustomPrologue=Q,e.isHoistedFunction=function(t){return Q(t)&&e.isFunctionDeclaration(t)},e.isHoistedVariableStatement=function(t){return Q(t)&&e.isVariableStatement(t)&&e.every(t.declarationList.declarations,X)},e.getLeadingCommentRangesOfNode=function(t,r){return 11!==t.kind?e.getLeadingCommentRanges(r.text,t.pos):void 0},e.getJSDocCommentRanges=function(t,r){var n=164===t.kind||163===t.kind||213===t.kind||214===t.kind||212===t.kind||254===t.kind||275===t.kind?e.concatenate(e.getTrailingCommentRanges(r,t.pos),e.getLeadingCommentRanges(r,t.pos)):e.getLeadingCommentRanges(r,t.pos);return e.filter(n,(function(e){return 42===r.charCodeAt(e.pos+1)&&42===r.charCodeAt(e.pos+2)&&47!==r.charCodeAt(e.pos+3)}))},e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*/;var $=/^(\/\/\/\s*/;e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*/;var Y,Z,ee,te,re=/^(\/\/\/\s*/;function ne(t){if(177<=t.kind&&t.kind<=200)return!0;switch(t.kind){case 130:case 155:case 147:case 158:case 150:case 133:case 151:case 148:case 153:case 143:return!0;case 114:return 217!==t.parent.kind;case 228:return e.isHeritageClause(t.parent)&&!Kr(t);case 163:return 195===t.parent.kind||190===t.parent.kind;case 79:(161===t.parent.kind&&t.parent.right===t||206===t.parent.kind&&t.parent.name===t)&&(t=t.parent),e.Debug.assert(79===t.kind||161===t.kind||206===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 161:case 206:case 108:var r=t.parent;if(181===r.kind)return!1;if(200===r.kind)return!r.isTypeOf;if(177<=r.kind&&r.kind<=200)return!0;switch(r.kind){case 228:return e.isHeritageClause(r.parent)&&!Kr(r);case 163:case 344:return t===r.constraint;case 167:case 166:case 164:case 254:case 256:case 213:case 214:case 171:case 169:case 168:case 172:case 173:case 174:case 175:case 176:case 211:return t===r.type;case 208:case 209:return e.contains(r.typeArguments,t);case 210:return!1}}return!1}function ie(e){if(e)switch(e.kind){case 203:case 299:case 164:case 296:case 167:case 166:case 297:case 254:return!0}return!1}function ae(e){return 255===e.parent.kind&&237===e.parent.parent.kind}function oe(t){return!!Se(t)&&(e.isBinaryExpression(t)&&1===Le(t))}function se(e,t,r){return e.properties.filter((function(e){if(296===e.kind){var n=R(e.name);return t===n||!!r&&r===n}return!1}))}function ce(t){if(t&&t.statements.length){var r=t.statements[0].expression;return e.tryCast(r,e.isObjectLiteralExpression)}}function le(t,r){var n=ce(t);return n?se(n,r):e.emptyArray}function ue(t,r){for(e.Debug.assert(305!==t.kind);;){if(!(t=t.parent))return e.Debug.fail();switch(t.kind){case 162:if(e.isClassLike(t.parent.parent))return t;t=t.parent;break;case 165:164===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);break;case 214:if(!r)continue;case 256:case 213:case 261:case 170:case 167:case 166:case 169:case 168:case 171:case 172:case 173:case 174:case 175:case 176:case 260:case 305:return t}}}function de(e){var t=e.kind;return(206===t||207===t)&&106===e.expression.kind}function _e(t,r,n){if(e.isNamedDeclaration(t)&&e.isPrivateIdentifier(t.name))return!1;switch(t.kind){case 257:return!0;case 167:return 257===r.kind;case 172:case 173:case 169:return void 0!==t.body&&257===r.kind;case 164:return void 0!==r.body&&(171===r.kind||169===r.kind||173===r.kind)&&257===n.kind}return!1}function pe(e,t,r){return void 0!==e.decorators&&_e(e,t,r)}function fe(e,t,r){return pe(e,t,r)||me(e,t)}function me(t,r){switch(t.kind){case 257:return e.some(t.members,(function(e){return fe(e,t,r)}));case 169:case 173:case 171:return e.some(t.parameters,(function(e){return pe(e,t,r)}));default:return!1}}function ge(e){var t=e.parent;return(280===t.kind||279===t.kind||281===t.kind)&&t.tagName===e}function ye(t){switch(t.kind){case 106:case 104:case 110:case 95:case 13:case 204:case 205:case 206:case 207:case 208:case 209:case 210:case 229:case 211:case 230:case 212:case 213:case 226:case 214:case 217:case 215:case 216:case 219:case 220:case 221:case 222:case 225:case 223:case 227:case 278:case 279:case 282:case 224:case 218:case 231:return!0;case 228:return!e.isHeritageClause(t.parent);case 161:for(;161===t.parent.kind;)t=t.parent;return 181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 311:for(;e.isJSDocMemberName(t.parent);)t=t.parent;return 181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 80:return e.isBinaryExpression(t.parent)&&t.parent.left===t&&101===t.parent.operatorToken.kind;case 79:if(181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t))return!0;case 8:case 9:case 10:case 14:case 108:return he(t);default:return!1}}function he(e){var t=e.parent;switch(t.kind){case 254:case 164:case 167:case 166:case 299:case 296:case 203:return t.initializer===e;case 238:case 239:case 240:case 241:case 247:case 248:case 249:case 289:case 251:return t.expression===e;case 242:var r=t;return r.initializer===e&&255!==r.initializer.kind||r.condition===e||r.incrementor===e;case 243:case 244:var n=t;return n.initializer===e&&255!==n.initializer.kind||n.expression===e;case 211:case 229:case 233:case 162:return e===t.expression;case 165:case 288:case 287:case 298:return!0;case 228:return t.expression===e&&!ne(t);case 297:return t.objectAssignmentInitializer===e;default:return ye(t)}}function ve(e){for(;161===e.kind||79===e.kind;)e=e.parent;return 181===e.kind}function be(e){return 265===e.kind&&277===e.moduleReference.kind}function xe(e){return Se(e)}function Se(e){return!!e&&!!(262144&e.flags)}function De(e){return!!e&&!!(8388608&e.flags)}function Ce(t,r){if(208!==t.kind)return!1;var n=t,i=n.expression,a=n.arguments;if(79!==i.kind||"require"!==i.escapedText)return!1;if(1!==a.length)return!1;var o=a[0];return!r||e.isStringLiteralLike(o)}function Te(e){return ke(e,!1)}function Ee(e){return ke(e,!0)}function ke(t,r){return e.isVariableDeclaration(t)&&!!t.initializer&&Ce(r?dn(t.initializer):t.initializer,!0)}function Ae(t){return e.isBinaryExpression(t)||un(t)||e.isIdentifier(t)||e.isCallExpression(t)}function Ne(t){return Se(t)&&t.initializer&&e.isBinaryExpression(t.initializer)&&(56===t.initializer.operatorToken.kind||60===t.initializer.operatorToken.kind)&&t.name&&zr(t.name)&&Fe(t.name,t.initializer.left)?t.initializer.right:t.initializer}function we(t,r){if(e.isCallExpression(t)){var n=_t(t.expression);return 213===n.kind||214===n.kind?t:void 0}return 213===t.kind||226===t.kind||214===t.kind||e.isObjectLiteralExpression(t)&&(0===t.properties.length||r)?t:void 0}function Fe(t,r){return Nt(t)&&Nt(r)?wt(t)===wt(r):e.isMemberName(t)&&Be(r)&&(108===r.expression.kind||e.isIdentifier(r.expression)&&("window"===r.expression.escapedText||"self"===r.expression.escapedText||"global"===r.expression.escapedText))?Fe(t,Ke(r)):!(!Be(t)||!Be(r))&&(Ge(t)===Ge(r)&&Fe(t.expression,r.expression))}function Pe(e){for(;Vr(e,!0);)e=e.right;return e}function Ie(t){return e.isIdentifier(t)&&"exports"===t.escapedText}function Oe(t){return e.isIdentifier(t)&&"module"===t.escapedText}function Me(t){return(e.isPropertyAccessExpression(t)||Je(t))&&Oe(t.expression)&&"exports"===Ge(t)}function Le(t){var r=function(t){if(e.isCallExpression(t)){if(!Re(t))return 0;var r=t.arguments[0];return Ie(r)||Me(r)?8:je(r)&&"prototype"===Ge(r)?9:7}if(63!==t.operatorToken.kind||!un(t.left)||function(t){return e.isVoidExpression(t)&&e.isNumericLiteral(t.expression)&&"0"===t.expression.text}(Pe(t)))return 0;if(Ve(t.left.expression,!0)&&"prototype"===Ge(t.left)&&e.isObjectLiteralExpression(We(t)))return 6;return qe(t.left)}(t);return 5===r||Se(t)?r:0}function Re(t){return 3===e.length(t.arguments)&&e.isPropertyAccessExpression(t.expression)&&e.isIdentifier(t.expression.expression)&&"Object"===e.idText(t.expression.expression)&&"defineProperty"===e.idText(t.expression.name)&&Ct(t.arguments[1])&&Ve(t.arguments[0],!0)}function Be(t){return e.isPropertyAccessExpression(t)||Je(t)}function Je(t){return e.isElementAccessExpression(t)&&Ct(t.argumentExpression)}function je(t,r){return e.isPropertyAccessExpression(t)&&(!r&&108===t.expression.kind||e.isIdentifier(t.name)&&Ve(t.expression,!0))||Ue(t,r)}function Ue(e,t){return Je(e)&&(!t&&108===e.expression.kind||zr(e.expression)||je(e.expression,!0))}function Ve(e,t){return zr(e)||je(e,t)}function Ke(t){return e.isPropertyAccessExpression(t)?t.name:t.argumentExpression}function ze(t){if(e.isPropertyAccessExpression(t))return t.name;var r=_t(t.argumentExpression);return e.isNumericLiteral(r)||e.isStringLiteralLike(r)?r:t}function Ge(t){var r=ze(t);if(r){if(e.isIdentifier(r))return r.escapedText;if(e.isStringLiteralLike(r)||e.isNumericLiteral(r))return e.escapeLeadingUnderscores(r.text)}}function qe(t){if(108===t.expression.kind)return 4;if(Me(t))return 2;if(Ve(t.expression,!0)){if(qr(t.expression))return 3;for(var r=t;!e.isIdentifier(r.expression);)r=r.expression;var n=r.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===Ge(r))&&je(t))return 1;if(Ve(t,!0)||e.isElementAccessExpression(t)&&kt(t))return 5}return 0}function We(t){for(;e.isBinaryExpression(t.right);)t=t.right;return t.right}function He(t){switch(t.parent.kind){case 266:case 272:return t.parent;case 277:return t.parent.parent;case 208:return q(t.parent)||Ce(t.parent,!1)?t.parent:void 0;case 196:return e.Debug.assert(e.isStringLiteral(t)),e.tryCast(t.parent.parent,e.isImportTypeNode);default:return}}function Qe(t){switch(t.kind){case 266:case 272:return t.moduleSpecifier;case 265:return 277===t.moduleReference.kind?t.moduleReference.expression:void 0;case 200:return W(t)?t.argument.literal:void 0;case 208:return t.arguments[0];case 261:return 10===t.name.kind?t.name:void 0;default:return e.Debug.assertNever(t)}}function Xe(e){return 345===e.kind||338===e.kind||339===e.kind}function $e(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&0!==Le(t.expression)&&e.isBinaryExpression(t.expression.right)&&(56===t.expression.right.operatorToken.kind||60===t.expression.right.operatorToken.kind)?t.expression.right.right:void 0}function Ye(e){switch(e.kind){case 237:var t=Ze(e);return t&&t.initializer;case 167:case 296:return e.initializer}}function Ze(t){return e.isVariableStatement(t)?e.firstOrUndefined(t.declarationList.declarations):void 0}function et(t){return e.isModuleDeclaration(t)&&t.body&&261===t.body.kind?t.body:void 0}function tt(t,r){if(e.isJSDoc(r)){var n=e.filter(r.tags,(function(e){return rt(t,e)}));return r.tags===n?[r]:n}return rt(t,r)?[r]:void 0}function rt(t,r){return!(e.isJSDocTypeTag(r)&&r.parent&&e.isJSDoc(r.parent)&&e.isParenthesizedExpression(r.parent.parent)&&r.parent.parent!==t)}function nt(t){var r=t.parent;return 296===r.kind||271===r.kind||167===r.kind||238===r.kind&&206===t.kind||247===r.kind||et(r)||e.isBinaryExpression(t)&&63===t.operatorToken.kind?r:r.parent&&(Ze(r.parent)===t||e.isBinaryExpression(r)&&63===r.operatorToken.kind)?r.parent:r.parent&&r.parent.parent&&(Ze(r.parent.parent)||Ye(r.parent.parent)===t||$e(r.parent.parent))?r.parent.parent:void 0}function it(t){var r=at(t);if(r)return e.isPropertySignature(r)&&r.type&&e.isFunctionLike(r.type)?r.type:e.isFunctionLike(r)?r:void 0}function at(t){var r=ot(t);if(r)return $e(r)||function(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&63===t.expression.operatorToken.kind?Pe(t.expression):void 0}(r)||Ye(r)||Ze(r)||et(r)||r}function ot(t){var r=st(t);if(r){var n=r.parent;return n&&n.jsDoc&&r===e.lastOrUndefined(n.jsDoc)?n:void 0}}function st(t){return e.findAncestor(t.parent,e.isJSDoc)}function ct(t){var r=e.isJSDocParameterTag(t)?t.typeExpression&&t.typeExpression.type:t.type;return void 0!==t.dotDotDotToken||!!r&&318===r.kind}function lt(e){for(var t=e.parent;;){switch(t.kind){case 221:var r=t.operatorToken.kind;return Jr(r)&&t.left===e?63===r||Br(r)?1:2:0;case 219:case 220:var n=t.operator;return 45===n||46===n?2:0;case 243:case 244:return t.initializer===e?1:0;case 212:case 204:case 225:case 230:e=t;break;case 298:e=t.parent;break;case 297:if(t.name!==e)return 0;e=t.parent;break;case 296:if(t.name===e)return 0;e=t.parent;break;default:return 0}t=e.parent}}function ut(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function dt(e){return ut(e,212)}function _t(t,r){var n=r?17:1;return e.skipOuterExpressions(t,n)}function pt(t){return zr(t)||e.isClassExpression(t)}function ft(e){return pt(mt(e))}function mt(t){return e.isExportAssignment(t)?t.expression:t.right}function gt(t){var r=yt(t);if(r&&Se(t)){var n=e.getJSDocAugmentsTag(t);if(n)return n.class}return r}function yt(e){var t=bt(e.heritageClauses,94);return t&&t.types.length>0?t.types[0]:void 0}function ht(t){if(Se(t))return e.getJSDocImplementsTags(t).map((function(e){return e.class}));var r=bt(t.heritageClauses,117);return null==r?void 0:r.types}function vt(e){var t=bt(e.heritageClauses,94);return t?t.types:void 0}function bt(e,t){if(e)for(var r=0,n=e;r0&&e.every(t.declarationList.declarations,(function(e){return Te(e)}))},e.isSingleOrDoubleQuote=function(e){return 39===e||34===e},e.isStringDoubleQuoted=function(e,t){return 34===v(t,e).charCodeAt(0)},e.isAssignmentDeclaration=Ae,e.getEffectiveInitializer=Ne,e.getDeclaredExpandoInitializer=function(e){var t=Ne(e);return t&&we(t,qr(e.name))},e.getAssignedExpandoInitializer=function(t){if(t&&t.parent&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind){var r=qr(t.parent.left);return we(t.parent.right,r)||function(t,r,n){var i=e.isBinaryExpression(r)&&(56===r.operatorToken.kind||60===r.operatorToken.kind)&&we(r.right,n);if(i&&Fe(t,r.left))return i}(t.parent.left,t.parent.right,r)}if(t&&e.isCallExpression(t)&&Re(t)){var n=function(t,r){return e.forEach(t.properties,(function(t){return e.isPropertyAssignment(t)&&e.isIdentifier(t.name)&&"value"===t.name.escapedText&&t.initializer&&we(t.initializer,r)}))}(t.arguments[2],"prototype"===t.arguments[1].text);if(n)return n}},e.getExpandoInitializer=we,e.isDefaultedExpandoInitializer=function(t){var r=e.isVariableDeclaration(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind?t.parent.left:void 0;return r&&we(t.right,qr(r))&&zr(r)&&Fe(r,t.left)},e.getNameOfExpando=function(t){if(e.isBinaryExpression(t.parent)){var r=56!==t.parent.operatorToken.kind&&60!==t.parent.operatorToken.kind||!e.isBinaryExpression(t.parent.parent)?t.parent:t.parent.parent;if(63===r.operatorToken.kind&&e.isIdentifier(r.left))return r.left}else if(e.isVariableDeclaration(t.parent))return t.parent.name},e.isSameEntityName=Fe,e.getRightMostAssignedExpression=Pe,e.isExportsIdentifier=Ie,e.isModuleIdentifier=Oe,e.isModuleExportsAccessExpression=Me,e.getAssignmentDeclarationKind=Le,e.isBindableObjectDefinePropertyCall=Re,e.isLiteralLikeAccess=Be,e.isLiteralLikeElementAccess=Je,e.isBindableStaticAccessExpression=je,e.isBindableStaticElementAccessExpression=Ue,e.isBindableStaticNameExpression=Ve,e.getNameOrArgument=Ke,e.getElementOrPropertyAccessArgumentExpressionOrName=ze,e.getElementOrPropertyAccessName=Ge,e.getAssignmentDeclarationPropertyAccessKind=qe,e.getInitializerOfBinaryExpression=We,e.isPrototypePropertyAssignment=function(t){return e.isBinaryExpression(t)&&3===Le(t)},e.isSpecialPropertyDeclaration=function(t){return Se(t)&&t.parent&&238===t.parent.kind&&(!e.isElementAccessExpression(t)||Je(t))&&!!e.getJSDocTypeTag(t.parent)},e.setValueDeclaration=function(e,t){var r=e.valueDeclaration;(!r||(!(16777216&t.flags)||16777216&r.flags)&&Ae(r)&&!Ae(t)||r.kind!==t.kind&&E(r))&&(e.valueDeclaration=t)},e.isFunctionSymbol=function(t){if(!t||!t.valueDeclaration)return!1;var r=t.valueDeclaration;return 256===r.kind||e.isVariableDeclaration(r)&&r.initializer&&e.isFunctionLike(r.initializer)},e.tryGetModuleSpecifierFromDeclaration=function(t){var r,n;switch(t.kind){case 254:return null===(r=e.findAncestor(t.initializer,(function(e){return Ce(e,!0)})))||void 0===r?void 0:r.arguments[0];case 266:return e.tryCast(t.moduleSpecifier,e.isStringLiteralLike);case 265:return e.tryCast(null===(n=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===n?void 0:n.expression,e.isStringLiteralLike);default:e.Debug.assertNever(t)}},e.importFromModuleSpecifier=function(t){return He(t)||e.Debug.failBadSyntaxKind(t.parent)},e.tryGetImportFromModuleSpecifier=He,e.getExternalModuleName=Qe,e.getNamespaceDeclarationNode=function(t){switch(t.kind){case 266:return t.importClause&&e.tryCast(t.importClause.namedBindings,e.isNamespaceImport);case 265:return t;case 272:return t.exportClause&&e.tryCast(t.exportClause,e.isNamespaceExport);default:return e.Debug.assertNever(t)}},e.isDefaultImport=function(e){return 266===e.kind&&!!e.importClause&&!!e.importClause.name},e.forEachImportClauseDeclaration=function(t,r){var n;if(t.name&&(n=r(t)))return n;if(t.namedBindings&&(n=e.isNamespaceImport(t.namedBindings)?r(t.namedBindings):e.forEach(t.namedBindings.elements,r)))return n},e.hasQuestionToken=function(e){if(e)switch(e.kind){case 164:case 169:case 168:case 297:case 296:case 167:case 166:return void 0!==e.questionToken}return!1},e.isJSDocConstructSignature=function(t){var r=e.isJSDocFunctionType(t)?e.firstOrUndefined(t.parameters):void 0,n=e.tryCast(r&&r.name,e.isIdentifier);return!!n&&"new"===n.escapedText},e.isJSDocTypeAlias=Xe,e.isTypeAlias=function(t){return Xe(t)||e.isTypeAliasDeclaration(t)},e.getSingleInitializerOfVariableStatementOrPropertyDeclaration=Ye,e.getSingleVariableOfVariableStatement=Ze,e.getJSDocCommentsAndTags=function(t,r){var n;ie(t)&&e.hasInitializer(t)&&e.hasJSDocNodes(t.initializer)&&(n=e.addRange(n,tt(t,e.last(t.initializer.jsDoc))));for(var i=t;i&&i.parent;){if(e.hasJSDocNodes(i)&&(n=e.addRange(n,tt(t,e.last(i.jsDoc)))),164===i.kind){n=e.addRange(n,(r?e.getJSDocParameterTagsNoCache:e.getJSDocParameterTags)(i));break}if(163===i.kind){n=e.addRange(n,(r?e.getJSDocTypeParameterTagsNoCache:e.getJSDocTypeParameterTags)(i));break}i=nt(i)}return n||e.emptyArray},e.getNextJSDocCommentLocation=nt,e.getParameterSymbolFromJSDoc=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t.name)){var r=t.name.escapedText,n=it(t);if(n){var i=e.find(n.parameters,(function(e){return 79===e.name.kind&&e.name.escapedText===r}));return i&&i.symbol}}},e.getEffectiveContainerForJSDocTemplateTag=function(t){if(e.isJSDoc(t.parent)&&t.parent.tags){var r=e.find(t.parent.tags,Xe);if(r)return r}return it(t)},e.getHostSignatureFromJSDoc=it,e.getEffectiveJSDocHost=at,e.getJSDocHost=ot,e.getJSDocRoot=st,e.getTypeParameterFromJsDoc=function(t){var r=t.name.escapedText,n=t.parent.parent.parent.typeParameters;return n&&e.find(n,(function(e){return e.name.escapedText===r}))},e.hasRestParameter=function(t){var r=e.lastOrUndefined(t.parameters);return!!r&&ct(r)},e.isRestParameter=ct,e.hasTypeArguments=function(e){return!!e.typeArguments},(Y=e.AssignmentKind||(e.AssignmentKind={}))[Y.None=0]="None",Y[Y.Definite=1]="Definite",Y[Y.Compound=2]="Compound",e.getAssignmentTargetKind=lt,e.isAssignmentTarget=function(e){return 0!==lt(e)},e.isNodeWithPossibleHoistedDeclaration=function(e){switch(e.kind){case 235:case 237:case 248:case 239:case 249:case 263:case 289:case 290:case 250:case 242:case 243:case 244:case 240:case 241:case 252:case 292:return!0}return!1},e.isValueSignatureDeclaration=function(t){return e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isMethodOrAccessor(t)||e.isFunctionDeclaration(t)||e.isConstructorDeclaration(t)},e.walkUpParenthesizedTypes=function(e){return ut(e,191)},e.walkUpParenthesizedExpressions=dt,e.walkUpParenthesizedTypesAndGetParentAndChild=function(e){for(var t;e&&191===e.kind;)t=e,e=e.parent;return[t,e]},e.skipParentheses=_t,e.isDeleteTarget=function(e){return(206===e.kind||207===e.kind)&&((e=dt(e.parent))&&215===e.kind)},e.isNodeDescendantOf=function(e,t){for(;e;){if(e===t)return!0;e=e.parent}return!1},e.isDeclarationName=function(t){return!e.isSourceFile(t)&&!e.isBindingPattern(t)&&e.isDeclaration(t.parent)&&t.parent.name===t},e.getDeclarationFromName=function(t){var r=t.parent;switch(t.kind){case 10:case 14:case 8:if(e.isComputedPropertyName(r))return r.parent;case 79:if(e.isDeclaration(r))return r.name===t?r:void 0;if(e.isQualifiedName(r)){var n=r.parent;return e.isJSDocParameterTag(n)&&n.name===r?n:void 0}var i=r.parent;return e.isBinaryExpression(i)&&0!==Le(i)&&(i.left.symbol||i.symbol)&&e.getNameOfDeclaration(i)===t?i:void 0;case 80:return e.isDeclaration(r)&&r.name===t?r:void 0;default:return}},e.isLiteralComputedPropertyDeclarationName=function(t){return Ct(t)&&162===t.parent.kind&&e.isDeclaration(t.parent.parent)},e.isIdentifierName=function(e){var t=e.parent;switch(t.kind){case 167:case 166:case 169:case 168:case 172:case 173:case 299:case 296:case 206:return t.name===e;case 161:return t.right===e;case 203:case 270:return t.propertyName===e;case 275:case 285:case 279:case 280:case 281:return!0}return!1},e.isAliasSymbolDeclaration=function(t){return!!(265===t.kind||264===t.kind||267===t.kind&&t.name||268===t.kind||274===t.kind||270===t.kind||275===t.kind||271===t.kind&&ft(t))||Se(t)&&(e.isBinaryExpression(t)&&2===Le(t)&&ft(t)||e.isPropertyAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&pt(t.parent.right))},e.getAliasDeclarationFromName=function e(t){switch(t.parent.kind){case 267:case 270:case 268:case 275:case 271:case 265:case 274:return t.parent;case 161:do{t=t.parent}while(161===t.parent.kind);return e(t)}},e.isAliasableExpression=pt,e.exportAssignmentIsAlias=ft,e.getExportAssignmentExpression=mt,e.getPropertyAssignmentAliasLikeExpression=function(e){return 297===e.kind?e.name:296===e.kind?e.initializer:e.parent.right},e.getEffectiveBaseTypeNode=gt,e.getClassExtendsHeritageElement=yt,e.getEffectiveImplementsTypeNodes=ht,e.getAllSuperTypeNodes=function(t){return e.isInterfaceDeclaration(t)?vt(t)||e.emptyArray:e.isClassLike(t)&&e.concatenate(e.singleElementArray(gt(t)),ht(t))||e.emptyArray},e.getInterfaceBaseTypeNodes=vt,e.getHeritageClause=bt,e.getAncestor=function(e,t){for(;e;){if(e.kind===t)return e;e=e.parent}},e.isKeyword=xt,e.isContextualKeyword=St,e.isNonContextualKeyword=Dt,e.isFutureReservedKeyword=function(e){return 117<=e&&e<=125},e.isStringANonContextualKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&Dt(r)},e.isStringAKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&xt(r)},e.isIdentifierANonContextualKeyword=function(e){var t=e.originalKeywordKind;return!!t&&!St(t)},e.isTrivia=function(e){return 2<=e&&e<=7},(Z=e.FunctionFlags||(e.FunctionFlags={}))[Z.Normal=0]="Normal",Z[Z.Generator=1]="Generator",Z[Z.Async=2]="Async",Z[Z.Invalid=4]="Invalid",Z[Z.AsyncGenerator=3]="AsyncGenerator",e.getFunctionFlags=function(e){if(!e)return 4;var t=0;switch(e.kind){case 256:case 213:case 169:e.asteriskToken&&(t|=1);case 214:Tr(e,256)&&(t|=2)}return e.body||(t|=4),t},e.isAsyncFunction=function(e){switch(e.kind){case 256:case 213:case 214:case 169:return void 0!==e.body&&void 0===e.asteriskToken&&Tr(e,256)}return!1},e.isStringOrNumericLiteralLike=Ct,e.isSignedNumericLiteral=Tt,e.hasDynamicName=Et,e.isDynamicName=kt,e.getPropertyNameForPropertyNameNode=At,e.isPropertyNameLiteral=Nt,e.getTextOfIdentifierOrLiteral=wt,e.getEscapedTextOfIdentifierOrLiteral=function(t){return e.isMemberName(t)?t.escapedText:e.escapeLeadingUnderscores(t.text)},e.getPropertyNameForUniqueESSymbol=function(t){return"__@".concat(e.getSymbolId(t),"@").concat(t.escapedName)},e.getSymbolNameForPrivateIdentifier=function(t,r){return"__#".concat(e.getSymbolId(t),"@").concat(r)},e.isKnownSymbol=function(t){return e.startsWith(t.escapedName,"__@")},e.isPrivateIdentifierSymbol=function(t){return e.startsWith(t.escapedName,"__#")},e.isESSymbolIdentifier=function(e){return 79===e.kind&&"Symbol"===e.escapedText},e.isPushOrUnshiftIdentifier=function(e){return"push"===e.escapedText||"unshift"===e.escapedText},e.isParameterDeclaration=function(e){return 164===Ft(e).kind},e.getRootDeclaration=Ft,e.nodeStartsNewLexicalEnvironment=function(e){var t=e.kind;return 171===t||213===t||256===t||214===t||169===t||172===t||173===t||261===t||305===t},e.nodeIsSynthesized=Pt,e.getOriginalSourceFile=function(t){return e.getParseTreeNode(t,e.isSourceFile)||t},(ee=e.Associativity||(e.Associativity={}))[ee.Left=0]="Left",ee[ee.Right=1]="Right",e.getExpressionAssociativity=function(e){var t=Ot(e),r=209===e.kind&&void 0!==e.arguments;return It(e.kind,t,r)},e.getOperatorAssociativity=It,e.getExpressionPrecedence=function(e){var t=Ot(e),r=209===e.kind&&void 0!==e.arguments;return Mt(e.kind,t,r)},e.getOperator=Ot,(te=e.OperatorPrecedence||(e.OperatorPrecedence={}))[te.Comma=0]="Comma",te[te.Spread=1]="Spread",te[te.Yield=2]="Yield",te[te.Assignment=3]="Assignment",te[te.Conditional=4]="Conditional",te[te.Coalesce=4]="Coalesce",te[te.LogicalOR=5]="LogicalOR",te[te.LogicalAND=6]="LogicalAND",te[te.BitwiseOR=7]="BitwiseOR",te[te.BitwiseXOR=8]="BitwiseXOR",te[te.BitwiseAND=9]="BitwiseAND",te[te.Equality=10]="Equality",te[te.Relational=11]="Relational",te[te.Shift=12]="Shift",te[te.Additive=13]="Additive",te[te.Multiplicative=14]="Multiplicative",te[te.Exponentiation=15]="Exponentiation",te[te.Unary=16]="Unary",te[te.Update=17]="Update",te[te.LeftHandSide=18]="LeftHandSide",te[te.Member=19]="Member",te[te.Primary=20]="Primary",te[te.Highest=20]="Highest",te[te.Lowest=0]="Lowest",te[te.Invalid=-1]="Invalid",e.getOperatorPrecedence=Mt,e.getBinaryOperatorPrecedence=Lt,e.getSemanticJsxChildren=function(t){return e.filter(t,(function(e){switch(e.kind){case 288:return!!e.expression;case 11:return!e.containsOnlyTriviaWhiteSpaces;default:return!0}}))},e.createDiagnosticCollection=function(){var t=[],r=[],n=new e.Map,i=!1;return{add:function(a){var o;a.file?(o=n.get(a.file.fileName))||(o=[],n.set(a.file.fileName,o),e.insertSorted(r,a.file.fileName,e.compareStringsCaseSensitive)):(i&&(i=!1,t=t.slice()),o=t);e.insertSorted(o,a,En)},lookup:function(r){var i;i=r.file?n.get(r.file.fileName):t;if(!i)return;var a=e.binarySearch(i,r,e.identity,kn);if(a>=0)return i[a];return},getGlobalDiagnostics:function(){return i=!0,t},getDiagnostics:function(i){if(i)return n.get(i)||[];var a=e.flatMapToMutable(r,(function(e){return n.get(e)}));if(!t.length)return a;return a.unshift.apply(a,t),a}}};var Rt=/\$\{/g;e.hasInvalidEscape=function(t){return t&&!!(e.isNoSubstitutionTemplateLiteral(t)?t.templateFlags:t.head.templateFlags||e.some(t.templateSpans,(function(e){return!!e.literal.templateFlags})))};var Bt=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Jt=/[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,jt=/\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,Ut=new e.Map(e.getEntries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085","\r\n":"\\r\\n"}));function Vt(e){return"\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Kt(e,t,r){if(0===e.charCodeAt(0)){var n=r.charCodeAt(t+e.length);return n>=48&&n<=57?"\\x00":"\\0"}return Ut.get(e)||Vt(e.charCodeAt(0))}function zt(e,t){var r=96===t?jt:39===t?Jt:Bt;return e.replace(r,Kt)}e.escapeString=zt;var Gt=/[^\u0000-\u007F]/g;function qt(e,t){return e=zt(e,t),Gt.test(e)?e.replace(Gt,(function(e){return Vt(e.charCodeAt(0))})):e}e.escapeNonAsciiString=qt;var Wt=/[\"\u0000-\u001f\u2028\u2029\u0085]/g,Ht=/[\'\u0000-\u001f\u2028\u2029\u0085]/g,Qt=new e.Map(e.getEntries({'"':""","'":"'"}));function Xt(e){return 0===e.charCodeAt(0)?"�":Qt.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function $t(e,t){var r=39===t?Ht:Wt;return e.replace(r,Xt)}e.escapeJsxAttributeString=$t,e.stripQuotes=function(e){var t,r=e.length;return r>=2&&e.charCodeAt(0)===e.charCodeAt(r-1)&&(39===(t=e.charCodeAt(0))||34===t||96===t)?e.substring(1,r-1):e},e.isIntrinsicJsxName=function(t){var r=t.charCodeAt(0);return r>=97&&r<=122||e.stringContains(t,"-")||e.stringContains(t,":")};var Yt=[""," "];function Zt(e){for(var t=Yt[1],r=Yt.length;r<=e;r++)Yt.push(Yt[r-1]+t);return Yt[e]}function er(){return Yt[1].length}function tr(e){return!!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function rr(e,t,r){return t.moduleName||ir(e,t.fileName,r&&r.fileName)}function nr(t,r){return t.getCanonicalFileName(e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()))}function ir(t,r,n){var i=function(e){return t.getCanonicalFileName(e)},a=e.toPath(n?e.getDirectoryPath(n):t.getCommonSourceDirectory(),t.getCurrentDirectory(),i),o=e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()),s=pi(e.getRelativePathToDirectoryOrUrl(a,o,a,i,!1));return n?e.ensurePathIsNonModuleName(s):s}function ar(e,t,r,n,i){var a=t.declarationDir||t.outDir,o=a?ur(e,a,r,n,i):e,s=or(o);return pi(o)+s}function or(t){return e.fileExtensionIsOneOf(t,[".mjs",".mts"])?".d.mts":e.fileExtensionIsOneOf(t,[".cjs",".cts"])?".d.cts":e.fileExtensionIsOneOf(t,[".json"])?".json.d.ts":".d.ts"}function sr(e){return e.outFile||e.out}function cr(e,t,r){return!(t.getCompilerOptions().noEmitForJsFiles&&xe(e))&&!e.isDeclarationFile&&!t.isSourceFileFromExternalLibrary(e)&&(r||!(z(e)&&t.getResolvedProjectReferenceToRedirect(e.fileName))&&!t.isSourceOfProjectReferenceRedirect(e.fileName))}function lr(e,t,r){return ur(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))}function ur(t,r,n,i,a){var o=e.getNormalizedAbsolutePath(t,n);return o=0===a(o).indexOf(a(i))?o.substring(i.length):o,e.combinePaths(r,o)}function dr(t,r,n){t.length>e.getRootLength(t)&&!n(t)&&(dr(e.getDirectoryPath(t),r,n),r(t))}function _r(t,r){return e.computeLineOfPosition(t,r)}function pr(t){return e.find(t.members,(function(t){return e.isConstructorDeclaration(t)&&p(t.body)}))}function fr(e){if(e&&e.parameters.length>0){var t=2===e.parameters.length&&mr(e.parameters[0]);return e.parameters[t?1:0]}}function mr(e){return gr(e.name)}function gr(e){return!!e&&79===e.kind&&yr(e)}function yr(e){return 108===e.originalKeywordKind}function hr(t){if(Se(t)||!e.isFunctionDeclaration(t)){var r=t.type;return r||!Se(t)?r:e.isJSDocPropertyLikeTag(t)?t.typeExpression&&t.typeExpression.type:e.getJSDocType(t)}}function vr(e,t,r,n){br(e,t,r.pos,n)}function br(e,t,r,n){n&&n.length&&r!==n[0].pos&&_r(e,r)!==_r(e,n[0].pos)&&t.writeLine()}function xr(e,t,r,n,i,a,o,s){if(n&&n.length>0){i&&r.writeSpace(" ");for(var c=!1,l=0,u=n;l=0&&e.kind<=160?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|Mr(e)),!t||4096&e.modifierFlagsCache||!r&&!Se(e)||!e.parent||(e.modifierFlagsCache|=4096|Or(e)),-536875009&e.modifierFlagsCache)}function Pr(e){return Fr(e,!0)}function Ir(e){return Fr(e,!1)}function Or(t){var r=0;return t.parent&&!e.isParameter(t)&&(Se(t)&&(e.getJSDocPublicTagNoCache(t)&&(r|=4),e.getJSDocPrivateTagNoCache(t)&&(r|=8),e.getJSDocProtectedTagNoCache(t)&&(r|=16),e.getJSDocReadonlyTagNoCache(t)&&(r|=64),e.getJSDocOverrideTagNoCache(t)&&(r|=16384)),e.getJSDocDeprecatedTagNoCache(t)&&(r|=8192)),r}function Mr(e){var t=Lr(e.modifiers);return(4&e.flags||79===e.kind&&e.isInJSDocNamespace)&&(t|=1),t}function Lr(e){var t=0;if(e)for(var r=0,n=e;r=63&&e<=78}function jr(e){var t=Ur(e);return t&&!t.isImplements?t.class:void 0}function Ur(t){return e.isExpressionWithTypeArguments(t)&&e.isHeritageClause(t.parent)&&e.isClassLike(t.parent.parent)?{class:t.parent.parent,isImplements:117===t.parent.token}:void 0}function Vr(t,r){return e.isBinaryExpression(t)&&(r?63===t.operatorToken.kind:Jr(t.operatorToken.kind))&&e.isLeftHandSideExpression(t.left)}function Kr(e){return void 0!==jr(e)}function zr(e){return 79===e.kind||Gr(e)}function Gr(t){return e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&zr(t.expression)}function qr(e){return je(e)&&"prototype"===Ge(e)}function Wr(t){return e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isElementAccessExpression(t.parent)&&t.parent.argumentExpression===t}e.getIndentString=Zt,e.getIndentSize=er,e.isNightly=function(){return e.stringContains(e.version,"-dev")||e.stringContains(e.version,"-insiders")},e.createTextWriter=function(t){var r,n,i,a,o,s=!1;function c(t){var n=e.computeLineStarts(t);n.length>1?(a=a+n.length-1,o=r.length-t.length+e.last(n),i=o-r.length==0):i=!1}function l(e){e&&e.length&&(i&&(e=Zt(n)+e,i=!1),r+=e,c(e))}function u(e){e&&(s=!1),l(e)}function d(){r="",n=0,i=!0,a=0,o=0,s=!1}return d(),{write:u,rawWrite:function(e){void 0!==e&&(r+=e,c(e),s=!1)},writeLiteral:function(e){e&&e.length&&u(e)},writeLine:function(e){i&&!e||(a++,o=(r+=t).length,i=!0,s=!1)},increaseIndent:function(){n++},decreaseIndent:function(){n--},getIndent:function(){return n},getTextPos:function(){return r.length},getLine:function(){return a},getColumn:function(){return i?n*er():r.length-o},getText:function(){return r},isAtStartOfLine:function(){return i},hasTrailingComment:function(){return s},hasTrailingWhitespace:function(){return!!r.length&&e.isWhiteSpaceLike(r.charCodeAt(r.length-1))},clear:d,reportInaccessibleThisError:e.noop,reportPrivateInBaseOfClassExpression:e.noop,reportInaccessibleUniqueSymbolError:e.noop,trackSymbol:function(){return!1},writeKeyword:u,writeOperator:u,writeParameter:u,writeProperty:u,writePunctuation:u,writeSpace:u,writeStringLiteral:u,writeSymbol:function(e,t){return u(e)},writeTrailingSemicolon:u,writeComment:function(e){e&&(s=!0),l(e)},getTextPosWithWriteLine:function(){return i?r.length:r.length+t.length}}},e.getTrailingSemicolonDeferringWriter=function(e){var t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1)}return n(n({},e),{writeTrailingSemicolon:function(){t=!0},writeLiteral:function(t){r(),e.writeLiteral(t)},writeStringLiteral:function(t){r(),e.writeStringLiteral(t)},writeSymbol:function(t,n){r(),e.writeSymbol(t,n)},writePunctuation:function(t){r(),e.writePunctuation(t)},writeKeyword:function(t){r(),e.writeKeyword(t)},writeOperator:function(t){r(),e.writeOperator(t)},writeParameter:function(t){r(),e.writeParameter(t)},writeSpace:function(t){r(),e.writeSpace(t)},writeProperty:function(t){r(),e.writeProperty(t)},writeComment:function(t){r(),e.writeComment(t)},writeLine:function(){r(),e.writeLine()},increaseIndent:function(){r(),e.increaseIndent()},decreaseIndent:function(){r(),e.decreaseIndent()}})},e.hostUsesCaseSensitiveFileNames=tr,e.hostGetCanonicalFileName=function(t){return e.createGetCanonicalFileName(tr(t))},e.getResolvedExternalModuleName=rr,e.getExternalModuleNameFromDeclaration=function(t,r,n){var i=r.getExternalModuleFileFromDeclaration(n);if(i&&!i.isDeclarationFile){var a=Qe(n);if(!a||!e.isStringLiteralLike(a)||e.pathIsRelative(a.text)||-1!==nr(t,i.path).indexOf(nr(t,e.ensureTrailingDirectorySeparator(t.getCommonSourceDirectory()))))return rr(t,i)}},e.getExternalModuleNameFromPath=ir,e.getOwnEmitOutputFilePath=function(e,t,r){var n=t.getCompilerOptions();return(n.outDir?pi(lr(e,t,n.outDir)):pi(e))+r},e.getDeclarationEmitOutputFilePath=function(e,t){return ar(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))},e.getDeclarationEmitOutputFilePathWorker=ar,e.getDeclarationEmitExtensionForPath=or,e.getPossibleOriginalInputExtensionForExtension=function(t){return e.fileExtensionIsOneOf(t,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:e.fileExtensionIsOneOf(t,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:e.fileExtensionIsOneOf(t,[".json.d.ts"])?[".json"]:[".tsx",".ts",".jsx",".js"]},e.outFile=sr,e.getPathsBasePath=function(t,r){var n,i;if(t.paths)return null!==(n=t.baseUrl)&&void 0!==n?n:e.Debug.checkDefined(t.pathsBasePath||(null===(i=r.getCurrentDirectory)||void 0===i?void 0:i.call(r)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")},e.getSourceFilesToEmit=function(t,r,n){var i=t.getCompilerOptions();if(sr(i)){var a=In(i),o=i.emitDeclarationOnly||a===e.ModuleKind.AMD||a===e.ModuleKind.System;return e.filter(t.getSourceFiles(),(function(r){return(o||!e.isExternalModule(r))&&cr(r,t,n)}))}var s=void 0===r?t.getSourceFiles():[r];return e.filter(s,(function(e){return cr(e,t,n)}))},e.sourceFileMayBeEmitted=cr,e.getSourceFilePathInNewDir=lr,e.getSourceFilePathInNewDirWorker=ur,e.writeFile=function(t,r,n,i,a,o,s){t.writeFile(n,i,a,(function(t){r.add(Cn(e.Diagnostics.Could_not_write_file_0_Colon_1,n,t))}),o,s)},e.writeFileEnsuringDirectories=function(t,r,n,i,a,o){try{i(t,r,n)}catch(s){dr(e.getDirectoryPath(e.normalizePath(t)),a,o),i(t,r,n)}},e.getLineOfLocalPosition=function(t,r){var n=e.getLineStarts(t);return e.computeLineOfPosition(n,r)},e.getLineOfLocalPositionFromLineMap=_r,e.getFirstConstructorWithBody=pr,e.getSetAccessorValueParameter=fr,e.getSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&t.type},e.getThisParameter=function(t){if(t.parameters.length&&!e.isJSDocSignature(t)){var r=t.parameters[0];if(mr(r))return r}},e.parameterIsThisKeyword=mr,e.isThisIdentifier=gr,e.isThisInTypeQuery=function(t){if(!gr(t))return!1;for(;e.isQualifiedName(t.parent)&&t.parent.left===t;)t=t.parent;return 181===t.parent.kind},e.identifierIsThisKeyword=yr,e.getAllAccessorDeclarations=function(t,r){var n,i,a,o;return Et(r)?(n=r,172===r.kind?a=r:173===r.kind?o=r:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,(function(t){e.isAccessor(t)&&Er(t)===Er(r)&&(At(t.name)===At(r.name)&&(n?i||(i=t):n=t,172!==t.kind||a||(a=t),173!==t.kind||o||(o=t)))})),{firstAccessor:n,secondAccessor:i,getAccessor:a,setAccessor:o}},e.getEffectiveTypeAnnotationNode=hr,e.getTypeAnnotationNode=function(e){return e.type},e.getEffectiveReturnTypeNode=function(t){return e.isJSDocSignature(t)?t.type&&t.type.typeExpression&&t.type.typeExpression.type:t.type||(Se(t)?e.getJSDocReturnType(t):void 0)},e.getJSDocTypeParameterDeclarations=function(t){return e.flatMap(e.getJSDocTags(t),(function(t){return function(t){return e.isJSDocTemplateTag(t)&&!(320===t.parent.kind&&t.parent.tags.some(Xe))}(t)?t.typeParameters:void 0}))},e.getEffectiveSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&hr(t)},e.emitNewLineBeforeLeadingComments=vr,e.emitNewLineBeforeLeadingCommentsOfPosition=br,e.emitNewLineBeforeLeadingCommentOfPosition=function(e,t,r,n){r!==n&&_r(e,r)!==_r(e,n)&&t.writeLine()},e.emitComments=xr,e.emitDetachedComments=function(t,r,n,i,a,o,s){var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),(function(e){return y(t,e.pos)}))):c=e.getLeadingCommentRanges(t,a.pos),c){for(var u=[],d=void 0,_=0,p=c;_=m+2)break}u.push(f),d=f}if(u.length){m=_r(r,e.last(u).end);_r(r,e.skipTrivia(t,a.pos))>=m+2&&(vr(r,n,a,c),xr(t,r,n,u,!1,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.last(u).end})}}return l},e.writeCommentRange=function(t,r,n,i,a,o){if(42===t.charCodeAt(i+1))for(var s=e.computeLineAndCharacterOfPosition(r,i),c=r.length,l=void 0,u=i,d=s.line;u0){var f=p%er(),m=Zt((p-f)/er());for(n.rawWrite(m);f;)n.rawWrite(" "),f--}else n.rawWrite("")}Sr(t,a,n,o,u,_),u=_}else n.writeComment(t.substring(i,a))},e.hasEffectiveModifiers=function(e){return 0!==Pr(e)},e.hasSyntacticModifiers=function(e){return 0!==Ir(e)},e.hasEffectiveModifier=Cr,e.hasSyntacticModifier=Tr,e.isStatic=Er,e.hasStaticModifier=kr,e.hasOverrideModifier=function(e){return Cr(e,16384)},e.hasAbstractModifier=function(e){return Tr(e,128)},e.hasAmbientModifier=function(e){return Tr(e,2)},e.hasEffectiveReadonlyModifier=Ar,e.getSelectedEffectiveModifierFlags=Nr,e.getSelectedSyntacticModifierFlags=wr,e.getEffectiveModifierFlags=Pr,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc=function(e){return Fr(e,!0,!0)},e.getSyntacticModifierFlags=Ir,e.getEffectiveModifierFlagsNoCache=function(e){return Mr(e)|Or(e)},e.getSyntacticModifierFlagsNoCache=Mr,e.modifiersToFlags=Lr,e.modifierToFlag=Rr,e.createModifiers=function(t){return t?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(t)):void 0},e.isLogicalOperator=function(e){return 56===e||55===e||53===e},e.isLogicalOrCoalescingAssignmentOperator=Br,e.isLogicalOrCoalescingAssignmentExpression=function(e){return Br(e.operatorToken.kind)},e.isAssignmentOperator=Jr,e.tryGetClassExtendingExpressionWithTypeArguments=jr,e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments=Ur,e.isAssignmentExpression=Vr,e.isLeftHandSideOfAssignment=function(e){return Vr(e.parent)&&e.parent.left===e},e.isDestructuringAssignment=function(e){if(Vr(e,!0)){var t=e.left.kind;return 205===t||204===t}return!1},e.isExpressionWithTypeArgumentsInClassExtendsClause=Kr,e.isEntityNameExpression=zr,e.getFirstIdentifier=function(e){switch(e.kind){case 79:return e;case 161:do{e=e.left}while(79!==e.kind);return e;case 206:do{e=e.expression}while(79!==e.kind);return e}},e.isDottedName=function e(t){return 79===t.kind||108===t.kind||106===t.kind||231===t.kind||206===t.kind&&e(t.expression)||212===t.kind&&e(t.expression)},e.isPropertyAccessEntityNameExpression=Gr,e.tryGetPropertyAccessOrIdentifierToString=function t(r){if(e.isPropertyAccessExpression(r)){if(void 0!==(n=t(r.expression)))return n+"."+B(r.name)}else if(e.isElementAccessExpression(r)){var n;if(void 0!==(n=t(r.expression))&&e.isPropertyName(r.argumentExpression))return n+"."+At(r.argumentExpression)}else if(e.isIdentifier(r))return e.unescapeLeadingUnderscores(r.escapedText)},e.isPrototypeAccess=qr,e.isRightSideOfQualifiedNameOrPropertyAccess=function(e){return 161===e.parent.kind&&e.parent.right===e||206===e.parent.kind&&e.parent.name===e},e.isRightSideOfAccessExpression=Wr,e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName=function(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isJSDocMemberName(t.parent)&&t.parent.right===t},e.isEmptyObjectLiteral=function(e){return 205===e.kind&&0===e.properties.length},e.isEmptyArrayLiteral=function(e){return 204===e.kind&&0===e.elements.length},e.getLocalSymbolForExportDefault=function(t){if(function(t){return t&&e.length(t.declarations)>0&&Tr(t.declarations[0],512)}(t)&&t.declarations)for(var r=0,n=t.declarations;r>6|192),r.push(63&a|128)):a<65536?(r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)):a<131072?(r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point")}return r}(t),c=0,l=s.length;c>2,n=(3&s[c])<<4|s[c+1]>>4,i=(15&s[c+1])<<2|s[c+2]>>6,a=63&s[c+2],c+1>=l?i=a=64:c+2>=l&&(a=64),o+=Hr.charAt(r)+Hr.charAt(n)+Hr.charAt(i)+Hr.charAt(a),c+=3;return o}e.convertToBase64=Qr,e.base64encode=function(e,t){return e&&e.base64encode?e.base64encode(t):Qr(t)},e.base64decode=function(e,t){if(e&&e.base64decode)return e.base64decode(t);for(var r=t.length,n=[],i=0;i>4&3,u=(15&o)<<4|s>>2&15,d=(3&s)<<6|63&c;0===u&&0!==s?n.push(l):0===d&&0!==c?n.push(l,u):n.push(l,u,d),i+=4}return function(e){for(var t="",r=0,n=e.length;r=t||-1===r),{pos:t,end:r}}function Zr(e,t){return Yr(t,e.end)}function en(e){return e.decorators&&e.decorators.length>0?Zr(e,e.decorators.end):e}function tn(e,t,r){return rn(nn(e,r,!1),t.end,r)}function rn(t,r,n){return 0===e.getLinesBetweenPositions(n,t,r)}function nn(t,r,n){return yi(t.pos)?-1:e.skipTrivia(r.text,t.pos,!1,n)}function an(e){return void 0!==e.initializer}function on(e){return 33554432&e.flags?e.checkFlags:0}function sn(t){var r=t.parent;if(!r)return 0;switch(r.kind){case 212:case 204:return sn(r);case 220:case 219:var n=r.operator;return 45===n||46===n?c():0;case 221:var i=r,a=i.left,o=i.operatorToken;return a===t&&Jr(o.kind)?63===o.kind?1:c():0;case 206:return r.name!==t?0:sn(r);case 296:var s=sn(r.parent);return t===r.name?function(t){switch(t){case 0:return 1;case 1:return 0;case 2:return 2;default:return e.Debug.assertNever(t)}}(s):s;case 297:return t===r.objectAssignmentInitializer?0:sn(r.parent);default:return 0}function c(){return r.parent&&238===dt(r.parent).kind?1:2}}function cn(e,t,r){var n=r.onDeleteValue,i=r.onExistingValue;e.forEach((function(r,a){var o=t.get(a);void 0===o?(e.delete(a),n(r,a)):i&&i(r,o,a)}))}function ln(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find(e.isClassLike)}function un(e){return 206===e.kind||207===e.kind}function dn(e){for(;un(e);)e=e.expression;return e}function _n(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=void 0,this.mergeId=void 0,this.parent=void 0}function pn(t,r){this.flags=r,(e.Debug.isDebugging||e.tracing)&&(this.checker=t)}function fn(t,r){this.flags=r,e.Debug.isDebugging&&(this.checker=t)}function mn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0}function gn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0}function yn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.flowNode=void 0}function hn(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||function(e){return e}}function vn(t,r,n){return void 0===n&&(n=0),t.replace(/{(\d+)}/g,(function(t,i){return""+e.Debug.checkDefined(r[+i+n])}))}function bn(e){return $r&&$r[e.key]||e.message}function xn(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function Sn(t,r){var n=r.fileName||"",i=r.text.length;e.Debug.assertEqual(t.fileName,n),e.Debug.assertLessThanOrEqual(t.start,i),e.Debug.assertLessThanOrEqual(t.start+t.length,i);var a={file:r,start:t.start,length:t.length,messageText:t.messageText,category:t.category,code:t.code,reportsUnnecessary:t.reportsUnnecessary};if(t.relatedInformation){a.relatedInformation=[];for(var o=0,s=t.relatedInformation;o4&&(i=vn(i,arguments,4)),{file:e,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated}}function Cn(e){var t=bn(e);return arguments.length>1&&(t=vn(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function Tn(e){return e.file?e.file.path:void 0}function En(t,r){return kn(t,r)||function(t,r){if(!t.relatedInformation&&!r.relatedInformation)return 0;if(t.relatedInformation&&r.relatedInformation)return e.compareValues(t.relatedInformation.length,r.relatedInformation.length)||e.forEach(t.relatedInformation,(function(e,t){return En(e,r.relatedInformation[t])}))||0;return t.relatedInformation?-1:1}(t,r)||0}function kn(t,r){return e.compareStringsCaseSensitive(Tn(t),Tn(r))||e.compareValues(t.start,r.start)||e.compareValues(t.length,r.length)||e.compareValues(t.code,r.code)||An(t.messageText,r.messageText)||0}function An(t,r){if("string"==typeof t&&"string"==typeof r)return e.compareStringsCaseSensitive(t,r);if("string"==typeof t)return-1;if("string"==typeof r)return 1;var n=e.compareStringsCaseSensitive(t.messageText,r.messageText);if(n)return n;if(!t.next&&!r.next)return 0;if(!t.next)return-1;if(!r.next)return 1;for(var i=Math.min(t.next.length,r.next.length),a=0;ar.next.length?1:0}function Nn(t){if(2&t.transformFlags)return e.isJsxOpeningLikeElement(t)||e.isJsxFragment(t)?t:e.forEachChild(t,Nn)}function wn(e){return e.isDeclarationFile?void 0:Nn(e)}function Fn(t){return!(t.impliedNodeFormat!==e.ModuleKind.ESNext&&!e.fileExtensionIsOneOf(t.fileName,[".cjs",".cts"])||t.isDeclarationFile)||void 0}function Pn(t){return t.target||t.module===e.ModuleKind.Node16&&9||t.module===e.ModuleKind.NodeNext&&99||0}function In(t){return"number"==typeof t.module?t.module:Pn(t)>=2?e.ModuleKind.ES2015:e.ModuleKind.CommonJS}function On(t){return t.moduleDetection||(In(t)===e.ModuleKind.Node16||In(t)===e.ModuleKind.NodeNext?e.ModuleDetectionKind.Force:e.ModuleDetectionKind.Auto)}function Mn(t){if(void 0!==t.esModuleInterop)return t.esModuleInterop;switch(In(t)){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return!0}}function Ln(e){return!(!e.declaration&&!e.composite)}function Rn(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function Bn(e){return void 0===e.allowJs?!!e.checkJs:e.allowJs}function Jn(e,t){return t.strictFlag?Rn(e,t.name):e[t.name]}function jn(t,r){return void 0!==t&&("node_modules"===r(t)||e.startsWith(t,"@"))}e.getNewLineCharacter=function(t,r){switch(t.newLine){case 0:return"\r\n";case 1:return"\n"}return r?r():e.sys?e.sys.newLine:"\r\n"},e.createRange=Yr,e.moveRangeEnd=function(e,t){return Yr(e.pos,t)},e.moveRangePos=Zr,e.moveRangePastDecorators=en,e.moveRangePastModifiers=function(e){return e.modifiers&&e.modifiers.length>0?Zr(e,e.modifiers.end):en(e)},e.isCollapsedRange=function(e){return e.pos===e.end},e.createTokenRange=function(t,r){return Yr(t,t+e.tokenToString(r).length)},e.rangeIsOnSingleLine=function(e,t){return tn(e,e,t)},e.rangeStartPositionsAreOnSameLine=function(e,t,r){return rn(nn(e,r,!1),nn(t,r,!1),r)},e.rangeEndPositionsAreOnSameLine=function(e,t,r){return rn(e.end,t.end,r)},e.rangeStartIsOnSameLineAsRangeEnd=tn,e.rangeEndIsOnSameLineAsRangeStart=function(e,t,r){return rn(e.end,nn(t,r,!1),r)},e.getLinesBetweenRangeEndAndRangeStart=function(t,r,n,i){var a=nn(r,n,i);return e.getLinesBetweenPositions(n,t.end,a)},e.getLinesBetweenRangeEndPositions=function(t,r,n){return e.getLinesBetweenPositions(n,t.end,r.end)},e.isNodeArrayMultiLine=function(e,t){return!rn(e.pos,e.end,t)},e.positionsAreOnSameLine=rn,e.getStartPositionOfRange=nn,e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i),o=function(t,r,n){void 0===r&&(r=0);for(;t-- >r;)if(!e.isWhiteSpaceLike(n.text.charCodeAt(t)))return t}(a,r,n);return e.getLinesBetweenPositions(n,null!=o?o:r,a)},e.getLinesBetweenPositionAndNextNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i);return e.getLinesBetweenPositions(n,t,Math.min(r,a))},e.isDeclarationNameOfEnumOrNamespace=function(t){var r=e.getParseTreeNode(t);if(r)switch(r.parent.kind){case 260:case 261:return r===r.parent.name}return!1},e.getInitializedVariables=function(t){return e.filter(t.declarations,an)},e.isWatchSet=function(e){return e.watch&&e.hasOwnProperty("watch")},e.closeFileWatcher=function(e){e.close()},e.getCheckFlags=on,e.getDeclarationModifierFlagsFromSymbol=function(t,r){if(void 0===r&&(r=!1),t.valueDeclaration){var n=r&&t.declarations&&e.find(t.declarations,(function(e){return 173===e.kind}))||t.valueDeclaration,i=e.getCombinedModifierFlags(n);return t.parent&&32&t.parent.flags?i:-29&i}if(6&on(t)){var a=t.checkFlags;return(1024&a?8:256&a?4:16)|(2048&a?32:0)}return 4194304&t.flags?36:0},e.skipAlias=function(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e},e.getCombinedLocalAndExportSymbolFlags=function(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags},e.isWriteOnlyAccess=function(e){return 1===sn(e)},e.isWriteAccess=function(e){return 0!==sn(e)},function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Xr||(Xr={})),e.compareDataObjects=function e(t,r){if(!t||!r||Object.keys(t).length!==Object.keys(r).length)return!1;for(var n in t)if("object"==typeof t[n]){if(!e(t[n],r[n]))return!1}else if("function"!=typeof t[n]&&t[n]!==r[n])return!1;return!0},e.clearMap=function(e,t){e.forEach(t),e.clear()},e.mutateMapSkippingNewValues=cn,e.mutateMap=function(e,t,r){cn(e,t,r);var n=r.createNewValue;t.forEach((function(t,r){e.has(r)||e.set(r,n(r,t))}))},e.isAbstractConstructorSymbol=function(e){if(32&e.flags){var t=ln(e);return!!t&&Tr(t,128)}return!1},e.getClassLikeDeclarationOfSymbol=ln,e.getObjectFlags=function(e){return 3899393&e.flags?e.objectFlags:0},e.typeHasCallOrConstructSignatures=function(e,t){return 0!==t.getSignaturesOfType(e,0).length||0!==t.getSignaturesOfType(e,1).length},e.forSomeAncestorDirectory=function(t,r){return!!e.forEachAncestorDirectory(t,(function(e){return!!r(e)||void 0}))},e.isUMDExportSymbol=function(t){return!!t&&!!t.declarations&&!!t.declarations[0]&&e.isNamespaceExportDeclaration(t.declarations[0])},e.showModuleSpecifier=function(t){var r=t.moduleSpecifier;return e.isStringLiteral(r)?r.text:x(r)},e.getLastChild=function(t){var r;return e.forEachChild(t,(function(e){p(e)&&(r=e)}),(function(e){for(var t=e.length-1;t>=0;t--)if(p(e[t])){r=e[t];break}})),r},e.addToSeen=function(e,t,r){return void 0===r&&(r=!0),!e.has(t)&&(e.set(t,r),!0)},e.isObjectTypeDeclaration=function(t){return e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)},e.isTypeNodeKind=function(e){return e>=177&&e<=200||130===e||155===e||147===e||158===e||148===e||133===e||150===e||151===e||114===e||153===e||143===e||228===e||312===e||313===e||314===e||315===e||316===e||317===e||318===e},e.isAccessExpression=un,e.getNameOfAccessExpression=function(t){return 206===t.kind?t.name:(e.Debug.assert(207===t.kind),t.argumentExpression)},e.isBundleFileTextLike=function(e){switch(e.kind){case"text":case"internal":return!0;default:return!1}},e.isNamedImportsOrExports=function(e){return 269===e.kind||273===e.kind},e.getLeftmostAccessExpression=dn,e.forEachNameInAccessChainWalkingLeft=function(t,r){if(un(t.parent)&&Wr(t))return function t(n){if(206===n.kind){if(void 0!==(i=r(n.name)))return i}else if(207===n.kind){if(!e.isIdentifier(n.argumentExpression)&&!e.isStringLiteralLike(n.argumentExpression))return;var i;if(void 0!==(i=r(n.argumentExpression)))return i}if(un(n.expression))return t(n.expression);if(e.isIdentifier(n.expression))return r(n.expression);return}(t.parent)},e.getLeftmostExpression=function(e,t){for(;;){switch(e.kind){case 220:e=e.operand;continue;case 221:e=e.left;continue;case 222:e=e.condition;continue;case 210:e=e.tag;continue;case 208:if(t)return e;case 229:case 207:case 206:case 230:case 350:e=e.expression;continue}return e}},e.objectAllocator={getNodeConstructor:function(){return mn},getTokenConstructor:function(){return gn},getIdentifierConstructor:function(){return yn},getPrivateIdentifierConstructor:function(){return mn},getSourceFileConstructor:function(){return mn},getSymbolConstructor:function(){return _n},getTypeConstructor:function(){return pn},getSignatureConstructor:function(){return fn},getSourceMapSourceConstructor:function(){return hn}},e.setObjectAllocator=function(t){Object.assign(e.objectAllocator,t)},e.formatStringFromArgs=vn,e.setLocalizedDiagnosticMessages=function(e){$r=e},e.maybeSetLocalizedDiagnosticMessages=function(e){!$r&&e&&($r=e())},e.getLocaleSpecificMessage=bn,e.createDetachedDiagnostic=function(e,t,r,n){j(void 0,t,r);var i=bn(n);return arguments.length>4&&(i=vn(i,arguments,4)),{file:void 0,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,fileName:e}},e.attachFileToDiagnostics=function(e,t){for(var r=[],n=0,i=e;n2&&(r=vn(r,arguments,2)),r},e.createCompilerDiagnostic=Cn,e.createCompilerDiagnosticFromMessageChain=function(e,t){return{file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}},e.chainDiagnosticMessages=function(e,t){var r=bn(t);return arguments.length>2&&(r=vn(r,arguments,2)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}},e.concatenateDiagnosticMessageChains=function(e,t){for(var r=e;r.next;)r=r.next[0];r.next=[t]},e.compareDiagnostics=En,e.compareDiagnosticsSkipRelatedInformation=kn,e.getLanguageVariant=function(e){return 4===e||2===e||1===e||6===e?1:0},e.getSetExternalModuleIndicator=function(t){switch(On(t)){case e.ModuleDetectionKind.Force:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t)||!t.isDeclarationFile||void 0};case e.ModuleDetectionKind.Legacy:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t)};case e.ModuleDetectionKind.Auto:var r=[e.isFileProbablyExternalModule];4!==t.jsx&&5!==t.jsx||r.push(wn);var n=In(t);n!==e.ModuleKind.Node16&&n!==e.ModuleKind.NodeNext||r.push(Fn);var i=e.or.apply(void 0,r);return function(e){e.externalModuleIndicator=i(e)}}},e.getEmitScriptTarget=Pn,e.getEmitModuleKind=In,e.getEmitModuleResolutionKind=function(t){var r=t.moduleResolution;if(void 0===r)switch(In(t)){case e.ModuleKind.CommonJS:r=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node16:r=e.ModuleResolutionKind.Node16;break;case e.ModuleKind.NodeNext:r=e.ModuleResolutionKind.NodeNext;break;default:r=e.ModuleResolutionKind.Classic}return r},e.getEmitModuleDetectionKind=On,e.hasJsonModuleEmitEnabled=function(t){switch(In(t)){case e.ModuleKind.CommonJS:case e.ModuleKind.AMD:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return!0;default:return!1}},e.unreachableCodeIsError=function(e){return!1===e.allowUnreachableCode},e.unusedLabelIsError=function(e){return!1===e.allowUnusedLabels},e.getAreDeclarationMapsEnabled=function(e){return!(!Ln(e)||!e.declarationMap)},e.getESModuleInterop=Mn,e.getAllowSyntheticDefaultImports=function(t){var r=In(t);return void 0!==t.allowSyntheticDefaultImports?t.allowSyntheticDefaultImports:Mn(t)||r===e.ModuleKind.System},e.getEmitDeclarations=Ln,e.shouldPreserveConstEnums=function(e){return!(!e.preserveConstEnums&&!e.isolatedModules)},e.isIncrementalCompilation=function(e){return!(!e.incremental&&!e.composite)},e.getStrictOptionValue=Rn,e.getAllowJSCompilerOption=Bn,e.getUseDefineForClassFields=function(e){return void 0===e.useDefineForClassFields?Pn(e)>=9:e.useDefineForClassFields},e.compilerOptionsAffectSemanticDiagnostics=function(t,r){return o(r,t,e.semanticDiagnosticsOptionDeclarations)},e.compilerOptionsAffectEmit=function(t,r){return o(r,t,e.affectsEmitOptionDeclarations)},e.getCompilerOptionValue=Jn,e.getJSXTransformEnabled=function(e){var t=e.jsx;return 2===t||4===t||5===t},e.getJSXImplicitImportBase=function(t,r){var n=null==r?void 0:r.pragmas.get("jsximportsource"),i=e.isArray(n)?n[n.length-1]:n;return 4===t.jsx||5===t.jsx||t.jsxImportSource||i?(null==i?void 0:i.arguments.factory)||t.jsxImportSource||"react":void 0},e.getJSXRuntimeImport=function(e,t){return e?"".concat(e,"/").concat(5===t.jsx?"jsx-dev-runtime":"jsx-runtime"):void 0},e.hasZeroOrOneAsteriskCharacter=function(e){for(var t=!1,r=0;r=2&&o.length>=2&&!jn(a[a.length-2],i)&&!jn(o[o.length-2],i)&&i(a[a.length-1])===i(o[o.length-1]);)a.pop(),o.pop(),s=!0;return s?[e.getPathFromPathComponents(a),e.getPathFromPathComponents(o)]:void 0}(a,o,t,r)||e.emptyArray,c=s[0],l=s[1];c&&l&&n.setSymlinkedDirectory(l,{real:c,realPath:e.toPath(c,t,r)})}}},e.tryRemoveDirectoryPrefix=function(t,r,n){var i=e.tryRemovePrefix(t,r,n);return void 0===i?void 0:function(t){return e.isAnyDirectorySeparator(t.charCodeAt(0))?t.slice(1):void 0}(i)};var Un=/[^\w\s\/]/g;function Vn(e){return"\\"+e}e.regExpEscape=function(e){return e.replace(Un,Vn)};var Kn=[42,63];e.commonPackageFolders=["node_modules","bower_components","jspm_packages"];var zn="(?!(".concat(e.commonPackageFolders.join("|"),")(/|$))"),Gn={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:"(/".concat(zn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return Zn(e,Gn.singleAsteriskRegexFragment)}},qn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/".concat(zn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return Zn(e,qn.singleAsteriskRegexFragment)}},Wn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:function(e){return Zn(e,Wn.singleAsteriskRegexFragment)}},Hn={files:Gn,directories:qn,exclude:Wn};function Qn(e,t,r){var n=Xn(e,t,r);if(n&&n.length){var i=n.map((function(e){return"(".concat(e,")")})).join("|"),a="exclude"===r?"($|/)":"$";return"^(".concat(i,")").concat(a)}}function Xn(t,r,n){if(void 0!==t&&0!==t.length)return e.flatMap(t,(function(e){return e&&Yn(e,r,n,Hn[n])}))}function $n(e){return!/[.*?]/.test(e)}function Yn(t,r,n,i){var a=i.singleAsteriskRegexFragment,o=i.doubleAsteriskRegexFragment,s=i.replaceWildcardCharacter,c="",l=!1,u=e.getNormalizedPathComponents(t,r),d=e.last(u);if("exclude"===n||"**"!==d){u[0]=e.removeTrailingDirectorySeparator(u[0]),$n(d)&&u.push("**","*");for(var _=0,p=0,f=u;p0;)c+=")?",_--;return c}}function Zn(e,t){return"*"===e?t:"?"===e?"[^/]":"\\"+e}function ei(t,r,n,i,a){t=e.normalizePath(t),a=e.normalizePath(a);var o=e.combinePaths(a,t);return{includeFilePatterns:e.map(Xn(n,o,"files"),(function(e){return"^".concat(e,"$")})),includeFilePattern:Qn(n,o,"files"),includeDirectoryPattern:Qn(n,o,"directories"),excludePattern:Qn(r,o,"exclude"),basePaths:ri(t,n,i)}}function ti(e,t){return new RegExp(e,t?"":"i")}function ri(t,r,n){var i=[t];if(r){for(var a=[],o=0,s=r;o=0)}function hi(e){return".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e}function vi(t){return e.find(_i,(function(r){return e.fileExtensionIs(t,r)}))}function bi(t,r){return t===r||"object"==typeof t&&null!==t&&"object"==typeof r&&null!==r&&e.equalOwnProperties(t,r,bi)}function xi(e,t){return e.pos=t,e}function Si(e,t){return e.end=t,e}function Di(e,t,r){return Si(xi(e,t),r)}function Ci(e,t){return e&&t&&(e.parent=t),e}function Ti(t){return!e.isOmittedExpression(t)}function Ei(t){return e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))}function ki(e){return 254===e.kind&&292===e.parent.kind}function Ai(e){return(+e).toString()===e}e.removeFileExtension=pi,e.tryRemoveExtension=fi,e.removeExtension=mi,e.changeExtension=function(t,r){return e.changeAnyExtension(t,r,_i,!1)},e.tryParsePattern=gi,e.tryParsePatterns=function(t){return e.mapDefined(e.getOwnKeys(t),(function(e){return gi(e)}))},e.positionIsSynthesized=yi,e.extensionIsTS=hi,e.resolutionExtensionIsTSOrJson=function(e){return hi(e)||".json"===e},e.extensionFromPath=function(t){var r=vi(t);return void 0!==r?r:e.Debug.fail("File ".concat(t," has unknown extension."))},e.isAnySupportedFileExtension=function(e){return void 0!==vi(e)},e.tryGetExtensionFromPath=vi,e.isCheckJsEnabledForFile=function(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs},e.emptyFileSystemEntries={files:e.emptyArray,directories:e.emptyArray},e.matchPatternOrExact=function(t,r){for(var n=[],i=0,a=t;ii&&(i=o)}return{min:n,max:i}},e.rangeOfNode=function(e){return{pos:h(e),end:e.end}},e.rangeOfTypeParameters=function(t,r){return{pos:r.pos-1,end:e.skipTrivia(t.text,r.end)+1}},e.skipTypeChecking=function(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)},e.isJsonEqual=bi,e.parsePseudoBigInt=function(e){var t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:for(var r=e.length-1,n=0;48===e.charCodeAt(n);)n++;return e.slice(n,r)||"0"}for(var i=e.length-1,a=(i-2)*t,o=new Uint16Array((a>>>4)+(15&a?1:0)),s=i-1,c=0;s>=2;s--,c+=t){var l=c>>>4,u=e.charCodeAt(s),d=(u<=57?u-48:10+u-(u<=70?65:97))<<(15&c);o[l]|=d;var _=d>>>16;_&&(o[l+1]|=_)}for(var p="",f=o.length-1,m=!0;m;){var g=0;m=!1;for(l=f;l>=0;l--){var y=g<<16|o[l],h=y/10|0;o[l]=h,g=y-10*h,h&&!m&&(f=l,m=!0)}p=g+p}return p},e.pseudoBigIntToString=function(e){var t=e.negative,r=e.base10Value;return(t&&"0"!==r?"-":"")+r},e.isValidTypeOnlyAliasUseSite=function(t){return!!(16777216&t.flags)||ve(t)||function(t){if(79!==t.kind)return!1;var r=e.findAncestor(t.parent,(function(e){switch(e.kind){case 291:return!0;case 206:case 228:return!1;default:return"quit"}}));return 117===(null==r?void 0:r.token)||258===(null==r?void 0:r.parent.kind)}(t)||function(e){for(;79===e.kind||206===e.kind;)e=e.parent;if(162!==e.kind)return!1;if(Tr(e.parent,128))return!0;var t=e.parent.parent.kind;return 258===t||182===t}(t)||!(ye(t)||function(t){return e.isIdentifier(t)&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t}(t))},e.isIdentifierTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)},e.arrayIsHomogeneous=function(t,r){if(void 0===r&&(r=e.equateValues),t.length<2)return!0;for(var n=t[0],i=1,a=t.length;i=0?e.factory.createNumericLiteral(+t):e.factory.createStringLiteral(t,!!n)},e.isThisTypeParameter=function(e){return!!(262144&e.flags&&e.isThisType)},e.getNodeModulePathParts=function(t){var r,n=0,i=0,a=0;!function(e){e[e.BeforeNodeModules=0]="BeforeNodeModules",e[e.NodeModules=1]="NodeModules",e[e.Scope=2]="Scope",e[e.PackageContent=3]="PackageContent"}(r||(r={}));for(var o=0,s=0,c=0;s>=0;)switch(o=s,s=t.indexOf("/",o+1),c){case 0:t.indexOf(e.nodeModulesPathPart,o)===o&&(n=o,i=s,c=1);break;case 1:case 2:1===c&&"@"===t.charAt(o+1)?c=2:(a=s,c=3);break;case 3:c=t.indexOf(e.nodeModulesPathPart,o)===o?1:3}return c>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:i,packageRootIndex:a,fileNameIndex:o}:void 0},e.getParameterTypeNode=function(e){var t;return 340===e.kind?null===(t=e.typeExpression)||void 0===t?void 0:t.type:e.type}}(c||(c={})),function(e){e.createBaseNodeFactory=function(){var t,r,n,i,a;return{createBaseSourceFileNode:function(t){return new(a||(a=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(n||(n=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(i||(i=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(r||(r=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(r){return new(t||(t=e.objectAllocator.getNodeConstructor()))(r,-1,-1)}}}}(c||(c={})),function(e){e.createParenthesizerRules=function(t){var r,n;return{getParenthesizeLeftSideOfBinaryForOperator:function(t){r||(r=new e.Map);var n=r.get(t);n||(n=function(e){return o(t,e)},r.set(t,n));return n},getParenthesizeRightSideOfBinaryForOperator:function(t){n||(n=new e.Map);var r=n.get(t);r||(r=function(e){return s(t,void 0,e)},n.set(t,r));return r},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:s,parenthesizeExpressionOfComputedPropertyName:function(r){return e.isCommaSequence(r)?t.createParenthesizedExpression(r):r},parenthesizeConditionOfConditionalExpression:function(r){var n=e.getOperatorPrecedence(222,57),i=e.skipPartiallyEmittedExpressions(r),a=e.getExpressionPrecedence(i);if(1!==e.compareValues(a,n))return t.createParenthesizedExpression(r);return r},parenthesizeBranchOfConditionalExpression:function(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isCommaSequence(n)?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfExportDefault:function(r){var n=e.skipPartiallyEmittedExpressions(r),i=e.isCommaSequence(n);if(!i)switch(e.getLeftmostExpression(n,!1).kind){case 226:case 213:i=!0}return i?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfNew:function(r){var n=e.getLeftmostExpression(r,!0);switch(n.kind){case 208:return t.createParenthesizedExpression(r);case 209:return n.arguments?r:t.createParenthesizedExpression(r)}return c(r)},parenthesizeLeftSideOfAccess:c,parenthesizeOperandOfPostfixUnary:function(r){return e.isLeftHandSideExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeOperandOfPrefixUnary:function(r){return e.isUnaryExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeExpressionsOfCommaDelimitedList:function(r){var n=e.sameMap(r,l);return e.setTextRange(t.createNodeArray(n,r.hasTrailingComma),r)},parenthesizeExpressionForDisallowedComma:l,parenthesizeExpressionOfExpressionStatement:function(r){var n=e.skipPartiallyEmittedExpressions(r);if(e.isCallExpression(n)){var i=n.expression,a=e.skipPartiallyEmittedExpressions(i).kind;if(213===a||214===a){var o=t.updateCallExpression(n,e.setTextRange(t.createParenthesizedExpression(i),i),n.typeArguments,n.arguments);return t.restoreOuterExpressions(r,o,8)}}var s=e.getLeftmostExpression(n,!1).kind;if(205===s||213===s)return e.setTextRange(t.createParenthesizedExpression(r),r);return r},parenthesizeConciseBodyOfArrowFunction:function(r){if(!e.isBlock(r)&&(e.isCommaSequence(r)||205===e.getLeftmostExpression(r,!1).kind))return e.setTextRange(t.createParenthesizedExpression(r),r);return r},parenthesizeCheckTypeOfConditionalType:u,parenthesizeExtendsTypeOfConditionalType:function(e){if(189===e.kind)return t.createParenthesizedType(e);return e},parenthesizeConstituentTypesOfUnionType:function(r){return t.createNodeArray(e.sameMap(r,d))},parenthesizeConstituentTypeOfUnionType:d,parenthesizeConstituentTypesOfIntersectionType:function(r){return t.createNodeArray(e.sameMap(r,_))},parenthesizeConstituentTypeOfIntersectionType:_,parenthesizeOperandOfTypeOperator:p,parenthesizeOperandOfReadonlyTypeOperator:function(e){if(193===e.kind)return t.createParenthesizedType(e);return p(e)},parenthesizeNonArrayTypeOfPostfixType:f,parenthesizeElementTypesOfTupleType:function(r){return t.createNodeArray(e.sameMap(r,m))},parenthesizeElementTypeOfTupleType:m,parenthesizeTypeOfOptionalType:function(e){return g(e)?t.createParenthesizedType(e):f(e)},parenthesizeTypeArguments:function(r){if(e.some(r))return t.createNodeArray(e.sameMap(r,h))},parenthesizeLeadingTypeArgument:y};function i(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isLiteralKind(t.kind))return t.kind;if(221===t.kind&&39===t.operatorToken.kind){if(void 0!==t.cachedLiteralKind)return t.cachedLiteralKind;var r=i(t.left),n=e.isLiteralKind(r)&&r===i(t.right)?r:0;return t.cachedLiteralKind=n,n}return 0}function a(r,n,a,o){return 212===e.skipPartiallyEmittedExpressions(n).kind?n:function(t,r,n,a){var o=e.getOperatorPrecedence(221,t),s=e.getOperatorAssociativity(221,t),c=e.skipPartiallyEmittedExpressions(r);if(!n&&214===r.kind&&o>3)return!0;var l=e.getExpressionPrecedence(c);switch(e.compareValues(l,o)){case-1:return!(!n&&1===s&&224===r.kind);case 1:return!1;case 0:if(n)return 1===s;if(e.isBinaryExpression(c)&&c.operatorToken.kind===t){if(function(e){return 41===e||51===e||50===e||52===e}(t))return!1;if(39===t){var u=a?i(a):0;if(e.isLiteralKind(u)&&u===i(c))return!1}}return 0===e.getExpressionAssociativity(c)}}(r,n,a,o)?t.createParenthesizedExpression(n):n}function o(e,t){return a(e,t,!0)}function s(e,t,r){return a(e,r,!1,t)}function c(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isLeftHandSideExpression(n)&&(209!==n.kind||n.arguments)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function l(r){var n=e.skipPartiallyEmittedExpressions(r);return e.getExpressionPrecedence(n)>e.getOperatorPrecedence(221,27)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function u(e){switch(e.kind){case 179:case 180:case 189:return t.createParenthesizedType(e)}return e}function d(e){switch(e.kind){case 187:case 188:return t.createParenthesizedType(e)}return u(e)}function _(e){switch(e.kind){case 187:case 188:return t.createParenthesizedType(e)}return d(e)}function p(e){return 188===e.kind?t.createParenthesizedType(e):_(e)}function f(e){switch(e.kind){case 190:case 193:case 181:return t.createParenthesizedType(e)}return p(e)}function m(e){return g(e)?t.createParenthesizedType(e):e}function g(t){return e.isJSDocNullableType(t)?t.postfix:e.isNamedTupleMember(t)||e.isFunctionTypeNode(t)||e.isConstructorTypeNode(t)||e.isTypeOperatorNode(t)?g(t.type):e.isConditionalTypeNode(t)?g(t.falseType):e.isUnionTypeNode(t)||e.isIntersectionTypeNode(t)?g(e.last(t.types)):!!e.isInferTypeNode(t)&&(!!t.typeParameter.constraint&&g(t.typeParameter.constraint))}function y(r){return e.isFunctionOrConstructorTypeNode(r)&&r.typeParameters?t.createParenthesizedType(r):r}function h(e,t){return 0===t?y(e):e}},e.nullParenthesizerRules={getParenthesizeLeftSideOfBinaryForOperator:function(t){return e.identity},getParenthesizeRightSideOfBinaryForOperator:function(t){return e.identity},parenthesizeLeftSideOfBinary:function(e,t){return t},parenthesizeRightSideOfBinary:function(e,t,r){return r},parenthesizeExpressionOfComputedPropertyName:e.identity,parenthesizeConditionOfConditionalExpression:e.identity,parenthesizeBranchOfConditionalExpression:e.identity,parenthesizeExpressionOfExportDefault:e.identity,parenthesizeExpressionOfNew:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeLeftSideOfAccess:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPostfixUnary:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPrefixUnary:function(t){return e.cast(t,e.isUnaryExpression)},parenthesizeExpressionsOfCommaDelimitedList:function(t){return e.cast(t,e.isNodeArray)},parenthesizeExpressionForDisallowedComma:e.identity,parenthesizeExpressionOfExpressionStatement:e.identity,parenthesizeConciseBodyOfArrowFunction:e.identity,parenthesizeCheckTypeOfConditionalType:e.identity,parenthesizeExtendsTypeOfConditionalType:e.identity,parenthesizeConstituentTypesOfUnionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfUnionType:e.identity,parenthesizeConstituentTypesOfIntersectionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfIntersectionType:e.identity,parenthesizeOperandOfTypeOperator:e.identity,parenthesizeOperandOfReadonlyTypeOperator:e.identity,parenthesizeNonArrayTypeOfPostfixType:e.identity,parenthesizeElementTypesOfTupleType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeElementTypeOfTupleType:e.identity,parenthesizeTypeOfOptionalType:e.identity,parenthesizeTypeArguments:function(t){return t&&e.cast(t,e.isNodeArray)},parenthesizeLeadingTypeArgument:e.identity}}(c||(c={})),function(e){e.createNodeConverters=function(t){return{convertToFunctionBlock:function(r,n){if(e.isBlock(r))return r;var i=t.createReturnStatement(r);e.setTextRange(i,r);var a=t.createBlock([i],n);return e.setTextRange(a,r),a},convertToFunctionExpression:function(r){if(!r.body)return e.Debug.fail("Cannot convert a FunctionDeclaration without a body");var n=t.createFunctionExpression(r.modifiers,r.asteriskToken,r.name,r.typeParameters,r.parameters,r.type,r.body);e.setOriginalNode(n,r),e.setTextRange(n,r),e.getStartsOnNewLine(r)&&e.setStartsOnNewLine(n,!0);return n},convertToArrayAssignmentElement:r,convertToObjectAssignmentElement:n,convertToAssignmentPattern:i,convertToObjectAssignmentPattern:a,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:s};function r(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadElement(r.name),r),r);var n=s(r.name);return r.initializer?e.setOriginalNode(e.setTextRange(t.createAssignment(n,r.initializer),r),r):n}return e.cast(r,e.isExpression)}function n(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadAssignment(r.name),r),r);if(r.propertyName){var n=s(r.name);return e.setOriginalNode(e.setTextRange(t.createPropertyAssignment(r.propertyName,r.initializer?t.createAssignment(n,r.initializer):n),r),r)}return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createShorthandPropertyAssignment(r.name,r.initializer),r),r)}return e.cast(r,e.isObjectLiteralElementLike)}function i(e){switch(e.kind){case 202:case 204:return o(e);case 201:case 205:return a(e)}}function a(r){return e.isObjectBindingPattern(r)?e.setOriginalNode(e.setTextRange(t.createObjectLiteralExpression(e.map(r.elements,n)),r),r):e.cast(r,e.isObjectLiteralExpression)}function o(n){return e.isArrayBindingPattern(n)?e.setOriginalNode(e.setTextRange(t.createArrayLiteralExpression(e.map(n.elements,r)),n),n):e.cast(n,e.isArrayLiteralExpression)}function s(t){return e.isBindingPattern(t)?i(t):e.cast(t,e.isExpression)}},e.nullNodeConverters={convertToFunctionBlock:e.notImplemented,convertToFunctionExpression:e.notImplemented,convertToArrayAssignmentElement:e.notImplemented,convertToObjectAssignmentElement:e.notImplemented,convertToAssignmentPattern:e.notImplemented,convertToObjectAssignmentPattern:e.notImplemented,convertToArrayAssignmentPattern:e.notImplemented,convertToAssignmentElementTarget:e.notImplemented}}(c||(c={})),function(e){var t,n,i=0;function a(t,a){var f=8&t?o:s,m=e.memoize((function(){return 1&t?e.nullParenthesizerRules:e.createParenthesizerRules(w)})),g=e.memoize((function(){return 2&t?e.nullNodeConverters:e.createNodeConverters(w)})),y=e.memoizeOne((function(e){return function(t,r){return Rt(t,e,r)}})),h=e.memoizeOne((function(e){return function(t){return Mt(e,t)}})),b=e.memoizeOne((function(e){return function(t){return Lt(t,e)}})),x=e.memoizeOne((function(e){return function(){return function(e){return P(e)}(e)}})),S=e.memoizeOne((function(e){return function(t){return on(e,t)}})),D=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(on(e,r),t):t}(e,t,r)}})),C=e.memoizeOne((function(e){return function(t,r){return an(e,t,r)}})),T=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(an(e,r,t.postfix),t):t}(e,t,r)}})),E=e.memoizeOne((function(e){return function(t,r){return En(e,t,r)}})),k=e.memoizeOne((function(e){return function(t,r,n){return function(e,t,r,n){void 0===r&&(r=dn(t));return t.tagName!==r||t.comment!==n?f(En(e,r,n),t):t}(e,t,r,n)}})),A=e.memoizeOne((function(e){return function(t,r,n){return kn(e,t,r,n)}})),N=e.memoizeOne((function(e){return function(t,r,n,i){return function(e,t,r,n,i){void 0===r&&(r=dn(t));return t.tagName!==r||t.typeExpression!==n||t.comment!==i?f(kn(e,r,n,i),t):t}(e,t,r,n,i)}})),w={get parenthesizer(){return m()},get converters(){return g()},baseFactory:a,flags:t,createNodeArray:F,createNumericLiteral:G,createBigIntLiteral:q,createStringLiteral:H,createStringLiteralFromNode:function(t){var r=W(e.getTextOfIdentifierOrLiteral(t),void 0);return r.textSourceNode=t,r},createRegularExpressionLiteral:Q,createLiteralLikeNode:function(e,t){switch(e){case 8:return G(t,0);case 9:return q(t);case 10:return H(t,void 0);case 11:return Ln(t,!1);case 12:return Ln(t,!0);case 13:return Q(t);case 14:return Vt(e,t,void 0,0)}},createIdentifier:Y,updateIdentifier:function(t,r){return t.typeArguments!==r?f(Y(e.idText(t),r),t):t},createTempVariable:Z,createLoopVariable:function(e){var t=2;e&&(t|=8);return $("",t)},createUniqueName:function(t,r){void 0===r&&(r=0);return e.Debug.assert(!(7&r),"Argument out of range: flags"),e.Debug.assert(32!=(48&r),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),$(t,3|r)},getGeneratedNameForNode:ee,createPrivateIdentifier:function(t){e.startsWith(t,"#")||e.Debug.fail("First character of private identifier must be #: "+t);var r=a.createBasePrivateIdentifierNode(80);return r.escapedText=e.escapeLeadingUnderscores(t),r.transformFlags|=8388608,r},createToken:re,createSuper:function(){return re(106)},createThis:ne,createNull:function(){return re(104)},createTrue:ie,createFalse:ae,createModifier:oe,createModifiersFromModifierFlags:se,createQualifiedName:ce,updateQualifiedName:function(e,t,r){return e.left!==t||e.right!==r?f(ce(t,r),e):e},createComputedPropertyName:le,updateComputedPropertyName:function(e,t){return e.expression!==t?f(le(t),e):e},createTypeParameterDeclaration:ue,updateTypeParameterDeclaration:function(t,r,n,i,a){var o,s,c;void 0===r||e.isArray(r)?(s=r,o=n,c=i):(s=void 0,o=r,c=n);return t.modifiers!==s||t.name!==o||t.constraint!==c||t.default!==a?f(ue(s,o,c,a),t):t},createParameterDeclaration:de,updateParameterDeclaration:_e,createDecorator:pe,updateDecorator:function(e,t){return e.expression!==t?f(pe(t),e):e},createPropertySignature:fe,updatePropertySignature:me,createPropertyDeclaration:ge,updatePropertyDeclaration:ye,createMethodSignature:he,updateMethodSignature:ve,createMethodDeclaration:be,updateMethodDeclaration:xe,createConstructorDeclaration:De,updateConstructorDeclaration:Ce,createGetAccessorDeclaration:Te,updateGetAccessorDeclaration:Ee,createSetAccessorDeclaration:ke,updateSetAccessorDeclaration:Ae,createCallSignature:Ne,updateCallSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(Ne(t,r,n),e):e},createConstructSignature:we,updateConstructSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(we(t,r,n),e):e},createIndexSignature:Fe,updateIndexSignature:Pe,createClassStaticBlockDeclaration:Se,updateClassStaticBlockDeclaration:function(e,t,r,n){return e.decorators!==t||e.modifier!==r||e.body!==n?f(Se(t,r,n),e):e},createTemplateLiteralTypeSpan:Ie,updateTemplateLiteralTypeSpan:function(e,t,r){return e.type!==t||e.literal!==r?f(Ie(t,r),e):e},createKeywordTypeNode:function(e){return re(e)},createTypePredicateNode:Oe,updateTypePredicateNode:function(e,t,r,n){return e.assertsModifier!==t||e.parameterName!==r||e.type!==n?f(Oe(t,r,n),e):e},createTypeReferenceNode:Me,updateTypeReferenceNode:function(e,t,r){return e.typeName!==t||e.typeArguments!==r?f(Me(t,r),e):e},createFunctionTypeNode:Le,updateFunctionTypeNode:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(Le(t,r,n),e):e},createConstructorTypeNode:Re,updateConstructorTypeNode:function(){for(var t=[],r=0;r10?ei(t):e.reduceLeft(t,w.createComma)},getInternalName:function(e,t,r){return ci(e,t,r,49152)},getLocalName:function(e,t,r){return ci(e,t,r,16384)},getExportName:li,getDeclarationName:function(e,t,r){return ci(e,t,r)},getNamespaceMemberName:ui,getExternalModuleOrNamespaceExportName:function(t,r,n,i){if(t&&e.hasSyntacticModifier(r,1))return ui(t,ci(r),n,i);return li(r,n,i)},restoreOuterExpressions:function t(r,n,i){void 0===i&&(i=15);if(r&&e.isOuterExpression(r,i)&&!function(t){return e.isParenthesizedExpression(t)&&e.nodeIsSynthesized(t)&&e.nodeIsSynthesized(e.getSourceMapRange(t))&&e.nodeIsSynthesized(e.getCommentRange(t))&&!e.some(e.getSyntheticLeadingComments(t))&&!e.some(e.getSyntheticTrailingComments(t))}(r))return function(e,t){switch(e.kind){case 212:return Et(e,t);case 211:return Ct(e,e.type,t);case 229:return Qt(e,t,e.type);case 230:return $t(e,t);case 350:return Yn(e,t)}}(r,t(r.expression,n));return n},restoreEnclosingLabel:function t(r,n,i){if(!n)return r;var a=vr(n,n.label,e.isLabeledStatement(n.statement)?t(r,n.statement):r);i&&i(n);return a},createUseStrictPrologue:_i,copyPrologue:function(e,t,r,n){var i=pi(e,t,0,r);return fi(e,t,i,n)},copyStandardPrologue:pi,copyCustomPrologue:fi,ensureUseStrict:function(t){if(!e.findUseStrictPrologue(t))return e.setTextRange(F(r([_i()],t,!0)),t);return t},liftToBlock:function(t){return e.Debug.assert(e.every(t,e.isStatementOrBlock),"Cannot lift nodes to a Block."),e.singleOrUndefined(t)||rr(t)},mergeLexicalEnvironment:function(t,n){if(!e.some(n))return t;var i=mi(t,e.isPrologueDirective,0),a=mi(t,e.isHoistedFunction,i),o=mi(t,e.isHoistedVariableStatement,a),s=mi(n,e.isPrologueDirective,0),c=mi(n,e.isHoistedFunction,s),l=mi(n,e.isHoistedVariableStatement,c),u=mi(n,e.isCustomPrologue,l);e.Debug.assert(u===n.length,"Expected declarations to be valid standard or custom prologues");var d=e.isNodeArray(t)?t.slice():t;u>l&&d.splice.apply(d,r([o,0],n.slice(l,u),!1));l>c&&d.splice.apply(d,r([a,0],n.slice(c,l),!1));c>s&&d.splice.apply(d,r([i,0],n.slice(s,c),!1));if(s>0)if(0===i)d.splice.apply(d,r([0,0],n.slice(0,s),!1));else{for(var _=new e.Map,p=0;p=0;p--){var m=n[p];_.has(m.expression.text)||d.unshift(m)}}if(e.isNodeArray(t))return e.setTextRange(F(d,t.hasTrailingComma),t);return t},updateModifiers:function(t,r){var n,i;i="number"==typeof r?se(r):r;return e.isParameter(t)?_e(t,t.decorators,i,t.dotDotDotToken,t.name,t.questionToken,t.type,t.initializer):e.isPropertySignature(t)?me(t,i,t.name,t.questionToken,t.type):e.isPropertyDeclaration(t)?ye(t,t.decorators,i,t.name,null!==(n=t.questionToken)&&void 0!==n?n:t.exclamationToken,t.type,t.initializer):e.isMethodSignature(t)?ve(t,i,t.name,t.questionToken,t.typeParameters,t.parameters,t.type):e.isMethodDeclaration(t)?xe(t,t.decorators,i,t.asteriskToken,t.name,t.questionToken,t.typeParameters,t.parameters,t.type,t.body):e.isConstructorDeclaration(t)?Ce(t,t.decorators,i,t.parameters,t.body):e.isGetAccessorDeclaration(t)?Ee(t,t.decorators,i,t.name,t.parameters,t.type,t.body):e.isSetAccessorDeclaration(t)?Ae(t,t.decorators,i,t.name,t.parameters,t.body):e.isIndexSignatureDeclaration(t)?Pe(t,t.decorators,i,t.parameters,t.type):e.isFunctionExpression(t)?At(t,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isArrowFunction(t)?wt(t,i,t.typeParameters,t.parameters,t.type,t.equalsGreaterThanToken,t.body):e.isClassExpression(t)?qt(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isVariableStatement(t)?ir(t,i,t.declarationList):e.isFunctionDeclaration(t)?Tr(t,t.decorators,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isClassDeclaration(t)?kr(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isInterfaceDeclaration(t)?Nr(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isTypeAliasDeclaration(t)?Fr(t,t.decorators,i,t.name,t.typeParameters,t.type):e.isEnumDeclaration(t)?Ir(t,t.decorators,i,t.name,t.members):e.isModuleDeclaration(t)?Mr(t,t.decorators,i,t.name,t.body):e.isImportEqualsDeclaration(t)?jr(t,t.decorators,i,t.isTypeOnly,t.name,t.moduleReference):e.isImportDeclaration(t)?Vr(t,t.decorators,i,t.importClause,t.moduleSpecifier,t.assertClause):e.isExportAssignment(t)?Yr(t,t.decorators,i,t.expression):e.isExportDeclaration(t)?en(t,t.decorators,i,t.isTypeOnly,t.exportClause,t.moduleSpecifier,t.assertClause):e.Debug.assertNever(t)}};return w;function F(t,r){if(void 0===t||t===e.emptyArray)t=[];else if(e.isNodeArray(t)){if(void 0===r||t.hasTrailingComma===r)return void 0===t.transformFlags&&p(t),e.Debug.attachNodeArrayDebugInfo(t),t;var n=t.slice();return n.pos=t.pos,n.end=t.end,n.hasTrailingComma=r,n.transformFlags=t.transformFlags,e.Debug.attachNodeArrayDebugInfo(n),n}var i=t.length,a=i>=1&&i<=4?t.slice():t;return e.setTextRangePosEnd(a,-1,-1),a.hasTrailingComma=!!r,p(a),e.Debug.attachNodeArrayDebugInfo(a),a}function P(e){return a.createBaseNode(e)}function I(e,t,r){var n=P(e);return n.decorators=gi(t),n.modifiers=gi(r),n.transformFlags|=_(n.decorators)|_(n.modifiers),n.symbol=void 0,n.localSymbol=void 0,n.locals=void 0,n.nextContainer=void 0,n}function O(t,r,n,i){var a=I(t,r,n);if(i=yi(i),a.name=i,i)switch(a.kind){case 169:case 172:case 173:case 167:case 296:if(e.isIdentifier(i)){a.transformFlags|=u(i);break}default:a.transformFlags|=d(i)}return a}function M(e,t,r,n,i){var a=O(e,t,r,n);return a.typeParameters=gi(i),a.transformFlags|=_(a.typeParameters),i&&(a.transformFlags|=1),a}function L(e,t,r,n,i,a,o){var s=M(e,t,r,n,i);return s.parameters=F(a),s.type=o,s.transformFlags|=_(s.parameters)|d(s.type),o&&(s.transformFlags|=1),s}function R(e,t){return t.typeArguments&&(e.typeArguments=t.typeArguments),f(e,t)}function B(e,t,r,n,i,a,o,s){var c=L(e,t,r,n,i,a,o);return c.body=s,c.transformFlags|=-16777217&d(c.body),s||(c.transformFlags|=1),c}function J(e,t){return t.exclamationToken&&(e.exclamationToken=t.exclamationToken),t.typeArguments&&(e.typeArguments=t.typeArguments),R(e,t)}function j(e,t,r,n,i,a){var o=M(e,t,r,n,i);return o.heritageClauses=gi(a),o.transformFlags|=_(o.heritageClauses),o}function U(e,t,r,n,i,a,o){var s=j(e,t,r,n,i,a);return s.members=F(o),s.transformFlags|=_(s.members),s}function V(e,t,r,n,i){var a=O(e,t,r,n);return a.initializer=i,a.transformFlags|=d(a.initializer),a}function K(e,t,r,n,i,a){var o=V(e,t,r,n,a);return o.type=i,o.transformFlags|=d(i),i&&(o.transformFlags|=1),o}function z(e,t){var r=te(e);return r.text=t,r}function G(e,t){void 0===t&&(t=0);var r=z(8,"number"==typeof e?e+"":e);return r.numericLiteralFlags=t,384&t&&(r.transformFlags|=1024),r}function q(t){var r=z(9,"string"==typeof t?t:e.pseudoBigIntToString(t)+"n");return r.transformFlags|=4,r}function W(e,t){var r=z(10,e);return r.singleQuote=t,r}function H(e,t,r){var n=W(e,t);return n.hasExtendedUnicodeEscape=r,r&&(n.transformFlags|=1024),n}function Q(e){return z(13,e)}function X(t,r){void 0===r&&t&&(r=e.stringToToken(t)),79===r&&(r=void 0);var n=a.createBaseIdentifierNode(79);return n.originalKeywordKind=r,n.escapedText=e.escapeLeadingUnderscores(t),n}function $(e,t){var r=X(e,void 0);return r.autoGenerateFlags=t,r.autoGenerateId=i,i++,r}function Y(e,t,r){var n=X(e,r);return t&&(n.typeArguments=F(t)),132===n.originalKeywordKind&&(n.transformFlags|=16777216),n}function Z(e,t){var r=1;t&&(r|=8);var n=$("",r);return e&&e(n),n}function ee(t,r){void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags");var n=$(t&&e.isIdentifier(t)?e.idText(t):"",4|r);return n.original=t,n}function te(e){return a.createBaseTokenNode(e)}function re(t){e.Debug.assert(t>=0&&t<=160,"Invalid token"),e.Debug.assert(t<=14||t>=17,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),e.Debug.assert(t<=8||t>=14,"Invalid token. Use 'createLiteralLikeNode' to create literals."),e.Debug.assert(79!==t,"Invalid token. Use 'createIdentifier' to create identifiers");var r=te(t),n=0;switch(t){case 131:n=384;break;case 123:case 121:case 122:case 145:case 126:case 135:case 85:case 130:case 147:case 158:case 143:case 148:case 101:case 144:case 159:case 150:case 133:case 151:case 114:case 155:case 153:n=1;break;case 106:n=33555456;break;case 124:n=1024;break;case 108:n=8192}return n&&(r.transformFlags|=n),r}function ne(){return re(108)}function ie(){return re(110)}function ae(){return re(95)}function oe(e){return re(e)}function se(e){var t=[];return 1&e&&t.push(oe(93)),2&e&&t.push(oe(135)),512&e&&t.push(oe(88)),2048&e&&t.push(oe(85)),4&e&&t.push(oe(123)),8&e&&t.push(oe(121)),16&e&&t.push(oe(122)),128&e&&t.push(oe(126)),32&e&&t.push(oe(124)),16384&e&&t.push(oe(159)),64&e&&t.push(oe(145)),256&e&&t.push(oe(131)),32768&e&&t.push(oe(101)),65536&e&&t.push(oe(144)),t.length?t:void 0}function ce(e,t){var r=P(161);return r.left=e,r.right=yi(t),r.transformFlags|=d(r.left)|u(r.right),r}function le(e){var t=P(162);return t.expression=m().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=66560|d(t.expression),t}function ue(t,r,n,i){var a,o,s;void 0===t||e.isArray(t)?(o=t,a=r,s=n):(o=void 0,a=t,s=r);var c=O(163,void 0,o,a);return c.constraint=s,c.default=i,c.transformFlags=1,c}function de(t,r,n,i,a,o,s){var c=K(164,t,r,i,o,s&&m().parenthesizeExpressionForDisallowedComma(s));return c.dotDotDotToken=n,c.questionToken=a,e.isThisIdentifier(c.name)?c.transformFlags=1:(c.transformFlags|=d(c.dotDotDotToken)|d(c.questionToken),a&&(c.transformFlags|=1),16476&e.modifiersToFlags(c.modifiers)&&(c.transformFlags|=4096),(s||n)&&(c.transformFlags|=1024)),c}function _e(e,t,r,n,i,a,o,s){return e.decorators!==t||e.modifiers!==r||e.dotDotDotToken!==n||e.name!==i||e.questionToken!==a||e.type!==o||e.initializer!==s?f(de(t,r,n,i,a,o,s),e):e}function pe(e){var t=P(165);return t.expression=m().parenthesizeLeftSideOfAccess(e),t.transformFlags|=4097|d(t.expression),t}function fe(e,t,r,n){var i=O(166,void 0,e,t);return i.type=n,i.questionToken=r,i.transformFlags=1,i}function me(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(fe(t,r,n,i),e):e}function ge(t,r,n,i,a,o){var s=K(167,t,r,n,a,o);return s.questionToken=i&&e.isQuestionToken(i)?i:void 0,s.exclamationToken=i&&e.isExclamationToken(i)?i:void 0,s.transformFlags|=d(s.questionToken)|d(s.exclamationToken)|8388608,(e.isComputedPropertyName(s.name)||e.hasStaticModifier(s)&&s.initializer)&&(s.transformFlags|=4096),(i||2&e.modifiersToFlags(s.modifiers))&&(s.transformFlags|=1),s}function ye(t,r,n,i,a,o,s){return t.decorators!==r||t.modifiers!==n||t.name!==i||t.questionToken!==(void 0!==a&&e.isQuestionToken(a)?a:void 0)||t.exclamationToken!==(void 0!==a&&e.isExclamationToken(a)?a:void 0)||t.type!==o||t.initializer!==s?f(ge(r,n,i,a,o,s),t):t}function he(e,t,r,n,i,a){var o=L(168,void 0,e,t,n,i,a);return o.questionToken=r,o.transformFlags=1,o}function ve(e,t,r,n,i,a,o){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o?R(he(t,r,n,i,a,o),e):e}function be(t,r,n,i,a,o,s,c,l){var u=B(169,t,r,i,o,s,c,l);return u.asteriskToken=n,u.questionToken=a,u.transformFlags|=d(u.asteriskToken)|d(u.questionToken)|1024,a&&(u.transformFlags|=1),256&e.modifiersToFlags(u.modifiers)?u.transformFlags|=n?128:256:n&&(u.transformFlags|=2048),u}function xe(e,t,r,n,i,a,o,s,c,l){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.questionToken!==a||e.typeParameters!==o||e.parameters!==s||e.type!==c||e.body!==l?J(be(t,r,n,i,a,o,s,c,l),e):e}function Se(e,t,r){var n=M(170,e,t,void 0,void 0);return n.body=r,n.transformFlags=8388608|d(r),n}function De(e,t,r,n){var i=B(171,e,t,void 0,void 0,r,void 0,n);return i.transformFlags|=1024,i}function Ce(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.parameters!==n||e.body!==i?J(De(t,r,n,i),e):e}function Te(e,t,r,n,i,a){return B(172,e,t,r,void 0,n,i,a)}function Ee(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.type!==a||e.body!==o?J(Te(t,r,n,i,a,o),e):e}function ke(e,t,r,n,i){return B(173,e,t,r,void 0,n,void 0,i)}function Ae(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.body!==a?J(ke(t,r,n,i,a),e):e}function Ne(e,t,r){var n=L(174,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function we(e,t,r){var n=L(175,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Fe(e,t,r,n){var i=L(176,e,t,void 0,void 0,r,n);return i.transformFlags=1,i}function Pe(e,t,r,n,i){return e.parameters!==n||e.type!==i||e.decorators!==t||e.modifiers!==r?R(Fe(t,r,n,i),e):e}function Ie(e,t){var r=P(199);return r.type=e,r.literal=t,r.transformFlags=1,r}function Oe(e,t,r){var n=P(177);return n.assertsModifier=e,n.parameterName=yi(t),n.type=r,n.transformFlags=1,n}function Me(e,t){var r=P(178);return r.typeName=yi(e),r.typeArguments=t&&m().parenthesizeTypeArguments(F(t)),r.transformFlags=1,r}function Le(e,t,r){var n=L(179,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Re(){for(var t=[],r=0;r0;default:return!0}}function ci(t,r,n,i){void 0===i&&(i=0);var a=e.getNameOfDeclaration(t);if(a&&e.isIdentifier(a)&&!e.isGeneratedIdentifier(a)){var o=e.setParent(e.setTextRange(ri(a),a),a.parent);return i|=e.getEmitFlags(a),n||(i|=48),r||(i|=1536),i&&e.setEmitFlags(o,i),o}return ee(t)}function li(e,t,r){return ci(e,t,r,8192)}function ui(t,r,n,i){var a=_t(t,e.nodeIsSynthesized(r)?r:ri(r));e.setTextRange(a,r);var o=0;return i||(o|=48),n||(o|=1536),o&&e.setEmitFlags(a,o),a}function di(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function _i(){return e.startOnNewLine(or(H("use strict")))}function pi(t,r,n,i){void 0===n&&(n=0),e.Debug.assert(0===r.length,"Prologue directives should be at the first statement in the target statements array");for(var a=!1,o=t.length;n=177&&e<=200)return-2;switch(e){case 208:case 209:case 204:case 201:case 202:return 536887296;case 261:return 589443072;case 164:case 211:case 229:case 350:case 212:case 106:case 206:case 207:default:return 536870912;case 214:return 557748224;case 213:case 256:return 591310848;case 255:return 537165824;case 257:case 226:return 536940544;case 171:return 591306752;case 167:return 570433536;case 169:case 172:case 173:return 574529536;case 130:case 147:case 158:case 143:case 150:case 148:case 133:case 151:case 114:case 163:case 166:case 168:case 174:case 175:case 176:case 258:case 259:return-2;case 205:return 536973312;case 292:return 536903680}}e.getTransformFlagsSubtreeExclusions=f;var m=e.createBaseNodeFactory();function g(e){return e.flags|=8,e}var y,h={createBaseSourceFileNode:function(e){return g(m.createBaseSourceFileNode(e))},createBaseIdentifierNode:function(e){return g(m.createBaseIdentifierNode(e))},createBasePrivateIdentifierNode:function(e){return g(m.createBasePrivateIdentifierNode(e))},createBaseTokenNode:function(e){return g(m.createBaseTokenNode(e))},createBaseNode:function(e){return g(m.createBaseNode(e))}};function v(t,r){if(t.original=r,r){var n=r.emitNode;n&&(t.emitNode=function(t,r){var n=t.flags,i=t.leadingComments,a=t.trailingComments,o=t.commentRange,s=t.sourceMapRange,c=t.tokenSourceMapRanges,l=t.constantValue,u=t.helpers,d=t.startsOnNewLine;r||(r={});i&&(r.leadingComments=e.addRange(i.slice(),r.leadingComments));a&&(r.trailingComments=e.addRange(a.slice(),r.trailingComments));n&&(r.flags=-268435457&n);o&&(r.commentRange=o);s&&(r.sourceMapRange=s);c&&(r.tokenSourceMapRanges=function(e,t){t||(t=[]);for(var r in e)t[r]=e[r];return t}(c,r.tokenSourceMapRanges));void 0!==l&&(r.constantValue=l);if(u)for(var _=0,p=u;_0&&(o[l-c]=u)}c>0&&(o.length-=c)}},e.getSnippetElement=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.snippetElement},e.setSnippetElement=function(e,r){return t(e).snippetElement=r,e},e.ignoreSourceNewlines=function(e){return t(e).flags|=134217728,e},e.setTypeNode=function(e,r){return t(e).typeNode=r,e},e.getTypeNode=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.typeNode}}(c||(c={})),function(e){function t(e){for(var t=[],r=1;r=2)return n.createCallExpression(n.createPropertyAccessExpression(n.createIdentifier("Object"),"assign"),void 0,r);return t.requestEmitHelper(e.assignHelper),n.createCallExpression(o("__assign"),void 0,r)},createAwaitHelper:function(r){return t.requestEmitHelper(e.awaitHelper),n.createCallExpression(o("__await"),void 0,[r])},createAsyncGeneratorHelper:function(r,i){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncGeneratorHelper),(r.emitNode||(r.emitNode={})).flags|=786432,n.createCallExpression(o("__asyncGenerator"),void 0,[i?n.createThis():n.createVoidZero(),n.createIdentifier("arguments"),r])},createAsyncDelegatorHelper:function(r){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncDelegator),n.createCallExpression(o("__asyncDelegator"),void 0,[r])},createAsyncValuesHelper:function(r){return t.requestEmitHelper(e.asyncValues),n.createCallExpression(o("__asyncValues"),void 0,[r])},createRestHelper:function(r,i,a,s){t.requestEmitHelper(e.restHelper);for(var c=[],l=0,u=0;u= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };'},e.metadataHelper={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };'},e.paramHelper={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };"},e.assignHelper={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };"},e.awaitHelper={name:"typescript:await",importName:"__await",scoped:!1,text:"\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},e.asyncGeneratorHelper={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };'},e.asyncDelegator={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n };'},e.asyncValues={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };'},e.restHelper={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };'},e.awaiterHelper={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };'},e.extendsHelper={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();'},e.templateObjectHelper={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };'},e.readHelper={name:"typescript:read",importName:"__read",scoped:!1,text:'\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };'},e.spreadArrayHelper={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"},e.valuesHelper={name:"typescript:values",importName:"__values",scoped:!1,text:'\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };'},e.generatorHelper={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };'},e.createBindingHelper={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:'\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));'},e.setModuleDefaultHelper={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });'},e.importStarHelper={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[e.createBindingHelper,e.setModuleDefaultHelper],priority:2,text:'\n var __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n };'},e.importDefaultHelper={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };'},e.exportStarHelper={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[e.createBindingHelper],priority:2,text:'\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };'},e.classPrivateFieldGetHelper={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };'},e.classPrivateFieldSetHelper={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };'},e.classPrivateFieldInHelper={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };'},e.getAllUnscopedEmitHelpers=function(){return n||(n=e.arrayToMap([e.decorateHelper,e.metadataHelper,e.paramHelper,e.assignHelper,e.awaitHelper,e.asyncGeneratorHelper,e.asyncDelegator,e.asyncValues,e.restHelper,e.awaiterHelper,e.extendsHelper,e.templateObjectHelper,e.spreadArrayHelper,e.valuesHelper,e.readHelper,e.generatorHelper,e.importStarHelper,e.importDefaultHelper,e.exportStarHelper,e.classPrivateFieldGetHelper,e.classPrivateFieldSetHelper,e.classPrivateFieldInHelper,e.createBindingHelper,e.setModuleDefaultHelper],(function(e){return e.name})))},e.asyncSuperHelper={name:"typescript:async-super",scoped:!0,text:t(i(["\n const "," = name => super[name];"],["\n const "," = name => super[name];"]),"_superIndex")},e.advancedAsyncSuperHelper={name:"typescript:advanced-async-super",scoped:!0,text:t(i(["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"],["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"]),"_superIndex")},e.isCallToHelper=function(t,r){return e.isCallExpression(t)&&e.isIdentifier(t.expression)&&0!=(4096&e.getEmitFlags(t.expression))&&t.expression.escapedText===r}}(c||(c={})),function(e){e.isNumericLiteral=function(e){return 8===e.kind},e.isBigIntLiteral=function(e){return 9===e.kind},e.isStringLiteral=function(e){return 10===e.kind},e.isJsxText=function(e){return 11===e.kind},e.isRegularExpressionLiteral=function(e){return 13===e.kind},e.isNoSubstitutionTemplateLiteral=function(e){return 14===e.kind},e.isTemplateHead=function(e){return 15===e.kind},e.isTemplateMiddle=function(e){return 16===e.kind},e.isTemplateTail=function(e){return 17===e.kind},e.isDotDotDotToken=function(e){return 25===e.kind},e.isCommaToken=function(e){return 27===e.kind},e.isPlusToken=function(e){return 39===e.kind},e.isMinusToken=function(e){return 40===e.kind},e.isAsteriskToken=function(e){return 41===e.kind},e.isExclamationToken=function(e){return 53===e.kind},e.isQuestionToken=function(e){return 57===e.kind},e.isColonToken=function(e){return 58===e.kind},e.isQuestionDotToken=function(e){return 28===e.kind},e.isEqualsGreaterThanToken=function(e){return 38===e.kind},e.isIdentifier=function(e){return 79===e.kind},e.isPrivateIdentifier=function(e){return 80===e.kind},e.isExportModifier=function(e){return 93===e.kind},e.isAsyncModifier=function(e){return 131===e.kind},e.isAssertsKeyword=function(e){return 128===e.kind},e.isAwaitKeyword=function(e){return 132===e.kind},e.isReadonlyKeyword=function(e){return 145===e.kind},e.isStaticModifier=function(e){return 124===e.kind},e.isAbstractModifier=function(e){return 126===e.kind},e.isSuperKeyword=function(e){return 106===e.kind},e.isImportKeyword=function(e){return 100===e.kind},e.isQualifiedName=function(e){return 161===e.kind},e.isComputedPropertyName=function(e){return 162===e.kind},e.isTypeParameterDeclaration=function(e){return 163===e.kind},e.isParameter=function(e){return 164===e.kind},e.isDecorator=function(e){return 165===e.kind},e.isPropertySignature=function(e){return 166===e.kind},e.isPropertyDeclaration=function(e){return 167===e.kind},e.isMethodSignature=function(e){return 168===e.kind},e.isMethodDeclaration=function(e){return 169===e.kind},e.isClassStaticBlockDeclaration=function(e){return 170===e.kind},e.isConstructorDeclaration=function(e){return 171===e.kind},e.isGetAccessorDeclaration=function(e){return 172===e.kind},e.isSetAccessorDeclaration=function(e){return 173===e.kind},e.isCallSignatureDeclaration=function(e){return 174===e.kind},e.isConstructSignatureDeclaration=function(e){return 175===e.kind},e.isIndexSignatureDeclaration=function(e){return 176===e.kind},e.isTypePredicateNode=function(e){return 177===e.kind},e.isTypeReferenceNode=function(e){return 178===e.kind},e.isFunctionTypeNode=function(e){return 179===e.kind},e.isConstructorTypeNode=function(e){return 180===e.kind},e.isTypeQueryNode=function(e){return 181===e.kind},e.isTypeLiteralNode=function(e){return 182===e.kind},e.isArrayTypeNode=function(e){return 183===e.kind},e.isTupleTypeNode=function(e){return 184===e.kind},e.isNamedTupleMember=function(e){return 197===e.kind},e.isOptionalTypeNode=function(e){return 185===e.kind},e.isRestTypeNode=function(e){return 186===e.kind},e.isUnionTypeNode=function(e){return 187===e.kind},e.isIntersectionTypeNode=function(e){return 188===e.kind},e.isConditionalTypeNode=function(e){return 189===e.kind},e.isInferTypeNode=function(e){return 190===e.kind},e.isParenthesizedTypeNode=function(e){return 191===e.kind},e.isThisTypeNode=function(e){return 192===e.kind},e.isTypeOperatorNode=function(e){return 193===e.kind},e.isIndexedAccessTypeNode=function(e){return 194===e.kind},e.isMappedTypeNode=function(e){return 195===e.kind},e.isLiteralTypeNode=function(e){return 196===e.kind},e.isImportTypeNode=function(e){return 200===e.kind},e.isTemplateLiteralTypeSpan=function(e){return 199===e.kind},e.isTemplateLiteralTypeNode=function(e){return 198===e.kind},e.isObjectBindingPattern=function(e){return 201===e.kind},e.isArrayBindingPattern=function(e){return 202===e.kind},e.isBindingElement=function(e){return 203===e.kind},e.isArrayLiteralExpression=function(e){return 204===e.kind},e.isObjectLiteralExpression=function(e){return 205===e.kind},e.isPropertyAccessExpression=function(e){return 206===e.kind},e.isElementAccessExpression=function(e){return 207===e.kind},e.isCallExpression=function(e){return 208===e.kind},e.isNewExpression=function(e){return 209===e.kind},e.isTaggedTemplateExpression=function(e){return 210===e.kind},e.isTypeAssertionExpression=function(e){return 211===e.kind},e.isParenthesizedExpression=function(e){return 212===e.kind},e.isFunctionExpression=function(e){return 213===e.kind},e.isArrowFunction=function(e){return 214===e.kind},e.isDeleteExpression=function(e){return 215===e.kind},e.isTypeOfExpression=function(e){return 216===e.kind},e.isVoidExpression=function(e){return 217===e.kind},e.isAwaitExpression=function(e){return 218===e.kind},e.isPrefixUnaryExpression=function(e){return 219===e.kind},e.isPostfixUnaryExpression=function(e){return 220===e.kind},e.isBinaryExpression=function(e){return 221===e.kind},e.isConditionalExpression=function(e){return 222===e.kind},e.isTemplateExpression=function(e){return 223===e.kind},e.isYieldExpression=function(e){return 224===e.kind},e.isSpreadElement=function(e){return 225===e.kind},e.isClassExpression=function(e){return 226===e.kind},e.isOmittedExpression=function(e){return 227===e.kind},e.isExpressionWithTypeArguments=function(e){return 228===e.kind},e.isAsExpression=function(e){return 229===e.kind},e.isNonNullExpression=function(e){return 230===e.kind},e.isMetaProperty=function(e){return 231===e.kind},e.isSyntheticExpression=function(e){return 232===e.kind},e.isPartiallyEmittedExpression=function(e){return 350===e.kind},e.isCommaListExpression=function(e){return 351===e.kind},e.isTemplateSpan=function(e){return 233===e.kind},e.isSemicolonClassElement=function(e){return 234===e.kind},e.isBlock=function(e){return 235===e.kind},e.isVariableStatement=function(e){return 237===e.kind},e.isEmptyStatement=function(e){return 236===e.kind},e.isExpressionStatement=function(e){return 238===e.kind},e.isIfStatement=function(e){return 239===e.kind},e.isDoStatement=function(e){return 240===e.kind},e.isWhileStatement=function(e){return 241===e.kind},e.isForStatement=function(e){return 242===e.kind},e.isForInStatement=function(e){return 243===e.kind},e.isForOfStatement=function(e){return 244===e.kind},e.isContinueStatement=function(e){return 245===e.kind},e.isBreakStatement=function(e){return 246===e.kind},e.isReturnStatement=function(e){return 247===e.kind},e.isWithStatement=function(e){return 248===e.kind},e.isSwitchStatement=function(e){return 249===e.kind},e.isLabeledStatement=function(e){return 250===e.kind},e.isThrowStatement=function(e){return 251===e.kind},e.isTryStatement=function(e){return 252===e.kind},e.isDebuggerStatement=function(e){return 253===e.kind},e.isVariableDeclaration=function(e){return 254===e.kind},e.isVariableDeclarationList=function(e){return 255===e.kind},e.isFunctionDeclaration=function(e){return 256===e.kind},e.isClassDeclaration=function(e){return 257===e.kind},e.isInterfaceDeclaration=function(e){return 258===e.kind},e.isTypeAliasDeclaration=function(e){return 259===e.kind},e.isEnumDeclaration=function(e){return 260===e.kind},e.isModuleDeclaration=function(e){return 261===e.kind},e.isModuleBlock=function(e){return 262===e.kind},e.isCaseBlock=function(e){return 263===e.kind},e.isNamespaceExportDeclaration=function(e){return 264===e.kind},e.isImportEqualsDeclaration=function(e){return 265===e.kind},e.isImportDeclaration=function(e){return 266===e.kind},e.isImportClause=function(e){return 267===e.kind},e.isImportTypeAssertionContainer=function(e){return 295===e.kind},e.isAssertClause=function(e){return 293===e.kind},e.isAssertEntry=function(e){return 294===e.kind},e.isNamespaceImport=function(e){return 268===e.kind},e.isNamespaceExport=function(e){return 274===e.kind},e.isNamedImports=function(e){return 269===e.kind},e.isImportSpecifier=function(e){return 270===e.kind},e.isExportAssignment=function(e){return 271===e.kind},e.isExportDeclaration=function(e){return 272===e.kind},e.isNamedExports=function(e){return 273===e.kind},e.isExportSpecifier=function(e){return 275===e.kind},e.isMissingDeclaration=function(e){return 276===e.kind},e.isNotEmittedStatement=function(e){return 349===e.kind},e.isSyntheticReference=function(e){return 354===e.kind},e.isMergeDeclarationMarker=function(e){return 352===e.kind},e.isEndOfDeclarationMarker=function(e){return 353===e.kind},e.isExternalModuleReference=function(e){return 277===e.kind},e.isJsxElement=function(e){return 278===e.kind},e.isJsxSelfClosingElement=function(e){return 279===e.kind},e.isJsxOpeningElement=function(e){return 280===e.kind},e.isJsxClosingElement=function(e){return 281===e.kind},e.isJsxFragment=function(e){return 282===e.kind},e.isJsxOpeningFragment=function(e){return 283===e.kind},e.isJsxClosingFragment=function(e){return 284===e.kind},e.isJsxAttribute=function(e){return 285===e.kind},e.isJsxAttributes=function(e){return 286===e.kind},e.isJsxSpreadAttribute=function(e){return 287===e.kind},e.isJsxExpression=function(e){return 288===e.kind},e.isCaseClause=function(e){return 289===e.kind},e.isDefaultClause=function(e){return 290===e.kind},e.isHeritageClause=function(e){return 291===e.kind},e.isCatchClause=function(e){return 292===e.kind},e.isPropertyAssignment=function(e){return 296===e.kind},e.isShorthandPropertyAssignment=function(e){return 297===e.kind},e.isSpreadAssignment=function(e){return 298===e.kind},e.isEnumMember=function(e){return 299===e.kind},e.isUnparsedPrepend=function(e){return 301===e.kind},e.isSourceFile=function(e){return 305===e.kind},e.isBundle=function(e){return 306===e.kind},e.isUnparsedSource=function(e){return 307===e.kind},e.isJSDocTypeExpression=function(e){return 309===e.kind},e.isJSDocNameReference=function(e){return 310===e.kind},e.isJSDocMemberName=function(e){return 311===e.kind},e.isJSDocLink=function(e){return 324===e.kind},e.isJSDocLinkCode=function(e){return 325===e.kind},e.isJSDocLinkPlain=function(e){return 326===e.kind},e.isJSDocAllType=function(e){return 312===e.kind},e.isJSDocUnknownType=function(e){return 313===e.kind},e.isJSDocNullableType=function(e){return 314===e.kind},e.isJSDocNonNullableType=function(e){return 315===e.kind},e.isJSDocOptionalType=function(e){return 316===e.kind},e.isJSDocFunctionType=function(e){return 317===e.kind},e.isJSDocVariadicType=function(e){return 318===e.kind},e.isJSDocNamepathType=function(e){return 319===e.kind},e.isJSDoc=function(e){return 320===e.kind},e.isJSDocTypeLiteral=function(e){return 322===e.kind},e.isJSDocSignature=function(e){return 323===e.kind},e.isJSDocAugmentsTag=function(e){return 328===e.kind},e.isJSDocAuthorTag=function(e){return 330===e.kind},e.isJSDocClassTag=function(e){return 332===e.kind},e.isJSDocCallbackTag=function(e){return 338===e.kind},e.isJSDocPublicTag=function(e){return 333===e.kind},e.isJSDocPrivateTag=function(e){return 334===e.kind},e.isJSDocProtectedTag=function(e){return 335===e.kind},e.isJSDocReadonlyTag=function(e){return 336===e.kind},e.isJSDocOverrideTag=function(e){return 337===e.kind},e.isJSDocDeprecatedTag=function(e){return 331===e.kind},e.isJSDocSeeTag=function(e){return 346===e.kind},e.isJSDocEnumTag=function(e){return 339===e.kind},e.isJSDocParameterTag=function(e){return 340===e.kind},e.isJSDocReturnTag=function(e){return 341===e.kind},e.isJSDocThisTag=function(e){return 342===e.kind},e.isJSDocTypeTag=function(e){return 343===e.kind},e.isJSDocTemplateTag=function(e){return 344===e.kind},e.isJSDocTypedefTag=function(e){return 345===e.kind},e.isJSDocUnknownTag=function(e){return 327===e.kind},e.isJSDocPropertyTag=function(e){return 347===e.kind},e.isJSDocImplementsTag=function(e){return 329===e.kind},e.isSyntaxList=function(e){return 348===e.kind}}(c||(c={})),function(e){function t(t,r,n,i){if(e.isComputedPropertyName(n))return e.setTextRange(t.createElementAccessExpression(r,n.expression),i);var a=e.setTextRange(e.isMemberName(n)?t.createPropertyAccessExpression(r,n):t.createElementAccessExpression(r,n),n);return e.getOrCreateEmitNode(a).flags|=64,a}function n(t,r){var n=e.parseNodeFactory.createIdentifier(t||"React");return e.setParent(n,e.getParseTreeNode(r)),n}function i(t,r,a){if(e.isQualifiedName(r)){var o=i(t,r.left,a),s=t.createIdentifier(e.idText(r.right));return s.escapedText=r.right.escapedText,t.createPropertyAccessExpression(o,s)}return n(e.idText(r),a)}function a(e,t,r,a){return t?i(e,t,a):e.createPropertyAccessExpression(n(r,a),"createElement")}function o(t,r){return e.isIdentifier(r)?t.createStringLiteralFromNode(r):e.isComputedPropertyName(r)?e.setParent(e.setTextRange(t.cloneNode(r.expression),r.expression),r.expression.parent):e.setParent(e.setTextRange(t.cloneNode(r),r),r.parent)}function s(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function c(t){return e.isParenthesizedExpression(t)&&e.isInJSFile(t)&&!!e.getJSDocTypeTag(t)}function l(e,t){switch(void 0===t&&(t=15),e.kind){case 212:return!(16&t&&c(e))&&0!=(1&t);case 211:case 229:return 0!=(2&t);case 230:return 0!=(4&t);case 350:return 0!=(8&t)}return!1}function u(e,t){for(void 0===t&&(t=15);l(e,t);)e=e.expression;return e}function d(t){return e.setStartsOnNewLine(t,!0)}function _(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return n&&n.externalHelpersModuleName}function p(t,r,n,i,a){if(n.importHelpers&&e.isEffectiveExternalModule(r,n)){var o=_(r);if(o)return o;var s=e.getEmitModuleKind(n),c=(i||e.getESModuleInterop(n)&&a)&&s!==e.ModuleKind.System&&(s0)if(i||s.push(t.createNull()),a.length>1)for(var c=0,l=a;c0)if(c.length>1)for(var f=0,m=c;f=e.ModuleKind.ES2015&&l<=e.ModuleKind.ESNext||n.impliedNodeFormat===e.ModuleKind.ESNext){var u=e.getEmitHelpers(n);if(u){for(var d=[],_=0,f=u;_0?o[n-1]:void 0;return e.Debug.assertEqual(i[n],r),o[n]=t.onEnter(a[n],u,l),i[n]=c(t,r),n}function n(t,r,i,a,o,s,d){e.Debug.assertEqual(i[r],n),e.Debug.assertIsDefined(t.onLeft),i[r]=c(t,n);var _=t.onLeft(a[r].left,o[r],a[r]);return _?(u(r,a,_),l(r,i,a,o,_)):r}function i(t,r,n,a,o,s,l){return e.Debug.assertEqual(n[r],i),e.Debug.assertIsDefined(t.onOperator),n[r]=c(t,i),t.onOperator(a[r].operatorToken,o[r],a[r]),r}function a(t,r,n,i,o,s,d){e.Debug.assertEqual(n[r],a),e.Debug.assertIsDefined(t.onRight),n[r]=c(t,a);var _=t.onRight(i[r].right,o[r],i[r]);return _?(u(r,i,_),l(r,n,i,o,_)):r}function o(t,r,n,i,a,s,l){e.Debug.assertEqual(n[r],o),n[r]=c(t,o);var u=t.onExit(i[r],a[r]);if(r>0){if(r--,t.foldState){var d=n[r]===o?"right":"left";a[r]=t.foldState(a[r],u,d)}}else s.value=u;return r}function s(t,r,n,i,a,o,c){return e.Debug.assertEqual(n[r],s),r}function c(t,c){switch(c){case r:if(t.onLeft)return n;case n:if(t.onOperator)return i;case i:if(t.onRight)return a;case a:return o;case o:case s:return s;default:e.Debug.fail("Invalid state")}}function l(e,t,n,i,a){return t[++e]=r,n[e]=a,i[e]=void 0,e}function u(t,r,n){if(e.Debug.shouldAssert(2))for(;t>=0;)e.Debug.assert(r[t]!==n,"Circular traversal detected."),t--}t.enter=r,t.left=n,t.operator=i,t.right=a,t.exit=o,t.done=s,t.nextState=c}(v||(v={}));var b=function(e,t,r,n,i,a){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=n,this.onExit=i,this.foldState=a};e.createBinaryExpressionTrampoline=function(t,r,n,i,a,o){var s=new b(t,r,n,i,a,o);return function(t,r){var n={value:void 0},i=[v.enter],a=[t],o=[void 0],c=0;for(;i[c]!==v.done;)c=i[c](s,c,i,a,o,n,r);return e.Debug.assertEqual(c,0),n.value}}}(c||(c={})),function(e){e.setTextRange=function(t,r){return r?e.setTextRangePosEnd(t,r.pos,r.end):t}}(c||(c={})),function(e){var t,i,a,o,s,c,l,u,d;function _(e,t){return t&&e(t)}function p(e,t,r){if(r){if(t)return t(r);for(var n=0,i=r;nt.checkJsDirective.pos)&&(t.checkJsDirective={enabled:"ts-check"===a,end:e.range.end,pos:e.range.pos})}));break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:e.Debug.fail("Unhandled pragma kind")}}))}!function(e){e[e.None=0]="None",e[e.Yield=1]="Yield",e[e.Await=2]="Await",e[e.Type=4]="Type",e[e.IgnoreMissingOpenBrace=16]="IgnoreMissingOpenBrace",e[e.JSDoc=32]="JSDoc"}(t||(t={})),function(e){e[e.TryParse=0]="TryParse",e[e.Lookahead=1]="Lookahead",e[e.Reparse=2]="Reparse"}(i||(i={})),e.parseBaseNodeFactory={createBaseSourceFileNode:function(t){return new(l||(l=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(s||(s=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(c||(c=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(o||(o=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(t){return new(a||(a=e.objectAllocator.getNodeConstructor()))(t,-1,-1)}},e.parseNodeFactory=e.createNodeFactory(1,e.parseBaseNodeFactory),e.isJSDocLikeText=f,e.isFileProbablyExternalModule=m,e.forEachChild=h,e.forEachChildRecursively=function(t,r,n){for(var i=v(t),a=[];a.length=0;--c)i.push(o[c]),a.push(s)}else{var l;if(l=r(o,s)){if("skip"===l)continue;return l}if(o.kind>=161)for(var u=0,d=v(o);u=r.pos})),u=l>=0?e.findIndex(a,(function(e){return e.start>=n.pos}),l):-1;l>=0&&e.addRange(v,a,l,u>=0?u:void 0),we((function(){var e=M;for(M|=32768,c.setTextPos(n.pos),Se();1!==ve();){var r=c.getStartPos(),a=kt(0,ei);if(i.push(a),r===c.getStartPos()&&Se(),o>=0){var s=t.statements[o];if(a.end===s.pos)break;a.end>s.pos&&(o=m(t.statements,o+1))}}M=e}),2),s=o>=0?f(t.statements,o):-1};-1!==s;)l();if(o>=0){var u=t.statements[o];e.addRange(i,t.statements,o);var _=e.findIndex(a,(function(e){return e.start>=u.pos}));_>=0&&e.addRange(v,a,_)}return E=r,R.updateSourceFile(t,e.setTextRange(R.createNodeArray(i),t.statements));function p(e){return!(32768&e.flags||!(16777216&e.transformFlags))}function f(e,t){for(var r=t;r116}function Oe(){return 79===ve()||(125!==ve()||!se())&&((132!==ve()||!de())&&ve()>116)}function Me(t,r,n){return void 0===n&&(n=!0),ve()===t?(n&&Se(),!0):(r?_e(r):_e(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}t.fixupParentReferences=W;var Le,Re,Be,Je=Object.keys(e.textToKeywordObj).filter((function(e){return e.length>2}));function je(t){var r;if(e.isTaggedTemplateExpression(t))fe(e.skipTrivia(m,t.template.pos),t.template.end,e.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);else{var n=e.isIdentifier(t)?e.idText(t):void 0;if(n&&e.isIdentifierText(n,g)){var i=e.skipTrivia(m,t.pos);switch(n){case"const":case"let":case"var":return void fe(i,t.end,e.Diagnostics.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void Ue(e.Diagnostics.Interface_name_cannot_be_0,e.Diagnostics.Interface_must_be_given_a_name,18);case"is":return void fe(i,c.getTextPos(),e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void Ue(e.Diagnostics.Namespace_name_cannot_be_0,e.Diagnostics.Namespace_must_be_given_a_name,18);case"type":return void Ue(e.Diagnostics.Type_alias_name_cannot_be_0,e.Diagnostics.Type_alias_must_be_given_a_name,63)}var a=null!==(r=e.getSpellingSuggestion(n,Je,(function(e){return e})))&&void 0!==r?r:function(t){for(var r=0,n=Je;ri.length+2&&e.startsWith(t,i))return"".concat(i," ").concat(t.slice(i.length))}return}(n);a?fe(i,t.end,e.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0,a):0!==ve()&&fe(i,t.end,e.Diagnostics.Unexpected_keyword_or_identifier)}else _e(e.Diagnostics._0_expected,e.tokenToString(26))}}function Ue(e,t,r){ve()===r?_e(t):_e(e,c.getTokenValue())}function Ve(t){return ve()===t?(De(),!0):(_e(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function Ke(t,r,n,i){if(ve()!==r){var a=_e(e.Diagnostics._0_expected,e.tokenToString(r));n&&a&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,i,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,e.tokenToString(t),e.tokenToString(r)))}else Se()}function ze(e){return ve()===e&&(Se(),!0)}function Ge(e){if(ve()===e)return He()}function qe(e){if(ve()===e)return t=ye(),r=ve(),De(),Ze(R.createToken(r),t);var t,r}function We(t,r,n){return Ge(t)||et(t,!1,r||e.Diagnostics._0_expected,n||e.tokenToString(t))}function He(){var e=ye(),t=ve();return Se(),Ze(R.createToken(t),e)}function Qe(){return 26===ve()||(19===ve()||1===ve()||c.hasPrecedingLineBreak())}function Xe(){return!!Qe()&&(26===ve()&&Se(),!0)}function $e(){return Xe()||Me(26)}function Ye(t,r,n,i){var a=R.createNodeArray(t,i);return e.setTextRangePosEnd(a,r,null!=n?n:c.getStartPos()),a}function Ze(t,r,n){return e.setTextRangePosEnd(t,r,null!=n?n:c.getStartPos()),M&&(t.flags|=M),J&&(J=!1,t.flags|=131072),t}function et(t,r,n,i){r?pe(c.getStartPos(),0,n,i):n&&_e(n,i);var a=ye();return Ze(79===t?R.createIdentifier("",void 0,void 0):e.isTemplateLiteralKind(t)?R.createTemplateLiteralLikeNode(t,"","",void 0):8===t?R.createNumericLiteral("",void 0):10===t?R.createStringLiteral("",void 0):276===t?R.createMissingDeclaration():R.createToken(t),a)}function tt(e){var t=N.get(e);return void 0===t&&N.set(e,t=e),t}function rt(t,r,n){if(t){P++;var i=ye(),a=ve(),o=tt(c.getTokenValue());return be(),Ze(R.createIdentifier(o,void 0,a),i)}if(80===ve())return _e(n||e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),rt(!0);if(0===ve()&&c.tryScan((function(){return 79===c.reScanInvalidIdentifier()})))return rt(!0);P++;var s=1===ve(),l=c.isReservedWord(),u=c.getTokenText(),d=l?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:e.Diagnostics.Identifier_expected;return et(79,s,r||d,u)}function nt(e){return rt(Ie(),void 0,e)}function it(e,t){return rt(Oe(),e,t)}function at(t){return rt(e.tokenIsIdentifierOrKeyword(ve()),t)}function ot(){return e.tokenIsIdentifierOrKeyword(ve())||10===ve()||8===ve()}function st(e){if(10===ve()||8===ve()){var t=Kt();return t.text=tt(t.text),t}return e&&22===ve()?function(){var e=ye();Me(22);var t=re(Qr);return Me(23),Ze(R.createComputedPropertyName(t),e)}():80===ve()?lt():at()}function ct(){return st(!0)}function lt(){var e,t,r=ye(),n=R.createPrivateIdentifier((e=c.getTokenText(),void 0===(t=w.get(e))&&w.set(e,t=e),t));return Se(),Ze(n,r)}function ut(e){return ve()===e&&Pe(_t)}function dt(){return Se(),!c.hasPrecedingLineBreak()&&mt()}function _t(){switch(ve()){case 85:return 92===Se();case 93:return Se(),88===ve()?Fe(gt):152===ve()?Fe(ft):pt();case 88:return gt();case 124:case 136:case 149:return Se(),mt();default:return dt()}}function pt(){return 41!==ve()&&127!==ve()&&18!==ve()&&mt()}function ft(){return Se(),pt()}function mt(){return 22===ve()||18===ve()||41===ve()||25===ve()||ot()}function gt(){return Se(),84===ve()||98===ve()||118===ve()||126===ve()&&Fe(Wn)||131===ve()&&Fe(Hn)}function yt(t,r){if(At(t))return!0;switch(t){case 0:case 1:case 3:return!(26===ve()&&r)&&Yn();case 2:return 82===ve()||88===ve();case 4:return Fe(_r);case 5:return Fe(xi)||26===ve()&&!r;case 6:return 22===ve()||ot();case 12:switch(ve()){case 22:case 41:case 25:case 24:return!0;default:return ot()}case 18:return ot();case 9:return 22===ve()||25===ve()||ot();case 24:return e.tokenIsIdentifierOrKeyword(ve())||10===ve();case 7:return 18===ve()?Fe(ht):r?Oe()&&!St():Wr()&&!St();case 8:return ci();case 10:return 27===ve()||25===ve()||ci();case 19:return 101===ve()||Oe();case 15:switch(ve()){case 27:case 24:return!0}case 11:return 25===ve()||Hr();case 16:return tr(!1);case 17:return tr(!0);case 20:case 21:return 27===ve()||Fr();case 22:return Li();case 23:return e.tokenIsIdentifierOrKeyword(ve());case 13:return e.tokenIsIdentifierOrKeyword(ve())||18===ve();case 14:return!0}return e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function ht(){if(e.Debug.assert(18===ve()),19===Se()){var t=Se();return 27===t||18===t||94===t||117===t}return!0}function vt(){return Se(),Oe()}function bt(){return Se(),e.tokenIsIdentifierOrKeyword(ve())}function xt(){return Se(),e.tokenIsIdentifierOrKeywordOrGreaterThan(ve())}function St(){return(117===ve()||94===ve())&&Fe(Dt)}function Dt(){return Se(),Hr()}function Ct(){return Se(),Fr()}function Tt(e){if(1===ve())return!0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 19===ve();case 3:return 19===ve()||82===ve()||88===ve();case 7:return 18===ve()||94===ve()||117===ve();case 8:return function(){if(Qe())return!0;if(on(ve()))return!0;if(38===ve())return!0;return!1}();case 19:return 31===ve()||20===ve()||18===ve()||94===ve()||117===ve();case 11:return 21===ve()||26===ve();case 15:case 21:case 10:return 23===ve();case 17:case 16:case 18:return 21===ve()||23===ve();case 20:return 27!==ve();case 22:return 18===ve()||19===ve();case 13:return 31===ve()||43===ve();case 14:return 29===ve()&&Fe(Ki);default:return!1}}function Et(e,t){var r=I;I|=1<=0)}function Pt(t){return 6===t?e.Diagnostics.An_enum_member_name_must_be_followed_by_a_or:void 0}function It(){var e=Ye([],ye());return e.isMissingList=!0,e}function Ot(e,t,r,n){if(Me(r)){var i=Ft(e,t);return Me(n),i}return It()}function Mt(e,t){for(var r=ye(),n=e?at(t):it(t),i=ye();ze(24);){if(29===ve()){n.jsdocDotPos=i;break}i=ye(),n=Ze(R.createQualifiedName(n,Rt(e,!1)),r)}return n}function Lt(e,t){return Ze(R.createQualifiedName(e,t),e.pos)}function Rt(t,r){if(c.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(ve())&&Fe(qn))return et(79,!0,e.Diagnostics.Identifier_expected);if(80===ve()){var n=lt();return r?n:et(79,!0,e.Diagnostics.Identifier_expected)}return t?at():it()}function Bt(e){var t=ye();return Ze(R.createTemplateExpression(zt(e),function(e){var t,r=ye(),n=[];do{t=Vt(e),n.push(t)}while(16===t.literal.kind);return Ye(n,r)}(e)),t)}function Jt(){var e=ye();return Ze(R.createTemplateLiteralType(zt(!1),function(){var e,t=ye(),r=[];do{e=jt(),r.push(e)}while(16===e.literal.kind);return Ye(r,t)}()),e)}function jt(){var e=ye();return Ze(R.createTemplateLiteralTypeSpan(Gr(),Ut(!1)),e)}function Ut(t){return 19===ve()?(function(e){k=c.reScanTemplateToken(e)}(t),r=Gt(ve()),e.Debug.assert(16===r.kind||17===r.kind,"Template fragment has wrong token kind"),r):We(17,e.Diagnostics._0_expected,e.tokenToString(19));var r}function Vt(e){var t=ye();return Ze(R.createTemplateSpan(re(Qr),Ut(e)),t)}function Kt(){return Gt(ve())}function zt(t){t&&Te();var r=Gt(ve());return e.Debug.assert(15===r.kind,"Template head has wrong token kind"),r}function Gt(t){var r=ye(),n=e.isTemplateLiteralKind(t)?R.createTemplateLiteralLikeNode(t,c.getTokenValue(),function(e){var t=14===e||17===e,r=c.getTokenText();return r.substring(1,r.length-(c.isUnterminated()?0:t?1:2))}(t),2048&c.getTokenFlags()):8===t?R.createNumericLiteral(c.getTokenValue(),c.getNumericLiteralFlags()):10===t?R.createStringLiteral(c.getTokenValue(),void 0,c.hasExtendedUnicodeEscape()):e.isLiteralKind(t)?R.createLiteralLikeNode(t,c.getTokenValue()):e.Debug.fail();return c.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),c.isUnterminated()&&(n.isUnterminated=!0),Se(),Ze(n,r)}function qt(){return Mt(!0,e.Diagnostics.Type_expected)}function Wt(){if(!c.hasPrecedingLineBreak()&&29===Ee())return Ot(20,Gr,29,31)}function Ht(){var e=ye();return Ze(R.createTypeReferenceNode(qt(),Wt()),e)}function Qt(t){switch(t.kind){case 178:return e.nodeIsMissing(t.typeName);case 179:case 180:var r=t,n=r.parameters,i=r.type;return!!n.isMissingList||Qt(i);case 191:return Qt(t.type);default:return!1}}function Xt(){var e=ye();return Se(),Ze(R.createThisTypeNode(),e)}function $t(){var e,t=ye();return 108!==ve()&&103!==ve()||(e=at(),Me(58)),Ze(R.createParameterDeclaration(void 0,void 0,void 0,e,void 0,Yt(),void 0),t)}function Yt(){c.setInJSDocType(!0);var e=ye();if(ze(141)){var t=R.createJSDocNamepathType(void 0);e:for(;;)switch(ve()){case 19:case 1:case 27:case 5:break e;default:De()}return c.setInJSDocType(!1),Ze(t,e)}var r=ze(25),n=Kr();return c.setInJSDocType(!1),r&&(n=Ze(R.createJSDocVariadicType(n),e)),63===ve()?(Se(),Ze(R.createJSDocOptionalType(n),e)):n}function Zt(){var e,t,r=ye(),n=ki(),i=it();ze(94)&&(Fr()||!Hr()?e=Gr():t=un());var a=ze(63)?Gr():void 0,o=R.createTypeParameterDeclaration(n,i,e,a);return o.expression=t,Ze(o,r)}function er(){if(29===ve())return Ot(19,Zt,29,31)}function tr(t){return 25===ve()||ci()||e.isModifierKind(ve())||59===ve()||Fr(!t)}function rr(e){return nr(e)}function nr(t,r){void 0===r&&(r=!0);var n=ye(),i=he(),a=t?ae(Ti):Ti();if(108===ve()){var o=R.createParameterDeclaration(a,void 0,void 0,rt(!0),void 0,qr(),void 0);return a&&me(a[0],e.Diagnostics.Decorators_may_not_be_applied_to_this_parameters),z(Ze(o,n),i)}var s=B;B=!1;var c=ki(),l=Ge(25);if(r||Ie()||22===ve()||18===ve()){var u=z(Ze(R.createParameterDeclaration(a,c,l,function(t){var r=li(e.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);return 0===e.getFullWidth(r)&&!e.some(t)&&e.isModifierKind(ve())&&Se(),r}(c),Ge(57),qr(),Xr()),n),i);return B=s,u}}function ir(t,r){if(function(t,r){if(38===t)return Me(t),!0;if(ze(58))return!0;if(r&&38===ve())return _e(e.Diagnostics._0_expected,e.tokenToString(58)),Se(),!0;return!1}(t,r))return ne(Kr)}function ar(e,t){var r=se(),n=de();$(!!(1&e)),Z(!!(2&e));var i=32&e?Ft(17,$t):Ft(16,(function(){return t?rr(n):nr(n,!1)}));return $(r),Z(n),i}function or(e){if(!Me(20))return It();var t=ar(e,!0);return Me(21),t}function sr(){ze(27)||$e()}function cr(e){var t=ye(),r=he();175===e&&Me(103);var n=er(),i=or(4),a=ir(58,!0);return sr(),z(Ze(174===e?R.createCallSignature(n,i,a):R.createConstructSignature(n,i,a),t),r)}function lr(){return 22===ve()&&Fe(ur)}function ur(){if(Se(),25===ve()||23===ve())return!0;if(e.isModifierKind(ve())){if(Se(),Oe())return!0}else{if(!Oe())return!1;Se()}return 58===ve()||27===ve()||57===ve()&&(Se(),58===ve()||27===ve()||23===ve())}function dr(e,t,r,n){var i=Ot(16,(function(){return rr(!1)}),22,23),a=qr();return sr(),z(Ze(R.createIndexSignature(r,n,i,a),e),t)}function _r(){if(20===ve()||29===ve()||136===ve()||149===ve())return!0;for(var t=!1;e.isModifierKind(ve());)t=!0,Se();return 22===ve()||(ot()&&(t=!0,Se()),!!t&&(20===ve()||29===ve()||57===ve()||58===ve()||27===ve()||Qe()))}function pr(){if(20===ve()||29===ve())return cr(174);if(103===ve()&&Fe(fr))return cr(175);var e=ye(),t=he(),r=ki();return ut(136)?bi(e,t,void 0,r,172):ut(149)?bi(e,t,void 0,r,173):lr()?dr(e,t,void 0,r):function(e,t,r){var n,i=ct(),a=Ge(57);if(20===ve()||29===ve()){var o=er(),s=or(4),c=ir(58,!0);n=R.createMethodSignature(r,i,a,o,s,c)}else c=qr(),n=R.createPropertySignature(r,i,a,c),63===ve()&&(n.initializer=Xr());return sr(),z(Ze(n,e),t)}(e,t,r)}function fr(){return Se(),20===ve()||29===ve()}function mr(){return 24===Se()}function gr(){switch(Se()){case 20:case 29:case 24:return!0}return!1}function yr(){var e;return Me(18)?(e=Et(4,pr),Me(19)):e=It(),e}function hr(){return Se(),39===ve()||40===ve()?145===Se():(145===ve()&&Se(),22===ve()&&vt()&&101===Se())}function vr(){var e,t=ye();Me(18),145!==ve()&&39!==ve()&&40!==ve()||145!==(e=He()).kind&&Me(145),Me(22);var r,n=function(){var e=ye(),t=at();Me(101);var r=Gr();return Ze(R.createTypeParameterDeclaration(void 0,t,r,void 0),e)}(),i=ze(127)?Gr():void 0;Me(23),57!==ve()&&39!==ve()&&40!==ve()||57!==(r=He()).kind&&Me(57);var a=qr();$e();var o=Et(4,pr);return Me(19),Ze(R.createMappedTypeNode(e,n,i,r,a,o),t)}function br(){var t=ye();if(ze(25))return Ze(R.createRestTypeNode(Gr()),t);var r=Gr();if(e.isJSDocNullableType(r)&&r.pos===r.type.pos){var n=R.createOptionalTypeNode(r.type);return e.setTextRange(n,r),n.flags=r.flags,n}return r}function xr(){return 58===Se()||57===ve()&&58===Se()}function Sr(){return 25===ve()?e.tokenIsIdentifierOrKeyword(Se())&&xr():e.tokenIsIdentifierOrKeyword(ve())&&xr()}function Dr(){if(Fe(Sr)){var e=ye(),t=he(),r=Ge(25),n=at(),i=Ge(57);Me(58);var a=br();return z(Ze(R.createNamedTupleMember(r,n,i,a),e),t)}return br()}function Cr(){var e=ye(),t=he(),r=function(){var e;if(126===ve()){var t=ye();Se(),e=Ye([Ze(R.createToken(126),t)],t)}return e}(),n=ze(103),i=er(),a=or(4),o=ir(38,!1),s=n?R.createConstructorTypeNode(r,i,a,o):R.createFunctionTypeNode(i,a,o);return n||(s.modifiers=r),z(Ze(s,e),t)}function Tr(){var e=He();return 24===ve()?void 0:e}function Er(e){var t=ye();e&&Se();var r=110===ve()||95===ve()||104===ve()?He():Gt(ve());return e&&(r=Ze(R.createPrefixUnaryExpression(40,r),t)),Ze(R.createLiteralTypeNode(r),t)}function kr(){return Se(),100===ve()}function Ar(){p|=2097152;var t=ye(),r=ze(112);Me(100),Me(20);var n,i=Gr();ze(27)&&(n=function(){var t=ye(),r=c.getTokenPos();Me(18);var n=c.hasPrecedingLineBreak();Me(129),Me(58);var i=Gi(!0);if(!Me(19)){var a=e.lastOrUndefined(v);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return Ze(R.createImportTypeAssertionContainer(i,n),t)}()),Me(21);var a=ze(24)?qt():void 0,o=Wt();return Ze(R.createImportTypeNode(i,n,a,o,r),t)}function Nr(){return Se(),8===ve()||9===ve()}function wr(){switch(ve()){case 130:case 155:case 150:case 147:case 158:case 151:case 133:case 153:case 143:case 148:return Pe(Tr)||Ht();case 66:c.reScanAsteriskEqualsToken();case 41:return r=ye(),Se(),Ze(R.createJSDocAllType(),r);case 60:c.reScanQuestionToken();case 57:return function(){var e=ye();return Se(),27===ve()||19===ve()||21===ve()||31===ve()||63===ve()||51===ve()?Ze(R.createJSDocUnknownType(),e):Ze(R.createJSDocNullableType(Gr(),!1),e)}();case 98:return function(){var e=ye(),t=he();if(Fe(Ui)){Se();var r=or(36),n=ir(58,!1);return z(Ze(R.createJSDocFunctionType(r,n),e),t)}return Ze(R.createTypeReferenceNode(at(),void 0),e)}();case 53:return function(){var e=ye();return Se(),Ze(R.createJSDocNonNullableType(wr(),!1),e)}();case 14:case 10:case 8:case 9:case 110:case 95:case 104:return Er();case 40:return Fe(Nr)?Er(!0):Ht();case 114:return He();case 108:var e=Xt();return 139!==ve()||c.hasPrecedingLineBreak()?e:(t=e,Se(),Ze(R.createTypePredicateNode(void 0,t,Gr()),t.pos));case 112:return Fe(kr)?Ar():function(){var e=ye();Me(112);var t=Mt(!0),r=c.hasPrecedingLineBreak()?void 0:Mi();return Ze(R.createTypeQueryNode(t,r),e)}();case 18:return Fe(hr)?vr():function(){var e=ye();return Ze(R.createTypeLiteralNode(yr()),e)}();case 22:return function(){var e=ye();return Ze(R.createTupleTypeNode(Ot(21,Dr,22,23)),e)}();case 20:return function(){var e=ye();Me(20);var t=Gr();return Me(21),Ze(R.createParenthesizedType(t),e)}();case 100:return Ar();case 128:return Fe(qn)?function(){var e=ye(),t=We(128),r=108===ve()?Xt():it(),n=ze(139)?Gr():void 0;return Ze(R.createTypePredicateNode(t,r,n),e)}():Ht();case 15:return Jt();default:return Ht()}var t,r}function Fr(e){switch(ve()){case 130:case 155:case 150:case 147:case 158:case 133:case 145:case 151:case 154:case 114:case 153:case 104:case 108:case 112:case 143:case 18:case 22:case 29:case 51:case 50:case 103:case 10:case 8:case 9:case 110:case 95:case 148:case 41:case 57:case 53:case 25:case 137:case 100:case 128:case 14:case 15:return!0;case 98:return!e;case 40:return!e&&Fe(Nr);case 20:return!e&&Fe(Pr);default:return Oe()}}function Pr(){return Se(),21===ve()||tr(!1)||Fr()}function Ir(){for(var e=ye(),t=wr();!c.hasPrecedingLineBreak();)switch(ve()){case 53:Se(),t=Ze(R.createJSDocNonNullableType(t,!0),e);break;case 57:if(Fe(Ct))return t;Se(),t=Ze(R.createJSDocNullableType(t,!0),e);break;case 22:if(Me(22),Fr()){var r=Gr();Me(23),t=Ze(R.createIndexedAccessTypeNode(t,r),e)}else Me(23),t=Ze(R.createArrayTypeNode(t),e);break;default:return t}return t}function Or(){if(ze(94)){var e=ie(Gr);if(le()||57!==ve())return e}}function Mr(){var e=ye();return Me(137),Ze(R.createInferTypeNode(function(){var e=ye(),t=it(),r=Pe(Or);return Ze(R.createTypeParameterDeclaration(void 0,t,r),e)}()),e)}function Lr(){var e=ve();switch(e){case 140:case 154:case 145:return function(e){var t=ye();return Me(e),Ze(R.createTypeOperatorNode(e,Lr()),t)}(e);case 137:return Mr()}return ne(Ir)}function Rr(t){if(Ur()){var r=Cr();return me(r,e.isFunctionTypeNode(r)?t?e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t?e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type),r}}function Br(e,t,r){var n=ye(),i=51===e,a=ze(e),o=a&&Rr(i)||t();if(ve()===e||a){for(var s=[o];ze(e);)s.push(Rr(i)||t());o=Ze(r(Ye(s,n)),n)}return o}function Jr(){return Br(50,Lr,R.createIntersectionTypeNode)}function jr(){return Se(),103===ve()}function Ur(){return 29===ve()||(!(20!==ve()||!Fe(Vr))||(103===ve()||126===ve()&&Fe(jr)))}function Vr(){if(Se(),21===ve()||25===ve())return!0;if(function(){if(e.isModifierKind(ve())&&ki(),Oe()||108===ve())return Se(),!0;if(22===ve()||18===ve()){var t=v.length;return li(),t===v.length}return!1}()){if(58===ve()||27===ve()||57===ve()||63===ve())return!0;if(21===ve()&&(Se(),38===ve()))return!0}return!1}function Kr(){var e=ye(),t=Oe()&&Pe(zr),r=Gr();return t?Ze(R.createTypePredicateNode(void 0,t,r),e):r}function zr(){var e=it();if(139===ve()&&!c.hasPrecedingLineBreak())return Se(),e}function Gr(){if(40960&M)return ee(40960,Gr);if(Ur())return Cr();var e=ye(),t=Br(51,Jr,R.createUnionTypeNode);if(!le()&&!c.hasPrecedingLineBreak()&&ze(94)){var r=ie(Gr);Me(57);var n=ne(Gr);Me(58);var i=ne(Gr);return Ze(R.createConditionalTypeNode(t,r,n,i),e)}return t}function qr(){return ze(58)?Gr():void 0}function Wr(){switch(ve()){case 108:case 106:case 104:case 110:case 95:case 8:case 9:case 10:case 14:case 15:case 20:case 22:case 18:case 98:case 84:case 103:case 43:case 68:case 79:return!0;case 100:return Fe(gr);default:return Oe()}}function Hr(){if(Wr())return!0;switch(ve()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 45:case 46:case 29:case 132:case 125:case 80:return!0;default:return!!function(){if(ce()&&101===ve())return!1;return e.getBinaryOperatorPrecedence(ve())>0}()||Oe()}}function Qr(){var e=ue();e&&Y(!1);for(var t,r=ye(),n=$r();t=Ge(27);)n=cn(n,t,$r(),r);return e&&Y(!0),n}function Xr(){return ze(63)?$r():void 0}function $r(){if(function(){if(125===ve())return!!se()||Fe(Qn);return!1}())return function(){var e=ye();return Se(),c.hasPrecedingLineBreak()||41!==ve()&&!Hr()?Ze(R.createYieldExpression(void 0,void 0),e):Ze(R.createYieldExpression(Ge(41),$r()),e)}();var t=function(){var e=function(){if(20===ve()||29===ve()||131===ve())return Fe(Zr);if(38===ve())return 1;return 0}();if(0===e)return;return 1===e?rn(!0):Pe(en)}()||function(){if(131===ve()&&1===Fe(tn)){var e=ye(),t=Ai();return Yr(e,an(0),t)}return}();if(t)return t;var r=ye(),n=an(0);return 79===n.kind&&38===ve()?Yr(r,n,void 0):e.isLeftHandSideExpression(n)&&e.isAssignmentOperator(Ce())?cn(n,He(),$r(),r):function(t,r){var n,i=Ge(57);if(!i)return t;return Ze(R.createConditionalExpression(t,i,ee(l,$r),n=We(58),e.nodeIsPresent(n)?$r():et(79,!1,e.Diagnostics._0_expected,e.tokenToString(58))),r)}(n,r)}function Yr(t,r,n){e.Debug.assert(38===ve(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var i=R.createParameterDeclaration(void 0,void 0,void 0,r,void 0,void 0,void 0);Ze(i,r.pos);var a=Ye([i],i.pos,i.end),o=We(38),s=nn(!!n);return q(Ze(R.createArrowFunction(n,void 0,a,void 0,o,s),t))}function Zr(){if(131===ve()){if(Se(),c.hasPrecedingLineBreak())return 0;if(20!==ve()&&29!==ve())return 0}var t=ve(),r=Se();if(20===t){if(21===r)switch(Se()){case 38:case 58:case 18:return 1;default:return 0}if(22===r||18===r)return 2;if(25===r)return 1;if(e.isModifierKind(r)&&131!==r&&Fe(vt))return Fe((function(){return 127===Se()}))?0:1;if(!Oe()&&108!==r)return 0;switch(Se()){case 58:return 1;case 57:return Se(),58===ve()||27===ve()||63===ve()||21===ve()?1:0;case 27:case 63:case 21:return 2}return 0}if(e.Debug.assert(29===t),!Oe())return 0;if(1===h){var n=Fe((function(){var e=Se();if(94===e)switch(Se()){case 63:case 31:return!1;default:return!0}else if(27===e||63===e)return!0;return!1}));return n?1:0}return 2}function en(){var t=c.getTokenPos();if(!(null==O?void 0:O.has(t))){var r=rn(!1);return r||(O||(O=new e.Set)).add(t),r}}function tn(){if(131===ve()){if(Se(),c.hasPrecedingLineBreak()||38===ve())return 0;var e=an(0);if(!c.hasPrecedingLineBreak()&&79===e.kind&&38===ve())return 1}return 0}function rn(t){var r,n=ye(),i=he(),a=Ai(),o=e.some(a,e.isAsyncModifier)?2:0,s=er();if(Me(20)){if(t)r=ar(o,t);else{var c=ar(o,t);if(!c)return;r=c}if(!Me(21)&&!t)return}else{if(!t)return;r=It()}var l=ir(58,!1);if(!l||t||!Qt(l)){for(var u=l;191===(null==u?void 0:u.kind);)u=u.type;var d=u&&e.isJSDocFunctionType(u);if(t||38===ve()||!d&&18===ve()){var _=ve(),p=We(38),f=38===_||18===_?nn(e.some(a,e.isAsyncModifier)):it();return z(Ze(R.createArrowFunction(a,s,r,l,p,f),n),i)}}}function nn(e){if(18===ve())return jn(e?2:0);if(26!==ve()&&98!==ve()&&84!==ve()&&Yn()&&(18===ve()||98===ve()||84===ve()||59===ve()||!Hr()))return jn(16|(e?2:0));var t=B;B=!1;var r=e?ae($r):function(e){return ee(32768,e)}($r);return B=t,r}function an(e){var t=ye();return sn(e,un(),t)}function on(e){return 101===e||160===e}function sn(t,r,n){for(;;){Ce();var i=e.getBinaryOperatorPrecedence(ve());if(!(42===ve()?i>=t:i>t))break;if(101===ve()&&ce())break;if(127===ve()){if(c.hasPrecedingLineBreak())break;Se(),a=r,o=Gr(),r=Ze(R.createAsExpression(a,o),a.pos)}else r=cn(r,He(),an(i),n)}var a,o;return r}function cn(e,t,r,n){return Ze(R.createBinaryExpression(e,t,r),n)}function ln(){var e=ye();return Ze(R.createPrefixUnaryExpression(ve(),xe(dn)),e)}function un(){if(function(){switch(ve()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 132:return!1;case 29:if(1!==h)return!1;default:return!0}}()){var t=ye(),r=_n();return 42===ve()?sn(e.getBinaryOperatorPrecedence(ve()),r,t):r}var n=ve(),i=dn();if(42===ve()){t=e.skipTrivia(m,i.pos);var a=i.end;211===i.kind?fe(t,a,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):fe(t,a,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n))}return i}function dn(){switch(ve()){case 39:case 40:case 54:case 53:return ln();case 89:return e=ye(),Ze(R.createDeleteExpression(xe(dn)),e);case 112:return function(){var e=ye();return Ze(R.createTypeOfExpression(xe(dn)),e)}();case 114:return function(){var e=ye();return Ze(R.createVoidExpression(xe(dn)),e)}();case 29:return function(){var e=ye();Me(29);var t=Gr();Me(31);var r=dn();return Ze(R.createTypeAssertion(t,r),e)}();case 132:if(132===ve()&&(de()||Fe(Qn)))return function(){var e=ye();return Ze(R.createAwaitExpression(xe(dn)),e)}();default:return _n()}var e}function _n(){if(45===ve()||46===ve()){var t=ye();return Ze(R.createPrefixUnaryExpression(ve(),xe(pn)),t)}if(1===h&&29===ve()&&Fe(xt))return mn(!0);var r=pn();if(e.Debug.assert(e.isLeftHandSideExpression(r)),(45===ve()||46===ve())&&!c.hasPrecedingLineBreak()){var n=ve();return Se(),Ze(R.createPostfixUnaryExpression(r,n),r.pos)}return r}function pn(){var t,r=ye();return 100===ve()?Fe(fr)?(p|=2097152,t=He()):Fe(mr)?(Se(),Se(),t=Ze(R.createMetaProperty(100,at()),r),p|=4194304):t=fn():t=106===ve()?function(){var t=ye(),r=He();if(29===ve()){var n=ye();void 0!==Pe(wn)&&fe(n,ye(),e.Diagnostics.super_may_not_use_type_arguments)}if(20===ve()||24===ve()||22===ve())return r;return We(24,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),Ze(R.createPropertyAccessExpression(r,Rt(!0,!0)),t)}():fn(),An(r,t)}function fn(){return Tn(ye(),Fn(),!0)}function mn(t,n,i){var a,o=ye(),s=function(e){var t=ye();if(Me(29),31===ve())return Ne(),Ze(R.createJsxOpeningFragment(),t);var r,n=hn(),i=0==(262144&M)?Mi():void 0,a=function(){var e=ye();return Ze(R.createJsxAttributes(Et(13,bn)),e)}();31===ve()?(Ne(),r=R.createJsxOpeningElement(n,i,a)):(Me(43),Me(31,void 0,!1)&&(e?Se():Ne()),r=R.createJsxSelfClosingElement(n,i,a));return Ze(r,t)}(t);if(280===s.kind){var c=yn(s),l=void 0,u=c[c.length-1];if(278===(null==u?void 0:u.kind)&&!F(u.openingElement.tagName,u.closingElement.tagName)&&F(s.tagName,u.closingElement.tagName)){var d=u.children.end,_=Ze(R.createJsxElement(u.openingElement,u.children,Ze(R.createJsxClosingElement(Ze(R.createIdentifier(""),d,d)),d,d)),u.openingElement.pos,d);c=Ye(r(r([],c.slice(0,c.length-1),!0),[_],!1),c.pos,d),l=u.closingElement}else l=function(e,t){var r=ye();Me(30);var n=hn();Me(31,void 0,!1)&&(t||!F(e.tagName,n)?Se():Ne());return Ze(R.createJsxClosingElement(n),r)}(s,t),F(s.tagName,l.tagName)||(i&&e.isJsxOpeningElement(i)&&F(l.tagName,i.tagName)?me(s.tagName,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(m,s.tagName)):me(l.tagName,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(m,s.tagName)));a=Ze(R.createJsxElement(s,c,l),o)}else 283===s.kind?a=Ze(R.createJsxFragment(s,yn(s),function(t){var r=ye();Me(30),e.tokenIsIdentifierOrKeyword(ve())&&me(hn(),e.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);Me(31,void 0,!1)&&(t?Se():Ne());return Ze(R.createJsxJsxClosingFragment(),r)}(t)),o):(e.Debug.assert(279===s.kind),a=s);if(t&&29===ve()){var p=void 0===n?a.pos:n,f=Pe((function(){return mn(!0,p)}));if(f){var g=et(27,!1);return e.setTextRangePosWidth(g,f.pos,0),fe(e.skipTrivia(m,p),f.end,e.Diagnostics.JSX_expressions_must_have_one_parent_element),Ze(R.createBinaryExpression(a,g,f),o)}}return a}function gn(t,r){switch(r){case 1:if(e.isJsxOpeningFragment(t))me(t,e.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);else{var n=t.tagName;fe(e.skipTrivia(m,n.pos),n.end,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(m,t.tagName))}return;case 30:case 7:return;case 11:case 12:return function(){var e=ye(),t=R.createJsxText(c.getTokenValue(),12===k);return k=c.scanJsxToken(),Ze(t,e)}();case 18:return vn(!1);case 29:return mn(!1,void 0,t);default:return e.Debug.assertNever(r)}}function yn(t){var r=[],n=ye(),i=I;for(I|=16384;;){var a=gn(t,k=c.reScanJsxToken());if(!a)break;if(r.push(a),e.isJsxOpeningElement(t)&&278===(null==a?void 0:a.kind)&&!F(a.openingElement.tagName,a.closingElement.tagName)&&F(t.tagName,a.closingElement.tagName))break}return I=i,Ye(r,n)}function hn(){var e=ye();Ae();for(var t=108===ve()?He():at();ze(24);)t=Ze(R.createPropertyAccessExpression(t,Rt(!0,!1)),e);return t}function vn(e){var t,r,n=ye();if(Me(18))return 19!==ve()&&(t=Ge(25),r=Qr()),e?Me(19):Me(19,void 0,!1)&&Ne(),Ze(R.createJsxExpression(t,r),n)}function bn(){if(18===ve())return function(){var e=ye();Me(18),Me(25);var t=Qr();return Me(19),Ze(R.createJsxSpreadAttribute(t),e)}();Ae();var e=ye();return Ze(R.createJsxAttribute(at(),63!==ve()?void 0:10===(k=c.scanJsxAttributeValue())?Kt():vn(!0)),e)}function xn(){return Se(),e.tokenIsIdentifierOrKeyword(ve())||22===ve()||En()}function Sn(t){if(32&t.flags)return!0;if(e.isNonNullExpression(t)){for(var r=t.expression;e.isNonNullExpression(r)&&!(32&r.flags);)r=r.expression;if(32&r.flags){for(;e.isNonNullExpression(t);)t.flags|=32,t=t.expression;return!0}}return!1}function Dn(t,r,n){var i=Rt(!0,!0),a=n||Sn(r),o=a?R.createPropertyAccessChain(r,n,i):R.createPropertyAccessExpression(r,i);return a&&e.isPrivateIdentifier(o.name)&&me(o.name,e.Diagnostics.An_optional_chain_cannot_contain_private_identifiers),Ze(o,t)}function Cn(t,r,n){var i;if(23===ve())i=et(79,!0,e.Diagnostics.An_element_access_expression_should_take_an_argument);else{var a=re(Qr);e.isStringOrNumericLiteralLike(a)&&(a.text=tt(a.text)),i=a}return Me(23),Ze(n||Sn(r)?R.createElementAccessChain(r,n,i):R.createElementAccessExpression(r,i),t)}function Tn(t,r,n){for(;;){var i=void 0,a=!1;if(n&&28===ve()&&Fe(xn)?(i=We(28),a=e.tokenIsIdentifierOrKeyword(ve())):a=ze(24),a)r=Dn(t,r,i);else if(!i&&ue()||!ze(22)){if(!En()){if(!i){if(53===ve()&&!c.hasPrecedingLineBreak()){Se(),r=Ze(R.createNonNullExpression(r),t);continue}var o=Pe(wn);if(o){r=Ze(R.createExpressionWithTypeArguments(r,o),t);continue}}return r}r=i||228!==r.kind?kn(t,r,i,void 0):kn(t,r.expression,i,r.typeArguments)}else r=Cn(t,r,i)}}function En(){return 14===ve()||15===ve()}function kn(e,t,r,n){var i=R.createTaggedTemplateExpression(t,n,14===ve()?(Te(),Kt()):Bt(!0));return(r||32&t.flags)&&(i.flags|=32),i.questionDotToken=r,Ze(i,e)}function An(t,r){for(;;){r=Tn(t,r,!0);var n=void 0,i=Ge(28);if(i&&(n=Pe(wn),En()))r=kn(t,r,i,n);else{if(!n&&20!==ve()){if(i){var a=et(79,!1,e.Diagnostics.Identifier_expected);r=Ze(R.createPropertyAccessChain(r,i,a),t)}break}i||228!==r.kind||(n=r.typeArguments,r=r.expression);var o=Nn();r=Ze(i||Sn(r)?R.createCallChain(r,i,n,o):R.createCallExpression(r,n,o),t)}}return r}function Nn(){Me(20);var e=Ft(11,In);return Me(21),e}function wn(){if(0==(262144&M)&&29===Ee()){Se();var e=Ft(20,Gr);if(Me(31))return e&&function(){switch(ve()){case 20:case 14:case 15:return!0}return!Hr()}()?e:void 0}}function Fn(){switch(ve()){case 8:case 9:case 10:case 14:return Kt();case 108:case 106:case 104:case 110:case 95:return He();case 20:return function(){var e=ye(),t=he();Me(20);var r=re(Qr);return Me(21),z(Ze(R.createParenthesizedExpression(r),e),t)}();case 22:return On();case 18:return Ln();case 131:if(!Fe(Hn))break;return Rn();case 84:return Fi(ye(),he(),void 0,void 0,226);case 98:return Rn();case 103:return function(){var e=ye();if(Me(103),ze(24)){var t=at();return Ze(R.createMetaProperty(103,t),e)}var r,n=Tn(ye(),Fn(),!1);228===n.kind&&(r=n.typeArguments,n=n.expression);var i=20===ve()?Nn():void 0;return Ze(R.createNewExpression(n,r,i),e)}();case 43:case 68:if(13===(k=c.reScanSlashToken()))return Kt();break;case 15:return Bt(!1);case 80:return lt()}return it(e.Diagnostics.Expression_expected)}function Pn(){return 25===ve()?function(){var e=ye();Me(25);var t=$r();return Ze(R.createSpreadElement(t),e)}():27===ve()?Ze(R.createOmittedExpression(),ye()):$r()}function In(){return ee(l,Pn)}function On(){var e=ye(),t=c.getTokenPos(),r=Me(22),n=c.hasPrecedingLineBreak(),i=Ft(15,Pn);return Ke(22,23,r,t),Ze(R.createArrayLiteralExpression(i,n),e)}function Mn(){var e=ye(),t=he();if(Ge(25)){var r=$r();return z(Ze(R.createSpreadAssignment(r),e),t)}var n=Ti(),i=ki();if(ut(136))return bi(e,t,n,i,172);if(ut(149))return bi(e,t,n,i,173);var a,o=Ge(41),s=Oe(),c=ct(),l=Ge(57),u=Ge(53);if(o||20===ve()||29===ve())return yi(e,t,n,i,o,c,l,u);if(s&&58!==ve()){var d=Ge(63),_=d?re($r):void 0;(a=R.createShorthandPropertyAssignment(c,_)).equalsToken=d}else{Me(58);var p=re($r);a=R.createPropertyAssignment(c,p)}return a.decorators=n,a.modifiers=i,a.questionToken=l,a.exclamationToken=u,z(Ze(a,e),t)}function Ln(){var e=ye(),t=c.getTokenPos(),r=Me(18),n=c.hasPrecedingLineBreak(),i=Ft(12,Mn,!0);return Ke(18,19,r,t),Ze(R.createObjectLiteralExpression(i,n),e)}function Rn(){var t=ue();Y(!1);var r=ye(),n=he(),i=ki();Me(98);var a=Ge(41),o=a?1:0,s=e.some(i,e.isAsyncModifier)?2:0,c=o&&s?function(e){return te(40960,e)}(Bn):o?function(e){return te(8192,e)}(Bn):s?ae(Bn):Bn(),l=er(),u=or(o|s),d=ir(58,!1),_=jn(o|s);return Y(t),z(Ze(R.createFunctionExpression(i,a,c,l,u,d,_),r),n)}function Bn(){return Ie()?nt():void 0}function Jn(t,r){var n=ye(),i=he(),a=c.getTokenPos(),o=Me(18,r);if(o||t){var s=c.hasPrecedingLineBreak(),l=Et(1,ei);Ke(18,19,o,a);var u=z(Ze(R.createBlock(l,s),n),i);return 63===ve()&&(_e(e.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses),Se()),u}l=It();return z(Ze(R.createBlock(l,void 0),n),i)}function jn(e,t){var r=se();$(!!(1&e));var n=de();Z(!!(2&e));var i=B;B=!1;var a=ue();a&&Y(!1);var o=Jn(!!(16&e),t);return a&&Y(!0),B=i,$(r),Z(n),o}function Un(){var e=ye(),t=he();Me(97);var r,n,i=Ge(132);if(Me(20),26!==ve()&&(r=113===ve()||119===ve()||85===ve()?_i(!0):function(e){return te(4096,e)}(Qr)),i?Me(160):ze(160)){var a=re($r);Me(21),n=R.createForOfStatement(i,r,a,ei())}else if(ze(101)){a=re(Qr);Me(21),n=R.createForInStatement(r,a,ei())}else{Me(26);var o=26!==ve()&&21!==ve()?re(Qr):void 0;Me(26);var s=21!==ve()?re(Qr):void 0;Me(21),n=R.createForStatement(r,o,s,ei())}return z(Ze(n,e),t)}function Vn(e){var t=ye(),r=he();Me(246===e?81:86);var n=Qe()?void 0:it();return $e(),z(Ze(246===e?R.createBreakStatement(n):R.createContinueStatement(n),t),r)}function Kn(){return 82===ve()?function(){var e=ye(),t=he();Me(82);var r=re(Qr);Me(58);var n=Et(3,ei);return z(Ze(R.createCaseClause(r,n),e),t)}():function(){var e=ye();Me(88),Me(58);var t=Et(3,ei);return Ze(R.createDefaultClause(t),e)}()}function zn(){var e=ye(),t=he();Me(107),Me(20);var r=re(Qr);Me(21);var n=function(){var e=ye();Me(18);var t=Et(2,Kn);return Me(19),Ze(R.createCaseBlock(t),e)}();return z(Ze(R.createSwitchStatement(r,n),e),t)}function Gn(){var t=ye(),r=he();Me(111);var n,i=Jn(!1),a=83===ve()?function(){var e,t=ye();Me(83),ze(20)?(e=di(),Me(21)):e=void 0;var r=Jn(!1);return Ze(R.createCatchClause(e,r),t)}():void 0;return a&&96!==ve()||(Me(96,e.Diagnostics.catch_or_finally_expected),n=Jn(!1)),z(Ze(R.createTryStatement(i,a,n),t),r)}function qn(){return Se(),e.tokenIsIdentifierOrKeyword(ve())&&!c.hasPrecedingLineBreak()}function Wn(){return Se(),84===ve()&&!c.hasPrecedingLineBreak()}function Hn(){return Se(),98===ve()&&!c.hasPrecedingLineBreak()}function Qn(){return Se(),(e.tokenIsIdentifierOrKeyword(ve())||8===ve()||9===ve()||10===ve())&&!c.hasPrecedingLineBreak()}function Xn(){for(;;)switch(ve()){case 113:case 119:case 85:case 98:case 84:case 92:return!0;case 118:case 152:return Se(),!c.hasPrecedingLineBreak()&&Oe();case 141:case 142:return ii();case 126:case 131:case 135:case 121:case 122:case 123:case 145:if(Se(),c.hasPrecedingLineBreak())return!1;continue;case 157:return Se(),18===ve()||79===ve()||93===ve();case 100:return Se(),10===ve()||41===ve()||18===ve()||e.tokenIsIdentifierOrKeyword(ve());case 93:var t=Se();if(152===t&&(t=Fe(Se)),63===t||41===t||18===t||88===t||127===t)return!0;continue;case 124:Se();continue;default:return!1}}function $n(){return Fe(Xn)}function Yn(){switch(ve()){case 59:case 26:case 18:case 113:case 119:case 98:case 84:case 92:case 99:case 90:case 115:case 97:case 86:case 81:case 105:case 116:case 107:case 109:case 111:case 87:case 83:case 96:case 131:case 135:case 118:case 141:case 142:case 152:case 157:return!0;case 100:return $n()||Fe(gr);case 85:case 93:return $n();case 123:case 121:case 122:case 124:case 145:return $n()||!Fe(qn);default:return Hr()}}function Zn(){return Se(),Ie()||18===ve()||22===ve()}function ei(){switch(ve()){case 26:return t=ye(),r=he(),Me(26),z(Ze(R.createEmptyStatement(),t),r);case 18:return Jn(!1);case 113:return fi(ye(),he(),void 0,void 0);case 119:if(Fe(Zn))return fi(ye(),he(),void 0,void 0);break;case 98:return mi(ye(),he(),void 0,void 0);case 84:return wi(ye(),he(),void 0,void 0);case 99:return function(){var e=ye(),t=he();Me(99);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=ei(),o=ze(91)?ei():void 0;return z(Ze(R.createIfStatement(i,a,o),e),t)}();case 90:return function(){var e=ye(),t=he();Me(90);var r=ei();Me(115);var n=c.getTokenPos(),i=Me(20),a=re(Qr);return Ke(20,21,i,n),ze(26),z(Ze(R.createDoStatement(r,a),e),t)}();case 115:return function(){var e=ye(),t=he();Me(115);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=ei();return z(Ze(R.createWhileStatement(i,a),e),t)}();case 97:return Un();case 86:return Vn(245);case 81:return Vn(246);case 105:return function(){var e=ye(),t=he();Me(105);var r=Qe()?void 0:re(Qr);return $e(),z(Ze(R.createReturnStatement(r),e),t)}();case 116:return function(){var e=ye(),t=he();Me(116);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=te(33554432,ei);return z(Ze(R.createWithStatement(i,a),e),t)}();case 107:return zn();case 109:return function(){var e=ye(),t=he();Me(109);var r=c.hasPrecedingLineBreak()?void 0:re(Qr);return void 0===r&&(P++,r=Ze(R.createIdentifier(""),ye())),Xe()||je(r),z(Ze(R.createThrowStatement(r),e),t)}();case 111:case 83:case 96:return Gn();case 87:return function(){var e=ye(),t=he();return Me(87),$e(),z(Ze(R.createDebuggerStatement(),e),t)}();case 59:return ri();case 131:case 118:case 152:case 141:case 142:case 135:case 85:case 92:case 93:case 100:case 121:case 122:case 123:case 126:case 124:case 145:case 157:if($n())return ri()}var t,r;return function(){var t,r=ye(),n=he(),i=20===ve(),a=re(Qr);return e.isIdentifier(a)&&ze(58)?t=R.createLabeledStatement(a,ei()):(Xe()||je(a),t=R.createExpressionStatement(a),i&&(n=!1)),z(Ze(t,r),n)}()}function ti(e){return 135===e.kind}function ri(){var t=e.some(Fe((function(){return Ti(),ki()})),ti);if(t){var r=te(16777216,(function(){var e=At(I);if(e)return Nt(e)}));if(r)return r}var n=ye(),i=he(),a=Ti(),o=ki();if(t){for(var s=0,c=o;s=0),e.Debug.assert(t<=o),e.Debug.assert(o<=a.length),f(a,t)){var s,l,u,d,p,g=[],y=[];return c.scanRange(t+3,i-5,(function(){var r,n=1,i=t-(a.lastIndexOf("\n",t)+1)+4;function _(e){r||(r=i),g.push(e),i+=e.length}for(De();W(5););W(4)&&(n=0,i=0);e:for(;;){switch(ve()){case 59:0===n||1===n?(v(g),p||(p=ye()),w(D(i)),n=0,r=void 0):_(c.getTokenText());break;case 4:g.push(c.getTokenText()),n=0,i=0;break;case 41:var f=c.getTokenText();1===n||2===n?(n=2,_(f)):(n=1,i+=f.length);break;case 5:var m=c.getTokenText();2===n?g.push(m):void 0!==r&&i+m.length>r&&g.push(m.slice(r-i)),i+=m.length;break;case 1:break e;case 18:n=2;var b=c.getStartPos(),x=k(c.getTextPos()-1);if(x){d||h(g),y.push(Ze(R.createJSDocText(g.join("")),null!=d?d:t,b)),y.push(x),g=[],d=c.getTextPos();break}default:n=2,_(c.getTokenText())}De()}v(g),y.length&&g.length&&y.push(Ze(R.createJSDocText(g.join("")),null!=d?d:t,p)),y.length&&s&&e.Debug.assertIsDefined(p,"having parsed tags implies that the end of the comment span should be set");var S=s&&Ye(s,l,u);return Ze(R.createJSDocComment(y.length?Ye(y,t,p):g.length?g.join(""):void 0,S),t,o)}))}function h(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift()}function v(e){for(;e.length&&""===e[e.length-1].trim();)e.pop()}function b(){for(;;){if(De(),1===ve())return!0;if(5!==ve()&&4!==ve())return!1}}function x(){if(5!==ve()&&4!==ve()||!Fe(b))for(;5===ve()||4===ve();)De()}function S(){if((5===ve()||4===ve())&&Fe(b))return"";for(var e=c.hasPrecedingLineBreak(),t=!1,r="";e&&41===ve()||5===ve()||4===ve();)r+=c.getTokenText(),4===ve()?(e=!0,t=!0,r=""):41===ve()&&(e=!1),De();return t?r:""}function D(t){e.Debug.assert(59===ve());var i=c.getTokenPos();De();var a,o=H(void 0),l=S();switch(o.escapedText){case"author":a=function(t,r,n,i){var a=ye(),o=function(){var e=[],t=!1,r=c.getToken();for(;1!==r&&4!==r;){if(29===r)t=!0;else{if(59===r&&!t)break;if(31===r&&t){e.push(c.getTokenText()),c.setTextPos(c.getTokenPos()+1);break}}e.push(c.getTokenText()),r=De()}return R.createJSDocText(e.join(""))}(),s=c.getStartPos(),l=C(t,s,n,i);l||(s=c.getStartPos());var u="string"!=typeof l?Ye(e.concatenate([Ze(o,a,s)],l),a):o.text+l;return Ze(R.createJSDocAuthorTag(r,u),t)}(i,o,t,l);break;case"implements":a=function(e,t,r,n){var i=B();return Ze(R.createJSDocImplementsTag(t,i,C(e,ye(),r,n)),e)}(i,o,t,l);break;case"augments":case"extends":a=function(e,t,r,n){var i=B();return Ze(R.createJSDocAugmentsTag(t,i,C(e,ye(),r,n)),e)}(i,o,t,l);break;case"class":case"constructor":a=J(i,R.createJSDocClassTag,o,t,l);break;case"public":a=J(i,R.createJSDocPublicTag,o,t,l);break;case"private":a=J(i,R.createJSDocPrivateTag,o,t,l);break;case"protected":a=J(i,R.createJSDocProtectedTag,o,t,l);break;case"readonly":a=J(i,R.createJSDocReadonlyTag,o,t,l);break;case"override":a=J(i,R.createJSDocOverrideTag,o,t,l);break;case"deprecated":G=!0,a=J(i,R.createJSDocDeprecatedTag,o,t,l);break;case"this":a=function(e,t,n,i){var a=r(!0);return x(),Ze(R.createJSDocThisTag(t,a,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"enum":a=function(e,t,n,i){var a=r(!0);return x(),Ze(R.createJSDocEnumTag(t,a,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"arg":case"argument":case"param":return M(i,o,2,t);case"return":case"returns":a=function(t,r,n,i){e.some(s,e.isJSDocReturnTag)&&fe(r.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,r.escapedText);var a=F();return Ze(R.createJSDocReturnTag(r,a,C(t,ye(),n,i)),t)}(i,o,t,l);break;case"template":a=function(e,t,n,i){var a=18===ve()?r():void 0,o=function(){var e=ye(),t=[];do{x();var r=q();void 0!==r&&t.push(r),S()}while(W(27));return Ye(t,e)}();return Ze(R.createJSDocTemplateTag(t,a,o,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"type":a=L(i,o,t,l);break;case"typedef":a=function(t,r,n,i){var a,o=F();S();var s=j();x();var c,l=T(n);if(!o||O(o.type)){for(var u=void 0,d=void 0,p=void 0,f=!1;u=Pe((function(){return V(n)}));)if(f=!0,343===u.kind){if(d){var m=_e(e.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);m&&e.addRelatedInfo(m,e.createDetachedDiagnostic(_,0,0,e.Diagnostics.The_tag_was_first_specified_here));break}d=u}else p=e.append(p,u);if(f){var g=o&&183===o.type.kind,y=R.createJSDocTypeLiteral(p,g);c=(o=d&&d.typeExpression&&!O(d.typeExpression.type)?d.typeExpression:Ze(y,t)).end}}c=c||void 0!==l?ye():(null!==(a=null!=s?s:o)&&void 0!==a?a:r).end,l||(l=C(t,c,n,i));return Ze(R.createJSDocTypedefTag(r,o,s,l),t,c)}(i,o,t,l);break;case"callback":a=function(t,r,n,i){var a=j();x();var o=T(n),s=function(t){var r,n,i=ye();for(;r=Pe((function(){return K(4,t)}));)n=e.append(n,r);return Ye(n||[],i)}(n),c=Pe((function(){if(W(59)){var e=D(n);if(e&&341===e.kind)return e}})),l=Ze(R.createJSDocSignature(void 0,s,c),t);o||(o=C(t,ye(),n,i));var u=void 0!==o?ye():l.end;return Ze(R.createJSDocCallbackTag(r,l,a,o),t,u)}(i,o,t,l);break;case"see":a=function(t,r,i,a){var o=22===ve()||Fe((function(){return 59===De()&&e.tokenIsIdentifierOrKeyword(De())&&N(c.getTokenValue())}))?void 0:n(),s=void 0!==i&&void 0!==a?C(t,ye(),i,a):void 0;return Ze(R.createJSDocSeeTag(r,o,s),t)}(i,o,t,l);break;default:a=function(e,t,r,n){return Ze(R.createJSDocUnknownTag(t,C(e,ye(),r,n)),e)}(i,o,t,l)}return a}function C(e,t,r,n){return n||(r+=t-e),T(r,n.slice(r))}function T(e,t){var r,n,i=ye(),a=[],o=[],s=0,l=!0;function u(t){n||(n=e),a.push(t),e+=t.length}void 0!==t&&(""!==t&&u(t),s=1);var d=ve();e:for(;;){switch(d){case 4:s=0,a.push(c.getTokenText()),e=0;break;case 59:if(3===s||2===s&&(!l||Fe(E))){a.push(c.getTokenText());break}c.setTextPos(c.getTextPos()-1);case 1:break e;case 5:if(2===s||3===s)u(c.getTokenText());else{var _=c.getTokenText();void 0!==n&&e+_.length>n&&a.push(_.slice(n-e)),e+=_.length}break;case 18:s=2;var p=c.getStartPos(),f=k(c.getTextPos()-1);f?(o.push(Ze(R.createJSDocText(a.join("")),null!=r?r:i,p)),o.push(f),a=[],r=c.getTextPos()):u(c.getTokenText());break;case 61:s=3===s?2:3,u(c.getTokenText());break;case 41:if(0===s){s=1,e+=1;break}default:3!==s&&(s=2),u(c.getTokenText())}l=5===ve(),d=De()}return h(a),v(a),o.length?(a.length&&o.push(Ze(R.createJSDocText(a.join("")),null!=r?r:i)),Ye(o,i,c.getTextPos())):a.length?a.join(""):void 0}function E(){var e=De();return 5===e||4===e}function k(t){var r=Pe(A);if(r){De(),x();var n=ye(),i=e.tokenIsIdentifierOrKeyword(ve())?Mt(!0):void 0;if(i)for(;80===ve();)ke(),De(),i=Ze(R.createJSDocMemberName(i,it()),n);for(var a=[];19!==ve()&&4!==ve()&&1!==ve();)a.push(c.getTokenText()),De();return Ze(("link"===r?R.createJSDocLink:"linkcode"===r?R.createJSDocLinkCode:R.createJSDocLinkPlain)(i,a.join("")),t,c.getTextPos())}}function A(){if(S(),18===ve()&&59===De()&&e.tokenIsIdentifierOrKeyword(De())){var t=c.getTokenValue();if(N(t))return t}}function N(e){return"link"===e||"linkcode"===e||"linkplain"===e}function w(e){e&&(s?s.push(e):(s=[e],l=e.pos),u=e.end)}function F(){return S(),18===ve()?r():void 0}function I(){var t=W(22);t&&x();var r,n=W(61),i=function(){var e=H();ze(22)&&Me(23);for(;ze(24);){var t=H();ze(22)&&Me(23),e=Lt(e,t)}return e}();return n&&(qe(r=61)||et(r,!1,e.Diagnostics._0_expected,e.tokenToString(r))),t&&(x(),Ge(63)&&Qr(),Me(23)),{name:i,isBracketed:t}}function O(t){switch(t.kind){case 148:return!0;case 183:return O(t.elementType);default:return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&!t.typeArguments}}function M(t,r,n,i){var a=F(),o=!a;S();var s=I(),c=s.name,l=s.isBracketed,u=S();o&&!Fe(A)&&(a=F());var d=C(t,ye(),i,u),_=4!==n&&function(t,r,n,i){if(t&&O(t.type)){for(var a=ye(),o=void 0,s=void 0;o=Pe((function(){return K(n,i,r)}));)340!==o.kind&&347!==o.kind||(s=e.append(s,o));if(s){var c=Ze(R.createJSDocTypeLiteral(s,183===t.type.kind),a);return Ze(R.createJSDocTypeExpression(c),a)}}}(a,c,n,i);return _&&(a=_,o=!0),Ze(1===n?R.createJSDocPropertyTag(r,c,l,a,o,d):R.createJSDocParameterTag(r,c,l,a,o,d),t)}function L(t,n,i,a){e.some(s,e.isJSDocTypeTag)&&fe(n.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,n.escapedText);var o=r(!0),l=void 0!==i&&void 0!==a?C(t,ye(),i,a):void 0;return Ze(R.createJSDocTypeTag(n,o,l),t)}function B(){var e=ze(18),t=ye(),r=function(){var e=ye(),t=H();for(;ze(24);){var r=H();t=Ze(R.createPropertyAccessExpression(t,r),e)}return t}(),n=Mi(),i=Ze(R.createExpressionWithTypeArguments(r,n),t);return e&&Me(19),i}function J(e,t,r,n,i){return Ze(t(r,C(e,ye(),n,i)),e)}function j(t){var r=c.getTokenPos();if(e.tokenIsIdentifierOrKeyword(ve())){var n=H();if(ze(24)){var i=j(!0);return Ze(R.createModuleDeclaration(void 0,void 0,n,i,t?4:void 0),r)}return t&&(n.isInJSDocNamespace=!0),n}}function U(t,r){for(;!e.isIdentifier(t)||!e.isIdentifier(r);){if(e.isIdentifier(t)||e.isIdentifier(r)||t.right.escapedText!==r.right.escapedText)return!1;t=t.left,r=r.left}return t.escapedText===r.escapedText}function V(e){return K(1,e)}function K(t,r,n){for(var i=!0,a=!1;;)switch(De()){case 59:if(i){var o=z(t,r);return!(o&&(340===o.kind||347===o.kind)&&4!==t&&n&&(e.isIdentifier(o.name)||!U(n,o.name.left)))&&o}a=!1;break;case 4:i=!0,a=!1;break;case 41:a&&(i=!1),a=!0;break;case 79:i=!1;break;case 1:return!1}}function z(t,r){e.Debug.assert(59===ve());var n=c.getStartPos();De();var i,a=H();switch(x(),a.escapedText){case"type":return 1===t&&L(n,a);case"prop":case"property":i=1;break;case"arg":case"argument":case"param":i=6;break;default:return!1}return!!(t&i)&&M(n,a,t,r)}function q(){var t=ye(),r=W(22);r&&x();var n,i=H(e.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);if(r&&(x(),Me(63),n=te(8388608,Yt),Me(23)),!e.nodeIsMissing(i))return Ze(R.createTypeParameterDeclaration(void 0,i,void 0,n),t)}function W(e){return ve()===e&&(De(),!0)}function H(t){if(!e.tokenIsIdentifierOrKeyword(ve()))return et(79,!t,t||e.Diagnostics.Identifier_expected);P++;var r=c.getTokenPos(),n=c.getTextPos(),i=ve(),a=tt(c.getTokenValue()),o=Ze(R.createIdentifier(a,void 0,i),r,n);return De(),o}}t.parseJSDocTypeExpressionForTests=function(t,n,i){U("file.js",t,99,void 0,1),c.setText(t,n,i),k=c.scan();var a=r(),o=H("file.js",99,1,!1,[],R.createToken(1),0,e.noop),s=e.attachFileToDiagnostics(v,o);return T&&(o.jsDocDiagnostics=e.attachFileToDiagnostics(T,o)),V(),a?{jsDocTypeExpression:a,diagnostics:s}:void 0},t.parseJSDocTypeExpression=r,t.parseJSDocNameReference=n,t.parseIsolatedJSDocComment=function(t,r,n){U("",t,99,void 0,1);var i=te(8388608,(function(){return o(r,n)})),a={languageVariant:0,text:t},s=e.attachFileToDiagnostics(v,a);return V(),i?{jsDoc:i,diagnostics:s}:void 0},t.parseJSDocComment=function(t,r,n){var i=k,a=v.length,s=J,c=te(8388608,(function(){return o(r,n)}));return e.setParent(c,t),262144&M&&(T||(T=[]),T.push.apply(T,v)),k=i,v.length=a,J=s,c},function(e){e[e.BeginningOfLine=0]="BeginningOfLine",e[e.SawAsterisk=1]="SawAsterisk",e[e.SavingComments=2]="SavingComments",e[e.SavingBackticks=3]="SavingBackticks"}(i||(i={})),function(e){e[e.Property=1]="Property",e[e.Parameter=2]="Parameter",e[e.CallbackParameter=4]="CallbackParameter"}(a||(a={}))}(Be=t.JSDocParser||(t.JSDocParser={}))}(u||(u={})),function(t){function r(t,r,i,o,s,c){return void(r?u(t):l(t));function l(t){var r="";if(c&&n(t)&&(r=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),e.setTextRangePosEnd(t,t.pos+i,t.end+i),c&&n(t)&&e.Debug.assert(r===s.substring(t.pos,t.end)),h(t,l,u),e.hasJSDocNodes(t))for(var d=0,_=t.jsDoc;d<_.length;d++){l(_[d])}a(t,c)}function u(t){t._children=void 0,e.setTextRangePosEnd(t,t.pos+i,t.end+i);for(var r=0,n=t;r=r,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=n,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end);var o=Math.min(t.pos,i),s=t.end>=n?t.end+a:Math.min(t.end,i);e.Debug.assert(o<=s),t.parent&&(e.Debug.assertGreaterThanOrEqual(o,t.parent.pos),e.Debug.assertLessThanOrEqual(s,t.parent.end)),e.setTextRangePosEnd(t,o,s)}function a(t,r){if(r){var n=t.pos,i=function(t){e.Debug.assert(t.pos>=n),n=t.end};if(e.hasJSDocNodes(t))for(var a=0,o=t.jsDoc;ar),!0;if(a.pos>=i.pos&&(i=a),ri.pos&&(i=a)}return i}function s(t,r,n,i){var a=t.text;if(n&&(e.Debug.assert(a.length-n.span.length+n.newLength===r.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,n.span.start),s=r.substr(0,n.span.start);e.Debug.assert(o===s);var c=a.substring(e.textSpanEnd(n.span),a.length),l=r.substring(e.textSpanEnd(e.textChangeRangeNewSpan(n)),r.length);e.Debug.assert(c===l)}}function c(t){var r=t.statements,n=0;e.Debug.assert(n=t.pos&&e=t.pos&&e0&&a<=n;a++){var s=o(t,i);e.Debug.assert(s.pos<=i);var c=s.pos;i=Math.max(0,c-1)}var l=e.createTextSpanFromBounds(i,e.textSpanEnd(r.span)),u=r.newLength+(r.span.start-i);return e.createTextChangeRange(l,u)}(t,l);s(t,n,m,d),e.Debug.assert(m.span.start<=l.span.start),e.Debug.assert(e.textSpanEnd(m.span)===e.textSpanEnd(l.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(m))===e.textSpanEnd(e.textChangeRangeNewSpan(l)));var g=e.textChangeRangeNewSpan(m).length-m.span.length;!function(t,n,o,s,c,l,u,d){return void _(t);function _(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!1,c,l,u,d);else{var f=t.end;if(f>=n){if(t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c),h(t,_,p),e.hasJSDocNodes(t))for(var m=0,g=t.jsDoc;mo)r(t,!0,c,l,u,d);else{var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c);for(var p=0,f=t;pi){y();var g={range:{pos:f.pos+a,end:f.end+a},type:m};l=e.append(l,g),c&&e.Debug.assert(o.substring(f.pos,f.end)===s.substring(g.range.pos,g.range.end))}}return y(),l;function y(){u||(u=!0,l?r&&l.push.apply(l,r):l=r)}}(t.commentDirectives,y.commentDirectives,m.span.start,e.textSpanEnd(m.span),g,p,n,d),y.impliedNodeFormat=t.impliedNodeFormat,y},t.createSyntaxCursor=c,function(e){e[e.Value=-1]="Value"}(l||(l={}))}(d||(d={})),e.isDeclarationFileName=S,e.processCommentPragmas=D,e.processPragmasIntoFields=C;var T=new e.Map;function E(e){if(T.has(e))return T.get(e);var t=new RegExp("(\\s".concat(e,"\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"),"im");return T.set(e,t),t}var k=/^\/\/\/\s*<(\S+)\s.*?\/>/im,A=/^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;function N(t,r,n){var i=2===r.kind&&k.exec(n);if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(!(o&&1&o.kind))return;if(o.args){for(var s={},c=0,l=o.args;c=r.length)break;var o=a;if(34===r.charCodeAt(o)){for(a++;a32;)a++;i.push(r.substring(o,a))}}c(i)}else s.push(r)}}function v(t,r,n,i,a,o){if(i.isTSConfigOnly)"null"===(s=t[r])?(a[i.name]=void 0,r++):"boolean"===i.type?"false"===s?(a[i.name]=ge(i,!1,o),r++):("true"===s&&r++,o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),s&&!e.startsWith(s,"-")&&r++);else if(t[r]||"boolean"===i.type||o.push(e.createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,i.name,V(i))),"null"!==t[r])switch(i.type){case"number":a[i.name]=ge(i,parseInt(t[r]),o),r++;break;case"boolean":var s=t[r];a[i.name]=ge(i,"false"!==s,o),"false"!==s&&"true"!==s||r++;break;case"string":a[i.name]=ge(i,t[r]||"",o),r++;break;case"list":var c=m(i,t[r],o);a[i.name]=c||[],c&&r++;break;default:a[i.name]=f(i,t[r],o),r++}else a[i.name]=void 0,r++;return r}function b(e,t){return x(c,e,t)}function x(e,t,r){void 0===r&&(r=!1),t=t.toLowerCase();var n=e(),i=n.optionsNameMap,a=n.shortOptionNames;if(r){var o=a.get(t);void 0!==o&&(t=o)}return i.get(t)}function S(){return l||(l=s(e.buildOpts))}e.defaultInitCompilerOptions={module:e.ModuleKind.CommonJS,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},e.convertEnableAutoDiscoveryToEnable=d,e.createCompilerDiagnosticForInvalidCustomType=_,e.parseCustomTypeOption=f,e.parseListTypeOption=m,e.parseCommandLineWorker=h,e.compilerOptionsDidYouMeanDiagnostics={alternateMode:u,getOptionsNameMap:c,optionDeclarations:e.optionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Compiler_option_0_expects_an_argument},e.parseCommandLine=function(t,r){return h(e.compilerOptionsDidYouMeanDiagnostics,t,r)},e.getOptionFromName=b;var D={alternateMode:{diagnostic:e.Diagnostics.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:c},getOptionsNameMap:S,optionDeclarations:e.buildOpts,unknownOptionDiagnostic:e.Diagnostics.Unknown_build_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Build_option_0_requires_a_value_of_type_1};function C(t,r){var n=e.parseJsonText(t,r);return{config:J(n,n.parseDiagnostics,!1,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function T(t,r){var n=E(t,r);return e.isString(n)?e.parseJsonText(t,n):{fileName:t,parseDiagnostics:[n]}}function E(t,r){var n;try{n=r(t)}catch(r){return e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,r.message)}return void 0===n?e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0,t):n}function k(t){return e.arrayToMap(t,g)}e.parseBuildCommand=function(t){var r=h(D,t),n=r.options,i=r.watchOptions,a=r.fileNames,o=r.errors,s=n;return 0===a.length&&a.push("."),s.clean&&s.force&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","force")),s.clean&&s.verbose&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","verbose")),s.clean&&s.watch&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","watch")),s.watch&&s.dry&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:s,watchOptions:i,projects:a,errors:o}},e.getDiagnosticText=function(t){for(var r=[],n=1;n=0)return l.push(e.createCompilerDiagnostic(e.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0,r(r([],c,!0),[_],!1).join(" -> "))),{raw:t||j(n,l)};var p=t?function(t,r,n,i,a){e.hasProperty(t,"excludes")&&a.push(e.createCompilerDiagnostic(e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));var o,s=le(t.compilerOptions,n,a,i),c=de(t.typeAcquisition||t.typingOptions,n,a,i),l=function(e,t,r){return _e(R(),e,t,void 0,M,r)}(t.watchOptions,n,a);if(t.compileOnSave=function(t,r,n){if(!e.hasProperty(t,e.compileOnSaveCommandLineOption.name))return!1;var i=pe(e.compileOnSaveCommandLineOption,t.compileOnSave,r,n);return"boolean"==typeof i&&i}(t,n,a),t.extends)if(e.isString(t.extends)){var u=i?te(i,n):n;o=se(t.extends,r,u,a,e.createCompilerDiagnostic)}else a.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"extends","string"));return{raw:t,options:s,watchOptions:l,typeAcquisition:c,extendedConfigPath:o}}(t,i,a,s,l):function(t,r,n,i,a){var s,c,l,u,d,_=ce(i),p={onSetValidOptionKeyValueInParent:function(t,r,a){var o;switch(t){case"compilerOptions":o=_;break;case"watchOptions":o=l||(l={});break;case"typeAcquisition":o=s||(s=ue(i));break;case"typingOptions":o=c||(c=ue(i));break;default:e.Debug.fail("Unknown option")}o[r.name]=fe(r,n,a)},onSetValidOptionKeyValueInRoot:function(o,s,c,l){if("extends"!==o);else{var d=i?te(i,n):n;u=se(c,r,d,a,(function(r,n){return e.createDiagnosticForNodeInSourceFile(t,l,r,n)}))}},onSetUnknownOptionKeyValueInRoot:function(r,n,i,s){"excludes"===r&&a.push(e.createDiagnosticForNodeInSourceFile(t,n,e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)),e.find(o,(function(e){return e.name===r}))&&(d=e.append(d,n))}},f=J(t,a,!0,p);s||(s=c?void 0!==c.enableAutoDiscovery?{enable:c.enableAutoDiscovery,include:c.include,exclude:c.exclude}:c:ue(i));d&&f&&void 0===f.compilerOptions&&a.push(e.createDiagnosticForNodeInSourceFile(t,d[0],e.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,e.getTextOfPropertyName(d[0])));return{raw:f,options:_,watchOptions:l,typeAcquisition:s,extendedConfigPath:u}}(n,i,a,s,l);if((null===(d=p.options)||void 0===d?void 0:d.paths)&&(p.options.pathsBasePath=a),p.extendedConfigPath){c=c.concat([_]);var f=function(t,r,n,i,a,o){var s,c,l,u,d=n.useCaseSensitiveFileNames?r:e.toFileNameLowerCase(r);o&&(c=o.get(d))?(l=c.extendedResult,u=c.extendedConfig):(l=T(r,(function(e){return n.readFile(e)})),l.parseDiagnostics.length||(u=oe(void 0,l,n,e.getDirectoryPath(r),e.getBaseFileName(r),i,a,o)),o&&o.set(d,{extendedResult:l,extendedConfig:u}));t&&(t.extendedSourceFiles=[l.fileName],l.extendedSourceFiles&&(s=t.extendedSourceFiles).push.apply(s,l.extendedSourceFiles));if(l.parseDiagnostics.length)return void a.push.apply(a,l.parseDiagnostics);return u}(n,p.extendedConfigPath,i,c,l,u);if(f&&f.options){var m,g=f.raw,y=p.raw,h=function(t){!y[t]&&g[t]&&(y[t]=e.map(g[t],(function(t){return e.isRootedDiskPath(t)?t:e.combinePaths(m||(m=e.convertToRelativePath(e.getDirectoryPath(p.extendedConfigPath),a,e.createGetCanonicalFileName(i.useCaseSensitiveFileNames))),t)})))};h("include"),h("exclude"),h("files"),void 0===y.compileOnSave&&(y.compileOnSave=g.compileOnSave),p.options=e.assign({},f.options,p.options),p.watchOptions=p.watchOptions&&f.watchOptions?e.assign({},f.watchOptions,p.watchOptions):p.watchOptions||f.watchOptions}}return p}function se(t,r,n,i,a){if(t=e.normalizeSlashes(t),e.isRootedDiskPath(t)||e.startsWith(t,"./")||e.startsWith(t,"../")){var o=e.getNormalizedAbsolutePath(t,n);return r.fileExists(o)||e.endsWith(o,".json")||(o="".concat(o,".json"),r.fileExists(o))?o:void i.push(a(e.Diagnostics.File_0_not_found,t))}var s=e.nodeModuleNameResolver(t,e.combinePaths(n,"tsconfig.json"),{moduleResolution:e.ModuleResolutionKind.NodeJs},r,void 0,void 0,!0);if(s.resolvedModule)return s.resolvedModule.resolvedFileName;i.push(a(e.Diagnostics.File_0_not_found,t))}function ce(t){return t&&"jsconfig.json"===e.getBaseFileName(t)?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function le(t,r,n,i){var a=ce(i);return _e(L(),t,r,a,e.compilerOptionsDidYouMeanDiagnostics,n),i&&(a.configFilePath=e.normalizeSlashes(i)),a}function ue(t){return{enable:!!t&&"jsconfig.json"===e.getBaseFileName(t),include:[],exclude:[]}}function de(e,t,r,n){var i=ue(n),a=d(e);return _e(B(),a,t,i,N,r),i}function _e(t,r,n,i,a,o){if(r){for(var s in r){var c=t.get(s);c?(i||(i={}))[c.name]=pe(c,r[s],n,o):o.push(y(s,a,e.createCompilerDiagnostic))}return i}}function pe(t,r,n,i){if(K(t,r)){var a=t.type;if("list"===a&&e.isArray(r))return function(t,r,n,i){return e.filter(e.map(r,(function(e){return pe(t.element,e,n,i)})),(function(e){return!!t.listPreserveFalsyValues||!!e}))}(t,r,n,i);if(!e.isString(a))return ye(t,r,i);var o=ge(t,r,i);return ee(o)?o:me(t,n,o)}i.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t.name,V(t)))}function fe(t,r,n){if(!ee(n)){if("list"===t.type){var i=t;return i.element.isFilePath||!e.isString(i.element.type)?e.filter(e.map(n,(function(e){return fe(i.element,r,e)})),(function(e){return!!i.listPreserveFalsyValues||!!e})):n}return e.isString(t.type)?me(t,r,n):t.type.get(e.isString(n)?n.toLowerCase():n)}}function me(t,r,n){return t.isFilePath&&""===(n=e.getNormalizedAbsolutePath(n,r))&&(n="."),n}function ge(t,r,n){var i;if(!ee(r)){var a=null===(i=t.extraValidation)||void 0===i?void 0:i.call(t,r);if(!a)return r;n.push(e.createCompilerDiagnostic.apply(void 0,a))}}function ye(e,t,r){if(!ee(t)){var n=t.toLowerCase(),i=e.type.get(n);if(void 0!==i)return ge(e,i,r);r.push(_(e))}}e.convertToObject=j,e.convertToObjectWorker=U,e.convertToTSConfig=function(t,r,i){var a,o,s,c=e.createGetCanonicalFileName(i.useCaseSensitiveFileNames),l=e.map(e.filter(t.fileNames,(null===(o=null===(a=t.options.configFile)||void 0===a?void 0:a.configFileSpecs)||void 0===o?void 0:o.validatedIncludeSpecs)?function(t,r,n,i){if(!r)return e.returnTrue;var a=e.getFileMatcherPatterns(t,n,r,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=a.excludePattern&&e.getRegexFromPattern(a.excludePattern,i.useCaseSensitiveFileNames),s=a.includeFilePattern&&e.getRegexFromPattern(a.includeFilePattern,i.useCaseSensitiveFileNames);if(s)return o?function(e){return!(s.test(e)&&!o.test(e))}:function(e){return!s.test(e)};if(o)return function(e){return o.test(e)};return e.returnTrue}(r,t.options.configFile.configFileSpecs.validatedIncludeSpecs,t.options.configFile.configFileSpecs.validatedExcludeSpecs,i):e.returnTrue),(function(t){return e.getRelativePathFromFile(e.getNormalizedAbsolutePath(r,i.getCurrentDirectory()),e.getNormalizedAbsolutePath(t,i.getCurrentDirectory()),c)})),u=H(t.options,{configFilePath:e.getNormalizedAbsolutePath(r,i.getCurrentDirectory()),useCaseSensitiveFileNames:i.useCaseSensitiveFileNames}),d=t.watchOptions&&Q(t.watchOptions,w()),_=n(n({compilerOptions:n(n({},z(u)),{showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0}),watchOptions:d&&z(d),references:e.map(t.projectReferences,(function(e){return n(n({},e),{path:e.originalPath?e.originalPath:"",originalPath:void 0})})),files:e.length(l)?l:void 0},(null===(s=t.options.configFile)||void 0===s?void 0:s.configFileSpecs)?{include:G(t.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:t.options.configFile.configFileSpecs.validatedExcludeSpecs}:{}),{compileOnSave:!!t.compileOnSave||void 0});return _},e.getCompilerOptionsDiffValue=function(t,r){var n,i,a,s=X(t);return n=[],a=2,i=Array(a+1).join(" "),o.forEach((function(t){if(s.has(t.name)){var r=s.get(t.name),a=Ae(t);r!==a?n.push("".concat(i).concat(t.name,": ").concat(r)):e.hasProperty(e.defaultInitCompilerOptions,t.name)&&n.push("".concat(i).concat(t.name,": ").concat(a))}})),n.join(r)+r},e.generateTSConfig=function(t,r,n){var i=X(t);return function(){for(var t=e.createMultiMap(),s=0,c=e.optionDeclarations;s0)for(var b=function(t){if(e.fileExtensionIs(t,".json")){if(!o){var n=_.filter((function(t){return e.endsWith(t,".json")})),a=e.map(e.getRegularExpressionsForWildcards(n,r,"files"),(function(e){return"^".concat(e,"$")}));o=a?a.map((function(t){return e.getRegexFromPattern(t,i.useCaseSensitiveFileNames)})):e.emptyArray}if(-1!==e.findIndex(o,(function(e){return e.test(t)}))){var d=s(t);c.has(d)||u.has(d)||u.set(d,t)}return"continue"}if(function(t,r,n,i,a){var o=e.forEach(i,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(!o)return!1;for(var s=0,c=o;s=0;o--){var s=a[o];if(e.fileExtensionIs(t,s))return;var c=i(e.changeExtension(t,s));r.delete(c)}}(t,l,f,s);var p=s(t);c.has(p)||l.has(p)||l.set(p,t)},x=0,S=i.readDirectory(r,e.flatten(m),p,_,void 0);xr}function Se(t,r,n,i,a){var o=e.getRegularExpressionForWildcard(r,e.combinePaths(e.normalizePath(i),a),"exclude"),s=o&&e.getRegexFromPattern(o,n);return!!s&&(!!s.test(t)||!e.hasExtension(t)&&s.test(e.ensureTrailingDirectorySeparator(t)))}function De(t,r,n,i,a){return t.filter((function(t){if(!e.isString(t))return!1;var i=Ce(t,n);return void 0!==i&&r.push(o.apply(void 0,i)),void 0===i}));function o(t,r){var n=e.getTsConfigPropArrayElementValue(i,a,r);return n?e.createDiagnosticForNodeInSourceFile(i,n,t,r):e.createCompilerDiagnostic(t,r)}}function Ce(t,r){return r&&he.test(t)?[e.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:xe(t)?[e.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:void 0}function Te(t,r,n){var i=t.validatedIncludeSpecs,a=t.validatedExcludeSpecs,o=e.getRegularExpressionForWildcard(a,r,"exclude"),s=o&&new RegExp(o,n?"":"i"),c={};if(void 0!==i){for(var l=[],u=0,d=i;u0);var i={sourceFile:t.configFile,commandLine:{options:t}};r.setOwnMap(r.getOrCreateMapOfCacheRedirects(i)),null==n||n.setOwnMap(n.getOrCreateMapOfCacheRedirects(i))}r.setOwnOptions(t),null==n||n.setOwnOptions(t)}}function k(t,r,n){return{getOrCreateCacheForDirectory:function(i,a){var o=e.toPath(i,t,r);return T(n,a,o,(function(){return A()}))},clear:function(){n.clear()},update:function(e){E(e,n)}}}function A(){var t=new e.Map,r=new e.Map,n={get:function(e,r){return t.get(i(e,r))},set:function(e,r,a){return t.set(i(e,r),a),n},delete:function(e,r){return t.delete(i(e,r)),n},has:function(e,r){return t.has(i(e,r))},forEach:function(e){return t.forEach((function(t,n){var i=r.get(n),a=i[0],o=i[1];return e(t,a,o)}))},size:function(){return t.size}};return n;function i(e,t){var n=void 0===t?e:"".concat(t,"|").concat(e);return r.set(n,[e,t]),n}}function N(r,n,i,a,o){var s=function(r,n,i,a){var o,s=a.compilerOptions,c=s.baseUrl,l=s.paths,u=s.configFile;if(l&&!e.pathIsRelative(n)){return a.traceEnabled&&(c&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,c,n),t(a.host,e.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,n)),_e(r,n,e.getPathsBasePath(a.compilerOptions,a.host),l,(null==u?void 0:u.configFileSpecs)?(o=u.configFileSpecs).pathPatterns||(o.pathPatterns=e.tryParsePatterns(l)):void 0,i,!1,a)}}(r,n,a,o);return s?s.value:e.isExternalModuleNameRelative(n)?function(r,n,i,a,o){if(!o.compilerOptions.rootDirs)return;o.traceEnabled&&t(o.host,e.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,n);for(var s,c,l=e.normalizePath(e.combinePaths(i,n)),u=0,d=o.compilerOptions.rootDirs;u=0||c.indexOf(".")>=0||c.indexOf("node_modules")>=0)return!1;var u=e.combinePaths(t.packageDirectory,r),d=e.getNormalizedAbsolutePath(u,null===(s=(o=n.host).getCurrentDirectory)||void 0===s?void 0:s.call(o)),_=q(i,d,!1,n);if(_)return a=e.appendIfUnique(a,_,(function(e,t){return e.path===t.path})),!0}else if(Array.isArray(r))for(var p=0,f=r;p0;){var c=Z(e.getPathFromPathComponents(s),!1,o);if(c)return c;s.pop()}}function Z(r,n,i){var a,o,s,c=i.host,l=i.traceEnabled,u=e.combinePaths(r,"package.json");if(n)i.failedLookupLocations.push(u);else{var d=null===(a=i.packageJsonInfoCache)||void 0===a?void 0:a.getPackageJsonInfo(u);if(void 0!==d)return"boolean"!=typeof d?(l&&t(c,e.Diagnostics.File_0_exists_according_to_earlier_cached_lookups,u),d):(d&&l&&t(c,e.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void i.failedLookupLocations.push(u));var _=e.directoryProbablyExists(r,c);if(_&&c.fileExists(u)){var p=e.readJson(u,c);l&&t(c,e.Diagnostics.Found_package_json_at_0,u);var f={packageDirectory:r,packageJsonContent:p,versionPaths:g(p,i),resolvedEntrypoints:void 0};return null===(o=i.packageJsonInfoCache)||void 0===o||o.setPackageJsonInfo(u,f),f}_&&l&&t(c,e.Diagnostics.File_0_does_not_exist,u),null===(s=i.packageJsonInfoCache)||void 0===s||s.setPackageJsonInfo(u,_),i.failedLookupLocations.push(u)}}function ee(r,n,i,a,l,u){var d;if(l)switch(r){case c.JavaScript:case c.Json:case c.TsOnly:d=m(l,n,a);break;case c.TypeScript:d=f(l,n,a)||m(l,n,a);break;case c.DtsOnly:d=f(l,n,a);break;case c.TSConfig:d=function(e,t,r){return p(e,"tsconfig",t,r)}(l,n,a);break;default:return e.Debug.assertNever(r)}var _=function(r,n,i,a){var s=H(n,i,a);if(s){var u=function(t,r){var n=e.tryGetExtensionFromPath(r);return void 0!==n&&function(e,t){switch(e){case c.JavaScript:return".js"===t||".jsx"===t||".mjs"===t||".cjs"===t;case c.TSConfig:case c.Json:return".json"===t;case c.TypeScript:return".ts"===t||".tsx"===t||".mts"===t||".cts"===t||".d.ts"===t||".d.mts"===t||".d.cts"===t;case c.TsOnly:return".ts"===t||".tsx"===t||".mts"===t||".cts"===t;case c.DtsOnly:return".d.ts"===t||".d.mts"===t||".d.cts"===t}}(t,n)?{path:r,ext:n}:void 0}(r,s);if(u)return o(u);a.traceEnabled&&t(a.host,e.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it,s)}var d=r===c.DtsOnly?c.TypeScript:r,_=a.features;"module"!==(null==l?void 0:l.type)&&(a.features&=~v.EsmMode);var p=J(d,n,i,a,!1);return a.features=_,p},g=d?!e.directoryProbablyExists(e.getDirectoryPath(d),a.host):void 0,y=i||!e.directoryProbablyExists(n,a.host),h=e.combinePaths(n,r===c.TSConfig?"tsconfig":"index");if(u&&(!d||e.containsPath(n,d))){var b=e.getRelativePathFromDirectory(n,d||h,!1);a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,u.version,e.version,b);var x=_e(r,b,n,u.paths,void 0,_,g||y,a);if(x)return s(x.value)}var S=d&&s(_(r,d,g,a));return S||(a.features&v.EsmMode?void 0:z(r,h,y,a))}function te(t){var r=t.indexOf(e.directorySeparator);return"@"===t[0]&&(r=t.indexOf(e.directorySeparator,r+1)),-1===r?{packageName:t,rest:""}:{packageName:t.slice(0,r),rest:t.slice(r+1)}}function re(t){return e.every(e.getOwnKeys(t),(function(t){return e.startsWith(t,".")}))}function ne(r,n,i,a,o,s){if(r.packageJsonContent.exports){if("."===i){var c=void 0;if("string"==typeof r.packageJsonContent.exports||Array.isArray(r.packageJsonContent.exports)||"object"==typeof r.packageJsonContent.exports&&(u=r.packageJsonContent.exports,!e.some(e.getOwnKeys(u),(function(t){return e.startsWith(t,".")})))?c=r.packageJsonContent.exports:e.hasProperty(r.packageJsonContent.exports,".")&&(c=r.packageJsonContent.exports["."]),c)return oe(n,a,o,s,i,r,!1)(c,"",!1)}else if(re(r.packageJsonContent.exports)){if("object"!=typeof r.packageJsonContent.exports)return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0);var l=ae(n,a,o,s,i,r.packageJsonContent.exports,r,!1);if(l)return l}var u;return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0)}}function ie(e,t){var r=e.indexOf("*"),n=t.indexOf("*"),i=-1===r?e.length:r+1,a=-1===n?t.length:n+1;return i>a?-1:a>i||-1===r?1:-1===n||e.length>t.length?-1:t.length>e.length?1:0}function ae(t,r,n,i,a,o,s,c){var l=oe(t,r,n,i,a,s,c);if(!e.endsWith(a,e.directorySeparator)&&-1===a.indexOf("*")&&e.hasProperty(o,a))return l(p=o[a],"",!1);for(var u=0,d=e.sort(e.filter(e.getOwnKeys(o),(function(t){return-1!==t.indexOf("*")||e.endsWith(t,"/")})),ie);u0&&!e.endsWith(_,"/"))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);if(!e.startsWith(_,"./")){if(u&&!e.startsWith(_,"../")&&!e.startsWith(_,"/")&&!e.isRootedDiskPath(_)){var m=f?_.replace(/\*/g,p):_+p;return he((T=L(n.features,m,l.packageDirectory+"/",n.compilerOptions,n.host,i,[r],o)).resolvedModule?{path:T.resolvedModule.resolvedFileName,extension:T.resolvedModule.extension,packageId:T.resolvedModule.packageId,originalPath:T.resolvedModule.originalPath}:void 0)}return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0)}var g=(e.pathIsRelative(_)?e.getPathComponents(_).slice(1):e.getPathComponents(_)).slice(1);if(g.indexOf("..")>=0||g.indexOf(".")>=0||g.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);var y=e.combinePaths(l.packageDirectory,_),h=e.getPathComponents(p);if(h.indexOf("..")>=0||h.indexOf(".")>=0||h.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);var v=N(f?y.replace(/\*/g,p):y+p),b=function(t,i,o,s){var u,d,_,p;if((r===c.TypeScript||r===c.JavaScript||r===c.Json)&&(n.compilerOptions.declarationDir||n.compilerOptions.outDir)&&-1===t.indexOf("/node_modules/")&&(!n.compilerOptions.configFile||e.startsWith(N(n.compilerOptions.configFile.fileName),l.packageDirectory))){var f=e.hostGetCanonicalFileName({useCaseSensitiveFileNames:F}),m=[];if(n.compilerOptions.rootDir||n.compilerOptions.composite&&n.compilerOptions.configFilePath){var g=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return[]}),(null===(d=(u=n.host).getCurrentDirectory)||void 0===d?void 0:d.call(u))||"",f));m.push(g)}else if(n.requestContainingDirectory){var y=N(e.combinePaths(n.requestContainingDirectory,"index.ts"));g=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return[y,N(o)]}),(null===(p=(_=n.host).getCurrentDirectory)||void 0===p?void 0:p.call(_))||"",f));m.push(g);for(var h=e.ensureTrailingDirectorySeparator(g);h&&h.length>1;){var v=e.getPathComponents(h);v.pop();var b=e.getPathFromPathComponents(v);m.unshift(b),h=e.ensureTrailingDirectorySeparator(b)}}m.length>1&&n.reportDiagnostic(e.createCompilerDiagnostic(s?e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,""===i?".":i,o));for(var x=0,S=m;x=0||se(n.conditions,D)){var C=_[D],T=d(C,p,f);if(T)return T}}return}if(!e.length(_))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);for(var E=0,k=_;Ei&&(i=u),1===i)return i}return i}break;case 262:var d=0;return e.forEachChild(t,(function(t){var n=o(t,r);switch(n){case 0:return;case 2:return void(d=2);case 1:return d=1,!0;default:e.Debug.assertNever(n)}})),d;case 261:return a(t,r);case 79:if(t.isInJSDocNamespace)return 0}return 1}(t,r);return r.set(n,i),i}function s(t,r){for(var n=t.propertyName||t.name,i=t.parent;i;){if(e.isBlock(i)||e.isModuleBlock(i)||e.isSourceFile(i)){for(var a=void 0,s=0,c=i.statements;sa)&&(a=u),1===a)return a}}if(void 0!==a)return a}i=i.parent}return 1}function c(t){return e.Debug.attachFlowNodeDebugInfo(t),t}(t=e.ModuleInstanceState||(e.ModuleInstanceState={}))[t.NonInstantiated=0]="NonInstantiated",t[t.Instantiated=1]="Instantiated",t[t.ConstEnumOnly=2]="ConstEnumOnly",e.getModuleInstanceState=a,function(e){e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor"}(i||(i={}));var l=function(){var t,i,o,s,l,p,f,m,g,y,h,v,b,x,S,D,C,T,E,k,A,N,w,F,P=!1,I=0,O={flags:1},M={flags:1},L=function(){return e.createBinaryExpressionTrampoline(t,r,n,i,a,void 0);function t(t,r){if(r){r.stackIndex++,e.setParent(t,s);var n=N;Ue(t);var i=s;s=t,r.skip=!1,r.inStrictModeStack[r.stackIndex]=n,r.parentStack[r.stackIndex]=i}else r={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};var a=t.operatorToken.kind;if(55===a||56===a||60===a||e.isLogicalOrCoalescingAssignmentOperator(a)){if(ue(t)){var o=Z();ve(t,o,o),h=ce(o)}else ve(t,S,D);r.skip=!0}return r}function r(e,t,r){if(!t.skip){var n=o(e);return 27===r.operatorToken.kind&&ge(e),n}}function n(e,t,r){t.skip||Re(e)}function i(e,t,r){if(!t.skip){var n=o(e);return 27===r.operatorToken.kind&&ge(e),n}}function a(t,r){if(!r.skip){var n=t.operatorToken.kind;if(e.isAssignmentOperator(n)&&!e.isAssignmentTarget(t))if(he(t.left),63===n&&207===t.left.kind)Y(t.left.expression)&&(h=oe(256,h,t))}var i=r.inStrictModeStack[r.stackIndex],a=r.parentStack[r.stackIndex];void 0!==i&&(N=i),void 0!==a&&(s=a),r.skip=!1,r.stackIndex--}function o(t){if(t&&e.isBinaryExpression(t)&&!e.isDestructuringAssignment(t))return t;Re(t)}}();function R(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(e.getSourceFileOfNode(r)||t,r,n,i,a,o)}return function(r,n){t=r,i=n,o=e.getEmitScriptTarget(i),N=function(t,r){return!(!e.getStrictOptionValue(r,"alwaysStrict")||t.isDeclarationFile)||!!t.externalModuleIndicator}(t,n),F=new e.Set,I=0,w=e.objectAllocator.getSymbolConstructor(),e.Debug.attachFlowNodeDebugInfo(O),e.Debug.attachFlowNodeDebugInfo(M),t.locals||(null===e.tracing||void 0===e.tracing||e.tracing.push("bind","bindSourceFile",{path:t.path},!0),Re(t),null===e.tracing||void 0===e.tracing||e.tracing.pop(),t.symbolCount=I,t.classifiableNames=F,function(){if(g){for(var r=l,n=m,i=f,a=s,o=h,u=0,_=g;u<_.length;u++){var p=_[u],y=p.parent.parent;l=e.findAncestor(y.parent,(function(e){return!!(1&Ce(e))}))||t,f=e.getEnclosingBlockScopeContainer(y)||t,h=c({flags:2}),s=p,Re(p.typeExpression);var v=e.getNameOfDeclaration(p);if((e.isJSDocEnumTag(p)||!p.fullName)&&v&&e.isPropertyAccessEntityNameExpression(v.parent)){var b=Ze(v.parent);if(b){$e(t.symbol,v.parent,b,!!e.findAncestor(v,(function(t){return e.isPropertyAccessExpression(t)&&"prototype"===t.name.escapedText})),!1);var x=l;switch(e.getAssignmentDeclarationPropertyAccessKind(v.parent)){case 1:case 2:l=e.isExternalOrCommonJsModule(t)?t:void 0;break;case 4:l=v.parent.expression;break;case 3:l=v.parent.expression.name;break;case 5:l=d(t,v.parent.expression)?t:e.isPropertyAccessExpression(v.parent.expression)?v.parent.expression.name:v.parent.expression;break;case 0:return e.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}l&&K(p,524288,788968),l=x}}else e.isJSDocEnumTag(p)||!p.fullName||79===p.fullName.kind?(s=p.parent,we(p,524288,788968)):Re(p.fullName)}l=r,m=n,f=i,s=a,h=o}}()),t=void 0,i=void 0,o=void 0,s=void 0,l=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=!1,h=void 0,v=void 0,b=void 0,x=void 0,S=void 0,D=void 0,C=void 0,E=void 0,k=!1,P=!1,A=0};function B(e,t){return I++,new w(e,t)}function J(t,r,n){t.flags|=n,r.symbol=t,t.declarations=e.appendIfUnique(t.declarations,r),1955&n&&!t.exports&&(t.exports=e.createSymbolTable()),6240&n&&!t.members&&(t.members=e.createSymbolTable()),t.constEnumOnlyModule&&304&t.flags&&(t.constEnumOnlyModule=!1),111551&n&&e.setValueDeclaration(t,r)}function j(t){if(271===t.kind)return t.isExportEquals?"export=":"default";var r=e.getNameOfDeclaration(t);if(r){if(e.isAmbientModule(t)){var n=e.getTextOfIdentifierOrLiteral(r);return e.isGlobalScopeAugmentation(t)?"__global":'"'.concat(n,'"')}if(162===r.kind){var i=r.expression;if(e.isStringOrNumericLiteralLike(i))return e.escapeLeadingUnderscores(i.text);if(e.isSignedNumericLiteral(i))return e.tokenToString(i.operator)+i.operand.text;e.Debug.fail("Only computed properties with literal names have declaration names")}if(e.isPrivateIdentifier(r)){var a=e.getContainingClass(t);if(!a)return;var o=a.symbol;return e.getSymbolNameForPrivateIdentifier(o,r.escapedText)}return e.isPropertyNameLiteral(r)?e.getEscapedTextOfIdentifierOrLiteral(r):void 0}switch(t.kind){case 171:return"__constructor";case 179:case 174:case 323:return"__call";case 180:case 175:return"__new";case 176:return"__index";case 272:return"__export";case 305:return"export=";case 221:if(2===e.getAssignmentDeclarationKind(t))return"export=";e.Debug.fail("Unknown binary declaration kind");break;case 317:return e.isJSDocConstructSignature(t)?"__new":"__call";case 164:return e.Debug.assert(317===t.parent.kind,"Impossible parameter parent kind",(function(){return"parent is: ".concat(e.SyntaxKind?e.SyntaxKind[t.parent.kind]:t.parent.kind,", expected JSDocFunctionType")})),"arg"+t.parent.parameters.indexOf(t)}}function U(t){return e.isNamedDeclaration(t)?e.declarationNameToString(t.name):e.unescapeLeadingUnderscores(e.Debug.checkDefined(j(t)))}function V(n,i,a,o,s,c,l){e.Debug.assert(l||!e.hasDynamicName(a));var u,d=e.hasSyntacticModifier(a,512)||e.isExportSpecifier(a)&&"default"===a.name.escapedText,_=l?"__computed":d&&i?"default":j(a);if(void 0===_)u=B(0,"__missing");else if(u=n.get(_),2885600&o&&F.add(_),u){if(c&&!u.isReplaceableByMethod)return u;if(u.flags&s)if(u.isReplaceableByMethod)n.set(_,u=B(0,_));else if(!(3&o&&67108864&u.flags)){e.isNamedDeclaration(a)&&e.setParent(a.name,a);var p=2&u.flags?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,f=!0;(384&u.flags||384&o)&&(p=e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,f=!1);var m=!1;e.length(u.declarations)&&(d||u.declarations&&u.declarations.length&&271===a.kind&&!a.isExportEquals)&&(p=e.Diagnostics.A_module_cannot_have_multiple_default_exports,f=!1,m=!0);var g=[];e.isTypeAliasDeclaration(a)&&e.nodeIsMissing(a.type)&&e.hasSyntacticModifier(a,1)&&2887656&u.flags&&g.push(R(a,e.Diagnostics.Did_you_mean_0,"export type { ".concat(e.unescapeLeadingUnderscores(a.name.escapedText)," }")));var y=e.getNameOfDeclaration(a)||a;e.forEach(u.declarations,(function(r,n){var i=e.getNameOfDeclaration(r)||r,a=R(i,p,f?U(r):void 0);t.bindDiagnostics.push(m?e.addRelatedInfo(a,R(y,0===n?e.Diagnostics.Another_export_default_is_here:e.Diagnostics.and_here)):a),m&&g.push(R(i,e.Diagnostics.The_first_export_default_is_here))}));var h=R(y,p,f?U(a):void 0);t.bindDiagnostics.push(e.addRelatedInfo.apply(void 0,r([h],g,!1))),u=B(0,_)}}else n.set(_,u=B(0,_)),c&&(u.isReplaceableByMethod=!0);return J(u,a,o),u.parent?e.Debug.assert(u.parent===i,"Existing symbol parent should match new one"):u.parent=i,u}function K(t,r,n){var i=!!(1&e.getCombinedModifierFlags(t))||function(t){t.parent&&e.isModuleDeclaration(t)&&(t=t.parent);if(!e.isJSDocTypeAlias(t))return!1;if(!e.isJSDocEnumTag(t)&&t.fullName)return!0;var r=e.getNameOfDeclaration(t);return!!r&&(!(!e.isPropertyAccessEntityNameExpression(r.parent)||!Ze(r.parent))||!!(e.isDeclaration(r.parent)&&1&e.getCombinedModifierFlags(r.parent)))}(t);if(2097152&r)return 275===t.kind||265===t.kind&&i?V(l.symbol.exports,l.symbol,t,r,n):V(l.locals,void 0,t,r,n);if(e.isJSDocTypeAlias(t)&&e.Debug.assert(e.isInJSFile(t)),!e.isAmbientModule(t)&&(i||64&l.flags)){if(!l.locals||e.hasSyntacticModifier(t,512)&&!j(t))return V(l.symbol.exports,l.symbol,t,r,n);var a=111551&r?1048576:0,o=V(l.locals,void 0,t,a,n);return o.exportSymbol=V(l.symbol.exports,l.symbol,t,r,n),t.localSymbol=o,o}return V(l.locals,void 0,t,r,n)}function z(e){G(e,(function(e){return 256===e.kind?Re(e):void 0})),G(e,(function(e){return 256!==e.kind?Re(e):void 0}))}function G(t,r){void 0===r&&(r=Re),void 0!==t&&e.forEach(t,r)}function q(t){e.forEachChild(t,Re,G)}function W(t){var r=P;if(P=!1,function(t){if(!(1&h.flags))return!1;if(h===O){var r=e.isStatementButNotDeclaration(t)&&236!==t.kind||257===t.kind||261===t.kind&&function(t){var r=a(t);return 1===r||2===r&&e.shouldPreserveConstEnums(i)}(t);if(r&&(h=M,!i.allowUnreachableCode)){var n=e.unreachableCodeIsError(i)&&!(16777216&t.flags)&&(!e.isVariableStatement(t)||!!(3&e.getCombinedNodeFlags(t.declarationList))||t.declarationList.declarations.some((function(e){return!!e.initializer})));!function(t,r){if(e.isStatement(t)&&u(t)&&e.isBlock(t.parent)){var n=t.parent.statements,i=e.sliceAfter(n,t);e.getRangesWhere(i,u,(function(e,t){return r(i[e],i[t-1])}))}else r(t,t)}(t,(function(t,r){return Le(n,t,r,e.Diagnostics.Unreachable_code_detected)}))}}return!0}(t))return q(t),Be(t),void(P=r);switch(t.kind>=237&&t.kind<=253&&!i.allowUnreachableCode&&(t.flowNode=h),t.kind){case 241:!function(e){var t=fe(e,ee()),r=Z(),n=Z();ne(t,h),h=t,_e(e.expression,r,n),h=ce(r),pe(e.statement,n,t),ne(t,h),h=ce(n)}(t);break;case 240:!function(e){var t=ee(),r=fe(e,Z()),n=Z();ne(t,h),h=t,pe(e.statement,n,r),ne(r,h),h=ce(r),_e(e.expression,t,n),h=ce(n)}(t);break;case 242:!function(e){var t=fe(e,ee()),r=Z(),n=Z();Re(e.initializer),ne(t,h),h=t,_e(e.condition,r,n),h=ce(r),pe(e.statement,n,t),Re(e.incrementor),ne(t,h),h=ce(n)}(t);break;case 243:case 244:!function(e){var t=fe(e,ee()),r=Z();Re(e.expression),ne(t,h),h=t,244===e.kind&&Re(e.awaitModifier);ne(r,h),Re(e.initializer),255!==e.initializer.kind&&he(e.initializer);pe(e.statement,r,t),ne(t,h),h=ce(r)}(t);break;case 239:!function(e){var t=Z(),r=Z(),n=Z();_e(e.expression,t,r),h=ce(t),Re(e.thenStatement),ne(n,h),h=ce(r),Re(e.elseStatement),ne(n,h),h=ce(n)}(t);break;case 247:case 251:!function(e){Re(e.expression),247===e.kind&&(k=!0,x&&ne(x,h));h=O}(t);break;case 246:case 245:!function(e){if(Re(e.label),e.label){var t=function(e){for(var t=E;t;t=t.next)if(t.name===e)return t;return}(e.label.escapedText);t&&(t.referenced=!0,me(e,t.breakTarget,t.continueTarget))}else me(e,v,b)}(t);break;case 252:!function(t){var r=x,n=C,i=Z(),a=Z(),o=Z();t.finallyBlock&&(x=a);ne(o,h),C=o,Re(t.tryBlock),ne(i,h),t.catchClause&&(h=ce(o),ne(o=Z(),h),C=o,Re(t.catchClause),ne(i,h));if(x=r,C=n,t.finallyBlock){var s=Z();s.antecedents=e.concatenate(e.concatenate(i.antecedents,o.antecedents),a.antecedents),h=s,Re(t.finallyBlock),1&h.flags?h=O:(x&&a.antecedents&&ne(x,te(s,a.antecedents,h)),C&&o.antecedents&&ne(C,te(s,o.antecedents,h)),h=i.antecedents?te(s,i.antecedents,h):O)}else h=ce(i)}(t);break;case 249:!function(t){var r=Z();Re(t.expression);var n=v,i=T;v=r,T=h,Re(t.caseBlock),ne(r,h);var a=e.forEach(t.caseBlock.clauses,(function(e){return 290===e.kind}));t.possiblyExhaustive=!a&&!r.antecedents,a||ne(r,ae(T,t,0,0));v=n,T=i,h=ce(r)}(t);break;case 263:!function(e){for(var t=e.clauses,r=H(e.parent.expression),n=O,a=0;a=117&&r.originalKeywordKind<=125?t.bindDiagnostics.push(R(r,function(r){if(e.getContainingClass(r))return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode;if(t.externalModuleIndicator)return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode;return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(r),e.declarationNameToString(r))):132===r.originalKeywordKind?e.isExternalModule(t)&&e.isInTopLevelContext(r)?t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,e.declarationNameToString(r))):32768&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))):125===r.originalKeywordKind&&8192&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))))}function Pe(r,n){if(n&&79===n.kind){var i=n;if(function(t){return e.isIdentifier(t)&&("eval"===t.escapedText||"arguments"===t.escapedText)}(i)){var a=e.getErrorSpanForNode(t,n);t.bindDiagnostics.push(e.createFileDiagnostic(t,a.start,a.length,function(r){if(e.getContainingClass(r))return e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode;if(t.externalModuleIndicator)return e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;return e.Diagnostics.Invalid_use_of_0_in_strict_mode}(r),e.idText(i)))}}}function Ie(e){N&&Pe(e,e.name)}function Oe(r){if(o<2&&305!==f.kind&&261!==f.kind&&!e.isFunctionLikeOrClassStaticBlockDeclaration(f)){var n=e.getErrorSpanForNode(t,r);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}(r)))}}function Me(r,n,i,a,o){var s=e.getSpanOfTokenAtPosition(t,r.pos);t.bindDiagnostics.push(e.createFileDiagnostic(t,s.start,s.length,n,i,a,o))}function Le(r,i,a,o){!function(r,i,a){var o=e.createFileDiagnostic(t,i.pos,i.end-i.pos,a);r?t.bindDiagnostics.push(o):t.bindSuggestionDiagnostics=e.append(t.bindSuggestionDiagnostics,n(n({},o),{category:e.DiagnosticCategory.Suggestion}))}(r,{pos:e.getTokenPosOfNode(i,t),end:a.end},o)}function Re(r){if(r){e.setParent(r,s),e.tracing&&(r.tracingPath=t.path);var n=N;if(Ue(r),r.kind>160){var i=s;s=r;var a=Ce(r);0===a?W(r):function(t,r){var n=l,i=p,a=f;if(1&r?(214!==t.kind&&(p=l),l=f=t,32&r&&(l.locals=e.createSymbolTable()),Te(l)):2&r&&((f=t).locals=void 0),4&r){var o=h,s=v,u=b,d=x,_=C,m=E,g=k,S=16&r&&!e.hasSyntacticModifier(t,256)&&!t.asteriskToken&&!!e.getImmediatelyInvokedFunctionExpression(t)||170===t.kind;S||(h=c({flags:2}),144&r&&(h.node=t)),x=S||171===t.kind||e.isInJSFile(t)&&(256===t.kind||213===t.kind)?Z():void 0,C=void 0,v=void 0,b=void 0,E=void 0,k=!1,W(t),t.flags&=-2817,!(1&h.flags)&&8&r&&e.nodeIsPresent(t.body)&&(t.flags|=256,k&&(t.flags|=512),t.endFlowNode=h),305===t.kind&&(t.flags|=A,t.endFlowNode=h),x&&(ne(x,h),h=ce(x),(171===t.kind||170===t.kind||e.isInJSFile(t)&&(256===t.kind||213===t.kind))&&(t.returnFlowNode=h)),S||(h=o),v=s,b=u,x=d,C=_,E=m,k=g}else 64&r?(y=!1,W(t),t.flags=y?128|t.flags:-129&t.flags):W(t);l=n,p=i,f=a}(r,a),s=i}else{i=s;1===r.kind&&(s=r),Be(r),s=i}N=n}}function Be(t){if(e.hasJSDocNodes(t))if(e.isInJSFile(t))for(var r=0,n=t.jsDoc;r=2&&(e.isDeclarationStatement(t.statement)||e.isVariableStatement(t.statement))&&Me(t.label,e.Diagnostics.A_label_is_not_allowed_here)}(r);case 192:return void(y=!0);case 177:break;case 163:return function(t){if(e.isJSDocTemplateTag(t.parent)){var r=e.getEffectiveContainerForJSDocTemplateTag(t.parent);r?(r.locals||(r.locals=e.createSymbolTable()),V(r.locals,void 0,t,262144,526824)):Ee(t,262144,526824)}else if(190===t.parent.kind){var n=function(t){var r=e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&t.parent.extendsType===t}));return r&&r.parent}(t.parent);n?(n.locals||(n.locals=e.createSymbolTable()),V(n.locals,void 0,t,262144,526824)):Ne(t,262144,j(t))}else Ee(t,262144,526824)}(r);case 164:return it(r);case 254:return nt(r);case 203:return r.flowNode=h,nt(r);case 167:case 166:return function(e){return at(e,4|(e.questionToken?16777216:0),0)}(r);case 296:case 297:return at(r,4,0);case 299:return at(r,8,900095);case 174:case 175:case 176:return Ee(r,131072,0);case 169:case 168:return at(r,8192|(r.questionToken?16777216:0),e.isObjectLiteralMethod(r)?0:103359);case 256:return function(r){t.isDeclarationFile||16777216&r.flags||e.isAsyncFunction(r)&&(A|=2048);Ie(r),N?(Oe(r),we(r,16,110991)):Ee(r,16,110991)}(r);case 171:return Ee(r,16384,0);case 172:return at(r,32768,46015);case 173:return at(r,65536,78783);case 179:case 317:case 323:case 180:return function(t){var r=B(131072,j(t));J(r,t,131072);var n=B(2048,"__type");J(n,t,2048),n.members=e.createSymbolTable(),n.members.set(r.escapedName,r)}(r);case 182:case 322:case 195:return function(e){return Ne(e,2048,"__type")}(r);case 332:return function(t){q(t);var r=e.getHostSignatureFromJSDoc(t);r&&169!==r.kind&&J(r.symbol,r,32)}(r);case 205:return function(t){var r;if(function(e){e[e.Property=1]="Property",e[e.Accessor=2]="Accessor"}(r||(r={})),N&&!e.isAssignmentTarget(t))for(var n=new e.Map,i=0,a=t.properties;i1&&2097152&v.flags&&(t=e.createSymbolTable()).set("export=",v);return I(t),k(d);function b(e){return!!e&&79===e.kind}function x(t){return e.isVariableStatement(t)?e.filter(e.map(t.declarationList.declarations,e.getNameOfDeclaration),b):e.filter([e.getNameOfDeclaration(t)],b)}function D(t){var n=e.find(t,e.isExportAssignment),i=e.findIndex(t,e.isModuleDeclaration),a=-1!==i?t[i]:void 0;if(a&&n&&n.isExportEquals&&e.isIdentifier(n.expression)&&e.isIdentifier(a.name)&&e.idText(a.name)===e.idText(n.expression)&&a.body&&e.isModuleBlock(a.body)){var o=e.filter(t,(function(t){return!!(1&e.getEffectiveModifierFlags(t))})),s=a.name,c=a.body;if(e.length(o)&&(a=e.factory.updateModuleDeclaration(a,a.decorators,a.modifiers,a.name,c=e.factory.updateModuleBlock(c,e.factory.createNodeArray(r(r([],a.body.statements,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.map(e.flatMap(o,(function(e){return x(e)})),(function(t){return e.factory.createExportSpecifier(!1,void 0,t)}))),void 0)],!1)))),t=r(r(r([],t.slice(0,i),!0),[a],!1),t.slice(i+1),!0)),!e.find(t,(function(t){return t!==a&&e.nodeHasName(t,s)}))){d=[];var l=!e.some(c.statements,(function(t){return e.hasSyntacticModifier(t,1)||e.isExportAssignment(t)||e.isExportDeclaration(t)}));e.forEach(c.statements,(function(e){q(e,l?1:0)})),t=r(r([],e.filter(t,(function(e){return e!==a&&e!==n})),!0),d,!0)}}return t}function C(t){var n=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(n)>1){var i=e.filter(t,(function(t){return!e.isExportDeclaration(t)||!!t.moduleSpecifier||!t.exportClause}));t=r(r([],i,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(n,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),void 0)],!1)}var a=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(a)>1){var o=e.group(a,(function(t){return e.isStringLiteral(t.moduleSpecifier)?">"+t.moduleSpecifier.text:">"}));if(o.length!==a.length)for(var s=function(n){n.length>1&&(t=r(r([],e.filter(t,(function(e){return-1===n.indexOf(e)})),!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(n,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),n[0].moduleSpecifier)],!1))},c=0,l=o;c=0){var n=t[r],i=e.mapDefined(n.exportClause.elements,(function(r){if(!r.propertyName){var n=e.indicesOf(t),i=e.filter(n,(function(n){return e.nodeHasName(t[n],r.name)}));if(e.length(i)&&e.every(i,(function(e){return A(t[e])}))){for(var a=0,o=i;a0&&e.isSingleOrDoubleQuote(a.charCodeAt(0))?e.stripQuotes(a):a}return"default"===r?r="_default":"export="===r&&(r="_exports"),r=e.isIdentifierText(r,G)&&!e.isStringANonContextualKeyword(r)?r:"_"+r.replace(/[^a-zA-Z0-9]/g,"_")}function ve(e,t){var r=M(e);return i.remappedSymbolNames.has(r)?i.remappedSymbolNames.get(r):(t=he(e,t),i.remappedSymbolNames.set(r,t),t)}}(t,i,u)}))}};function a(r,n,i,a){var s,c;e.Debug.assert(void 0===r||0==(8&r.flags));var l={enclosingDeclaration:r,flags:n||0,tracker:i&&i.trackSymbol?i:{trackSymbol:function(){return!1},moduleResolverHost:134217728&n?{getCommonSourceDirectory:t.getCommonSourceDirectory?function(){return t.getCommonSourceDirectory()}:function(){return""},getCurrentDirectory:function(){return t.getCurrentDirectory()},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getPackageJsonInfoCache)||void 0===e?void 0:e.call(t)},useCaseSensitiveFileNames:e.maybeBind(t,t.useCaseSensitiveFileNames),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},fileExists:function(e){return t.fileExists(e)},getFileIncludeReasons:function(){return t.getFileIncludeReasons()},readFile:t.readFile?function(e){return t.readFile(e)}:void 0}:void 0},encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0};l.tracker=o(l,l.tracker);var u=a(l);return l.truncating&&1&l.flags&&(null===(c=null===(s=l.tracker)||void 0===s?void 0:s.reportTruncationError)||void 0===c||c.call(s)),l.encounteredError?void 0:u}function o(e,t){var r=t.trackSymbol;return n(n({},t),{reportCyclicStructureError:i(t.reportCyclicStructureError),reportInaccessibleThisError:i(t.reportInaccessibleThisError),reportInaccessibleUniqueSymbolError:i(t.reportInaccessibleUniqueSymbolError),reportLikelyUnsafeImportRequiredError:i(t.reportLikelyUnsafeImportRequiredError),reportNonlocalAugmentation:i(t.reportNonlocalAugmentation),reportPrivateInBaseOfClassExpression:i(t.reportPrivateInBaseOfClassExpression),reportNonSerializableProperty:i(t.reportNonSerializableProperty),trackSymbol:r&&function(){for(var t=[],n=0;n(1&t.flags?e.noTruncationMaximumTruncationLength:e.defaultMaximumTruncationLength)}function l(t,r){i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();var n=8388608&r.flags;if(r.flags&=-8388609,!t)return 262144&r.flags?(r.approximateLength+=3,e.factory.createKeywordTypeNode(130)):void(r.encounteredError=!0);if(536870912&r.flags||(t=nl(t)),1&t.flags)return t.aliasSymbol?e.factory.createTypeReferenceNode(k(t.aliasSymbol),f(t.aliasTypeArguments,r)):t===je?e.addSyntheticLeadingComment(e.factory.createKeywordTypeNode(130),3,"unresolved"):(r.approximateLength+=3,e.factory.createKeywordTypeNode(t===Ve?138:130));if(2&t.flags)return e.factory.createKeywordTypeNode(155);if(4&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(150);if(8&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(147);if(64&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(158);if(16&t.flags&&!t.aliasSymbol)return r.approximateLength+=7,e.factory.createKeywordTypeNode(133);if(1024&t.flags&&!(1048576&t.flags)){var a=_a(t.symbol),o=A(a,r,788968);if(Is(a)===t)return o;var c=e.symbolName(t.symbol);return e.isIdentifierText(c,0)?G(o,e.factory.createTypeReferenceNode(c,void 0)):e.isImportTypeNode(o)?(o.isTypeOf=!0,e.factory.createIndexedAccessTypeNode(o,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c)))):e.isTypeReferenceNode(o)?e.factory.createIndexedAccessTypeNode(e.factory.createTypeQueryNode(o.typeName),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c))):e.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}if(1056&t.flags)return A(t.symbol,r,788968);if(128&t.flags)return r.approximateLength+=t.value.length+2,e.factory.createLiteralTypeNode(e.setEmitFlags(e.factory.createStringLiteral(t.value,!!(268435456&r.flags)),16777216));if(256&t.flags){var _=t.value;return r.approximateLength+=(""+_).length,e.factory.createLiteralTypeNode(_<0?e.factory.createPrefixUnaryExpression(40,e.factory.createNumericLiteral(-_)):e.factory.createNumericLiteral(_))}if(2048&t.flags)return r.approximateLength+=e.pseudoBigIntToString(t.value).length+1,e.factory.createLiteralTypeNode(e.factory.createBigIntLiteral(t.value));if(512&t.flags)return r.approximateLength+=t.intrinsicName.length,e.factory.createLiteralTypeNode("true"===t.intrinsicName?e.factory.createTrue():e.factory.createFalse());if(8192&t.flags){if(!(1048576&r.flags)){if(Ma(t.symbol,r.enclosingDeclaration))return r.approximateLength+=6,A(t.symbol,r,111551);r.tracker.reportInaccessibleUniqueSymbolError&&r.tracker.reportInaccessibleUniqueSymbolError()}return r.approximateLength+=13,e.factory.createTypeOperatorNode(154,e.factory.createKeywordTypeNode(151))}if(16384&t.flags)return r.approximateLength+=4,e.factory.createKeywordTypeNode(114);if(32768&t.flags)return r.approximateLength+=9,e.factory.createKeywordTypeNode(153);if(65536&t.flags)return r.approximateLength+=4,e.factory.createLiteralTypeNode(e.factory.createNull());if(131072&t.flags)return r.approximateLength+=5,e.factory.createKeywordTypeNode(143);if(4096&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(151);if(67108864&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(148);if(e.isThisTypeParameter(t))return 4194304&r.flags&&(r.encounteredError||32768&r.flags||(r.encounteredError=!0),r.tracker.reportInaccessibleThisError&&r.tracker.reportInaccessibleThisError()),r.approximateLength+=4,e.factory.createThisTypeNode();if(!n&&t.aliasSymbol&&(16384&r.flags||Oa(t.aliasSymbol,r.enclosingDeclaration))){var h=f(t.aliasTypeArguments,r);return!Ta(t.aliasSymbol.escapedName)||32&t.aliasSymbol.flags?A(t.aliasSymbol,r,788968,h):e.factory.createTypeReferenceNode(e.factory.createIdentifier(""),h)}var v=e.getObjectFlags(t);if(4&v)return e.Debug.assert(!!(524288&t.flags)),t.node?V(t,z):z(t);if(262144&t.flags||3&v){if(262144&t.flags&&e.contains(r.inferTypeParameters,t)){r.approximateLength+=e.symbolName(t.symbol).length+6;var b=void 0,x=Jc(t);if(x){var S=ru(t,!0);S&&vp(x,S)||(r.approximateLength+=9,b=x&&l(x,r))}return e.factory.createInferTypeNode(y(t,r,b))}if(4&r.flags&&262144&t.flags&&!Oa(t.symbol,r.enclosingDeclaration)){var D=w(t,r);return r.approximateLength+=e.idText(D).length,e.factory.createTypeReferenceNode(e.factory.createIdentifier(e.idText(D)),void 0)}if(t.symbol)return A(t.symbol,r,788968);var C=(t===Pt||t===It)&&d&&d.symbol?(t===It?"sub-":"super-")+e.symbolName(d.symbol):"?";return e.factory.createTypeReferenceNode(e.factory.createIdentifier(C),void 0)}if(1048576&t.flags&&t.origin&&(t=t.origin),3145728&t.flags){var T=1048576&t.flags?function(e){for(var t=[],r=0,n=0;n0?1048576&t.flags?e.factory.createUnionTypeNode(E):e.factory.createIntersectionTypeNode(E):void(r.encounteredError||262144&r.flags||(r.encounteredError=!0))}if(48&v)return e.Debug.assert(!!(524288&t.flags)),U(t);if(4194304&t.flags){var N=t.type;r.approximateLength+=6;var F=l(N,r);return e.factory.createTypeOperatorNode(140,F)}if(134217728&t.flags){var P=t.texts,I=t.types,L=e.factory.createTemplateHead(P[0]),R=e.factory.createNodeArray(e.map(I,(function(t,n){return e.factory.createTemplateLiteralTypeSpan(l(t,r),(n10)return u(r);r.symbolDepth.set(c,_+1)}r.visitedTypes.add(o);var f=r.approximateLength,m=n(t),g=r.approximateLength-f;return r.reportedDiagnostic||r.encounteredError||(r.truncating&&(m.truncating=!0),m.addedLength=g,null===(a=null==l?void 0:l.serializedTypes)||void 0===a||a.set(d,m)),r.visitedTypes.delete(o),c&&r.symbolDepth.set(c,_),m;function y(t,r,n,i,a){return t&&0===t.length?e.setTextRange(e.factory.createNodeArray(void 0,t.hasTrailingComma),t):e.visitNodes(t,r,n,i,a)}}function K(t){if(Pc(t)||t.containsError)return function(t){e.Debug.assert(!!(524288&t.flags));var n,i,a=t.declaration.readonlyToken?e.factory.createToken(t.declaration.readonlyToken.kind):void 0,o=t.declaration.questionToken?e.factory.createToken(t.declaration.questionToken.kind):void 0;if(kc(t)){if(!(262144&Ac(t).flags)&&4&r.flags){var s=w(Ca(Wn(262144,"T")),r);i=e.factory.createTypeReferenceNode(s)}n=e.factory.createTypeOperatorNode(140,i||l(Ac(t),r))}else n=l(Dc(t),r);var c=y(Sc(t),r,n),u=t.declaration.nameType?l(Cc(t),r):void 0,d=l(am(Tc(t),!!(4&Nc(t))),r),_=e.factory.createMappedTypeNode(a,c,u,o,d,void 0);r.approximateLength+=10;var p=e.setEmitFlags(_,1);return kc(t)&&!(262144&Ac(t).flags)&&4&r.flags?e.factory.createConditionalTypeNode(l(Ac(t),r),e.factory.createInferTypeNode(e.factory.createTypeParameterDeclaration(void 0,e.factory.cloneNode(i.typeName))),p,e.factory.createKeywordTypeNode(143)):p}(t);var n=Ic(t);if(!n.properties.length&&!n.indexInfos.length){if(!n.callSignatures.length&&!n.constructSignatures.length)return r.approximateLength+=2,e.setEmitFlags(e.factory.createTypeLiteralNode(void 0),1);if(1===n.callSignatures.length&&!n.constructSignatures.length)return g(n.callSignatures[0],179,r);if(1===n.constructSignatures.length&&!n.callSignatures.length)return g(n.constructSignatures[0],180,r)}var i=e.filter(n.constructSignatures,(function(e){return!!(4&e.flags)}));if(e.some(i)){var a=e.map(i,Hl);return n.callSignatures.length+(n.constructSignatures.length-i.length)+n.indexInfos.length+(2048&r.flags?e.countWhere(n.properties,(function(e){return!(4194304&e.flags)})):e.length(n.properties))&&a.push(function(t){if(0===t.constructSignatures.length)return t;if(t.objectTypeWithoutAbstractConstructSignatures)return t.objectTypeWithoutAbstractConstructSignatures;var r=e.filter(t.constructSignatures,(function(e){return!(4&e.flags)}));if(t.constructSignatures===r)return t;var n=Na(t.symbol,t.members,t.callSignatures,e.some(r)?r:e.emptyArray,t.indexInfos);return t.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(n)),l(Td(a),r)}var o=r.flags;r.flags|=4194304;var c=function(t){if(s(r))return[e.factory.createPropertySignature(void 0,"...",void 0,void 0)];for(var n=[],i=0,a=t.callSignatures;i0){var h=(t.target.typeParameters||e.emptyArray).length;y=f(n.slice(S,h),r)}D=r.flags;r.flags|=16;var v=A(t.symbol,r,788968,y);return r.flags=D,c?G(c,v):v}if(n=e.sameMap(n,(function(e,r){return am(e,!!(2&t.target.elementFlags[r]))})),n.length>0){var b=_u(t),x=f(n.slice(0,b),r);if(x){if(t.target.labeledElementDeclarations)for(var S=0;S2)return[l(t[0],r),e.factory.createTypeReferenceNode("... ".concat(t.length-2," more ..."),void 0),l(t[t.length-1],r)]}for(var i=!(64&r.flags)?e.createUnderscoreEscapedMultiMap():void 0,a=[],o=0,c=0,u=t;c0)),a}function D(t,r){var n;return 524384&fC(t).flags&&(n=e.factory.createNodeArray(e.map(ps(t),(function(e){return h(e,r)})))),n}function C(t,r,n){var i;e.Debug.assert(t&&0<=r&&r1?N(l,l.length-1,1):void 0,_=i||C(l,0,r),p=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),f=e.getSourceFileOfModule(l[0]),m=void 0,g=void 0;if(e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.NodeNext||(null==f?void 0:f.impliedNodeFormat)===e.ModuleKind.ESNext&&f.impliedNodeFormat!==(null==p?void 0:p.impliedNodeFormat)&&(m=E(l[0],r,e.ModuleKind.ESNext),g=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral("import"))]))),null===(o=(a=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===o||o.call(a)),m||(m=E(l[0],r)),!(67108864&r.flags)&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Classic&&m.indexOf("/node_modules/")>=0){var y=m;if(e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.NodeNext){var h=(null==p?void 0:p.impliedNodeFormat)===e.ModuleKind.ESNext?e.ModuleKind.CommonJS:e.ModuleKind.ESNext;(m=E(l[0],r,h)).indexOf("/node_modules/")>=0?m=y:(g=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral(h===e.ModuleKind.ESNext?"import":"require"))]))),null===(c=(s=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===c||c.call(s))}g||(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(y))}var v=e.factory.createLiteralTypeNode(e.factory.createStringLiteral(m));if(r.tracker.trackExternalModuleSymbolOfImportTypeNode&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l[0]),r.approximateLength+=m.length+10,!d||e.isEntityName(d)){if(d)(k=e.isIdentifier(d)?d:d.right).typeArguments=void 0;return e.factory.createImportTypeNode(v,g,d,_,u)}var b=T(d),S=b.objectType.typeName;return e.factory.createIndexedAccessTypeNode(e.factory.createImportTypeNode(v,g,S,_,u),b.indexType)}var D=N(l,l.length-1,0);if(e.isIndexedAccessTypeNode(D))return D;if(u)return e.factory.createTypeQueryNode(D);var k,A=(k=e.isIdentifier(D)?D:D.right).typeArguments;return k.typeArguments=void 0,e.factory.createTypeReferenceNode(D,A);function N(t,n,a){var o,s=n===t.length-1?i:C(t,n,r),c=t[n],l=t[n-1];if(0===n)r.flags|=16777216,o=io(c,r),r.approximateLength+=(o?o.length:0)+1,r.flags^=16777216;else if(l&&oa(l)){var u=oa(l);e.forEachEntry(u,(function(t,r){if(ga(t,c)&&!Gs(r)&&"export="!==r)return o=e.unescapeLeadingUnderscores(r),!0}))}if(void 0===o){var d=e.firstDefined(c.declarations,e.getNameOfDeclaration);if(d&&e.isComputedPropertyName(d)&&e.isEntityName(d.expression)){var _=N(t,n-1,a);return e.isEntityName(_)?e.factory.createIndexedAccessTypeNode(e.factory.createParenthesizedType(e.factory.createTypeQueryNode(_)),e.factory.createTypeQueryNode(d.expression)):_}o=io(c,r)}if(r.approximateLength+=o.length+1,!(16&r.flags)&&l&&$s(l)&&$s(l).get(c.escapedName)&&ga($s(l).get(c.escapedName),c)){_=N(t,n-1,a);return e.isIndexedAccessTypeNode(_)?e.factory.createIndexedAccessTypeNode(_,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o))):e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(_,s),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o)))}var p=e.setEmitFlags(e.factory.createIdentifier(o,s),16777216);if(p.symbol=c,n>a){_=N(t,n-1,a);return e.isEntityName(_)?e.factory.createQualifiedName(_,p):e.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable")}return p}}function N(e,t,r){var n=li(t.enclosingDeclaration,e,788968,void 0,e,!1);return!!n&&!(262144&n.flags&&n===r.symbol)}function w(t,r){var n,i;if(4&r.flags&&r.typeParameterNames){var a=r.typeParameterNames.get(ud(t));if(a)return a}var o=F(t.symbol,r,788968,!0);if(!(79&o.kind))return e.factory.createIdentifier("(Missing type parameter)");if(4&r.flags){for(var s=o.escapedText,c=(null===(n=r.typeParameterNamesByTextNextNameCount)||void 0===n?void 0:n.get(s))||0,l=s;(null===(i=r.typeParameterNamesByText)||void 0===i?void 0:i.has(l))||N(l,r,t);)c++,l="".concat(s,"_").concat(c);l!==s&&(o=e.factory.createIdentifier(l,o.typeArguments)),(r.typeParameterNamesByTextNextNameCount||(r.typeParameterNamesByTextNextNameCount=new e.Map)).set(s,c),(r.typeParameterNames||(r.typeParameterNames=new e.Map)).set(ud(t),o),(r.typeParameterNamesByText||(r.typeParameterNamesByText=new e.Set)).add(s)}return o}function F(t,r,n,i){var a=x(t,r,n);return!i||1===a.length||r.encounteredError||65536&r.flags||(r.encounteredError=!0),function t(n,i){var a=C(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=io(o,r);0===i&&(r.flags^=16777216);var c=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return c.symbol=o,i>0?e.factory.createQualifiedName(t(n,i-1),c):c}(a,a.length-1)}function P(t,r,n){var i=x(t,r,n);return function t(n,i){var a=C(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=io(o,r);0===i&&(r.flags^=16777216);var c=s.charCodeAt(0);if(e.isSingleOrDoubleQuote(c)&&e.some(o.declarations,Va))return e.factory.createStringLiteral(E(o,r));var l=35===c?s.length>1&&e.isIdentifierStart(s.charCodeAt(1),G):e.isIdentifierStart(c,G);if(0===i||l){var u=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return u.symbol=o,i>0?e.factory.createPropertyAccessExpression(t(n,i-1),u):u}91===c&&(s=s.substring(1,s.length-1),c=s.charCodeAt(0));var d=void 0;return!e.isSingleOrDoubleQuote(c)||8&o.flags?""+ +s===s&&(d=e.factory.createNumericLiteral(+s)):d=e.factory.createStringLiteral(e.stripQuotes(s).replace(/\\./g,(function(e){return e.substring(1)})),39===c),d||((d=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216)).symbol=o),e.factory.createElementAccessExpression(t(n,i-1),d)}(i,i.length-1)}function I(t){var r=e.getNameOfDeclaration(t);return!!r&&e.isStringLiteral(r)}function L(t){var r=e.getNameOfDeclaration(t);return!!(r&&e.isStringLiteral(r)&&(r.singleQuote||!e.nodeIsSynthesized(r)&&e.startsWith(e.getTextOfNode(r,!1),"'")))}function R(t,r){var n=!!e.length(t.declarations)&&e.every(t.declarations,L),i=function(t,r,n){var i=ri(t).nameType;if(i){if(384&i.flags){var a=""+i.value;return e.isIdentifierText(a,e.getEmitScriptTarget(z))||e.isNumericLiteralName(a)?e.isNumericLiteralName(a)&&e.startsWith(a,"-")?e.factory.createComputedPropertyName(e.factory.createNumericLiteral(+a)):e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(z)):e.factory.createStringLiteral(a,!!n)}if(8192&i.flags)return e.factory.createComputedPropertyName(P(i.symbol,r,111551))}}(t,r,n);if(i)return i;var a=e.unescapeLeadingUnderscores(t.escapedName),o=!!e.length(t.declarations)&&e.every(t.declarations,I);return e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(z),n,o)}function B(t,r){return t.declarations&&e.find(t.declarations,(function(t){return!(!e.getEffectiveTypeAnnotationNode(t)||r&&!e.findAncestor(t,(function(e){return e===r})))}))}function J(t,r){return!(4&e.getObjectFlags(r))||!e.isTypeReferenceNode(t)||e.length(t.typeArguments)>=Al(r.target.typeParameters)}function j(t,r,n,i,a,o){if(!mo(r)&&i){var s=B(n,i);if(s&&!e.isFunctionLikeDeclaration(s)&&!e.isGetAccessorDeclaration(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(function(t,r,n){var i=J_(t);if(i===n)return!0;if(e.isParameter(r)&&r.questionToken)return Cg(n,524288)===i;return!1}(c,s,r)&&J(c,r)){var u=V(t,c,a,o);if(u)return u}}}var d=t.flags;8192&r.flags&&r.symbol===n&&(!t.enclosingDeclaration||e.some(n.declarations,(function(r){return e.getSourceFileOfNode(r)===e.getSourceFileOfNode(t.enclosingDeclaration)})))&&(t.flags|=1048576);var _=l(r,t);return t.flags=d,_}function U(t,r,n){var i,a,o=!1,s=e.getFirstIdentifier(t);if(e.isInJSFile(t)&&(e.isExportsIdentifier(s)||e.isModuleExportsAccessExpression(s.parent)||e.isQualifiedName(s.parent)&&e.isModuleIdentifier(s.parent.left)&&e.isExportsIdentifier(s.parent.right)))return{introducesError:o=!0,node:t};var c=Wi(s,67108863,!0,!0);if(c&&(0!==Ba(c,r.enclosingDeclaration,67108863,!1).accessibility?o=!0:(null===(a=null===(i=r.tracker)||void 0===i?void 0:i.trackSymbol)||void 0===a||a.call(i,c,r.enclosingDeclaration,67108863),null==n||n(c)),e.isIdentifier(t))){var l=Is(c),u=262144&c.flags&&!Oa(l.symbol,r.enclosingDeclaration)?w(l,r):e.factory.cloneNode(t);return u.symbol=c,{introducesError:o,node:e.setEmitFlags(e.setOriginalNode(u,t),16777216)}}return{introducesError:o,node:t}}function V(r,n,a,o){i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();var s=!1,c=e.getSourceFileOfNode(n),u=e.visitNode(n,(function n(i){if(e.isJSDocAllType(i)||319===i.kind)return e.factory.createKeywordTypeNode(130);if(e.isJSDocUnknownType(i))return e.factory.createKeywordTypeNode(155);if(e.isJSDocNullableType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,n),e.factory.createLiteralTypeNode(e.factory.createNull())]);if(e.isJSDocOptionalType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,n),e.factory.createKeywordTypeNode(153)]);if(e.isJSDocNonNullableType(i))return e.visitNode(i.type,n);if(e.isJSDocVariadicType(i))return e.factory.createArrayTypeNode(e.visitNode(i.type,n));if(e.isJSDocTypeLiteral(i))return e.factory.createTypeLiteralNode(e.map(i.jsDocPropertyTags,(function(t){var a=e.isIdentifier(t.name)?t.name:t.name.right,o=po(J_(i),a.escapedText),s=o&&t.typeExpression&&J_(t.typeExpression.type)!==o?l(o,r):void 0;return e.factory.createPropertySignature(void 0,a,t.isBracketed||t.typeExpression&&e.isJSDocOptionalType(t.typeExpression.type)?e.factory.createToken(57):void 0,s||t.typeExpression&&e.visitNode(t.typeExpression.type,n)||e.factory.createKeywordTypeNode(130))})));if(e.isTypeReferenceNode(i)&&e.isIdentifier(i.typeName)&&""===i.typeName.escapedText)return e.setOriginalNode(e.factory.createKeywordTypeNode(130),i);if((e.isExpressionWithTypeArguments(i)||e.isTypeReferenceNode(i))&&e.isJSDocIndexSignature(i))return e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,e.visitNode(i.typeArguments[0],n))],e.visitNode(i.typeArguments[1],n))]);if(e.isJSDocFunctionType(i)){var u;return e.isJSDocConstructSignature(i)?e.factory.createConstructorTypeNode(i.modifiers,e.visitNodes(i.typeParameters,n),e.mapDefined(i.parameters,(function(t,r){return t.name&&e.isIdentifier(t.name)&&"new"===t.name.escapedText?void(u=t.type):e.factory.createParameterDeclaration(void 0,void 0,m(t),g(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(u||i.type,n)||e.factory.createKeywordTypeNode(130)):e.factory.createFunctionTypeNode(e.visitNodes(i.typeParameters,n),e.map(i.parameters,(function(t,r){return e.factory.createParameterDeclaration(void 0,void 0,m(t),g(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(i.type,n)||e.factory.createKeywordTypeNode(130))}if(e.isTypeReferenceNode(i)&&e.isInJSDoc(i)&&(!J(i,J_(i))||Eu(i)||Pe===hu(i,788968,!0)))return e.setOriginalNode(l(J_(i),r),i);if(e.isLiteralImportTypeNode(i)){var d=ni(i).resolvedSymbol;return!e.isInJSDoc(i)||!d||(i.isTypeOf||788968&d.flags)&&e.length(i.typeArguments)>=Al(ps(d))?e.factory.updateImportTypeNode(i,e.factory.updateLiteralTypeNode(i.argument,function(n,i){if(o){if(r.tracker&&r.tracker.moduleResolverHost){var a=KT(n);if(a){var s={getCanonicalFileName:e.createGetCanonicalFileName(!!t.useCaseSensitiveFileNames),getCurrentDirectory:function(){return r.tracker.moduleResolverHost.getCurrentDirectory()},getCommonSourceDirectory:function(){return r.tracker.moduleResolverHost.getCommonSourceDirectory()}},c=e.getResolvedExternalModuleName(s,a);return e.factory.createStringLiteral(c)}}}else if(r.tracker&&r.tracker.trackExternalModuleSymbolOfImportTypeNode){var l=Xi(i,i,void 0);l&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l)}return i}(i,i.argument.literal)),i.qualifier,e.visitNodes(i.typeArguments,n,e.isTypeNode),i.isTypeOf):e.setOriginalNode(l(J_(i),r),i)}if(e.isEntityName(i)||e.isEntityNameExpression(i)){var _=U(i,r,a),p=_.introducesError,f=_.node;if(s=s||p,f!==i)return f}c&&e.isTupleTypeNode(i)&&e.getLineAndCharacterOfPosition(c,i.pos).line===e.getLineAndCharacterOfPosition(c,i.end).line&&e.setEmitFlags(i,1);return e.visitEachChild(i,n,e.nullTransformationContext);function m(t){return t.dotDotDotToken||(t.type&&e.isJSDocVariadicType(t.type)?e.factory.createToken(25):void 0)}function g(t,r){return t.name&&e.isIdentifier(t.name)&&"this"===t.name.escapedText?"this":m(t)?"args":"arg".concat(r)}}));if(!s)return u===n?e.setTextRange(e.factory.cloneNode(n),n):u}}(),ce=e.createSymbolTable(),le=Wn(4,"undefined");le.declarations=[];var ue=Wn(1536,"globalThis",8);ue.exports=ce,ue.declarations=[],ce.set(ue.escapedName,ue);var de,_e=Wn(4,"arguments"),pe=Wn(4,"require"),fe={getNodeCount:function(){return e.sum(t.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(t.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(t.getSourceFiles(),"symbolCount")+x},getTypeCount:function(){return b},getInstantiationCount:function(){return T},getRelationCacheSizes:function(){return{assignable:Nn.size,identity:Fn.size,subtype:kn.size,strictSubtype:An.size}},isUndefinedSymbol:function(e){return e===le},isArgumentsSymbol:function(e){return e===_e},isUnknownSymbol:function(e){return e===Pe},getMergedSymbol:ua,getDiagnostics:qC,getGlobalDiagnostics:function(){return WC(),Dn.getGlobalDiagnostics()},getRecursionIdentity:hf,getUnmatchedProperties:Bm,getTypeOfSymbolAtLocation:function(t,r){var n=e.getParseTreeNode(r);return n?function(t,r){if(t=t.exportSymbol||t,(79===r.kind||80===r.kind)&&(e.isRightSideOfQualifiedNameOrPropertyAccess(r)&&(r=r.parent),e.isExpressionNode(r)&&(!e.isAssignmentTarget(r)||e.isWriteAccess(r)))){var n=aS(r);if(ya(ni(r).resolvedSymbol)===t)return n}if(e.isDeclarationName(r)&&e.isSetAccessor(r.parent)&&Ho(r.parent))return $o(r.parent.symbol);return os(t)}(t,n):Je},getTypeOfSymbol:as,getSymbolsOfParameterPropertyDeclaration:function(t,r){var n=e.getParseTreeNode(t,e.isParameter);return void 0===n?e.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):function(t,r){var n=t.parent,i=t.parent.parent,a=ai(n.locals,r,111551),o=ai($s(i.symbol),r,111551);if(a&&o)return[a,o];return e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,e.escapeLeadingUnderscores(r))},getDeclaredTypeOfSymbol:Is,getPropertiesOfType:Rc,getPropertyOfType:function(t,r){return cl(t,e.escapeLeadingUnderscores(r))},getPrivateIdentifierPropertyOfType:function(t,r,n){var i=e.getParseTreeNode(n);if(i){var a=sv(e.escapeLeadingUnderscores(r),i);return a?uv(t,a):void 0}},getTypeOfPropertyOfType:function(t,r){return po(t,e.escapeLeadingUnderscores(r))},getIndexInfoOfType:function(e,t){return gl(e,0===t?$e:Ye)},getIndexInfosOfType:ml,getSignaturesOfType:ul,getIndexTypeOfType:function(e,t){return yl(e,0===t?$e:Ye)},getIndexType:function(e){return Md(e)},getBaseTypes:xs,getBaseTypeOfLiteralType:Rf,getWidenedType:gm,getTypeFromTypeNode:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r?J_(r):Je},getParameterType:Qb,getParameterIdentifierNameAtPosition:function(e,t){var r;if(317===(null===(r=e.declaration)||void 0===r?void 0:r.kind))return;var n=e.parameters.length-(j(e)?1:0);if(t>",0,Le),Ir=tc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),Or=tc(void 0,void 0,void 0,e.emptyArray,Je,void 0,0,0),Mr=tc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),Lr=tc(void 0,void 0,void 0,e.emptyArray,ct,void 0,0,0),Rr=$l(Ye,$e,!0),Br=new e.Map,Jr={get yieldType(){return e.Debug.fail("Not supported")},get returnType(){return e.Debug.fail("Not supported")},get nextType(){return e.Debug.fail("Not supported")}},jr=FD(Le,Le,Le),Ur=FD(Le,Le,Ke),Vr=FD(st,Le,Ge),Kr={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return fr||(fr=Mu("AsyncIterator",3,e))||kt},getGlobalIterableType:function(e){return pr||(pr=Mu("AsyncIterable",1,e))||kt},getGlobalIterableIteratorType:function(e){return mr||(mr=Mu("AsyncIterableIterator",1,e))||kt},getGlobalGeneratorType:function(e){return gr||(gr=Mu("AsyncGenerator",3,e))||kt},resolveIterationType:RS,mustHaveANextMethodDiagnostic:e.Diagnostics.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},zr={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return cr||(cr=Mu("Iterator",3,e))||kt},getGlobalIterableType:zu,getGlobalIterableIteratorType:function(e){return lr||(lr=Mu("IterableIterator",1,e))||kt},getGlobalGeneratorType:function(e){return ur||(ur=Mu("Generator",3,e))||kt},resolveIterationType:function(e,t){return e},mustHaveANextMethodDiagnostic:e.Diagnostics.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Gr=new e.Map,qr=!1,Wr=new e.Map,Hr=0,Qr=0,Xr=0,$r=!1,Yr=0,Zr=F_(""),en=P_(0),tn=I_({negative:!1,base10Value:"0"}),rn=[],nn=[],an=[],on=0,sn=[],cn=[],ln=[],un=[],dn=[],_n=[],pn=[],fn=[],mn=[],gn=[],yn=[],hn=[],vn=[],bn=[],xn=[],Sn=[],Dn=e.createDiagnosticCollection(),Cn=e.createDiagnosticCollection(),Tn=new e.Map(e.getEntries({string:$e,number:Ye,bigint:Ze,boolean:it,symbol:at,undefined:Ge})),En=yd(e.arrayFrom(D.keys(),F_)),kn=new e.Map,An=new e.Map,Nn=new e.Map,wn=new e.Map,Fn=new e.Map,Pn=new e.Map,In=e.createSymbolTable();In.set(le.escapedName,le);var On=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===z.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(var r=0,n=t.getSourceFiles();r=5||e.some(o.relatedInformation,(function(t){return 0===e.compareDiagnostics(t,s)||0===e.compareDiagnostics(t,i)})))return"continue";e.addRelatedInfo(o,e.length(o.relatedInformation)?s:i)},c=0,l=i||e.emptyArray;c1)}function ri(e){if(33554432&e.flags)return e;var t=M(e);return cn[t]||(cn[t]=new P)}function ni(e){var t=O(e);return ln[t]||(ln[t]=new I)}function ii(t){return 305===t.kind&&!e.isExternalOrCommonJsModule(t)}function ai(t,r,n){if(n){var i=ua(t.get(r));if(i){if(e.Debug.assert(0==(1&e.getCheckFlags(i)),"Should never get an instantiated symbol here."),i.flags&n)return i;if(2097152&i.flags){var a=Ji(i);if(a===Pe||a.flags&n)return i}}}}function oi(r,n){var i=e.getSourceFileOfNode(r),a=e.getSourceFileOfNode(n),o=e.getEnclosingBlockScopeContainer(r);if(i!==a){if(q&&(i.externalModuleIndicator||a.externalModuleIndicator)||!e.outFile(z)||og(n)||16777216&r.flags)return!0;if(l(n,r))return!0;var s=t.getSourceFiles();return s.indexOf(i)<=s.indexOf(a)}if(r.pos<=n.pos&&(!e.isPropertyDeclaration(r)||!e.isThisProperty(n.parent)||r.initializer||r.exclamationToken)){if(203===r.kind){var c=e.getAncestor(n,203);return c?e.findAncestor(c,e.isBindingElement)!==e.findAncestor(r,e.isBindingElement)||r.pos=i&&c.pos<=a){var l=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);if(e.setParent(l.expression,l),e.setParent(l,c),l.flowNode=c.returnFlowNode,!(32768&Qf(my(l,r,Zf(r)))))return!0}}return!1}(a,as(da(r)),e.filter(r.parent.members,e.isClassStaticBlockDeclaration),r.parent.pos,n.pos))return!0}}else{if(!(167===r.kind&&!e.isStatic(r))||e.getContainingClass(t)!==e.getContainingClass(r))return!0}return!1}))}function u(t,r,n){if(r.end>t.end)return!1;var i=e.findAncestor(r,(function(r){if(r===t)return"quit";switch(r.kind){case 214:return!0;case 167:return!n||!(e.isPropertyDeclaration(t)&&r.parent===t.parent||e.isParameterPropertyDeclaration(t,t.parent)&&r.parent===t.parent.parent)||"quit";case 235:switch(r.parent.kind){case 172:case 169:case 173:return!0;default:return!1}default:return!1}}));return void 0===i}}function si(t,r,n){var i=e.getEmitScriptTarget(z),a=r;if(e.isParameter(n)&&a.body&&t.valueDeclaration&&t.valueDeclaration.pos>=a.body.pos&&t.valueDeclaration.end<=a.body.end&&i>=2){var o=ni(a);return void 0===o.declarationRequiresScopeChange&&(o.declarationRequiresScopeChange=e.forEach(a.parameters,(function(e){return s(e.name)||!!e.initializer&&s(e.initializer)}))||!1),!o.declarationRequiresScopeChange}return!1;function s(t){switch(t.kind){case 214:case 213:case 256:case 171:return!1;case 169:case 172:case 173:case 296:return s(t.name);case 167:return e.hasStaticModifier(t)?i<99||!W:s(t.name);default:return e.isNullishCoalesce(t)||e.isOptionalChain(t)?i<7:e.isBindingElement(t)&&t.dotDotDotToken&&e.isObjectBindingPattern(t.parent)?i<4:!e.isTypeNode(t)&&(e.forEachChild(t,s)||!1)}}}function ci(t){return e.isAssertionExpression(t)&&e.isConstTypeReference(t.type)||e.isJSDocTypeTag(t)&&e.isConstTypeReference(t.typeExpression)}function li(e,t,r,n,i,a,o,s){return void 0===o&&(o=!1),void 0===s&&(s=!0),ui(e,t,r,n,i,a,o,s,ai)}function ui(t,r,n,i,a,o,s,c,l){var u,d,_,p,f,m,y,h,v,b=t,x=!1,S=t,D=!1;e:for(;t;){if("const"===r&&ci(t))return;if(t.locals&&!ii(t)&&(p=l(t.locals,r,n))){var C=!0;if(e.isFunctionLike(t)&&f&&f!==t.body?(n&p.flags&788968&&320!==f.kind&&(C=!!(262144&p.flags)&&(f===t.type||164===f.kind||340===f.kind||341===f.kind||163===f.kind)),n&p.flags&3&&(si(p,t,f)?C=!1:1&p.flags&&(C=164===f.kind||f===t.type&&!!e.findAncestor(p.valueDeclaration,e.isParameter)))):189===t.kind&&(C=f===t.trueType),C)break e;p=void 0}switch(x=x||_i(t,f),t.kind){case 305:if(!e.isExternalOrCommonJsModule(t))break;D=!0;case 261:var T=(null===(u=da(t))||void 0===u?void 0:u.exports)||V;if(305===t.kind||e.isModuleDeclaration(t)&&16777216&t.flags&&!e.isGlobalScopeAugmentation(t)){if(p=T.get("default")){var E=e.getLocalSymbolForExportDefault(p);if(E&&p.flags&n&&E.escapedName===r)break e;p=void 0}var k=T.get(r);if(k&&2097152===k.flags&&(e.getDeclarationOfKind(k,275)||e.getDeclarationOfKind(k,274)))break}if("default"!==r&&(p=l(T,r,2623475&n))){if(!e.isSourceFile(t)||!t.commonJsModuleIndicator||(null===(d=p.declarations)||void 0===d?void 0:d.some(e.isJSDocTypeAlias)))break e;p=void 0}break;case 260:if(p=l((null===(_=da(t))||void 0===_?void 0:_.exports)||V,r,8&n))break e;break;case 167:if(!e.isStatic(t)){var A=va(t.parent);A&&A.locals&&l(A.locals,r,111551&n)&&(y=t)}break;case 257:case 226:case 258:if(p=l(da(t).members||V,r,788968&n)){if(!mi(p,t)){p=void 0;break}if(f&&e.isStatic(f))return void jn(S,e.Diagnostics.Static_members_cannot_reference_class_type_parameters);break e}if(226===t.kind&&32&n){var N=t.name;if(N&&r===N.escapedText){p=t.symbol;break e}}break;case 228:if(f===t.expression&&94===t.parent.token){var w=t.parent.parent;if(e.isClassLike(w)&&(p=l(da(w).members,r,788968&n)))return void(i&&jn(S,e.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters))}break;case 162:if(v=t.parent.parent,(e.isClassLike(v)||258===v.kind)&&(p=l(da(v).members,r,788968&n)))return void jn(S,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);break;case 214:if(e.getEmitScriptTarget(z)>=2)break;case 169:case 171:case 172:case 173:case 256:if(3&n&&"arguments"===r){p=_e;break e}break;case 213:if(3&n&&"arguments"===r){p=_e;break e}if(16&n){var F=t.name;if(F&&r===F.escapedText){p=t.symbol;break e}}break;case 165:t.parent&&164===t.parent.kind&&(t=t.parent),t.parent&&(e.isClassElement(t.parent)||257===t.parent.kind)&&(t=t.parent);break;case 345:case 338:case 339:var P=e.getJSDocRoot(t);P&&(t=P.parent);break;case 164:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&(h||(h=t));break;case 203:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&e.isParameterDeclaration(t)&&!h&&(h=t);break;case 190:if(262144&n){var I=t.typeParameter.name;if(I&&r===I.escapedText){p=t.typeParameter.symbol;break e}}}pi(t)&&(m=t),f=t,t=e.isJSDocTemplateTag(t)?e.getEffectiveContainerForJSDocTemplateTag(t)||t.parent:(e.isJSDocParameterTag(t)||e.isJSDocReturnTag(t))&&e.getHostSignatureFromJSDoc(t)||t.parent}if(!o||!p||m&&p===m.symbol||(p.isReferenced|=n),!p){if(f&&(e.Debug.assert(305===f.kind),f.commonJsModuleIndicator&&"exports"===r&&n&f.symbol.flags))return f.symbol;s||(p=l(ce,r,n))}if(!p&&b&&e.isInJSFile(b)&&b.parent&&e.isRequireCall(b.parent,!1))return pe;if(p){if(!y||99===e.getEmitScriptTarget(z)&&W)return i&&g((function(){if(S&&(2&n||(32&n||384&n)&&111551==(111551&n))){var t=ya(p);(2&t.flags||32&t.flags||384&t.flags)&&function(t,r){var n;if(e.Debug.assert(!!(2&t.flags||32&t.flags||384&t.flags)),67108881&t.flags&&32&t.flags)return;var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isBlockOrCatchScoped(t)||e.isClassLike(t)||260===t.kind}));if(void 0===i)return e.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(16777216&i.flags||oi(i,r))){var a=void 0,o=e.declarationNameToString(e.getNameOfDeclaration(i));2&t.flags?a=jn(r,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,o):32&t.flags?a=jn(r,e.Diagnostics.Class_0_used_before_its_declaration,o):256&t.flags?a=jn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o):(e.Debug.assert(!!(128&t.flags)),e.shouldPreserveConstEnums(z)&&(a=jn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o))),a&&e.addRelatedInfo(a,e.createDiagnosticForNode(i,e.Diagnostics._0_is_declared_here,o))}}(t,S)}if(p&&D&&111551==(111551&n)&&!(8388608&b.flags)){var i=ua(p);e.length(i.declarations)&&e.every(i.declarations,(function(t){return e.isNamespaceExportDeclaration(t)||e.isSourceFile(t)&&!!t.symbol.globalExports}))&&Vn(!z.allowUmdGlobalAccess,S,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,e.unescapeLeadingUnderscores(r))}if(p&&h&&!x&&111551==(111551&n)){var a=ua(Ys(p)),o=e.getRootDeclaration(h);a===da(h)?jn(S,e.Diagnostics.Parameter_0_cannot_reference_itself,e.declarationNameToString(h.name)):a.valueDeclaration&&a.valueDeclaration.pos>h.pos&&o.parent.locals&&l(o.parent.locals,a.escapedName,n)===a&&jn(S,e.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it,e.declarationNameToString(h.name),e.declarationNameToString(S))}if(p&&S&&111551&n&&2097152&p.flags&&!(111551&p.flags)&&!e.isValidTypeOnlyAliasUseSite(S)){var s=Vi(p);if(s){var c=275===s.kind?e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,u=e.unescapeLeadingUnderscores(r);di(jn(S,c,u),s,u)}}})),p;var O=y.name;jn(S,e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(O),fi(a))}else i&&g((function(){if(!(S&&(function(t,r,n){if(!e.isIdentifier(t)||t.escapedText!==r||XC(t)||og(t))return!1;var i=e.getThisContainer(t,!1),a=i;for(;a;){if(e.isClassLike(a.parent)){var o=da(a.parent);if(!o)break;if(cl(as(o),r))return jn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,fi(n),Ga(o)),!0;if(a===i&&!e.isStatic(a))if(cl(Is(o).thisType,r))return jn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,fi(n)),!0}a=a.parent}return!1}(S,r,a)||gi(S)||function(t,r,n){var i=1920|(e.isInJSFile(t)?111551:0);if(n===i){var a=Bi(li(t,r,788968&~i,void 0,void 0,!1)),o=t.parent;if(a){if(e.isQualifiedName(o)){e.Debug.assert(o.left===t,"Should only be resolving left side of qualified name as a namespace");var s=o.right.escapedText;if(cl(Is(a),s))return jn(o,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,e.unescapeLeadingUnderscores(r),e.unescapeLeadingUnderscores(s)),!0}return jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,e.unescapeLeadingUnderscores(r)),!0}}return!1}(S,r,n)||function(t,r){if(hi(r)&&275===t.parent.kind)return jn(t,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,r),!0;return!1}(S,r)||function(t,r,n){if(111551&n){if(hi(r))return jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,e.unescapeLeadingUnderscores(r)),!0;var i=Bi(li(t,r,788544,void 0,void 0,!1));if(i&&!(1024&i.flags)){var a=e.unescapeLeadingUnderscores(r);return!function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return!0}return!1}(r)?!function(t,r){var n=e.findAncestor(t.parent,(function(t){return!e.isComputedPropertyName(t)&&!e.isPropertySignature(t)&&(e.isTypeLiteralNode(t)||"quit")}));if(n&&1===n.members.length){var i=Is(r);return!!(1048576&i.flags)&&Fx(i,384,!0)}return!1}(t,i)?jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,a):jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,a,"K"===a?"P":"K"):jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,a),!0}}return!1}(S,r,n)||function(t,r,n){if(111127&n){if(Bi(li(t,r,1024,void 0,void 0,!1)))return jn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_value,e.unescapeLeadingUnderscores(r)),!0}else if(788544&n){if(Bi(li(t,r,1536,void 0,void 0,!1)))return jn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_type,e.unescapeLeadingUnderscores(r)),!0}return!1}(S,r,n)||function(t,r,n){if(788584&n){var i=Bi(li(t,r,111127,void 0,void 0,!1));if(i&&!(1920&i.flags))return jn(t,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.unescapeLeadingUnderscores(r)),!0}return!1}(S,r,n)))){var t=void 0;if(c&&on<10)if((null==(t=Dv(b,r,n))?void 0:t.valueDeclaration)&&e.isAmbientModule(t.valueDeclaration)&&e.isGlobalScopeAugmentation(t.valueDeclaration)&&(t=void 0),t){var o=Ga(t),s=pv(b,t,!1),l=1920===n||a&&"string"!=typeof a&&e.nodeIsSynthesized(a)?e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1:s?e.Diagnostics.Could_not_find_name_0_Did_you_mean_1:e.Diagnostics.Cannot_find_name_0_Did_you_mean_1,u=Jn(S,l,fi(a),o);Un(!s,u),t.valueDeclaration&&e.addRelatedInfo(u,e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_is_declared_here,o))}if(!t&&a){var d=function(t){for(var r=fi(t),n=e.getScriptTargetFeatures(),i=e.getOwnKeys(n),a=0,o=i;a=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop",d=i.exports.get("export=").valueDeclaration,_=jn(t.name,e.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag,Ga(i),u);d&&e.addRelatedInfo(_,e.createDiagnosticForNode(d,e.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,u))}else!function(t,r){var n,i,a;if(null===(n=t.exports)||void 0===n?void 0:n.has(r.symbol.escapedName))jn(r.name,e.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,Ga(t),Ga(r.symbol));else{var o=jn(r.name,e.Diagnostics.Module_0_has_no_default_export,Ga(t)),s=null===(i=t.exports)||void 0===i?void 0:i.get("__export");if(s){var c=null===(a=s.declarations)||void 0===a?void 0:a.find((function(t){var r,n;return!!(e.isExportDeclaration(t)&&t.moduleSpecifier&&(null===(n=null===(r=Qi(t,t.moduleSpecifier))||void 0===r?void 0:r.exports)||void 0===n?void 0:n.has("default")))}));c&&e.addRelatedInfo(o,e.createDiagnosticForNode(c,e.Diagnostics.export_Asterisk_does_not_re_export_a_default))}}}(i,t);return ji(t,a,void 0,!1),a}}function Pi(t,n,i){var a,o;void 0===i&&(i=!1);var s=e.getExternalModuleRequireArgument(t)||t.moduleSpecifier,c=Qi(t,s),l=!e.isPropertyAccessExpression(n)&&n.propertyName||n.name;if(e.isIdentifier(l)){var u=ea(c,s,!1,"default"===l.escapedText&&!(!z.allowSyntheticDefaultImports&&!e.getESModuleInterop(z)));if(u&&l.escapedText){if(e.isShorthandAmbientModuleSymbol(c))return c;var d=void 0;d=c&&c.exports&&c.exports.get("export=")?cl(as(u),l.escapedText,!0):function(e,t){if(3&e.flags){var r=e.valueDeclaration.type;if(r)return Bi(cl(J_(r),t))}}(u,l.escapedText),d=Bi(d,i);var _=function(e,t,r,n){if(1536&e.flags){var i=oa(e).get(t.escapedText),a=Bi(i,n);return ji(r,i,a,!1),a}}(u,l,n,i);if(void 0===_&&"default"===l.escapedText){var p=null===(a=c.declarations)||void 0===a?void 0:a.find(e.isSourceFile);(Ni(s)||wi(p,c,i,s))&&(_=Zi(c,i)||Bi(c,i))}var f=_&&d&&_!==d?function(t,r){if(t===Pe&&r===Pe)return Pe;if(790504&t.flags)return t;var n=Wn(t.flags|r.flags,t.escapedName);return n.declarations=e.deduplicate(e.concatenate(t.declarations,r.declarations),e.equateValues),n.parent=t.parent||r.parent,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),r.members&&(n.members=new e.Map(r.members)),t.exports&&(n.exports=new e.Map(t.exports)),n}(d,_):_||d;if(!f){var m=qi(c,t),g=e.declarationNameToString(l),y=Cv(l,u);if(void 0!==y){var h=Ga(y),v=jn(l,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,m,g,h);y.valueDeclaration&&e.addRelatedInfo(v,e.createDiagnosticForNode(y.valueDeclaration,e.Diagnostics._0_is_declared_here,h))}else(null===(o=c.exports)||void 0===o?void 0:o.has("default"))?jn(l,e.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,m,g):function(t,n,i,a,o){var s,c,l=null===(c=null===(s=a.valueDeclaration)||void 0===s?void 0:s.locals)||void 0===c?void 0:c.get(n.escapedText),u=a.exports;if(l){var d=null==u?void 0:u.get("export=");if(d)ga(d,l)?function(t,r,n,i){if(q>=e.ModuleKind.ES2015){jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n)}else{if(e.isInJSFile(t))jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n);else jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,i)}}(t,n,i,o):jn(n,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);else{var _=u?e.find(Sl(u),(function(e){return!!ga(e,l)})):void 0,p=_?jn(n,e.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2,o,i,Ga(_)):jn(n,e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported,o,i);l.declarations&&e.addRelatedInfo.apply(void 0,r([p],e.map(l.declarations,(function(t,r){return e.createDiagnosticForNode(t,0===r?e.Diagnostics._0_is_declared_here:e.Diagnostics.and_here,i)})),!1))}}else jn(n,e.Diagnostics.Module_0_has_no_exported_member_1,o,i)}(t,l,g,c,m)}return f}}}function Ii(t){if(e.isVariableDeclaration(t)&&t.initializer&&e.isPropertyAccessExpression(t.initializer))return t.initializer}function Oi(e,t,r){var n=e.parent.parent.moduleSpecifier?Pi(e.parent.parent,e,r):Wi(e.propertyName||e.name,t,!1,r);return ji(e,void 0,n,!1),n}function Mi(t,r){if(e.isClassExpression(t))return zx(t).symbol;if(e.isEntityName(t)||e.isEntityNameExpression(t)){var n=Wi(t,901119,!0,r);return n||(zx(t),ni(t).resolvedSymbol)}}function Li(t,r){switch(void 0===r&&(r=!1),t.kind){case 265:case 254:return Ci(t,r);case 267:return Fi(t,r);case 268:return function(e,t){var r=e.parent.parent.moduleSpecifier,n=Qi(e,r),i=ea(n,r,t,!1);return ji(e,n,i,!1),i}(t,r);case 274:return function(e,t){var r=e.parent.moduleSpecifier,n=r&&Qi(e,r),i=r&&ea(n,r,t,!1);return ji(e,n,i,!1),i}(t,r);case 270:case 203:return function(t,r){var n=e.isBindingElement(t)?e.getRootDeclaration(t):t.parent.parent.parent,i=Ii(n),a=Pi(n,i||t,r),o=t.propertyName||t.name;return i&&a&&e.isIdentifier(o)?Bi(cl(as(a),o.escapedText),r):(ji(t,void 0,a,!1),a)}(t,r);case 275:return Oi(t,901119,r);case 271:case 221:return function(t,r){var n=Mi(e.isExportAssignment(t)?t.expression:t.right,r);return ji(t,void 0,n,!1),n}(t,r);case 264:return function(e,t){var r=Zi(e.parent.symbol,t);return ji(e,void 0,r,!1),r}(t,r);case 297:return Wi(t.name,901119,!0,r);case 296:return function(e,t){return Mi(e.initializer,t)}(t,r);case 207:case 206:return function(t,r){if(e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind)return Mi(t.parent.right,r)}(t,r);default:return e.Debug.fail()}}function Ri(e,t){return void 0===t&&(t=901119),!!e&&(2097152==(e.flags&(2097152|t))||!!(2097152&e.flags&&67108864&e.flags))}function Bi(e,t){return!t&&Ri(e)?Ji(e):e}function Ji(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=ri(t);if(r.aliasTarget)r.aliasTarget===Ie&&(r.aliasTarget=Pe);else{r.aliasTarget=Ie;var n=xi(t);if(!n)return e.Debug.fail();var i=Li(n);r.aliasTarget===Ie?r.aliasTarget=i||Pe:jn(n,e.Diagnostics.Circular_definition_of_import_alias_0,Ga(t))}return r.aliasTarget}function ji(t,r,n,i){if(!t||e.isPropertyAccessExpression(t))return!1;var a=da(t);if(e.isTypeOnlyImportOrExportDeclaration(t))return ri(a).typeOnlyDeclaration=t,!0;var o=ri(a);return Ui(o,r,i)||Ui(o,n,i)}function Ui(t,r,n){var i,a,o;if(r&&(void 0===t.typeOnlyDeclaration||n&&!1===t.typeOnlyDeclaration)){var s=null!==(a=null===(i=r.exports)||void 0===i?void 0:i.get("export="))&&void 0!==a?a:r,c=s.declarations&&e.find(s.declarations,e.isTypeOnlyImportOrExportDeclaration);t.typeOnlyDeclaration=null!==(o=null!=c?c:ri(s).typeOnlyDeclaration)&&void 0!==o&&o}return!!t.typeOnlyDeclaration}function Vi(e){if(2097152&e.flags)return ri(e).typeOnlyDeclaration||void 0}function Ki(e){var t=da(e),r=Ji(t);r&&((r===Pe||111551&r.flags&&!bT(r)&&!Vi(t))&&zi(t))}function zi(t){var r=ri(t);if(!r.referenced){r.referenced=!0;var n=xi(t);if(!n)return e.Debug.fail();if(e.isInternalModuleImportEqualsDeclaration(n)){var i=Bi(t);(i===Pe||111551&i.flags)&&zx(n.moduleReference)}}}function Gi(t,r){return 79===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),79===t.kind||161===t.parent.kind?Wi(t,1920,!1,r):(e.Debug.assert(265===t.parent.kind),Wi(t,901119,!1,r))}function qi(e,t){return e.parent?qi(e.parent,t)+"."+Ga(e):Ga(e,t,void 0,20)}function Wi(t,r,n,i,a){if(!e.nodeIsMissing(t)){var o,s=1920|(e.isInJSFile(t)?111551&r:0);if(79===t.kind){var c=r===s||e.nodeIsSynthesized(t)?e.Diagnostics.Cannot_find_namespace_0:ig(e.getFirstIdentifier(t)),l=e.isInJSFile(t)&&!e.nodeIsSynthesized(t)?function(t,r){if(Cu(t.parent)){var n=function(t){var r=e.findAncestor(t,(function(t){return e.isJSDocNode(t)||8388608&t.flags?e.isJSDocTypeAlias(t):"quit"}));if(r)return;var n=e.getJSDocHost(t);if(n&&e.isExpressionStatement(n)&&e.isPrototypePropertyAssignment(n.expression)){if(a=da(n.expression.left))return Hi(a)}if(n&&e.isFunctionExpression(n)&&e.isPrototypePropertyAssignment(n.parent)&&e.isExpressionStatement(n.parent.parent)){if(a=da(n.parent.left))return Hi(a)}if(n&&(e.isObjectLiteralMethod(n)||e.isPropertyAssignment(n))&&e.isBinaryExpression(n.parent.parent)&&6===e.getAssignmentDeclarationKind(n.parent.parent)){if(a=da(n.parent.parent.left))return Hi(a)}var i=e.getEffectiveJSDocHost(t);if(i&&e.isFunctionLike(i)){var a;return(a=da(i))&&a.valueDeclaration}}(t.parent);if(n)return li(n,t.escapedText,r,void 0,t,!0)}}(t,r):void 0;if(!(o=ua(li(a||t,t.escapedText,r,n||l?void 0:c,t,!0,!1))))return ua(l)}else{if(161!==t.kind&&206!==t.kind)throw e.Debug.assertNever(t,"Unknown entity name kind.");var u=161===t.kind?t.left:t.expression,d=161===t.kind?t.right:t.name,_=Wi(u,s,n,!1,a);if(!_||e.nodeIsMissing(d))return;if(_===Pe)return _;if(_.valueDeclaration&&e.isInJSFile(_.valueDeclaration)&&e.isVariableDeclaration(_.valueDeclaration)&&_.valueDeclaration.initializer&&Ob(_.valueDeclaration.initializer)){var p=_.valueDeclaration.initializer.arguments[0],f=Qi(p,p);if(f){var m=Zi(f);m&&(_=m)}}if(!(o=ua(ai(oa(_),d.escapedText,r)))){if(!n){var g=qi(_),y=e.declarationNameToString(d),h=Cv(d,_);if(h)return void jn(d,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,g,y,Ga(h));var v=e.isQualifiedName(t)&&function(t){for(;e.isQualifiedName(t.parent);)t=t.parent;return t}(t),b=Bt&&788968&r&&v&&!e.isTypeOfExpression(v.parent)&&function(t){var r=e.getFirstIdentifier(t),n=li(r,r.escapedText,111551,void 0,r,!0);if(n){for(;e.isQualifiedName(r.parent);){if(!(n=cl(as(n),r.parent.right.escapedText)))return;r=r.parent}return n}}(v);if(b)return void jn(v,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.entityNameToString(v));if(1920&r&&e.isQualifiedName(t.parent)){var x=ua(ai(oa(_),d.escapedText,788968));if(x)return void jn(t.parent.right,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,Ga(x),e.unescapeLeadingUnderscores(t.parent.right.escapedText))}jn(d,e.Diagnostics.Namespace_0_has_no_exported_member_1,g,y)}return}}return e.Debug.assert(0==(1&e.getCheckFlags(o)),"Should never get an instantiated symbol here."),!e.nodeIsSynthesized(t)&&e.isEntityName(t)&&(2097152&o.flags||271===t.parent.kind)&&ji(e.getAliasDeclarationFromName(t),o,void 0,!0),o.flags&r||i?o:Ji(o)}}function Hi(t){var r=t.parent.valueDeclaration;if(r)return(e.isAssignmentDeclaration(r)?e.getAssignedExpandoInitializer(r):e.hasOnlyExpressionInitializer(r)?e.getDeclaredExpandoInitializer(r):void 0)||r}function Qi(t,r,n){var i=e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;return Xi(t,r,n?void 0:i)}function Xi(t,r,n,i){return void 0===i&&(i=!1),e.isStringLiteralLike(r)?$i(t,r.text,n,r,i):void 0}function $i(r,n,i,a,o){var s,c,l,u,d,_,p,f;(void 0===o&&(o=!1),e.startsWith(n,"@types/"))&&jn(a,P=e.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,e.removePrefix(n,"@types/"),n);var m=Cl(n,!0);if(m)return m;var g=e.getSourceFileOfNode(r),y=e.isStringLiteralLike(r)?r:(null===(s=e.findAncestor(r,e.isImportCall))||void 0===s?void 0:s.arguments[0])||(null===(c=e.findAncestor(r,e.isImportDeclaration))||void 0===c?void 0:c.moduleSpecifier)||(null===(l=e.findAncestor(r,e.isExternalModuleImportEqualsDeclaration))||void 0===l?void 0:l.moduleReference.expression)||(null===(u=e.findAncestor(r,e.isExportDeclaration))||void 0===u?void 0:u.moduleSpecifier)||(null===(d=e.isModuleDeclaration(r)?r:r.parent&&e.isModuleDeclaration(r.parent)&&r.parent.name===r?r.parent:void 0)||void 0===d?void 0:d.name)||(null===(_=e.isLiteralImportTypeNode(r)?r:void 0)||void 0===_?void 0:_.argument.literal),h=y&&e.isStringLiteralLike(y)?e.getModeForUsageLocation(g,y):g.impliedNodeFormat,v=e.getResolvedModule(g,n,h),b=v&&e.getResolutionDiagnostic(z,v),x=v&&(!b||b===e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&t.getSourceFile(v.resolvedFileName);if(x){if(b&&jn(a,b,n,v.resolvedFileName),x.symbol){if(v.isExternalLibraryImport&&!e.resolutionExtensionIsTSOrJson(v.extension)&&Yi(!1,a,v,n),e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.NodeNext){var S=g.impliedNodeFormat===e.ModuleKind.CommonJS&&!e.findAncestor(r,e.isImportCall)||!!e.findAncestor(r,e.isImportEqualsDeclaration),D=e.findAncestor(r,(function(t){return e.isImportTypeNode(t)||e.isExportDeclaration(t)||e.isImportDeclaration(t)})),C=D&&e.isImportTypeNode(D)?null===(p=D.assertions)||void 0===p?void 0:p.assertClause:null==D?void 0:D.assertClause;S&&x.impliedNodeFormat===e.ModuleKind.ESNext&&!e.getResolutionModeOverrideForClause(C)&&jn(a,e.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead,n)}return ua(x.symbol)}i&&jn(a,e.Diagnostics.File_0_is_not_a_module,x.fileName)}else{if(Lt){var T=e.findBestPatternMatch(Lt,(function(e){return e.pattern}),n);if(T){var E=Rt&&Rt.get(n);return ua(E?E:T.symbol)}}if(v&&!e.resolutionExtensionIsTSOrJson(v.extension)&&void 0===b||b===e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type)o?jn(a,P=e.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,v.resolvedFileName):Yi(Z&&!!i,a,v,n);else if(i){if(v){var k=t.getProjectReferenceRedirect(v.resolvedFileName);if(k)return void jn(a,e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,k,v.resolvedFileName)}if(b)jn(a,b,n,v.resolvedFileName);else{var A=e.tryExtractTSExtension(n),N=e.pathIsRelative(n)&&!e.hasExtension(n),w=e.getEmitModuleResolutionKind(z),F=w===e.ModuleResolutionKind.Node16||w===e.ModuleResolutionKind.NodeNext;if(A){var P=e.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead,I=e.removeExtension(n,A);q>=e.ModuleKind.ES2015&&(I+=".mts"===A?".mjs":".cts"===A?".cjs":".js"),jn(a,P,A,I)}else if(!z.resolveJsonModule&&e.fileExtensionIs(n,".json")&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Classic&&e.hasJsonModuleEmitEnabled(z))jn(a,e.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(h===e.ModuleKind.ESNext&&F&&N){var O=e.getNormalizedAbsolutePath(n,e.getDirectoryPath(g.path)),M=null===(f=On.find((function(e){var r=e[0];return e[1],t.fileExists(O+r)})))||void 0===f?void 0:f[1];M?jn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,n+M):jn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path)}else jn(a,i,n)}}}}function Yi(t,r,n,i){var a,o=n.packageId,s=n.resolvedFileName,c=!e.isExternalModuleNameRelative(i)&&o?(a=o.name,f().has(e.getTypesPackageName(a))?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,o.name,e.mangleScopedPackageName(o.name)):function(e){return!!f().get(e)}(o.name)?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,o.name,i):e.chainDiagnosticMessages(void 0,e.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,i,e.mangleScopedPackageName(o.name))):void 0;Vn(t,r,e.chainDiagnosticMessages(c,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,i,s))}function Zi(t,r){if(null==t?void 0:t.exports){var n=function(t,r){if(!t||t===Pe||t===r||1===r.exports.size||2097152&t.flags)return t;var n=ri(t);if(n.cjsExportMerged)return n.cjsExportMerged;var i=33554432&t.flags?t:Xn(t);i.flags=512|i.flags,void 0===i.exports&&(i.exports=e.createSymbolTable());return r.exports.forEach((function(e,t){"export="!==t&&i.exports.set(t,i.exports.has(t)?$n(i.exports.get(t),e):e)})),ri(i).cjsExportMerged=i,n.cjsExportMerged=i}(ua(Bi(t.exports.get("export="),r)),ua(t));return ua(n)||t}}function ea(t,r,n,i){var a,o=Zi(t,n);if(!n&&o){if(!(i||1539&o.flags||e.getDeclarationOfKind(o,305))){var s=q>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop";return jn(r,e.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,s),o}var c=r.parent;if(e.isImportDeclaration(c)&&e.getNamespaceDeclarationNode(c)||e.isImportCall(c)){var l=e.isImportCall(c)?c.arguments[0]:c.moduleSpecifier,u=as(o),d=Pb(u,o,t,l);if(d)return ta(o,d,c);var _=null===(a=null==t?void 0:t.declarations)||void 0===a?void 0:a.find(e.isSourceFile),p=_&&Ai(ki(l),_.impliedNodeFormat);if(e.getESModuleInterop(z)||p){var f=ll(u,0);if(f&&f.length||(f=ll(u,1)),f&&f.length||cl(u,"default",!0)||p)return ta(o,Ib(u,o,t,l),c)}}}return o}function ta(t,r,n){var i=Wn(t.flags,t.escapedName);i.declarations=t.declarations?t.declarations.slice():[],i.parent=t.parent,i.target=t,i.originatingImport=n,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(i.constEnumOnlyModule=!0),t.members&&(i.members=new e.Map(t.members)),t.exports&&(i.exports=new e.Map(t.exports));var a=Ic(r);return i.type=Na(i,a.members,e.emptyArray,e.emptyArray,a.indexInfos),i}function ra(e){return void 0!==e.exports.get("export=")}function na(e){return Sl(sa(e))}function ia(e,t){var r=sa(t);if(r)return r.get(e)}function aa(t){return!(131068&t.flags||1&e.getObjectFlags(t)||Sf(t)||Vf(t))}function oa(e){return 6256&e.flags?Xs(e,"resolvedExports"):1536&e.flags?sa(e):e.exports||V}function sa(e){var t=ri(e);return t.resolvedExports||(t.resolvedExports=la(e))}function ca(t,r,n,i){r&&r.forEach((function(r,a){if("default"!==a){var o=t.get(a);if(o){if(n&&i&&o&&Bi(o)!==Bi(r)){var s=n.get(a);s.exportsWithDuplicate?s.exportsWithDuplicate.push(i):s.exportsWithDuplicate=[i]}}else t.set(a,r),n&&i&&n.set(a,{specifierText:e.getTextOfNode(i.moduleSpecifier)})}}))}function la(t){var r=[];return function t(n){if(!(n&&n.exports&&e.pushIfUnique(r,n)))return;var i=new e.Map(n.exports),a=n.exports.get("__export");if(a){var o=e.createSymbolTable(),s=new e.Map;if(a.declarations)for(var c=0,l=a.declarations;c=d?u.substr(0,d-"...".length)+"...":u}function Ha(e,t){var r=Xa(e.symbol)?Wa(e,e.symbol.valueDeclaration):Wa(e),n=Xa(t.symbol)?Wa(t,t.symbol.valueDeclaration):Wa(t);return r===n&&(r=Qa(e),n=Qa(t)),[r,n]}function Qa(e){return Wa(e,void 0,64)}function Xa(t){return t&&!!t.valueDeclaration&&e.isExpression(t.valueDeclaration)&&!mp(t.valueDeclaration)}function $a(e){return void 0===e&&(e=0),814775659&e}function Ya(t){return!!(t.symbol&&32&t.symbol.flags&&(t===Cs(t.symbol)||524288&t.flags&&16777216&e.getObjectFlags(t)))}function Za(t,r,n,i){return void 0===n&&(n=16384),i?a(i).getText():e.usingSingleLineStringWriter(a);function a(i){var a=e.factory.createTypePredicateNode(2===t.kind||3===t.kind?e.factory.createToken(128):void 0,1===t.kind||3===t.kind?e.factory.createIdentifier(t.parameterName):e.factory.createThisTypeNode(),t.type&&se.typeToTypeNode(t.type,r,70222336|$a(n))),o=e.createPrinter({removeComments:!0}),s=r&&e.getSourceFileOfNode(r);return o.writeNode(4,a,s,i),i}}function eo(e){return 8===e?"private":16===e?"protected":"public"}function to(t){return t&&t.parent&&262===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function ro(t){return 305===t.kind||e.isAmbientModule(t)}function no(t,r){var n=ri(t).nameType;if(n){if(384&n.flags){var i=""+n.value;return e.isIdentifierText(i,e.getEmitScriptTarget(z))||e.isNumericLiteralName(i)?e.isNumericLiteralName(i)&&e.startsWith(i,"-")?"[".concat(i,"]"):i:'"'.concat(e.escapeString(i,34),'"')}if(8192&n.flags)return"[".concat(io(n.symbol,r),"]")}}function io(t,r){if(r&&"default"===t.escapedName&&!(16384&r.flags)&&(!(16777216&r.flags)||!t.declarations||r.enclosingDeclaration&&e.findAncestor(t.declarations[0],ro)!==e.findAncestor(r.enclosingDeclaration,ro)))return"default";if(t.declarations&&t.declarations.length){var n=e.firstDefined(t.declarations,(function(t){return e.getNameOfDeclaration(t)?t:void 0})),i=n&&e.getNameOfDeclaration(n);if(n&&i){if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n))return e.symbolName(t);if(e.isComputedPropertyName(i)&&!(4096&e.getCheckFlags(t))){var a=ri(t).nameType;if(a&&384&a.flags){var o=no(t,r);if(void 0!==o)return o}}return e.declarationNameToString(i)}if(n||(n=t.declarations[0]),n.parent&&254===n.parent.kind)return e.declarationNameToString(n.parent.name);switch(n.kind){case 226:case 213:case 214:return!r||r.encounteredError||131072&r.flags||(r.encounteredError=!0),226===n.kind?"(Anonymous class)":"(Anonymous function)"}}var s=no(t,r);return void 0!==s?s:e.symbolName(t)}function ao(t){if(t){var r=ni(t);return void 0===r.isVisible&&(r.isVisible=!!function(){switch(t.kind){case 338:case 345:case 339:return!!(t.parent&&t.parent.parent&&t.parent.parent.parent&&e.isSourceFile(t.parent.parent.parent));case 203:return ao(t.parent.parent);case 254:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return!1;case 261:case 257:case 258:case 259:case 256:case 260:case 265:if(e.isExternalModuleAugmentation(t))return!0;var r=_o(t);return 1&e.getCombinedModifierFlags(t)||265!==t.kind&&305!==r.kind&&16777216&r.flags?ao(r):ii(r);case 167:case 166:case 172:case 173:case 169:case 168:if(e.hasEffectiveModifier(t,24))return!1;case 171:case 175:case 174:case 176:case 164:case 262:case 179:case 180:case 182:case 178:case 183:case 184:case 187:case 188:case 191:case 197:return ao(t.parent);case 267:case 268:case 270:return!1;case 163:case 305:case 264:return!0;default:return!1}}()),r.isVisible}return!1}function oo(t,r){var n,i,a;return t.parent&&271===t.parent.kind?n=li(t,t.escapedText,2998271,void 0,t,!1):275===t.parent.kind&&(n=Oi(t.parent,2998271)),n&&((a=new e.Set).add(M(n)),function t(n){e.forEach(n,(function(n){var o=bi(n)||n;if(r?ni(n).isVisible=!0:(i=i||[],e.pushIfUnique(i,o)),e.isInternalModuleImportEqualsDeclaration(n)){var s=n.moduleReference,c=li(n,e.getFirstIdentifier(s).escapedText,901119,void 0,void 0,!1);c&&a&&e.tryAddToSet(a,M(c))&&t(c.declarations)}}))}(n.declarations)),i}function so(e,t){var r=co(e,t);if(r>=0){for(var n=rn.length,i=r;i=0;r--){if(lo(rn[r],an[r]))return-1;if(rn[r]===e&&an[r]===t)return r}return-1}function lo(t,r){switch(r){case 0:return!!ri(t).type;case 5:return!!ni(t).resolvedEnumType;case 2:return!!ri(t).declaredType;case 1:return!!t.resolvedBaseConstructorType;case 3:return!!t.resolvedReturnType;case 4:return!!t.immediateBaseConstraint;case 6:return!!t.resolvedTypeArguments;case 7:return!!t.baseTypesResolved;case 8:return!!ri(t).writeType}return e.Debug.assertNever(r)}function uo(){return rn.pop(),an.pop(),nn.pop()}function _o(t){return e.findAncestor(e.getRootDeclaration(t),(function(e){switch(e.kind){case 254:case 255:case 270:case 269:case 268:case 267:return!1;default:return!0}})).parent}function po(e,t){var r=cl(e,t);return r?as(r):void 0}function fo(e){return e&&0!=(1&e.flags)}function mo(e){return e===Je||!!(1&e.flags&&e.aliasSymbol)}function go(e,t){if(0!==t)return Ao(e,!1,t);var r=da(e);return r&&ri(r).type||Ao(e,!1,t)}function yo(t,n,i){if(131072&(t=zg(t,(function(e){return!(98304&e.flags)}))).flags)return Dt;if(1048576&t.flags)return Wg(t,(function(e){return yo(e,n,i)}));for(var a=yd(e.map(n,wd)),o=[],s=[],c=0,l=Rc(t);c=2?(i=Le,Wu(zu(!0),[i])):Qt;var c=e.map(a,(function(t){return e.isOmittedExpression(t)?Le:Jo(t,r,n)})),l=e.findLastIndex(a,(function(t){return!(t===s||e.isOmittedExpression(t)||ph(t))}),a.length-1)+1,u=e.map(a,(function(e,t){return e===s?4:t>=l?2:1})),d=rd(c,u);return r&&((d=lu(d)).pattern=t,d.objectFlags|=131072),d}function Uo(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),201===t.kind?function(t,r,n){var i,a=e.createSymbolTable(),o=131200;e.forEach(t.elements,(function(e){var t=e.propertyName||e.name;if(e.dotDotDotToken)i=$l($e,Le,!1);else{var s=wd(t);if(Ks(s)){var c=Hs(s),l=Wn(4|(e.initializer?16777216:0),c);l.type=Jo(e,r,n),l.bindingElement=e,a.set(l.escapedName,l)}else o|=512}}));var s=Na(void 0,a,e.emptyArray,e.emptyArray,i?[i]:e.emptyArray);return s.objectFlags|=o,r&&(s.pattern=t,s.objectFlags|=131072),s}(t,r,n):jo(t,r,n)}function Vo(e,t){return zo(Ao(e,!0,0),e,t)}function Ko(e){var t,r=da(e),n=(t=!1,er||(er=Pu("SymbolConstructor",t)));return n&&r&&r===n}function zo(t,r,n){return t?(4096&t.flags&&Ko(r.parent)&&(t=M_(r)),n&&bm(r,t),8192&t.flags&&(e.isBindingElement(r)||!r.type)&&t.symbol!==da(r)&&(t=at),gm(t)):(t=e.isParameter(r)&&r.dotDotDotToken?Qt:Le,n&&(Go(r)||vm(r,t)),t)}function Go(t){var r=e.getRootDeclaration(t);return kS(164===r.kind?r.parent:r)}function qo(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return J_(r)}function Wo(t){var r=ri(t);if(!r.type){var n=function(t){if(4194304&t.flags)return(r=Is(_a(t))).typeParameters?cu(r,e.map(r.typeParameters,(function(e){return Le}))):r;var r;if(t===pe)return Le;if(134217728&t.flags&&t.valueDeclaration){var n=da(e.getSourceFileOfNode(t.valueDeclaration)),i=Wn(n.flags,"exports");i.declarations=n.declarations?n.declarations.slice():[],i.parent=t,i.target=n,n.valueDeclaration&&(i.valueDeclaration=n.valueDeclaration),n.members&&(i.members=new e.Map(n.members)),n.exports&&(i.exports=new e.Map(n.exports));var a=e.createSymbolTable();return a.set("exports",i),Na(t,a,e.emptyArray,e.emptyArray,e.emptyArray)}e.Debug.assertIsDefined(t.valueDeclaration);var o,s=t.valueDeclaration;if(e.isCatchClauseVariableDeclarationOrBindingElement(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(void 0===c)return te?Ke:Le;var l=nT(c);return fo(l)||l===Ke?l:Je}if(e.isSourceFile(s)&&e.isJsonSourceFile(s))return s.statements.length?gm(Bf(cS(s.statements[0].expression))):Dt;if(e.isAccessor(s))return Xo(t);if(!so(t,0))return 512&t.flags&&!(67108864&t.flags)?Zo(t):rs(t);if(271===s.kind)o=zo(qo(s)||zx(s.expression),s);else if(e.isBinaryExpression(s)||e.isInJSFile(s)&&(e.isCallExpression(s)||(e.isPropertyAccessExpression(s)||e.isBindableStaticElementAccessExpression(s))&&e.isBinaryExpression(s.parent)))o=Oo(t);else if(e.isPropertyAccessExpression(s)||e.isElementAccessExpression(s)||e.isIdentifier(s)||e.isStringLiteralLike(s)||e.isNumericLiteral(s)||e.isClassDeclaration(s)||e.isFunctionDeclaration(s)||e.isMethodDeclaration(s)&&!e.isObjectLiteralMethod(s)||e.isMethodSignature(s)||e.isSourceFile(s)){if(9136&t.flags)return Zo(t);o=e.isBinaryExpression(s.parent)?Oo(t):qo(s)||Le}else if(e.isPropertyAssignment(s))o=qo(s)||$x(s);else if(e.isJsxAttribute(s))o=qo(s)||Th(s);else if(e.isShorthandPropertyAssignment(s))o=qo(s)||Xx(s.name,0);else if(e.isObjectLiteralMethod(s))o=qo(s)||Yx(s,0);else if(e.isParameter(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isVariableDeclaration(s)||e.isBindingElement(s)||e.isJSDocPropertyLikeTag(s))o=Vo(s,!0);else if(e.isEnumDeclaration(s))o=Zo(t);else{if(!e.isEnumMember(s))return e.Debug.fail("Unhandled declaration kind! "+e.Debug.formatSyntaxKind(s.kind)+" for "+e.Debug.formatSymbol(t));o=es(t)}if(!uo())return 512&t.flags&&!(67108864&t.flags)?Zo(t):rs(t);return o}(t);r.type||(r.type=n)}return r.type}function Ho(t){if(t)return 172===t.kind?e.getEffectiveReturnTypeNode(t):e.getEffectiveSetAccessorTypeAnnotationNode(t)}function Qo(e){var t=Ho(e);return t&&J_(t)}function Xo(t){var r=ri(t);if(!r.type){if(!so(t,0))return Je;var n=e.getDeclarationOfKind(t,172),i=e.getDeclarationOfKind(t,173),a=n&&e.isInJSFile(n)&&To(n)||Qo(n)||Qo(i)||n&&n.body&&dx(n);a||(i&&!kS(i)?Vn(Z,i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,Ga(t)):n&&!kS(n)&&Vn(Z,n,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,Ga(t)),a=Le),uo()||(Ho(n)?jn(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)):Ho(i)?jn(i,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)):n&&Z&&jn(n,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,Ga(t)),a=Le),r.type=a}return r.type}function $o(t){var r=ri(t);if(!r.writeType){if(!so(t,8))return Je;var n=e.getDeclarationOfKind(t,173),i=Qo(n);uo()||(Ho(n)&&jn(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)),i=Le),r.writeType=i||Xo(t)}return r.writeType}function Yo(t){var r=vs(Cs(t));return 8650752&r.flags?r:2097152&r.flags?e.find(r.types,(function(e){return!!(8650752&e.flags)})):void 0}function Zo(t){var r=ri(t),n=r;if(!r.type){var i=t.valueDeclaration&&Eb(t.valueDeclaration,!1);if(i){var a=Tb(t,i);a&&(t=r=a)}n.type=r.type=function(t){var r=t.valueDeclaration;if(1536&t.flags&&e.isShorthandAmbientModuleSymbol(t))return Le;if(r&&(221===r.kind||e.isAccessExpression(r)&&221===r.parent.kind))return Oo(t);if(512&t.flags&&r&&e.isSourceFile(r)&&r.commonJsModuleIndicator){var n=Zi(t);if(n!==t){if(!so(t,0))return Je;var i=ua(t.exports.get("export=")),a=Oo(i,i===n?void 0:n);return uo()?a:rs(t)}}var o=Da(16,t);if(32&t.flags){var s=Yo(t);return s?Td([o,s]):o}return Q&&16777216&t.flags?Zf(o):o}(t)}return r.type}function es(e){var t=ri(e);return t.type||(t.type=Fs(e))}function ts(t){var r=ri(t);if(!r.type){var n=Ji(t),i=t.declarations&&Li(xi(t),!0),a=e.firstDefined(null==i?void 0:i.declarations,(function(t){return e.isExportAssignment(t)?qo(t):void 0}));r.type=(null==i?void 0:i.declarations)&&BC(i.declarations)&&t.declarations.length?function(t){var r=e.getSourceFileOfNode(t.declarations[0]),n=e.unescapeLeadingUnderscores(t.escapedName),i=t.declarations.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&e.isModuleExportsAccessExpression(t.expression)})),a=i?e.factory.createPropertyAccessExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("module"),e.factory.createIdentifier("exports")),n):e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),n);return i&&e.setParent(a.expression.expression,a.expression),e.setParent(a.expression,a),e.setParent(a,r),a.flowNode=r.endFlowNode,my(a,Re,Ge)}(i):BC(t.declarations)?Re:a||(111551&n.flags?as(n):Je)}return r.type}function rs(t){var r=t.valueDeclaration;return e.getEffectiveTypeAnnotationNode(r)?(jn(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)),Je):(Z&&(164!==r.kind||r.initializer)&&jn(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,Ga(t)),Le)}function ns(t){var r=ri(t);return r.type||(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.type=1048576&r.deferralParent.flags?yd(r.deferralConstituents):Td(r.deferralConstituents)),r.type}function is(t){var r=e.getCheckFlags(t);return 4&t.flags?2&r?65536&r?function(t){var r=ri(t);return!r.writeType&&r.deferralWriteConstituents&&(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.writeType=1048576&r.deferralParent.flags?yd(r.deferralWriteConstituents):Td(r.deferralWriteConstituents)),r.writeType}(t)||ns(t):t.writeType||t.type:as(t):98304&t.flags?1&r?function(e){var t=ri(e);return t.writeType||(t.writeType=up(is(t.target),t.mapper))}(t):$o(t):as(t)}function as(t){var r=e.getCheckFlags(t);return 65536&r?ns(t):1&r?function(e){var t=ri(e);return t.type||(t.type=up(as(t.target),t.mapper))}(t):262144&r?function(t){if(!t.type){var r=t.mappedType;if(!so(t,0))return r.containsError=!0,Je;var n=up(Tc(r.target||r),Z_(r.mapper,Sc(r),t.keyType)),i=Q&&16777216&t.flags&&!Nx(n,49152)?Zf(n,!0):524288&t.checkFlags?sm(n):n;uo()||(jn(u,e.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1,Ga(t),Wa(r)),i=Je),t.type=i}return t.type}(t):8192&r?function(e){var t=ri(e);t.type||(t.type=Rm(e.propertyType,e.mappedType,e.constraintType));return t.type}(t):7&t.flags?Wo(t):9136&t.flags?Zo(t):8&t.flags?es(t):98304&t.flags?Xo(t):2097152&t.flags?ts(t):Je}function os(e){return am(as(e),!!(16777216&e.flags))}function ss(t,r){return void 0!==t&&void 0!==r&&0!=(4&e.getObjectFlags(t))&&t.target===r}function cs(t){return 4&e.getObjectFlags(t)?t.target:t}function ls(t,r){return function t(n){if(7&e.getObjectFlags(n)){var i=cs(n);return i===r||e.some(xs(i),t)}if(2097152&n.flags)return e.some(n.types,t);return!1}(t)}function us(t,r){for(var n=0,i=r;n0)return!0;if(8650752&e.flags){var t=zc(e);return!!t&&fs(t)}return!1}function gs(t){var r=e.getClassLikeDeclarationOfSymbol(t.symbol);return r&&e.getEffectiveBaseTypeNode(r)}function ys(t,r,n){var i=e.length(r),a=e.isInJSFile(n);return e.filter(ul(t,1),(function(t){return(a||i>=Al(t.typeParameters))&&i<=e.length(t.typeParameters)}))}function hs(t,r,n){var i=ys(t,r,n),a=e.map(r,J_);return e.sameMap(i,(function(t){return e.some(t.typeParameters)?Vl(t,a,e.isInJSFile(n)):t}))}function vs(t){if(!t.resolvedBaseConstructorType){var r=e.getClassLikeDeclarationOfSymbol(t.symbol),n=r&&e.getEffectiveBaseTypeNode(r),i=gs(t);if(!i)return t.resolvedBaseConstructorType=Ge;if(!so(t,1))return Je;var a=cS(i.expression);if(n&&i!==n&&(e.Debug.assert(!n.typeArguments),cS(n.expression)),2621440&a.flags&&Ic(a),!uo())return jn(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,Ga(t.symbol)),t.resolvedBaseConstructorType=Je;if(!(1&a.flags||a===Xe||ms(a))){var o=jn(i.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,Wa(a));if(262144&a.flags){var s=nu(a),c=Ke;if(s){var l=ul(s,1);l[0]&&(c=Bl(l[0]))}a.symbol.declarations&&e.addRelatedInfo(o,e.createDiagnosticForNode(a.symbol.declarations[0],e.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,Ga(a.symbol),Wa(c)))}return t.resolvedBaseConstructorType=Je}t.resolvedBaseConstructorType=a}return t.resolvedBaseConstructorType}function bs(t,r){jn(t,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Wa(r,void 0,2))}function xs(t){if(!t.baseTypesResolved){if(so(t,7)&&(8&t.objectFlags?t.resolvedBaseTypes=[Ss(t)]:96&t.symbol.flags?(32&t.symbol.flags&&function(t){t.resolvedBaseTypes=e.resolvingEmptyArray;var r=Yc(vs(t));if(!(2621441&r.flags))return t.resolvedBaseTypes=e.emptyArray;var n,i=gs(t),a=r.symbol?Is(r.symbol):void 0;if(r.symbol&&32&r.symbol.flags&&function(e){var t=e.outerTypeParameters;if(t){var r=t.length-1,n=du(e);return t[r].symbol!==n[r].symbol}return!0}(a))n=pu(i,r.symbol);else if(1&r.flags)n=r;else{var o=hs(r,i.typeArguments,i);if(!o.length)return jn(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments),t.resolvedBaseTypes=e.emptyArray;n=Bl(o[0])}if(mo(n))return t.resolvedBaseTypes=e.emptyArray;var s=nl(n);if(!Ds(s)){var c=sl(void 0,n),l=e.chainDiagnosticMessages(c,e.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,Wa(s));return Dn.add(e.createDiagnosticForNodeFromMessageChain(i.expression,l)),t.resolvedBaseTypes=e.emptyArray}if(t===s||ls(s,t))return jn(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Wa(t,void 0,2)),t.resolvedBaseTypes=e.emptyArray;t.resolvedBaseTypes===e.resolvingEmptyArray&&(t.members=void 0);t.resolvedBaseTypes=[s]}(t),64&t.symbol.flags&&function(t){if(t.resolvedBaseTypes=t.resolvedBaseTypes||e.emptyArray,t.symbol.declarations)for(var r=0,n=t.symbol.declarations;r0)return;for(var i=1;i1&&(n=void 0===n?i:-1);for(var a=0,o=t[i];a1){var u=s.thisParameter,d=e.forEach(c,(function(e){return e.thisParameter}));if(d)u=lm(d,Td(e.mapDefined(c,(function(e){return e.thisParameter&&as(e.thisParameter)}))));(l=nc(s,c)).thisParameter=u}(r||(r=[])).push(l)}}}}if(!e.length(r)&&-1!==n){for(var _=t[void 0!==n?n:0],p=_.slice(),f=function(t){if(t!==_){var r=t[0];if(e.Debug.assert(!!r,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),p=r.typeParameters&&e.some(p,(function(e){return!!e.typeParameters&&!lc(r.typeParameters,e.typeParameters)}))?void 0:e.map(p,(function(t){return function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=G_(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Yb(e),i=Yb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=ex(e)||ex(t),l=c&&!ex(a),u=new Array(s+(l?1:0)),d=0;d=Zb(a)&&d>=Zb(o),y=d>=n?void 0:Gb(e,d),h=d>=i?void 0:Gb(t,d),v=Wn(1|(g&&!m?16777216:0),(y===h?y:y?h?void 0:y:h)||"arg".concat(d));v.type=m?Qu(f):f,u[d]=v}if(l){var b=Wn(1,"args");b.type=Qu(Qb(o,s)),o===t&&(b.type=up(b.type,r)),u[s]=b}return u}(t,r,n),s=function(e,t,r){if(!e||!t)return e||t;var n=Td([as(e),up(as(t),r)]);return lm(e,n)}(t.thisParameter,r.thisParameter,n),c=Math.max(t.minArgumentCount,r.minArgumentCount),l=tc(a,i,s,o,void 0,void 0,c,39&(t.flags|r.flags));l.compositeKind=1048576,l.compositeSignatures=e.concatenate(2097152!==t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(l.mapper=2097152!==t.compositeKind&&t.mapper&&t.compositeSignatures?$_(t.mapper,n):n);return l}(t,r)})),!p)return"break"}},m=0,g=t;m0})),n=e.map(t,fs);if(r>0&&r===e.countWhere(n,(function(e){return e}))){var i=n.indexOf(!0);n[i]=!1}return n}function pc(t){for(var r,n,i,a=t.types,o=_c(a),s=e.countWhere(o,(function(e){return e})),c=function(c){var l=t.types[c];if(!o[c]){var u=ul(l,1);u.length&&s>0&&(u=e.map(u,(function(e){var t=rc(e);return t.resolvedReturnType=function(e,t,r,n){for(var i=[],a=0;a=p&&c<=f){var m=f?zl(_,Nl(s,_.typeParameters,p,o)):rc(_);m.typeParameters=t.localTypeParameters,m.resolvedReturnType=t,m.flags=i?4|m.flags:-5&m.flags,l.push(m)}}return l}(_)),t.constructSignatures=a}}}function yc(e,t,r){return up(e,G_([t.indexType,t.objectType],[P_(0),rd([r])]))}function hc(t){if(4194304&t.flags){var r=Yc(t.type);return Kf(r)?sd(r):Md(r)}if(16777216&t.flags){if(t.root.isDistributive){var n=t.checkType,i=hc(n);if(i!==n)return lp(t,Y_(t.root.checkType,i,t.mapper))}return t}return 1048576&t.flags?Wg(t,hc):2097152&t.flags?Td(e.sameMap(t.types,hc)):t}function vc(t){return 4096&e.getCheckFlags(t)}function bc(e,t,r,n){for(var i=0,a=Rc(e);i2?(P.checkFlags|=65536,P.deferralParent=t,P.deferralConstituents=T,P.deferralWriteConstituents=D):(P.type=l?yd(T):Td(T),D&&(P.writeType=l?yd(D):Td(D))),P}}function tl(t,r,n){var i,a,o=(null===(i=t.propertyCacheWithoutObjectFunctionPropertyAugment)||void 0===i?void 0:i.get(r))||!n?null===(a=t.propertyCache)||void 0===a?void 0:a.get(r):void 0;o||(o=el(t,r,n))&&(n?t.propertyCacheWithoutObjectFunctionPropertyAugment||(t.propertyCacheWithoutObjectFunctionPropertyAugment=e.createSymbolTable()):t.propertyCache||(t.propertyCache=e.createSymbolTable())).set(r,o);return o}function rl(t,r,n){var i=tl(t,r,n);return!i||16&e.getCheckFlags(i)?void 0:i}function nl(t){return 1048576&t.flags&&16777216&t.objectFlags?t.resolvedReducedType||(t.resolvedReducedType=function(t){var r=e.sameMap(t.types,nl);if(r===t.types)return t;var n=yd(r);1048576&n.flags&&(n.resolvedReducedType=n);return n}(t)):2097152&t.flags?(16777216&t.objectFlags||(t.objectFlags|=16777216|(e.some(Lc(t),il)?33554432:0)),33554432&t.objectFlags?st:t):t}function il(e){return al(e)||ol(e)}function al(t){return!(16777216&t.flags||192!=(131264&e.getCheckFlags(t))||!(131072&as(t).flags))}function ol(t){return!t.valueDeclaration&&!!(1024&e.getCheckFlags(t))}function sl(t,r){if(2097152&r.flags&&33554432&e.getObjectFlags(r)){var n=e.find(Lc(r),al);if(n)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,Wa(r,void 0,536870912),Ga(n));var i=e.find(Lc(r),ol);if(i)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,Wa(r,void 0,536870912),Ga(i))}return t}function cl(e,t,r){if(524288&(e=Zc(e)).flags){var n=Ic(e),i=n.members.get(t);if(i&&ha(i))return i;if(r)return;var a=n===At?Jt:n.callSignatures.length?jt:n.constructSignatures.length?Ut:void 0;if(a){var o=Mc(a,t);if(o)return o}return Mc(Bt,t)}if(3145728&e.flags)return rl(e,t,r)}function ll(t,r){if(3670016&t.flags){var n=Ic(t);return 0===r?n.callSignatures:n.constructSignatures}return e.emptyArray}function ul(e,t){return ll(Zc(e),t)}function dl(t,r){return e.find(t,(function(e){return e.keyType===r}))}function _l(t,r){for(var n,i,a,o=0,s=t;o=0),n>=Zb(r,3)}var i=e.getImmediatelyInvokedFunctionExpression(t.parent);return!!i&&(!t.type&&!t.dotDotDotToken&&t.parent.parameters.indexOf(t)>=i.arguments.length)}function El(t){if(!e.isJSDocPropertyLikeTag(t))return!1;var r=t.isBracketed,n=t.typeExpression;return r||!!n&&316===n.type.kind}function kl(e,t,r,n){return{kind:e,parameterName:t,parameterIndex:r,type:n}}function Al(t){var r,n=0;if(t)for(var i=0;i=n&&o<=a){for(var s=t?t.slice():[],c=o;cl.arguments.length&&!f||Dl(_)||(o=i.length)}if((172===t.kind||173===t.kind)&&Ws(t)&&(!c||!s)){var m=172===t.kind?173:172,g=e.getDeclarationOfKind(da(t),m);g&&(s=(r=sE(g))&&r.symbol)}var y=171===t.kind?Cs(ua(t.parent.symbol)):void 0,h=y?y.localTypeParameters:xl(t);(e.hasRestParameter(t)||e.isInJSFile(t)&&function(t,r){if(e.isJSDocSignature(t)||!Pl(t))return!1;var n=e.lastOrUndefined(t.parameters),i=n?e.getJSDocParameterTags(n):e.getJSDocTags(t).filter(e.isJSDocParameterTag),a=e.firstDefined(i,(function(t){return t.typeExpression&&e.isJSDocVariadicType(t.typeExpression.type)?t.typeExpression.type:void 0})),o=Wn(3,"args",32768);a?o.type=Qu(J_(a.type)):(o.checkFlags|=65536,o.deferralParent=st,o.deferralConstituents=[Qt],o.deferralWriteConstituents=[Qt]);a&&r.pop();return r.push(o),!0}(t,i))&&(a|=1),(e.isConstructorTypeNode(t)&&e.hasSyntacticModifier(t,128)||e.isConstructorDeclaration(t)&&e.hasSyntacticModifier(t.parent,128))&&(a|=4),n.resolvedSignature=tc(t,h,s,i,void 0,void 0,o,a)}return n.resolvedSignature}function Fl(t){if(e.isInJSFile(t)&&e.isFunctionLikeDeclaration(t)){var r=e.getJSDocTypeTag(t);return(null==r?void 0:r.typeExpression)&&Kv(J_(r.typeExpression))}}function Pl(t){var r=ni(t);return void 0===r.containsArgumentsReference&&(8192&r.flags?r.containsArgumentsReference=!0:r.containsArgumentsReference=function t(r){if(!r)return!1;switch(r.kind){case 79:return r.escapedText===_e.escapedName&&RT(r)===_e;case 167:case 169:case 172:case 173:return 162===r.name.kind&&t(r.name);case 206:case 207:return t(r.expression);case 296:return t(r.initializer);default:return!e.nodeStartsNewLexicalEnvironment(r)&&!e.isPartOfTypeNode(r)&&!!e.forEachChild(r,t)}}(t.body)),r.containsArgumentsReference}function Il(t){if(!t||!t.declarations)return e.emptyArray;for(var r=[],n=0;n0&&i.body){var a=t.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)continue}r.push(wl(i))}}return r}function Ol(e){var t=Qi(e,e);if(t){var r=Zi(t);if(r)return as(r)}return Le}function Ml(e){if(e.thisParameter)return as(e.thisParameter)}function Ll(t){if(!t.resolvedTypePredicate){if(t.target){var r=Ll(t.target);t.resolvedTypePredicate=r?(o=r,s=t.mapper,kl(o.kind,o.parameterName,o.parameterIndex,up(o.type,s))):Pr}else if(t.compositeSignatures)t.resolvedTypePredicate=function(e,t){for(var r,n=[],i=0,a=e;i=0}function Ul(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]),r=Vf(t)?Gf(t):t;return r&&yl(r,Ye)}}function Vl(e,t,r,n){var i=Kl(e,Nl(t,e.typeParameters,Al(e.typeParameters),r));if(n){var a=zv(Bl(i));if(a){var o=rc(a);o.typeParameters=n;var s=rc(i);return s.resolvedReturnType=Hl(o),s}}return i}function Kl(t,r){var n=t.instantiations||(t.instantiations=new e.Map),i=au(r),a=n.get(i);return a||n.set(i,a=zl(t,r)),a}function zl(e,t){return tp(e,function(e,t){return G_(e.typeParameters,t)}(e,t),!0)}function Gl(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return tp(e,X_(e.typeParameters),!0)}(e)):e}function ql(t){return t.typeParameters?t.canonicalSignatureCache||(t.canonicalSignatureCache=function(t){return Vl(t,e.map(t.typeParameters,(function(e){return e.target&&!Jc(e.target)?e.target:e})),e.isInJSFile(t.declaration))}(t)):t}function Wl(t){var r=t.typeParameters;if(r){if(t.baseSignatureCache)return t.baseSignatureCache;for(var n=X_(r),i=G_(r,e.map(r,(function(e){return Jc(e)||Ke}))),a=e.map(r,(function(e){return up(e,i)||Ke})),o=0;o1&&(t+=":"+a),n+=a}return t}function ou(e,t){return e?"@".concat(M(e))+(t?":".concat(au(t)):""):""}function su(t,r){for(var n=0,i=0,a=t;ii.length)){var c=s&&e.isExpressionWithTypeArguments(t)&&!e.isJSDocAugmentsTag(t.parent);if(jn(t,o===i.length?c?e.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_1_type_argument_s:c?e.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Wa(n,void 0,2),o,i.length),!s)return Je}return 178===t.kind&&Zu(t,e.length(t.typeArguments)!==i.length)?uu(n,t,void 0):cu(n,e.concatenate(n.outerTypeParameters,Nl(Au(t),i,o,s)))}return Tu(t,r)?n:Je}function fu(t,r,n,i){var a=Is(t);if(a===Ve&&F.has(t.escapedName)&&r&&1===r.length)return Jd(t,r[0]);var o=ri(t),s=o.typeParameters,c=au(r)+ou(n,i),l=o.instantiations.get(c);return l||o.instantiations.set(c,l=dp(a,G_(s,Nl(r,s,Al(s),e.isInJSFile(t.valueDeclaration))),n,i)),l}function mu(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias);return!(!n||!e.getContainingFunction(n))}function gu(e){return e.parent?"".concat(gu(e.parent),".").concat(e.escapedName):e.escapedName}function yu(e){var t=(161===e.kind?e.right:206===e.kind?e.name:e).escapedText;if(t){var r=161===e.kind?yu(e.left):206===e.kind?yu(e.expression):void 0,n=r?"".concat(gu(r),".").concat(t):t,i=Oe.get(n);return i||(Oe.set(n,i=Wn(524288,t,1048576)),i.parent=r,i.declaredType=je),i}return Pe}function hu(t,r,n){var i=function(t){switch(t.kind){case 178:return t.typeName;case 228:var r=t.expression;if(e.isEntityNameExpression(r))return r}}(t);if(!i)return Pe;var a=Wi(i,r,n);return a&&a!==Pe?a:n?Pe:yu(i)}function vu(t,r){if(r===Pe)return Je;if(r=function(t){var r=t.valueDeclaration;if(r&&e.isInJSFile(r)&&!(524288&t.flags)&&!e.getExpandoInitializer(r,!1)){var n=e.isVariableDeclaration(r)?e.getDeclaredExpandoInitializer(r):e.getAssignedExpandoInitializer(r);if(n){var i=da(n);if(i)return Tb(i,t)}}}(r)||r,96&r.flags)return pu(t,r);if(524288&r.flags)return function(t,r){if(1048576&e.getCheckFlags(r)){var n=Au(t),i=ou(r,n),a=Me.get(i);return a||((a=Sa(1,"error")).aliasSymbol=r,a.aliasTypeArguments=n,Me.set(i,a)),a}var o=Is(r),s=ri(r).typeParameters;if(s){var c=e.length(t.typeArguments),l=Al(s);if(cs.length)return jn(t,l===s.length?e.Diagnostics.Generic_type_0_requires_1_type_argument_s:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ga(r),l,s.length),Je;var u=v_(t),d=!u||!mu(r)&&mu(u)?void 0:u;return fu(r,Au(t),d,b_(d))}return Tu(t,r)?o:Je}(t,r);var n=Os(r);if(n)return Tu(t,r)?N_(n):Je;if(111551&r.flags&&Cu(t)){var i=function(e,t){var r=ni(e);if(!r.resolvedJSDocType){var n=as(t),i=n;if(t.valueDeclaration){var a=200===e.kind&&e.qualifier;n.symbol&&n.symbol!==t&&a&&(i=vu(e,n.symbol))}r.resolvedJSDocType=i}return r.resolvedJSDocType}(t,r);return i||(hu(t,788968),as(r))}return Je}function bu(e,t){if(3&t.flags||t===e)return e;var r="".concat(ud(e),">").concat(ud(t)),n=ke.get(r);if(n)return n;var i=ba(33554432);return i.baseType=e,i.substitute=t,ke.set(r,i),i}function xu(e){return 184===e.kind&&1===e.elements.length}function Su(e,t,r){return xu(t)&&xu(r)?Su(e,t.elements[0],r.elements[0]):o_(J_(t))===o_(e)?J_(r):void 0}function Du(t,r){for(var n,i=!0;r&&!e.isStatement(r)&&320!==r.kind;){var a=r.parent;if(164===a.kind&&(i=!i),(i||8650752&t.flags)&&189===a.kind&&r===a.trueType)(s=Su(t,a.checkType,a.extendsType))&&(n=e.append(n,s));else if(262144&t.flags&&195===a.kind&&r===a.type){var o=J_(a);if(Sc(o)===o_(t)){var s,c=ip(o);if(c)(s=Jc(c))&&Kg(s,Cf)&&(n=e.append(n,yd([Ye,ht])))}}r=a}return n?bu(t,Td(e.append(n,t))):t}function Cu(e){return!!(8388608&e.flags)&&(178===e.kind||200===e.kind)}function Tu(t,r){return!t.typeArguments||(jn(t,e.Diagnostics.Type_0_is_not_generic,r?Ga(r):t.typeName?e.declarationNameToString(t.typeName):l),!1)}function Eu(t){if(e.isIdentifier(t.typeName)){var r=t.typeArguments;switch(t.typeName.escapedText){case"String":return Tu(t),$e;case"Number":return Tu(t),Ye;case"Boolean":return Tu(t),it;case"Void":return Tu(t),ot;case"Undefined":return Tu(t),Ge;case"Null":return Tu(t),Qe;case"Function":case"function":return Tu(t),Jt;case"array":return r&&r.length||Z?void 0:Qt;case"promise":return r&&r.length||Z?void 0:cx(Le);case"Object":if(r&&2===r.length){if(e.isJSDocIndexSignature(t)){var n=J_(r[0]),i=J_(r[1]),a=n===$e||n===Ye?[$l(n,i,!1)]:e.emptyArray;return Na(void 0,V,e.emptyArray,e.emptyArray,a)}return Le}return Tu(t),Z?void 0:Le}}}function ku(t){var r=ni(t);if(!r.resolvedType){if(e.isConstTypeReference(t)&&e.isAssertionExpression(t.parent))return r.resolvedSymbol=Pe,r.resolvedType=zx(t.parent.expression);var n=void 0,i=void 0,a=788968;Cu(t)&&((i=Eu(t))||((n=hu(t,a,!0))===Pe?n=hu(t,900095):hu(t,a),i=vu(t,n))),i||(i=vu(t,n=hu(t,a))),r.resolvedSymbol=n,r.resolvedType=i}return r.resolvedType}function Au(t){return e.map(t.typeArguments,J_)}function Nu(e){var t=ni(e);if(!t.resolvedType){var r=Jb(e);t.resolvedType=N_(gm(r))}return t.resolvedType}function wu(t,r){function n(e){var t=e.declarations;if(t)for(var r=0,n=t;r=0)return kd(e.map(r,(function(e,r){return 8&t.elementFlags[r]?e:Ke})))?Wg(r[o],(function(n){return ad(t,e.replaceElement(r,o,n))})):Je}for(var s=[],c=[],l=[],d=-1,_=-1,p=-1,f=function(o){var c=r[o],l=t.elementFlags[o];if(8&l)if(58982400&c.flags||Pc(c))h(c,8,null===(n=t.labeledElementDeclarations)||void 0===n?void 0:n[o]);else if(Vf(c)){var d=du(c);if(d.length+s.length>=1e4)return jn(u,e.isPartOfTypeNode(u)?e.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent:e.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent),{value:Je};e.forEach(d,(function(e,t){var r;return h(e,c.target.elementFlags[t],null===(r=c.target.labeledElementDeclarations)||void 0===r?void 0:r[t])}))}else h(kf(c)&&yl(c,Ye)||Je,4,null===(i=t.labeledElementDeclarations)||void 0===i?void 0:i[o]);else h(c,l,null===(a=t.labeledElementDeclarations)||void 0===a?void 0:a[o])},m=0;m=0&&_i.fixedLength?function(e){var t=Gf(e);return t&&Qu(t)}(t)||rd(e.emptyArray):rd(du(t).slice(r,a),i.elementFlags.slice(r,a),!1,i.labeledElementDeclarations&&i.labeledElementDeclarations.slice(r,a))}function sd(t){return yd(e.append(e.arrayOf(t.target.fixedLength,(function(e){return F_(""+e)})),Md(t.target.readonly?Kt:Vt)))}function cd(t,r){var n=e.findIndex(t.elementFlags,(function(e){return!(e&r)}));return n>=0?n:t.elementFlags.length}function ld(t,r){return t.elementFlags.length-e.findLastIndex(t.elementFlags,(function(e){return!(e&r)}))-1}function ud(e){return e.id}function dd(t,r){return e.binarySearch(t,r,ud,e.compareValues)>=0}function _d(t,r){var n=e.binarySearch(t,r,ud,e.compareValues);return n<0&&(t.splice(~n,0,r),!0)}function pd(t,r,n){var i=n.flags;if(1048576&i)return fd(t,r|(function(e){return!!(1048576&e.flags&&(e.aliasSymbol||e.origin))}(n)?1048576:0),n.types);if(!(131072&i))if(r|=205258751&i,465829888&i&&(r|=33554432),n===Be&&(r|=8388608),!Q&&98304&i)65536&e.getObjectFlags(n)||(r|=4194304);else{var a=t.length,o=a&&n.id>t[a-1].id?~a:e.binarySearch(t,n,ud,e.compareValues);o<0&&t.splice(~o,0,n)}return r}function fd(e,t,r){for(var n=0,i=r;n=0&&dd(o,Ge)&&e.orderedRemoveItemAt(o,c)}if((402664320&s||16384&s&&32768&s)&&function(t,r,n){for(var i=t.length;i>0;){var a=t[--i],o=a.flags;(402653312&o&&4&r||256&o&&8&r||2048&o&&64&r||8192&o&&4096&r||n&&32768&o&&16384&r||w_(a)&&dd(t,a.regularType))&&e.orderedRemoveItemAt(t,i)}}(o,s,!!(2&r)),128&s&&134217728&s&&function(t){var r=e.filter(t,qd);if(r.length)for(var n=t.length,i=function(){n--;var i=t[n];128&i.flags&&e.some(r,(function(e){return Gm(i,e)}))&&e.orderedRemoveItemAt(t,n)};n>0;)i()}(o),2===r&&(o=function(t,r){if(t.length<2)return t;var n=au(t),i=Ae.get(n);if(i)return i;for(var a=r&&e.some(t,(function(e){return!!(524288&e.flags)&&!Pc(e)&&Up(Ic(e))})),o=t.length,s=o,c=0;s>0;){var l=t[--s];if(a||469499904&l.flags)for(var d=61603840&l.flags?e.find(Rc(l),(function(e){return Of(as(e))})):void 0,_=d&&N_(as(d)),p=0,f=t;p1e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","removeSubtypes_DepthLimit",{typeIds:t.map((function(e){return e.id}))}),void jn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(c++,d&&61603840&m.flags){var g=po(m,d.escapedName);if(g&&Of(g)&&N_(g)!==_)continue}if(Wp(l,m,An)&&(!(1&e.getObjectFlags(cs(l)))||!(1&e.getObjectFlags(cs(m)))||Tp(l,m))){e.orderedRemoveItemAt(t,s);break}}}}return Ae.set(n,t),t}(o,!!(524288&s)),!o))return Je;if(0===o.length)return 65536&s?4194304&s?Qe:Xe:32768&s?4194304&s?Ge:qe:st}if(!a&&1048576&s){var l=[];md(l,t);for(var d=[],_=function(t){e.some(l,(function(e){return dd(e.types,t)}))||d.push(t)},p=0,f=o;p0;){var i=t[--r];if(134217728&i.flags)for(var a=0,o=n;a0;){var i=t[--n];(4&i.flags&&402653312&r||8&i.flags&&256&r||64&i.flags&&2048&r||4096&i.flags&&8192&r)&&e.orderedRemoveItemAt(t,n)}}(o,a),16777216&a&&524288&a&&e.orderedRemoveItemAt(o,e.findIndex(o,Kp)),262144&a&&(o[o.indexOf(Ge)]=He),0===o.length)return Ke;if(1===o.length)return o[0];var s=au(o)+ou(r,n),c=ve.get(s);if(!c){if(1048576&a)if(function(t){var r,n=e.findIndex(t,(function(t){return!!(32768&e.getObjectFlags(t))}));if(n<0)return!1;for(var i=n+1;i=0;o--)if(1048576&e[o].flags){var s=e[o].types,c=s.length;i[o]=s[a%c],a=Math.floor(a/c)}var l=Td(i);131072&l.flags||r.push(l)}return r}(o);c=yd(u,1,r,n,e.some(u,(function(e){return!!(2097152&e.flags)}))?gd(2097152,o):void 0)}else c=function(e,t,r){var n=ba(2097152);return n.objectFlags=su(e,98304),n.types=e,n.aliasSymbol=t,n.aliasTypeArguments=r,n}(o,r,n);ve.set(s,c)}return c}function Ed(t){return e.reduceLeft(t,(function(e,t){return 1048576&t.flags?e*t.types.length:131072&t.flags?0:e}),1)}function kd(t){var r=Ed(t);return!(r>=1e5)||(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkCrossProductUnion_DepthLimit",{typeIds:t.map((function(e){return e.id})),size:r}),jn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent),!1)}function Ad(e,t){var r=ba(4194304);return r.type=e,r.stringsOnly=t,r}function Nd(e,t){return t?e.resolvedStringIndexType||(e.resolvedStringIndexType=Ad(e,!0)):e.resolvedIndexType||(e.resolvedIndexType=Ad(e,!1))}function wd(t){return e.isPrivateIdentifier(t)?st:e.isIdentifier(t)?F_(e.unescapeLeadingUnderscores(t.escapedText)):N_(e.isComputedPropertyName(t)?yh(t):cS(t))}function Fd(t,r,n){if(n||!(24&e.getDeclarationModifierFlagsFromSymbol(t))){var i=ri(Ys(t)).nameType;if(!i){var a=e.getNameOfDeclaration(t.valueDeclaration);i="default"===t.escapedName?F_("default"):a&&wd(a)||(e.isKnownSymbol(t)?void 0:F_(e.symbolName(t)))}if(i&&i.flags&r)return i}return st}function Pd(t,r){return!!(t.flags&r||2097152&t.flags&&e.some(t.types,(function(e){return Pd(e,r)})))}function Id(t,r,n){var i=n&&(7&e.getObjectFlags(t)||t.aliasSymbol)?function(e){var t=xa(4194304);return t.type=e,t}(t):void 0,a=e.map(Rc(t),(function(e){return Fd(e,r)})),o=e.map(ml(t),(function(e){return e!==Rr&&Pd(e.keyType,r)?e.keyType===$e&&8&r?pt:e.keyType:st}));return yd(e.concatenate(a,o),1,void 0,void 0,i)}function Od(t){return e.some(t.types,(function(e){var t=function(e){return 262143&e.flags?e:e.uniqueLiteralFilledInstantiation||(e.uniqueLiteralFilledInstantiation=up(e,St))}(e);return nl(t)!==t}))}function Md(t,r,n){return void 0===r&&(r=re),1048576&(t=nl(t)).flags?Od(t)?Nd(t,r):Td(e.map(t.types,(function(e){return Md(e,r,n)}))):2097152&t.flags?yd(e.map(t.types,(function(e){return Md(e,r,n)}))):58982400&t.flags||Kf(t)||Pc(t)&&(a=Sc(i=t),!function t(r){return!!(68157439&r.flags)||(16777216&r.flags?r.root.isDistributive&&r.checkType===a:137363456&r.flags?e.every(r.types,t):8388608&r.flags?t(r.objectType)&&t(r.indexType):33554432&r.flags?t(r.substitute):!!(268435456&r.flags)&&t(r.type))}(Cc(i)||a))?Nd(t,r):32&e.getObjectFlags(t)?function(e,t,r){var n=Sc(e),i=Dc(e),a=Cc(e.target||e);if(!a&&!r)return i;var o=[];if(kc(e)){if(Qd(i))return Nd(e,t);bc(Yc(Ac(e)),8576,t,c)}else Ug(hc(i),c);Qd(i)&&Ug(i,c);var s=r?zg(yd(o),(function(e){return!(5&e.flags)})):yd(o);return 1048576&s.flags&&1048576&i.flags&&au(s.types)===au(i.types)?i:s;function c(t){var r=a?up(a,Z_(e.mapper,n,t)):t;o.push(r===$e?pt:r)}}(t,r,n):t===Be?Be:2&t.flags?st:131073&t.flags?mt:Id(t,(n?128:402653316)|(r?0:12584),r===re&&!n);var i,a}function Ld(e){if(re)return e;var t=(xr||(xr=Iu("Extract",2,!0)||Pe),xr===Pe?void 0:xr);return t?fu(t,[e,$e]):$e}function Rd(t,r){var n=e.findIndex(r,(function(e){return!!(1179648&e.flags)}));if(n>=0)return kd(r)?Wg(r[n],(function(i){return Rd(t,e.replaceElement(r,n,i))})):Je;if(e.contains(r,Be))return Be;var i=[],a=[],o=t[0];if(!function t(r,n){for(var s=e.isArray(r),c=0;c=0){if(a&&Kg(r,(function(e){return!e.target.hasRestElement}))&&!(16&o)){var _=zd(a);Vf(r)?jn(_,e.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,Wa(r),_u(r),e.unescapeLeadingUnderscores(l)):jn(_,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Wa(r))}return b(gl(r,Ye)),Wg(r,(function(e){var t=Gf(e)||Ge;return 1&o?yd([t,Ge]):t}))}}if(!(98304&n.flags)&&wx(n,402665900)){if(131073&r.flags)return r;var p=vl(r,n)||gl(r,$e);if(p)return 2&o&&p.keyType!==Ye?void(c&&jn(c,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Wa(n),Wa(t))):a&&p.keyType===$e&&!wx(n,12)?(jn(_=zd(a),e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Wa(n)),1&o?yd([p.type,Ge]):p.type):(b(p),1&o?yd([p.type,Ge]):p.type);if(131072&n.flags)return st;if(jd(r))return Le;if(c&&!Px(r)){if($m(r)){if(Z&&384&n.flags)return Dn.add(e.createDiagnosticForNode(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Wa(r))),Ge;if(12&n.flags){var f=e.map(r.properties,(function(e){return as(e)}));return yd(e.append(f,Ge))}}if(r.symbol===ue&&void 0!==l&&ue.exports.has(l)&&418&ue.exports.get(l).flags)jn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Wa(r));else if(Z&&!z.suppressImplicitAnyIndexErrors&&!(128&o))if(void 0!==l&&hv(l,r)){var m=Wa(r);jn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,m,m+"["+e.getTextOfNode(c.argumentExpression)+"]")}else if(yl(r,Ye))jn(c.argumentExpression,e.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else{var g=void 0;if(void 0!==l&&(g=Sv(l,r)))void 0!==g&&jn(c.argumentExpression,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,l,Wa(r),g);else{var y=function(t,r,n){function i(e){var r=Mc(t,e);if(r){var i=Kv(as(r));return!!i&&Zb(i)>=1&&Cp(n,Qb(i,0))}return!1}var a=e.isAssignmentTarget(r)?"set":"get";if(!i(a))return;var o=e.tryGetPropertyAccessOrIdentifierToString(r.expression);void 0===o?o=a:o+="."+a;return o}(r,c,n);if(void 0!==y)jn(c,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,Wa(r),y);else{var h=void 0;if(1024&n.flags)h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+Wa(n)+"]",Wa(r));else if(8192&n.flags){var v=qi(n.symbol,c);h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+v+"]",Wa(r))}else 128&n.flags||256&n.flags?h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Wa(r)):12&n.flags&&(h=e.chainDiagnosticMessages(void 0,e.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,Wa(n),Wa(r)));h=e.chainDiagnosticMessages(h,e.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,Wa(i),Wa(r)),Dn.add(e.createDiagnosticForNodeFromMessageChain(c,h))}}}return}}if(jd(r))return Le;if(a){_=zd(a);384&n.flags?jn(_,e.Diagnostics.Property_0_does_not_exist_on_type_1,""+n.value,Wa(r)):12&n.flags?jn(_,e.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1,Wa(r),Wa(n)):jn(_,e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Wa(n))}return fo(n)?n:void 0;function b(t){t&&t.isReadonly&&c&&(e.isAssignmentTarget(c)||e.isDeleteTarget(c))&&jn(c,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Wa(r))}}function zd(e){return 207===e.kind?e.argumentExpression:194===e.kind?e.indexType:162===e.kind?e.expression:e}function Gd(e){return!!(77&e.flags)}function qd(t){return!!(134217728&t.flags)&&e.every(t.types,Gd)}function Wd(e){return!!Xd(e)}function Hd(e){return!!(4194304&Xd(e))}function Qd(e){return!!(8388608&Xd(e))}function Xd(t){return 3145728&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|e.reduceLeft(t.types,(function(e,t){return e|Xd(t)}),0)),12582912&t.objectFlags):33554432&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|Xd(t.substitute)|Xd(t.baseType)),12582912&t.objectFlags):(58982400&t.flags||Pc(t)||Kf(t)?4194304:0)|(465829888&t.flags&&!qd(t)?8388608:0)}function $d(t,r){return 8388608&t.flags?function(t,r){var n=r?"simplifiedForWriting":"simplifiedForReading";if(t[n])return t[n]===wt?t:t[n];t[n]=wt;var i=$d(t.objectType,r),a=$d(t.indexType,r),o=function(t,r,n){if(1048576&r.flags){var i=e.map(r.types,(function(e){return $d(t_(t,e),n)}));return n?Td(i):yd(i)}}(i,a,r);if(o)return t[n]=o;if(!(465829888&a.flags)){var s=Yd(i,a,r);if(s)return t[n]=s}if(Kf(i)&&296&a.flags){var c=qf(i,8&a.flags?0:i.target.fixedLength,0,r);if(c)return t[n]=c}if(Pc(i)){var l=Cc(i);if(!l||Cp(l,Sc(i)))return t[n]=Wg(e_(i,t.indexType),(function(e){return $d(e,r)}))}return t[n]=t}(t,r):16777216&t.flags?function(e,t){var r=e.checkType,n=e.extendsType,i=__(e),a=p_(e);if(131072&a.flags&&o_(i)===o_(r)){if(1&r.flags||Cp(pp(r),pp(n)))return $d(i,t);if(Zd(r,n))return st}else if(131072&i.flags&&o_(a)===o_(r)){if(!(1&r.flags)&&Cp(pp(r),pp(n)))return st;if(1&r.flags||Zd(r,n))return $d(a,t)}return e}(t,r):t}function Yd(t,r,n){if(3145728&t.flags){var i=e.map(t.types,(function(e){return $d(t_(e,r),n)}));return 2097152&t.flags||n?Td(i):yd(i)}}function Zd(e,t){return!!(131072&yd([dc(e,t),st]).flags)}function e_(e,t){var r=G_([Sc(e)],[t]),n=$_(e.mapper,r);return up(Tc(e),n)}function t_(e,t,r,n,i,a){return void 0===r&&(r=0),n_(e,t,r,n,i,a)||(n?Je:Ke)}function r_(t,r){return Kg(t,(function(t){if(384&t.flags){var n=Hs(t);if(e.isNumericLiteralName(n)){var i=+n;return i>=0&&i=5e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","instantiateType_DepthLimit",{typeId:t.id,instantiationDepth:k,instantiationCount:E}),jn(u,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),Je;T++,E++,k++;var a=function(t,r,n,i){var a=t.flags;if(262144&a)return q_(t,r);if(524288&a){var o=t.objectFlags;if(52&o){if(4&o&&!t.node){var s=t.resolvedTypeArguments,c=V_(s,r);return c!==s?id(t.target,c):t}return 1024&o?function(t,r){var n=up(t.mappedType,r);if(!(32&e.getObjectFlags(n)))return t;var i=up(t.constraintType,r);if(!(4194304&i.flags))return t;var a=Mm(up(t.source,r),n,i);if(a)return a;return t}(t,r):function(t,r,n,i){var a=4&t.objectFlags||8388608&t.objectFlags?t.node:t.symbol.declarations[0],o=ni(a),s=4&t.objectFlags?o.resolvedType:64&t.objectFlags?t.target:t,c=o.outerTypeParameters;if(!c){var l=ds(a,!0);if(Cb(a)){var u=xl(a);l=e.addRange(l,u)}c=l||e.emptyArray;var d=8388612&t.objectFlags?[a]:t.symbol.declarations;c=(8388612&s.objectFlags||8192&s.symbol.flags||2048&s.symbol.flags)&&!s.aliasTypeArguments?e.filter(c,(function(t){return e.some(d,(function(e){return np(t,e)}))})):c,o.outerTypeParameters=c}if(c.length){var _=$_(t.mapper,r),p=e.map(c,(function(e){return q_(e,_)})),f=n||t.aliasSymbol,m=n?i:V_(t.aliasTypeArguments,r),g=au(p)+ou(f,m);s.instantiations||(s.instantiations=new e.Map,s.instantiations.set(au(c)+ou(s.aliasSymbol,s.aliasTypeArguments),s));var y=s.instantiations.get(g);if(!y){var h=G_(c,p);y=4&s.objectFlags?uu(t.target,t.node,h,f,m):32&s.objectFlags?ap(s,h,f,m):cp(s,h,f,m),s.instantiations.set(g,y)}return y}return t}(t,r,n,i)}return t}if(3145728&a){var l=1048576&t.flags?t.origin:void 0,u=l&&3145728&l.flags?l.types:t.types,d=V_(u,r);if(d===u&&n===t.aliasSymbol)return t;var _=n||t.aliasSymbol,p=n?i:V_(t.aliasTypeArguments,r);return 2097152&a||l&&2097152&l.flags?Td(d,_,p):yd(d,1,_,p)}if(4194304&a)return Md(up(t.type,r));if(134217728&a)return Rd(t.texts,V_(t.types,r));if(268435456&a)return Jd(t.symbol,up(t.type,r));if(8388608&a){_=n||t.aliasSymbol,p=n?i:V_(t.aliasTypeArguments,r);return t_(up(t.objectType,r),up(t.indexType,r),t.accessFlags,void 0,_,p)}if(16777216&a)return lp(t,$_(t.mapper,r),n,i);if(33554432&a){var f=up(t.baseType,r);if(8650752&f.flags)return bu(f,up(t.substitute,r));var m=up(t.substitute,r);return 3&m.flags||Cp(pp(f),pp(m))?f:m}return t}(t,r,n,i);return k--,a}function _p(e){return 262143&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=up(e,bt))}function pp(e){return 262143&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=up(e,vt),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function fp(e,t){return $l(e.keyType,up(e.type,t),e.isReadonly,e.declaration)}function mp(t){switch(e.Debug.assert(169!==t.kind||e.isObjectLiteralMethod(t)),t.kind){case 213:case 214:case 169:case 256:return gp(t);case 205:return e.some(t.properties,mp);case 204:return e.some(t.elements,mp);case 222:return mp(t.whenTrue)||mp(t.whenFalse);case 221:return(56===t.operatorToken.kind||60===t.operatorToken.kind)&&(mp(t.left)||mp(t.right));case 296:return mp(t.initializer);case 212:return mp(t.expression);case 286:return e.some(t.properties,mp)||e.isJsxOpeningElement(t.parent)&&e.some(t.parent.parent.children,mp);case 285:var r=t.initializer;return!!r&&mp(r);case 288:var n=t.expression;return!!n&&mp(n)}return!1}function gp(t){return(!e.isFunctionDeclaration(t)||e.isInJSFile(t)&&!!To(t))&&(e.hasContextSensitiveParameters(t)||function(t){return!t.typeParameters&&!e.getEffectiveReturnTypeNode(t)&&!!t.body&&235!==t.body.kind&&mp(t.body)}(t))}function yp(t){return(e.isInJSFile(t)&&e.isFunctionDeclaration(t)||e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t))&&gp(t)}function hp(t){if(524288&t.flags){var r=Ic(t);if(r.constructSignatures.length||r.callSignatures.length){var n=Da(16,t.symbol);return n.members=r.members,n.properties=r.properties,n.callSignatures=e.emptyArray,n.constructSignatures=e.emptyArray,n.indexInfos=e.emptyArray,n}}else if(2097152&t.flags)return Td(e.map(t.types,hp));return t}function vp(e,t){return Wp(e,t,Fn)}function bp(e,t){return Wp(e,t,Fn)?-1:0}function xp(e,t){return Wp(e,t,Nn)?-1:0}function Sp(e,t){return Wp(e,t,kn)?-1:0}function Dp(e,t){return Wp(e,t,kn)}function Cp(e,t){return Wp(e,t,Nn)}function Tp(t,r){return 1048576&t.flags?e.every(t.types,(function(e){return Tp(e,r)})):1048576&r.flags?e.some(r.types,(function(e){return Tp(t,e)})):58982400&t.flags?Tp(zc(t)||Ke,r):r===Bt?!!(67633152&t.flags):r===Jt?!!(524288&t.flags)&&Sg(t):ls(t,cs(r))||Sf(r)&&!Df(r)&&Tp(t,Kt)}function Ep(e,t){return Wp(e,t,wn)}function kp(e,t){return Ep(e,t)||Ep(t,e)}function Ap(e,t,r,n,i,a){return Xp(e,t,Nn,r,n,i,a)}function Np(e,t,r,n,i,a){return wp(e,t,Nn,r,n,i,a,void 0)}function wp(e,t,r,n,i,a,o,s){return!!Wp(e,t,r)||(!n||!Pp(i,e,t,r,a,o,s))&&Xp(e,t,r,n,a,o,s)}function Fp(t){return!!(16777216&t.flags||2097152&t.flags&&e.some(t.types,Fp))}function Pp(t,r,i,o,s,c,l){if(!t||Fp(i))return!1;if(!Xp(r,i,o,void 0)&&function(t,r,n,i,a,o,s){for(var c=ul(r,0),l=ul(r,1),u=0,d=[l,c];u1,h=zg(m,Pf),v=zg(m,(function(e){return!Pf(e)}));if(y){if(h!==st){var b=rd(Eh(d,0)),x=function(t,r){var n,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:if(!e.length(t.children))return[2];n=0,i=0,a.label=1;case 1:return il:Zb(t)>l))return 0;t.typeParameters&&t.typeParameters!==r.typeParameters&&(t=qv(t,r=ql(r),void 0,s));var u=Yb(t),d=rx(t),_=rx(r);(d||_)&&up(d||_,c);var p=r.declaration?r.declaration.kind:0,f=!(3&n)&&X&&169!==p&&168!==p&&171!==p,m=-1,g=Ml(t);if(g&&g!==ot){var y=Ml(r);if(y){if(!(D=!f&&s(g,y,!1)||s(y,g,i)))return i&&a(e.Diagnostics.The_this_types_of_each_signature_are_incompatible),0;m&=D}}for(var h=d||_?Math.min(u,l):Math.max(u,l),v=d||_?h-1:-1,b=0;b=Zb(t)&&b0||lT(l)),m=!!(2048&e.getObjectFlags(l));if(f&&!function(e,t,r){for(var n=0,i=Rc(e);n0&&j(Bl(h[0]),u,1,!1)||v.length>0&&j(Bl(v[0]),u,1,!1)?L(e.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,g,y):L(e.Diagnostics.Type_0_has_no_properties_in_common_with_type_1,g,y)}return 0}V(l,u);var b=1048576&l.flags&&l.types.length<4&&!(1048576&u.flags)||1048576&u.flags&&u.types.length<4&&!(469499904&l.flags)?K(l,u,o,c):H(l,u,o,c,n);if(b&&!C&&(2097152&u.flags&&(p||f)||x_(u)&&!Cf(u)&&2097152&l.flags&&3670016&Yc(l).flags&&!e.some(l.types,(function(t){return!!(262144&e.getObjectFlags(t))})))&&(C=!0,b&=H(l,u,o,4,n),C=!1),b)return b}return o&&U(t,r,l,u,s),0}function U(t,r,n,i,o){var s=!!Af(t),c=!!Af(r);n=t.aliasSymbol||s?t:n,i=r.aliasSymbol||c?r:i;var l=D>0;if(l&&D--,524288&n.flags&&524288&i.flags){var u=d;B(n,i,!0),d!==u&&(l=!!d)}if(524288&n.flags&&131068&i.flags)!function(t,r){var n=Xa(t.symbol)?Wa(t,t.symbol.valueDeclaration):Wa(t),i=Xa(r.symbol)?Wa(r,r.symbol.valueDeclaration):Wa(r);(zt===t&&$e===r||Gt===t&&Ye===r||qt===t&&it===r||ju()===t&&at===r)&&L(e.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,i,n)}(n,i);else if(n.symbol&&524288&n.flags&&Bt===n)L(e.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(2048&e.getObjectFlags(n)&&2097152&i.flags){var _=i.types,p=Nh(w.IntrinsicAttributes,a),f=Nh(w.IntrinsicClassAttributes,a);if(!mo(p)&&!mo(f)&&(e.contains(_,p)||e.contains(_,f)))return}else d=sl(d,r);o||!l?R(o,n,i):g=[n,i]}function V(t,r){if(e.tracing&&3145728&t.flags&&3145728&r.flags){var n=t,i=r;if(n.objectFlags&i.objectFlags&32768)return;var o=n.types.length,s=i.types.length;o*s>1e6&&e.tracing.instant("checkTypes","traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:t.id,sourceSize:o,targetId:r.id,targetSize:s,pos:null==a?void 0:a.pos,end:null==a?void 0:a.end})}}function K(t,r,n,a){if(1048576&t.flags)return i===wn?W(t,r,n&&!(131068&t.flags),a):function(e,t,r,n){for(var i=-1,a=e.types,o=function(e,t){if(1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags)return Qg(t,-32769);return t}(e,t),s=0;s=o.types.length&&a.length%o.types.length==0){var l=j(c,o.types[s%o.types.length],3,!1,void 0,n);if(l){i&=l;continue}}var u=j(c,t,1,r,void 0,n);if(!u)return 0;i&=u}return i}(t,r,n&&!(131068&t.flags),a);if(1048576&r.flags)return q(um(t),r,n&&!(131068&t.flags)&&!(131068&r.flags));if(2097152&r.flags)return function(e,t,r,n){for(var i=-1,a=t.types,o=0,s=a;o25)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","typeRelatedToDiscriminatedType_DepthLimit",{sourceId:t.id,targetId:r.id,numCombinations:a}),0}for(var c=new Array(n.length),l=new e.Set,u=0;u5?L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,Wa(t),Wa(n),e.map(g.slice(0,4),(function(e){return Ga(e)})).join(", "),g.length-4):L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,Wa(t),Wa(n),e.map(g,(function(e){return Ga(e)})).join(", ")),s&&d&&D++)}function re(t,r,n,a,o){if(i===Fn)return function(e,t,r){if(!(524288&e.flags&&524288&t.flags))return 0;var n=Y(Oc(e),r),i=Y(Oc(t),r);if(n.length!==i.length)return 0;for(var a=-1,o=0,s=n;o=l-y)?t.target.elementFlags[b]:4,S=r.target.elementFlags[v];if(8&S&&!(8&x))return n&&L(e.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target,v),0;if(8&x&&!(12&S))return n&&L(e.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,b,v),0;if(1&S&&!(1&x))return n&&L(e.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target,v),0;if(!(h&&((12&x||12&S)&&(h=!1),h&&(null==a?void 0:a.has(""+v))))){var D=Vf(t)?v=l-y?am(f[b],!!(x&S&2)):qf(t,g,y)||st:f[0],C=m[v];if(!(B=j(D,8&x&&4&S?Qu(C):am(C,!!(2&S)),3,n,void 0,o)))return n&&(l>1||c>1)&&(v=l-y||c-g-y==1?O(e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,b,v):O(e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,g,c-y-1,v)),0;s&=B}}return s}if(12&r.target.combinedFlags)return 0}var T=!(i!==kn&&i!==An||$m(t)||wf(t)||Vf(t)),E=Jm(t,r,T,!1);if(E)return n&&function(e,t){var r=ll(e,0),n=ll(e,1),i=Oc(e);if((r.length||n.length)&&!i.length)return!!(ul(t,0).length&&r.length||ul(t,1).length&&n.length);return!0}(t,r)&&te(t,r,E,T),0;if($m(r))for(var k=0,A=Y(Rc(t),a);k0||ul(t,n=1).length>0)return e.find(r.types,(function(e){return ul(e,n).length>0}))}(t,r)||function(t,r){var n;if(!(406978556&t.flags))for(var i=0,a=0,o=r.types;a=i&&(n=s,i=l)}}}return n}(t,r)}function tf(t,r,n,i,a){for(var o=t.types.map((function(e){})),s=0,c=r;s0&&e.every(r.properties,(function(e){return!!(16777216&e.flags)}))}return!!(2097152&t.flags)&&e.every(t.types,rf)}function nf(e){return e===Vt||e===Kt||8&e.objectFlags?K:of(e.symbol,e.typeParameters)}function af(e){return of(e,ri(e).typeParameters)}function of(t,r){void 0===r&&(r=e.emptyArray);var n=ri(t);if(!n.variances){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","getVariancesWorker",{arity:r.length,id:ud(Is(t))}),n.variances=e.emptyArray;for(var i=[],a=function(e){var r=lf(e),n=65536&r?32768&r?0:1:32768&r?2:void 0;if(void 0===n){var a=!1,o=!1,s=wr;wr=function(e){return e?o=!0:a=!0};var c=sf(t,e,Pt),l=sf(t,e,It);3===(n=(Cp(l,c)?1:0)|(Cp(c,l)?2:0))&&Cp(sf(t,e,Fr),c)&&(n=4),wr=s,(a||o)&&(a&&(n|=8),o&&(n|=16))}i.push(n)},o=0,s=r;ot.id){var a=e;e=t,t=a}var o=r?":"+r:"";return df(e)&&df(t)?function(e,t,r,n){var i=[],a="",o=c(e,0),s=c(t,0);return"".concat(a).concat(o,",").concat(s).concat(r);function c(e,t){void 0===t&&(t=0);for(var r=""+e.target.id,o=0,s=du(e);o";continue}r+="-"+l.id}return r}}(e,t,o,i):"".concat(e.id,",").concat(t.id).concat(o)}function pf(t,r){if(!(6&e.getCheckFlags(t)))return r(t);for(var n=0,i=t.containingType.types;n=n)for(var i=hf(e),a=0,o=0,s=0;s=o&&++a>=n)return!0;o=c.id}}return!1}function hf(t){if(524288&t.flags&&!Ym(t)){if(e.getObjectFlags(t)&&t.node)return t.node;if(t.symbol&&!(16&e.getObjectFlags(t)&&32&t.symbol.flags))return t.symbol;if(Vf(t))return t.target}if(262144&t.flags)return t.symbol;if(8388608&t.flags){do{t=t.objectType}while(8388608&t.flags);return t}return 16777216&t.flags?t.root:t}function vf(t,r,n){if(t===r)return-1;var i=24&e.getDeclarationModifierFlagsFromSymbol(t);if(i!==(24&e.getDeclarationModifierFlagsFromSymbol(r)))return 0;if(i){if(fC(t)!==fC(r))return 0}else if((16777216&t.flags)!=(16777216&r.flags))return 0;return Sx(t)!==Sx(r)?0:n(as(t),as(r))}function bf(t,r,n,i,a,o){if(t===r)return-1;if(!function(e,t,r){var n=Yb(e),i=Yb(t),a=Zb(e),o=Zb(t),s=ex(e),c=ex(t);return n===i&&a===o&&s===c||!!(r&&a<=o)}(t,r,n))return 0;if(e.length(t.typeParameters)!==e.length(r.typeParameters))return 0;if(r.typeParameters){for(var s=G_(t.typeParameters,r.typeParameters),c=0;ce.length(r.typeParameters)&&(a=Zs(a,e.last(du(t)))),t.objectFlags|=67108864,t.cachedEquivalentBaseType=a}}}function Nf(e){return Q?e===ut:e===qe}function wf(e){var t=Ef(e);return!!t&&Nf(t)}function Ff(e){return Vf(e)||!!cl(e,"0")}function Pf(e){return kf(e)||Ff(e)}function If(e){return!(240512&e.flags)}function Of(e){return!!(109440&e.flags)}function Mf(t){return 2097152&t.flags?e.some(t.types,Of):!!(109440&t.flags)}function Lf(t){return!!(16&t.flags)||(1048576&t.flags?!!(1024&t.flags)||e.every(t.types,Of):Of(t))}function Rf(e){return 1024&e.flags?Ns(e):402653312&e.flags?$e:256&e.flags?Ye:2048&e.flags?Ze:512&e.flags?it:1048576&e.flags?Wg(e,Rf):e}function Bf(e){return 1024&e.flags&&w_(e)?Ns(e):128&e.flags&&w_(e)?$e:256&e.flags&&w_(e)?Ye:2048&e.flags&&w_(e)?Ze:512&e.flags&&w_(e)?it:1048576&e.flags?Wg(e,Bf):e}function Jf(e){return 8192&e.flags?at:1048576&e.flags?Wg(e,Jf):e}function jf(e,t){return Hx(e,t)||(e=Jf(Bf(e))),e}function Uf(e,t,r,n){e&&Of(e)&&(e=jf(e,t?$D(r,t,n):void 0));return e}function Vf(t){return!!(4&e.getObjectFlags(t)&&8&t.target.objectFlags)}function Kf(e){return Vf(e)&&!!(8&e.target.combinedFlags)}function zf(e){return Kf(e)&&1===e.target.elementFlags.length}function Gf(e){return qf(e,e.target.fixedLength)}function qf(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=!1);var i=_u(e)-r;if(t-1&&(li(o,o.name.escapedText,788968,void 0,o.name.escapedText,!0)||o.name.originalKeywordKind&&e.isTypeNodeKind(o.name.originalKeywordKind))){var s="arg"+o.parent.parameters.indexOf(o),c=e.declarationNameToString(o.name)+(o.dotDotDotToken?"[]":"");return void Vn(Z,t,e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,s,c)}a=t.dotDotDotToken?Z?e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type:e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:Z?e.Diagnostics.Parameter_0_implicitly_has_an_1_type:e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 203:if(a=e.Diagnostics.Binding_element_0_implicitly_has_an_1_type,!Z)return;break;case 317:return void jn(t,e.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);case 256:case 169:case 168:case 172:case 173:case 213:case 214:if(Z&&!t.name)return void jn(t,3===n?e.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:e.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);a=Z?3===n?e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 195:return void(Z&&jn(t,e.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type));default:a=Z?e.Diagnostics.Variable_0_implicitly_has_an_1_type:e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage}Vn(Z,t,a,e.declarationNameToString(e.getNameOfDeclaration(t)),i)}}function bm(t,r,n){g((function(){!(Z&&65536&e.getObjectFlags(r))||n&&dh(t)||hm(r)||vm(t,r,n)}))}function xm(e,t,r){var n=Yb(e),i=Yb(t),a=tx(e),o=tx(t),s=o?i-1:i,c=a?s:Math.min(n,s),l=Ml(e);if(l){var u=Ml(t);u&&r(l,u)}for(var d=0;d0){for(var y=p,h=f;!((h=v(y).indexOf(g,h))>=0);){if(++y===e.length)return;h=0}b(y,h),f+=g.length}else if(f0)for(var S=0,D=r;Se.target.minLength||!t.target.hasRestElement&&(e.target.hasRestElement||t.target.fixedLength1){var r=e.filter(t,Ym);if(r.length){var n=yd(r,2);return e.concatenate(e.filter(t,(function(e){return!Ym(e)})),[n])}}return t}(t.candidates),o=(n=t.typeParameter,!!(i=Jc(n))&&Nx(16777216&i.flags?Uc(i):i,406978556)),s=!o&&t.topLevel&&(t.isFixed||!Om(Bl(r),t.typeParameter)),c=o?e.sameMap(a,N_):s?e.sameMap(a,Bf):a;return gm(416&t.priority?yd(c,2):function(t){if(!Q)return xf(t);var r=e.filter(t,(function(e){return!(98304&e.flags)}));return r.length?Yf(xf(r),98304&Hf(t)):yd(t,2)}(c))}function tg(t,r){var n,i,a=t.inferences[r];if(!a.inferredType){var o=void 0,s=t.signature;if(s){var c=a.candidates?eg(a,s):void 0;if(a.contraCandidates)o=!c||131072&c.flags||!e.some(a.contraCandidates,(function(e){return Dp(c,e)}))?Zm(a):c;else if(c)o=c;else if(1&t.flags)o=ct;else{var l=Qc(a.typeParameter);l&&(o=up(l,(n=function(t,r){return H_((function(n){return e.findIndex(t.inferences,(function(e){return e.typeParameter===n}))>=r?Ke:n}))}(t,r),i=t.nonFixingMapper,n?Q_(4,n,i):i)))}}else o=jm(a);a.inferredType=o||rg(!!(2&t.flags));var u=Jc(a.typeParameter);if(u){var d=up(u,t.nonFixingMapper);o&&t.compareTypes(o,Zs(d,o))||(a.inferredType=o=d)}}return a.inferredType}function rg(e){return e?Le:Ke}function ng(e){for(var t=[],r=0;r=10&&2*i>=t.length?n:void 0}(r,n);t.keyPropertyName=i?n:"",t.constituentMap=i}return t.keyPropertyName.length?t.keyPropertyName:void 0}}function gg(e,t){var r,n=null===(r=e.constituentMap)||void 0===r?void 0:r.get(ud(N_(t)));return n!==Ke?n:void 0}function yg(e,t){var r=mg(e),n=r&&po(t,r);return n&&gg(e,n)}function hg(e,t){return cg(e,t)||dg(e,t)}function vg(e,t){if(e.arguments)for(var r=0,n=e.arguments;r=0&&r.parameterIndex=n&&c-1){var u=a.filter((function(e){return void 0!==e})),d=c=2||0==(34&r.flags)||!r.valueDeclaration||e.isSourceFile(r.valueDeclaration)||292===r.valueDeclaration.parent.kind)return;var n=e.getEnclosingBlockScopeContainer(r.valueDeclaration),i=function(t,r){return!!e.findAncestor(t,(function(t){return t===r?"quit":e.isFunctionLike(t)||t.parent&&e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&t.parent.initializer===t}))}(t,n),a=Ey(n);if(a){if(i){var o=!0;if(e.isForStatement(n))if((u=e.getAncestor(r.valueDeclaration,255))&&u.parent===n){var s=function(t,r){return e.findAncestor(t,(function(e){return e===r?"quit":e===r.initializer||e===r.condition||e===r.incrementor||e===r.statement}))}(t.parent,n);if(s){var c=ni(s);c.flags|=131072;var l=c.capturedBlockScopeBindings||(c.capturedBlockScopeBindings=[]);e.pushIfUnique(l,r),s===n.initializer&&(o=!1)}}o&&(ni(a).flags|=65536)}var u;if(e.isForStatement(n))(u=e.getAncestor(r.valueDeclaration,255))&&u.parent===n&&function(t,r){var n=t;for(;212===n.parent.kind;)n=n.parent;var i=!1;if(e.isAssignmentTarget(n))i=!0;else if(219===n.parent.kind||220===n.parent.kind){var a=n.parent;i=45===a.operator||46===a.operator}if(!i)return!1;return!!e.findAncestor(n,(function(e){return e===r?"quit":e===r.statement}))}(t,n)&&(ni(r.valueDeclaration).flags|=4194304);ni(r.valueDeclaration).flags|=524288}i&&(ni(r.valueDeclaration).flags|=262144)}(t,n);var c=function(t,r){var n=t.valueDeclaration;if(n){if(e.isBindingElement(n)&&!n.initializer&&!n.dotDotDotToken&&n.parent.elements.length>=2){var i=n.parent.parent;if(254===i.kind&&2&e.getCombinedNodeFlags(n)||164===i.kind){var a=ni(i);if(!(268435456&a.flags)){a.flags|=268435456;var o=go(i,0);if(a.flags&=-268435457,o&&1048576&o.flags&&(164!==i.kind||!yy(t)))return 131072&(l=my(n.parent,o,o,void 0,r.flowNode)).flags?st:Co(n,l)}}}if(e.isParameter(n)&&!n.type&&!n.initializer&&!n.dotDotDotToken){var s=n.parent;if(s.parameters.length>=2&&yp(s)){var c=_h(s);if(c&&1===c.parameters.length&&j(c)){var l,u=Zc(as(c.parameters[0]));if(1048576&u.flags&&Kg(u,Vf)&&!yy(t))return t_(l=my(s,u,u,void 0,r.flowNode),P_(s.parameters.indexOf(n)-(e.getThisParameter(s)?1:0)))}}}}return as(t)}(a,t),l=e.getAssignmentTargetKind(t);if(l){if(!(3&a.flags||e.isInJSFile(t)&&512&a.flags))return jn(t,384&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum:32&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_class:1536&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace:16&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_function:2097152&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_import:e.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable,Ga(n)),Je;if(Sx(a))return 3&a.flags?jn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant,Ga(n)):jn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ga(n)),Je}var u=2097152&a.flags;if(3&a.flags){if(1===l)return c}else{if(!u)return c;s=xi(n)}if(!s)return c;c=Sy(c,t,r);for(var d=164===e.getRootDeclaration(s).kind,_=gy(s),p=gy(t),f=p!==_,m=t.parent&&t.parent.parent&&e.isSpreadAssignment(t.parent)&&wg(t.parent.parent),g=134217728&n.flags;p!==_&&(213===p.kind||214===p.kind||e.isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(vy(a)&&c!==Xt||d&&!yy(a));)p=gy(p);var y=d||u||f||m||g||e.isBindingElement(s)||c!==Re&&c!==Xt&&(!Q||0!=(16387&c.flags)||og(t)||275===t.parent.kind)||230===t.parent.kind||254===s.kind&&s.exclamationToken||16777216&s.flags,h=y?d?function(e,t){if(so(t.symbol,2)){var r=Q&&164===t.kind&&t.initializer&&32768&Qf(e)&&!(32768&Qf(cS(t.initializer)));return uo(),r?Cg(e,524288):e}return rs(t.symbol),e}(c,s):c:c===Re||c===Xt?Ge:Zf(c),v=my(t,c,h,p);if(ay(t)||c!==Re&&c!==Xt){if(!y&&!(32768&Qf(c))&&32768&Qf(v))return jn(t,e.Diagnostics.Variable_0_is_used_before_being_assigned,Ga(n)),c}else if(v===Re||v===Xt)return Z&&(jn(e.getNameOfDeclaration(s),e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,Ga(n),Wa(v)),jn(t,e.Diagnostics.Variable_0_implicitly_has_an_1_type,Ga(n),Wa(v))),mD(v);return l?Rf(v):v}function Ey(t){return e.findAncestor(t,(function(t){return!t||e.nodeStartsNewLexicalEnvironment(t)?"quit":e.isIterationStatement(t,!1)}))}function ky(e,t){(ni(e).flags|=2,167===t.kind||171===t.kind)?ni(t.parent).flags|=4:ni(t).flags|=4}function Ay(t){return e.isSuperCall(t)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,Ay)}function Ny(e){return vs(Is(da(e)))===Xe}function wy(t,r,n){var i=r.parent;e.getClassExtendsHeritageElement(i)&&!Ny(i)&&t.flowNode&&!py(t.flowNode,!1)&&jn(t,n)}function Fy(t){var r=og(t),n=e.getThisContainer(t,!0),i=!1;switch(171===n.kind&&wy(t,n,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class),214===n.kind&&(n=e.getThisContainer(n,!1),i=!0),function(t,r){e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)&&r.initializer&&e.textRangeContainsPositionInclusive(r.initializer,t.pos)&&e.length(r.parent.decorators)&&jn(t,e.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class)}(t,n),n.kind){case 261:jn(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 260:jn(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 171:Iy(t,n)&&jn(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 162:jn(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name)}!r&&i&&G<2&&ky(t,n);var a=Py(t,!0,n);if(ee){var o=as(ue);if(a===o&&i)jn(t,e.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);else if(!a){var s=jn(t,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!e.isSourceFile(n)){var c=Py(n);c&&c!==o&&e.addRelatedInfo(s,e.createDiagnosticForNode(n,e.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container))}}}return a||Le}function Py(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=e.getThisContainer(t,!1));var i=e.isInJSFile(t);if(e.isFunctionLike(n)&&(!jy(t)||e.getThisParameter(n))){var a=Ml(wl(n))||i&&function(t){var r=e.getJSDocType(t);if(r&&317===r.kind){var n=r;if(n.parameters.length>0&&n.parameters[0].name&&"this"===n.parameters[0].name.escapedText)return J_(n.parameters[0].type)}var i=e.getJSDocThisTag(t);if(i&&i.typeExpression)return J_(i.typeExpression)}(n);if(!a){var o=function(t){if(213===t.kind&&e.isBinaryExpression(t.parent)&&3===e.getAssignmentDeclarationKind(t.parent))return t.parent.left.expression.expression;if(169===t.kind&&205===t.parent.kind&&e.isBinaryExpression(t.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent))return t.parent.parent.left.expression;if(213===t.kind&&296===t.parent.kind&&205===t.parent.parent.kind&&e.isBinaryExpression(t.parent.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent.parent))return t.parent.parent.parent.left.expression;if(213===t.kind&&e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)&&("value"===t.parent.name.escapedText||"get"===t.parent.name.escapedText||"set"===t.parent.name.escapedText)&&e.isObjectLiteralExpression(t.parent.parent)&&e.isCallExpression(t.parent.parent.parent)&&t.parent.parent.parent.arguments[2]===t.parent.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent.parent))return t.parent.parent.parent.arguments[0].expression;if(e.isMethodDeclaration(t)&&e.isIdentifier(t.name)&&("value"===t.name.escapedText||"get"===t.name.escapedText||"set"===t.name.escapedText)&&e.isObjectLiteralExpression(t.parent)&&e.isCallExpression(t.parent.parent)&&t.parent.parent.arguments[2]===t.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent))return t.parent.parent.arguments[0].expression}(n);if(i&&o){var s=cS(o).symbol;s&&s.members&&16&s.flags&&(a=Is(s).thisType)}else Cb(n)&&(a=Is(ua(n.symbol)).thisType);a||(a=Ry(n))}if(a)return my(t,a)}if(e.isClassLike(n.parent)){var c=da(n.parent);return my(t,e.isStatic(n)?as(c):Is(c).thisType)}if(e.isSourceFile(n)){if(n.commonJsModuleIndicator){var l=da(n);return l&&as(l)}if(n.externalModuleIndicator)return Ge;if(r)return as(ue)}}function Iy(t,r){return!!e.findAncestor(t,(function(t){return e.isFunctionLikeDeclaration(t)?"quit":164===t.kind&&t.parent===r}))}function Oy(t){var r=208===t.parent.kind&&t.parent.expression===t,n=e.getSuperContainer(t,!0),i=n,a=!1;if(!r)for(;i&&214===i.kind;)i=e.getSuperContainer(i,!0),a=G<2;var o=function(t){if(!t)return!1;if(r)return 171===t.kind;if(e.isClassLike(t.parent)||205===t.parent.kind)return e.isStatic(t)?169===t.kind||168===t.kind||172===t.kind||173===t.kind||167===t.kind||170===t.kind:169===t.kind||168===t.kind||172===t.kind||173===t.kind||167===t.kind||166===t.kind||171===t.kind;return!1}(i),s=0;if(!o){var c=e.findAncestor(t,(function(e){return e===i?"quit":162===e.kind}));return c&&162===c.kind?jn(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):r?jn(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):i&&i.parent&&(e.isClassLike(i.parent)||205===i.parent.kind)?jn(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):jn(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),Je}if(r||171!==n.kind||wy(t,i,e.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),e.isStatic(i)||r?(s=512,!r&&G>=2&&G<=8&&(e.isPropertyDeclaration(i)||e.isClassStaticBlockDeclaration(i))&&e.forEachEnclosingBlockScopeContainer(t.parent,(function(t){e.isSourceFile(t)&&!e.isExternalOrCommonJsModule(t)||(ni(t).flags|=134217728)}))):s=256,ni(t).flags|=s,169===i.kind&&e.hasSyntacticModifier(i,256)&&(e.isSuperProperty(t.parent)&&e.isAssignmentTarget(t.parent)?ni(i).flags|=4096:ni(i).flags|=2048),a&&ky(t.parent,i),205===i.parent.kind)return G<2?(jn(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),Je):Le;var l=i.parent;if(!e.getClassExtendsHeritageElement(l))return jn(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),Je;var u=Is(da(l)),d=u&&xs(u)[0];return d?171===i.kind&&Iy(t,i)?(jn(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),Je):512===s?vs(u):Zs(d,u.thisType):Je}function My(t){return 4&e.getObjectFlags(t)&&t.target===Ht?du(t)[0]:void 0}function Ly(t){return Wg(t,(function(t){return 2097152&t.flags?e.forEach(t.types,My):My(t)}))}function Ry(t){if(214!==t.kind){if(yp(t)){var r=_h(t);if(r){var n=r.thisParameter;if(n)return as(n)}}var i=e.isInJSFile(t);if(ee||i){var a=function(e){return 169!==e.kind&&172!==e.kind&&173!==e.kind||205!==e.parent.kind?213===e.kind&&296===e.parent.kind?e.parent.parent:void 0:e.parent}(t);if(a){for(var o=rh(a),s=a,c=o;c;){var l=Ly(c);if(l)return up(l,Fm(oh(a)));if(296!==s.parent.kind)break;c=rh(s=s.parent.parent)}return gm(o?em(o):zx(a))}var u=e.walkUpParenthesizedExpressions(t.parent);if(221===u.kind&&63===u.operatorToken.kind){var d=u.left;if(e.isAccessExpression(d)){var _=d.expression;if(i&&e.isIdentifier(_)){var p=e.getSourceFileOfNode(u);if(p.commonJsModuleIndicator&&ag(_)===p.symbol)return}return gm(zx(_))}}}}}function By(t){var r=t.parent;if(yp(r)){var n=e.getImmediatelyInvokedFunctionExpression(r);if(n&&n.arguments){var i=rb(n),a=r.parameters.indexOf(t);if(t.dotDotDotToken)return Xv(i,a,i.length,Le,void 0,0);var o=ni(n),s=o.resolvedSignature;o.resolvedSignature=Ir;var c=a=i?t_(as(n.parameters[i]),P_(r-i),256):Qb(n,r)}function Gy(t,r){var n=t.parent,i=n.left,a=n.operatorToken,o=n.right;switch(a.kind){case 63:case 76:case 75:case 77:return t===o?function(t){var r,n,i=e.getAssignmentDeclarationKind(t);switch(i){case 0:case 4:var a=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t))return ag(t);if(e.isPropertyAccessExpression(t)){var r=aS(t.expression);return e.isPrivateIdentifier(t.name)?n(r,t.name):cl(r,t.name.escapedText)}return;function n(e,t){var r=sv(t.escapedText,t);return r&&uv(e,r)}}(t.left),o=a&&a.valueDeclaration;return o&&(e.isPropertyDeclaration(o)||e.isPropertySignature(o))?(c=e.getEffectiveTypeAnnotationNode(o))&&up(J_(c),ri(a).mapper)||o.initializer&&aS(t.left):0===i?aS(t.left):Wy(t);case 5:if(qy(t,i))return Wy(t);if(t.left.symbol){var s=t.left.symbol.valueDeclaration;if(!s)return;var c,l=e.cast(t.left,e.isAccessExpression);if(c=e.getEffectiveTypeAnnotationNode(s))return J_(c);if(e.isIdentifier(l.expression)){var u=l.expression,d=li(u,u.escapedText,111551,void 0,u.escapedText,!0);if(d){var _=d.valueDeclaration&&e.getEffectiveTypeAnnotationNode(d.valueDeclaration);if(_){var p=e.getElementOrPropertyAccessName(l);if(void 0!==p)return Hy(J_(_),p)}return}}return e.isInJSFile(s)?void 0:aS(t.left)}return aS(t.left);case 1:case 6:case 3:var f=null===(r=t.left.symbol)||void 0===r?void 0:r.valueDeclaration;case 2:f||(f=null===(n=t.symbol)||void 0===n?void 0:n.valueDeclaration);var m=f&&e.getEffectiveTypeAnnotationNode(f);return m?J_(m):void 0;case 7:case 8:case 9:return e.Debug.fail("Does not apply");default:return e.Debug.assertNever(i)}}(n):void 0;case 56:case 60:var s=ah(n,r);return t===o&&(s&&s.pattern||!s&&!e.isDefaultedExpandoInitializer(n))?aS(i):s;case 55:case 27:return t===o?ah(n,r):void 0;default:return}}function qy(t,r){if(void 0===r&&(r=e.getAssignmentDeclarationKind(t)),4===r)return!0;if(!e.isInJSFile(t)||5!==r||!e.isIdentifier(t.left.expression))return!1;var n=t.left.expression.escapedText,i=li(t.left,n,111551,void 0,void 0,!0,!0);return e.isThisInitializedDeclaration(null==i?void 0:i.valueDeclaration)}function Wy(t){if(!t.symbol)return aS(t.left);if(t.symbol.valueDeclaration){var r=e.getEffectiveTypeAnnotationNode(t.symbol.valueDeclaration);if(r){var n=J_(r);if(n)return n}}var i=e.cast(t.left,e.isAccessExpression);if(e.isObjectLiteralMethod(e.getThisContainer(i.expression,!1))){var a=Fy(i.expression),o=e.getElementOrPropertyAccessName(i);return void 0!==o&&Hy(a,o)||void 0}}function Hy(t,r,n){return Wg(t,(function(t){var i,a;if(Pc(t)&&!t.declaration.nameType){var o=Dc(t),s=zc(o)||o,c=n||F_(e.unescapeLeadingUnderscores(r));if(Cp(c,s))return e_(t,c)}else if(3670016&t.flags){var l=cl(t,r);if(l)return a=l,262144&e.getCheckFlags(a)&&!a.type&&co(a,0)>=0?void 0:as(l);if(Vf(t)){var u=Gf(t);if(u&&e.isNumericLiteralName(r)&&+r>=0)return u}return null===(i=_l(fl(t),n||F_(e.unescapeLeadingUnderscores(r))))||void 0===i?void 0:i.type}}),!0)}function Qy(t,r){if(e.Debug.assert(e.isObjectLiteralMethod(t)),!(33554432&t.flags))return Xy(t,r)}function Xy(t,r){var n=t.parent,i=e.isPropertyAssignment(t)&&Jy(t);if(i)return i;var a=rh(n,r);if(a){if(Ws(t)){var o=da(t);return Hy(a,o.escapedName,ri(o).nameType)}if(t.name){var s=wd(t.name);return Wg(a,(function(e){var t;return null===(t=_l(fl(e),s))||void 0===t?void 0:t.type}),!0)}}}function $y(e,t){return e&&(Hy(e,""+t)||Wg(e,(function(e){return ND(1,e,Ge,void 0,!1)}),!0))}function Yy(t){var r=t.parent;return e.isJsxAttributeLike(r)?ah(t):e.isJsxElement(r)?function(t,r){var n=rh(t.openingElement.tagName),i=Oh(Ph(t));if(n&&!fo(n)&&i&&""!==i){var a=e.getSemanticJsxChildren(t.children),o=a.indexOf(r),s=Hy(n,i);return s&&(1===a.length?s:Wg(s,(function(e){return kf(e)?t_(e,P_(o)):e}),!0))}}(r,t):void 0}function Zy(t){if(e.isJsxAttribute(t)){var r=rh(t.parent);if(!r||fo(r))return;return Hy(r,t.name.escapedText)}return ah(t.parent)}function eh(e){switch(e.kind){case 10:case 8:case 9:case 14:case 110:case 95:case 104:case 79:case 153:return!0;case 206:case 212:return eh(e.expression);case 288:return!e.expression||eh(e.expression)}return!1}function th(t,r){return function(t,r){var n=mg(t),i=n&&e.find(r.properties,(function(e){return e.symbol&&296===e.kind&&e.symbol.escapedName===n&&eh(e.initializer)})),a=i&&sS(i.initializer);return a&&gg(t,a)}(r,t)||tf(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return!!e.symbol&&296===e.kind&&eh(e.initializer)&&pg(r,e.symbol.escapedName)})),(function(e){return[function(){return sS(e.initializer)},e.symbol.escapedName]})),e.map(e.filter(Rc(r),(function(e){var n;return!!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&pg(r,e.escapedName)})),(function(e){return[function(){return Ge},e.escapedName]}))),Cp,r)}function rh(t,r){var n=nh(e.isObjectLiteralMethod(t)?Qy(t,r):ah(t,r),t,r);if(n&&!(r&&2&r&&8650752&n.flags)){var i=Wg(n,Yc,!0);return 1048576&i.flags&&e.isObjectLiteralExpression(t)?th(t,i):1048576&i.flags&&e.isJsxAttributes(t)?function(t,r){return tf(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return!!e.symbol&&285===e.kind&&pg(r,e.symbol.escapedName)&&(!e.initializer||eh(e.initializer))})),(function(e){return[e.initializer?function(){return sS(e.initializer)}:function(){return rt},e.symbol.escapedName]})),e.map(e.filter(Rc(r),(function(e){var n;return!!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&pg(r,e.escapedName)})),(function(e){return[function(){return Ge},e.escapedName]}))),Cp,r)}(t,i):i}}function nh(t,r,n){if(t&&Nx(t,465829888)){var i=oh(r);if(i&&e.some(i.inferences,tS)){if(n&&1&n)return ih(t,i.nonFixingMapper);if(i.returnMapper){var a=ih(t,i.returnMapper);return 1048576&a.flags&&dd(a.types,tt)&&dd(a.types,nt)?zg(a,(function(e){return e!==tt&&e!==nt})):a}}}return t}function ih(t,r){return 465829888&t.flags?up(t,r):1048576&t.flags?yd(e.map(t.types,(function(e){return ih(e,r)})),0):2097152&t.flags?Td(e.map(t.types,(function(e){return ih(e,r)}))):t}function ah(t,r){if(33554432&t.flags);else{if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 254:case 164:case 167:case 166:case 203:return function(t,r){var n=t.parent;if(e.hasInitializer(n)&&t===n.initializer){var i=Jy(n);if(i)return i;if(!(8&r)&&e.isBindingPattern(n.name))return Uo(n.name,!0,!1)}}(t,r);case 214:case 247:return function(t){var r=e.getContainingFunction(t);if(r){var n=Vy(r);if(n){var i=e.getFunctionFlags(r);if(1&i){var a=MD(n,2&i?2:1,void 0);if(!a)return;n=a.returnType}if(2&i){var o=Wg(n,BS);return o&&yd([o,lx(o)])}return n}}}(t);case 224:return function(t){var r=e.getContainingFunction(t);if(r){var n=e.getFunctionFlags(r),i=Vy(r);if(i)return t.asteriskToken?i:$D(0,i,0!=(2&n))}}(n);case 218:return function(e,t){var r=ah(e,t);if(r){var n=BS(r);return n&&yd([n,lx(n)])}}(n,r);case 208:case 209:return Ky(n,t);case 211:case 229:return e.isConstTypeReference(n.type)?o(n):J_(n.type);case 221:return Gy(t,r);case 296:case 297:return Xy(n,r);case 298:return ah(n.parent,r);case 204:var i=n;return $y(rh(i,r),e.indexOfNode(i.elements,t));case 222:return function(e,t){var r=e.parent;return e===r.whenTrue||e===r.whenFalse?ah(r,t):void 0}(t,r);case 233:return e.Debug.assert(223===n.parent.kind),function(e,t){if(210===e.parent.kind)return Ky(e.parent,t)}(n.parent,t);case 212:var a=e.isInJSFile(n)?e.getJSDocTypeTag(n):void 0;return a?e.isJSDocTypeTag(a)&&e.isConstTypeReference(a.typeExpression.type)?o(n):J_(a.typeExpression.type):ah(n,r);case 230:return ah(n,r);case 271:return qo(n);case 288:return Yy(n);case 285:case 287:return Zy(n);case 280:case 279:return function(t,r){if(e.isJsxOpeningElement(t)&&t.parent.contextualType&&4!==r)return t.parent.contextualType;return zy(t,0)}(n,r)}}function o(e){return ah(e)}}function oh(t){var r=e.findAncestor(t,(function(e){return!!e.inferenceContext}));return r&&r.inferenceContext}function sh(t,r){return 0!==Yv(r)?function(e,t){var r=ix(e,Ke);r=ch(t,Ph(t),r);var n=Nh(w.IntrinsicAttributes,t);mo(n)||(r=dc(n,r));return r}(t,r):function(t,r){var n=Ph(r),i=(o=n,Ih(w.ElementAttributesPropertyNameContainer,o)),a=void 0===i?ix(t,Ke):""===i?Bl(t):function(e,t){if(e.compositeSignatures){for(var r=[],n=0,i=e.compositeSignatures;n=2)return fu(a,Nl([s,n],c,2,e.isInJSFile(t)))}if(e.length(o.typeParameters)>=2)return cu(o,Nl([s,n],o.typeParameters,2,e.isInJSFile(t)))}return n}function lh(t){return e.getStrictOptionValue(z,"noImplicitAny")?e.reduceLeft(t,(function(t,r){return t!==r&&t?lc(t.typeParameters,r.typeParameters)?function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=G_(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Yb(e),i=Yb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=ex(e)||ex(t),l=c&&!ex(a),u=new Array(s+(l?1:0)),d=0;d=Zb(a)&&d>=Zb(o),y=d>=n?void 0:Gb(e,d),h=d>=i?void 0:Gb(t,d),v=Wn(1|(g&&!m?16777216:0),(y===h?y:y?h?void 0:y:h)||"arg".concat(d));v.type=m?Qu(f):f,u[d]=v}if(l){var b=Wn(1,"args");b.type=Qu(Qb(o,s)),o===t&&(b.type=up(b.type,r)),u[s]=b}return u}(t,r,n),s=function(e,t,r){if(!e||!t)return e||t;var n=yd([as(e),up(as(t),r)]);return lm(e,n)}(t.thisParameter,r.thisParameter,n),c=Math.max(t.minArgumentCount,r.minArgumentCount),l=tc(a,i,s,o,void 0,void 0,c,39&(t.flags|r.flags));l.compositeKind=2097152,l.compositeSignatures=e.concatenate(2097152===t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(l.mapper=2097152===t.compositeKind&&t.mapper&&t.compositeSignatures?$_(t.mapper,n):n);return l}(t,r):void 0:t})):void 0}function uh(t,r){var n=ul(t,0),i=e.filter(n,(function(t){return!function(t,r){for(var n=0;n0&&(s=C_(s,B(),t.symbol,m,u),o=[],a=e.createSymbolTable(),y=!1,h=!1,v=!1),Sh(N=nl(cS(E.expression)))){var M=D_(N,u);if(i&&kh(M,i,E),D=o.length,mo(s))continue;s=C_(s,M,t.symbol,m,u)}else jn(E,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),s=Je;continue}e.Debug.assert(172===E.kind||173===E.kind),UC(E)}!A||8576&A.flags?a.set(k.escapedName,k):Cp(A,ft)&&(Cp(A,Ye)?h=!0:Cp(A,at)?v=!0:y=!0,n&&(g=!0)),o.push(k)}if(l&&298!==t.parent.kind)for(var L=0,R=Rc(c);L0&&(s=C_(s,B(),t.symbol,m,u),o=[],a=e.createSymbolTable(),y=!1,h=!1),Wg(s,(function(e){return e===Dt?B():e}))):B();function B(){var r=[];y&&r.push(vh(t,D,o,$e)),h&&r.push(vh(t,D,o,Ye)),v&&r.push(vh(t,D,o,at));var i=Na(t.symbol,a,e.emptyArray,e.emptyArray,r);return i.objectFlags|=131200|m,f&&(i.objectFlags|=4096),g&&(i.objectFlags|=512),n&&(i.pattern=t),i}}function Sh(t){var r=Xf(Wg(t,Gc));return!!(126615553&r.flags||3145728&r.flags&&e.every(r.types,Sh))}function Dh(t){return e.stringContains(t,"-")}function Ch(t){return 79===t.kind&&e.isIntrinsicJsxName(t.escapedText)}function Th(e,t){return e.initializer?Xx(e.initializer,t):rt}function Eh(e,t){for(var r=[],n=0,i=e.children;n0&&(s=C_(s,C(),i.symbol,u,!1),o=e.createSymbolTable()),fo(g=nl(zx(f.expression,r)))&&(c=!0),Sh(g)?(s=C_(s,g,i.symbol,u,!1),a&&kh(g,a,f)):(jn(f.expression,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),n=n?Td([n,g]):g)}c||o.size>0&&(s=C_(s,C(),i.symbol,u,!1));var h=278===t.parent.kind?t.parent:void 0;if(h&&h.openingElement===t&&h.children.length>0){var v=Eh(h,r);if(!c&&d&&""!==d){l&&jn(i,e.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,e.unescapeLeadingUnderscores(d));var b=rh(t.attributes),x=b&&Hy(b,d),S=Wn(4,d);S.type=1===v.length?v[0]:x&&Vg(x,Ff)?rd(v):Qu(yd(v)),S.valueDeclaration=e.factory.createPropertySignature(void 0,e.unescapeLeadingUnderscores(d),void 0,void 0),e.setParent(S.valueDeclaration,i),S.valueDeclaration.symbol=S;var D=e.createSymbolTable();D.set(d,S),s=C_(s,Na(i.symbol,D,e.emptyArray,e.emptyArray,e.emptyArray),i.symbol,u,!1)}}return c?Le:n&&s!==Ct?Td([n,s]):n||(s===Ct?C():s);function C(){u|=ne;var t=Na(i.symbol,o,e.emptyArray,e.emptyArray,e.emptyArray);return t.objectFlags|=131200|u,t}}(t.parent,r)}function Nh(e,t){var r=Ph(t),n=r&&oa(r),i=n&&ai(n,e,788968);return i?Is(i):Je}function wh(t){var r=ni(t);if(!r.resolvedSymbol){var n=Nh(w.IntrinsicElements,t);if(mo(n))return Z&&jn(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,e.unescapeLeadingUnderscores(w.IntrinsicElements)),r.resolvedSymbol=Pe;if(!e.isIdentifier(t.tagName))return e.Debug.fail();var i=cl(n,t.tagName.escapedText);return i?(r.jsxFlags|=1,r.resolvedSymbol=i):yl(n,$e)?(r.jsxFlags|=2,r.resolvedSymbol=n.symbol):(jn(t,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.idText(t.tagName),"JSX."+w.IntrinsicElements),r.resolvedSymbol=Pe)}return r.resolvedSymbol}function Fh(t){var r=t&&e.getSourceFileOfNode(t),n=r&&ni(r);if(!n||!1!==n.jsxImplicitImportContainer){if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;var i=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(z,r),z);if(i){var a=$i(t,i,e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations,t),o=a&&a!==Pe?ua(Bi(a)):void 0;return n&&(n.jsxImplicitImportContainer=o||!1),o}}}function Ph(e){var t=e&&ni(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){var r=Fh(e);if(!r||r===Pe){var n=Mn(e);r=li(e,n,1920,void 0,n,!1)}if(r){var i=Bi(ai(oa(Bi(r)),w.JSX,1920));if(i&&i!==Pe)return t&&(t.jsxNamespace=i),i}t&&(t.jsxNamespace=!1)}var a=Bi(Ou(w.JSX,1920,void 0));return a!==Pe?a:void 0}function Ih(t,r){var n=r&&ai(r.exports,t,788968),i=n&&Is(n),a=i&&Rc(i);if(a){if(0===a.length)return"";if(1===a.length)return a[0].escapedName;a.length>1&&n.declarations&&jn(n.declarations[0],e.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property,e.unescapeLeadingUnderscores(t))}}function Oh(e){return Ih(w.ElementChildrenAttributeNameContainer,e)}function Mh(t,r){if(4&t.flags)return[Ir];if(128&t.flags){var n=Lh(t,r);return n?[bb(r,n)]:(jn(r,e.Diagnostics.Property_0_does_not_exist_on_type_1,t.value,"JSX."+w.IntrinsicElements),e.emptyArray)}var i=Yc(t),a=ul(i,1);return 0===a.length&&(a=ul(i,0)),0===a.length&&1048576&i.flags&&(a=cc(e.map(i.types,(function(e){return Mh(e,r)})))),a}function Lh(t,r){var n=Nh(w.IntrinsicElements,r);if(!mo(n)){var i=t.value,a=cl(n,e.escapeLeadingUnderscores(i));if(a)return as(a);var o=yl(n,$e);return o||void 0}return Le}function Rh(t){e.Debug.assert(Ch(t.tagName));var r=ni(t);if(!r.resolvedJsxElementAttributesType){var n=wh(t);return 1&r.jsxFlags?r.resolvedJsxElementAttributesType=as(n)||Je:2&r.jsxFlags?r.resolvedJsxElementAttributesType=yl(Nh(w.IntrinsicElements,t),$e)||Je:r.resolvedJsxElementAttributesType=Je}return r.resolvedJsxElementAttributesType}function Bh(e){var t=Nh(w.ElementClass,e);if(!mo(t))return t}function Jh(e){return Nh(w.Element,e)}function jh(e){var t=Jh(e);if(t)return yd([t,Qe])}function Uh(t){var r,n=e.isJsxOpeningLikeElement(t);if(n&&function(t){(function(t){if(e.isPropertyAccessExpression(t)){var r=t;do{var n=a(r.name);if(n)return n;r=r.expression}while(e.isPropertyAccessExpression(r));var i=a(r);if(i)return i}function a(t){if(e.isIdentifier(t)&&-1!==e.idText(t).indexOf(":"))return vE(t,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}})(t.tagName),ZT(t,t.typeArguments);for(var r=new e.Map,n=0,i=t.attributes.properties;n=0)return d>=Zb(n)&&(ex(n)||ds)return!1;if(o||a>=c)return!0;for(var _=a;_=i&&r.length<=n}function Kv(e){return Gv(e,0,!1)}function zv(e){return Gv(e,0,!1)||Gv(e,1,!1)}function Gv(e,t,r){if(524288&e.flags){var n=Ic(e);if(r||0===n.properties.length&&0===n.indexInfos.length){if(0===t&&1===n.callSignatures.length&&0===n.constructSignatures.length)return n.callSignatures[0];if(1===t&&1===n.constructSignatures.length&&0===n.callSignatures.length)return n.constructSignatures[0]}}}function qv(t,r,n,i){var a=Dm(t.typeParameters,t,0,i),o=tx(r),s=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return xm(s?tp(r,s):r,t,(function(e,t){Hm(a.inferences,e,t)})),n||Sm(r,t,(function(e,t){Hm(a.inferences,e,t,128)})),Vl(t,ng(a),e.isInJSFile(r.declaration))}function Wv(t){if(!t)return ot;var r=cS(t);return e.isOptionalChainRoot(t.parent)?em(r):e.isOptionalChain(t.parent)?rm(r):r}function Hv(t,r,n,i,a){if(e.isJsxOpeningLikeElement(t))return function(e,t,r,n){var i=sh(t,e),a=Kx(e.attributes,i,n,r);return Hm(n.inferences,a,i),ng(n)}(t,r,i,a);if(165!==t.kind){var o=ah(t,e.every(r.typeParameters,(function(e){return!!Qc(e)}))?8:0);if(o){var s=Bl(r);if(Pm(s)){var c=oh(t),l=Fm(function(t,r){return void 0===r&&(r=0),t&&Cm(e.map(t.inferences,wm),t.signature,t.flags|r,t.compareTypes)}(c,1)),u=up(o,l),d=Kv(u),_=d&&d.typeParameters?Hl(Kl(d,d.typeParameters)):u;Hm(a.inferences,_,s,128);var p=Dm(r.typeParameters,r,a.flags),f=up(o,c&&c.returnMapper);Hm(p.inferences,f,s),a.returnMapper=e.some(p.inferences,tS)?Fm(function(t){var r=e.filter(t.inferences,tS);return r.length?Cm(e.map(r,wm),t.signature,t.flags,t.compareTypes):void 0}(p)):void 0}}}var m=rx(r),g=m?Math.min(Yb(r)-1,n.length):n.length;if(m&&262144&m.flags){var y=e.find(a.inferences,(function(e){return e.typeParameter===m}));y&&(y.impliedArity=e.findIndex(n,Rv,g)<0?n.length-g:void 0)}var h=Ml(r);if(h&&Pm(h)){var v=eb(t);Hm(a.inferences,Wv(v),h)}for(var b=0;b=n-1&&Rv(d=t[n-1]))return Qv(232===d.kind?d.type:Kx(d.expression,i,a,o));for(var s=[],c=[],l=[],u=r;ud&&(d=h)}}if(!u)return!0;for(var v=1/0,b=0,x=i;b0||e.isJsxOpeningElement(t)&&t.parent.children.length>0?[t.attributes]:e.emptyArray;var i=t.arguments||e.emptyArray,a=Bv(i);if(a>=0){for(var o=i.slice(0,a),s=function(t){var r=i[t],n=225===r.kind&&(Qr?cS(r.expression):zx(r.expression));n&&Vf(n)?e.forEach(du(n),(function(e,t){var i,a=n.target.elementFlags[t],s=tb(r,4&a?Qu(e):e,!!(12&a),null===(i=n.target.labeledElementDeclarations)||void 0===i?void 0:i[t]);o.push(s)})):o.push(r)},c=a;c-1)return e.createDiagnosticForNode(n[a],e.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);for(var o,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,d=0,_=r;d<_.length;d++){var p=_[d],f=Zb(p),m=Yb(p);fl&&(l=f),n.length1&&(y=G(p,kn,v,x)),y||(y=G(p,Nn,v,x)),y)return y;if(_)if(f)if(1===f.length||f.length>3){var S,D=f[f.length-1];f.length>3&&(S=e.chainDiagnosticMessages(S,e.Diagnostics.The_last_overload_gave_the_following_error),S=e.chainDiagnosticMessages(S,e.Diagnostics.No_overload_matches_this_call));var C=Zv(t,h,D,Nn,0,!0,(function(){return S}));if(C)for(var T=0,E=C;T3&&e.addRelatedInfo(k,e.createDiagnosticForNode(D.declaration,e.Diagnostics.The_last_overload_is_declared_here)),z(D,k),Dn.add(k)}else e.Debug.fail("No error for last overload signature")}else{for(var A=[],N=0,w=Number.MAX_VALUE,F=0,P=0,I=function(r){var n=Zv(t,h,r,Nn,0,!0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Overload_0_of_1_2_gave_the_following_error,P+1,p.length,qa(r))}));n?(n.length<=w&&(w=n.length,F=P),N=Math.max(N,n.length),A.push(n)):e.Debug.fail("No error for 3 or fewer overload signatures"),P++},O=0,M=f;O1?A[F]:e.flatten(A);e.Debug.assert(L.length>0,"No errors reported for 3 or fewer overload signatures");var R=e.chainDiagnosticMessages(e.map(L,e.createDiagnosticMessageChainFromDiagnostic),e.Diagnostics.No_overload_matches_this_call),B=r([],e.flatMap(L,(function(e){return e.relatedInformation})),!0),J=void 0;if(e.every(L,(function(e){return e.start===L[0].start&&e.length===L[0].length&&e.file===L[0].file}))){var V=L[0];J={file:V.file,start:V.start,length:V.length,code:R.code,category:R.category,messageText:R,relatedInformation:B}}else J=e.createDiagnosticForNodeFromMessageChain(t,R,B);z(f[0],J),Dn.add(J)}else if(m)Dn.add(ob(t,[m],h));else if(g)$v(g,t.typeArguments,!0,s);else{var K=e.filter(n,(function(e){return Vv(e,c)}));0===K.length?Dn.add(function(t,r,n){var i=n.length;if(1===r.length){var a=Al((d=r[0]).typeParameters),o=e.length(d.typeParameters);return e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,ai?c=Math.min(c,_):o0),UC(t),i||1===r.length||r.some((function(e){return!!e.typeParameters}))?function(t,r,n,i){var a=function(e,t){for(var r=-1,n=-1,i=0;i=t)return i;o>n&&(n=o,r=i)}return r}(r,void 0===de?n.length:de),o=r[a],s=o.typeParameters;if(!s)return o;var c=Ov(t)?t.typeArguments:void 0,l=c?zl(o,function(e,t,r){var n=e.map(nT);for(;n.length>t.length;)n.pop();for(;n.length1?e.find(c,(function(t){return e.isFunctionLikeDeclaration(t)&&e.nodeIsPresent(t.body)})):void 0;if(l){var u=wl(l),d=!u.typeParameters;G([u],Nn,d)&&e.addRelatedInfo(r,e.createDiagnosticForNode(l,e.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible))}f=a,m=o,g=s}function G(r,n,i,o){if(void 0===o&&(o=!1),f=void 0,m=void 0,g=void 0,i){var s=r[0];if(e.some(c)||!Uv(t,h,s,o))return;return Zv(t,h,s,n,0,!1,void 0)?void(f=[s]):s}for(var l=0;l=0&&jn(t.arguments[i],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher)}var a=Xh(t.expression);if(a===ct)return Lr;if(mo(a=Yc(a)))return Lv(t);if(fo(a))return t.typeArguments&&jn(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),Mv(t);var o=ul(a,1);if(o.length){if(!function(t,r){if(!r||!r.declaration)return!0;var n=r.declaration,i=e.getSelectedEffectiveModifierFlags(n,24);if(!i||171!==n.kind)return!0;var a=e.getClassLikeDeclarationOfSymbol(n.parent.symbol),o=Is(n.parent.symbol);if(!YC(t,a)){var s=e.getContainingClass(t);if(s&&16&i){var c=nT(s);if(mb(n.parent.symbol,c))return!0}return 8&i&&jn(t,e.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,Wa(o)),16&i&&jn(t,e.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,Wa(o)),!1}return!0}(t,o[0]))return Lv(t);if(fb(o,(function(e){return!!(4&e.flags)})))return jn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Lv(t);var s=a.symbol&&e.getClassLikeDeclarationOfSymbol(a.symbol);return s&&e.hasSyntacticModifier(s,128)?(jn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Lv(t)):sb(t,o,r,n,0)}var c=ul(a,0);if(c.length){var l=sb(t,c,r,n,0);return Z||(l.declaration&&!Cb(l.declaration)&&Bl(l)!==ot&&jn(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),Ml(l)===ot&&jn(t,e.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),l}return yb(t.expression,a,1),Lv(t)}function fb(t,r){return e.isArray(t)?e.some(t,(function(e){return fb(e,r)})):1048576===t.compositeKind?e.some(t.compositeSignatures,r):r(t)}function mb(t,r){var n=xs(r);if(!e.length(n))return!1;var i=n[0];if(2097152&i.flags){for(var a=_c(i.types),o=0,s=0,c=i.types;s0;if(1048576&r.flags){for(var c=!1,l=0,u=r.types;l1)return vE(r[1],e.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext)}if(0===r.length||r.length>2)return vE(t,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);var n=e.find(r,e.isSpreadElement);if(n)return vE(n,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element)}(t),0===t.arguments.length)return ux(t,Le);for(var r=t.arguments[0],n=zx(r),i=t.arguments.length>1?zx(t.arguments[1]):void 0,a=2;a=n-1)return r===n-1?a:Qu(t_(a,Ye));for(var o=[],s=[],c=[],l=r;l0&&(a=t.parameters.length-1+c)}}if(void 0===a){if(!n&&32&t.flags)return 0;a=t.minArgumentCount}if(i)return a;for(var l=a-1;l>=0;l--){if(131072&zg(Qb(t,l),Jv).flags)break;a=l}t.resolvedMinArgumentCount=a}return t.resolvedMinArgumentCount}function ex(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]);return!Vf(t)||t.target.hasRestElement}return!1}function tx(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]);if(!Vf(t))return t;if(t.target.hasRestElement)return od(t,t.target.fixedLength)}}function rx(e){var t=tx(e);return!t||Sf(t)||fo(t)||0!=(131072&nl(t).flags)?void 0:t}function nx(e){return ix(e,st)}function ix(e,t){return e.parameters.length>0?Qb(e,0):t}function ax(t,r){if(r.typeParameters){if(t.typeParameters)return;t.typeParameters=r.typeParameters}r.thisParameter&&((!(a=t.thisParameter)||a.valueDeclaration&&!a.valueDeclaration.type)&&(a||(t.thisParameter=lm(r.thisParameter,void 0)),ox(t.thisParameter,as(r.thisParameter))));for(var n=t.parameters.length-(j(t)?1:0),i=0;i0&&(n=yd(u,2)):l=st;var d=function(t,r){var n=[],i=[],a=0!=(2&e.getFunctionFlags(t));return e.forEachYieldExpression(t.body,(function(t){var o,s=t.expression?cS(t.expression,r):qe;if(e.pushIfUnique(n,px(t,s,Le,a)),t.asteriskToken){var c=MD(s,a?19:17,t.expression);o=c&&c.nextType}else o=ah(t);o&&e.pushIfUnique(i,o)})),{yieldTypes:n,nextTypes:i}}(t,r),_=d.yieldTypes,p=d.nextTypes;i=e.some(_)?yd(_,2):void 0,a=e.some(p)?Td(p):void 0}else{var f=yx(t,r);if(!f)return 2&o?ux(t,st):st;if(0===f.length)return 2&o?ux(t,ot):ot;n=yd(f,2)}if(n||i||a){if(i&&bm(t,i,3),n&&bm(t,n,1),a&&bm(t,a,2),n&&Of(n)||i&&Of(i)||a&&Of(a)){var m=dh(t),g=m?m===wl(t)?c?void 0:n:nh(Bl(m),t):void 0;c?(i=Uf(i,g,0,s),n=Uf(n,g,1,s),a=Uf(a,g,2,s)):n=function(e,t,r){return e&&Of(e)&&(e=jf(e,t?r?PS(t):t:void 0)),e}(n,g,s)}i&&(i=gm(i)),n&&(n=gm(n)),a&&(a=gm(a))}return c?_x(i||st,n||l,a||Uy(2,t)||Ke,s):s?cx(n||l):n||l}function _x(e,t,r,n){var i=n?Kr:zr,a=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||Ke,t=i.resolveIterationType(t,void 0)||Ke,r=i.resolveIterationType(r,void 0)||Ke,a===kt){var o=i.getGlobalIterableIteratorType(!1),s=o!==kt?JD(o,i):void 0,c=s?s.returnType:Le,l=s?s.nextType:Ge;return Cp(t,c)&&Cp(l,r)?o!==kt?Wu(o,[e]):(i.getGlobalIterableIteratorType(!0),Dt):(i.getGlobalGeneratorType(!0),Dt)}return Wu(a,[e,t,r])}function px(t,r,n,i){var a=t.expression||t,o=t.asteriskToken?AD(i?19:17,r,n,a):r;return i?RS(o,a,t.asteriskToken?e.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:e.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function fx(e,t,r,n){var i=0;if(n){for(var a=t;a=4)break;default:null!=i||(i=e.getSpanOfTokenAtPosition(n,t.pos)),Dn.add(e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher))}}}else if(!gE(n=e.getSourceFileOfNode(t))){if(i=e.getSpanOfTokenAtPosition(n,t.pos),a=e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),r&&171!==r.kind&&0==(2&e.getFunctionFlags(r))){var o=e.createDiagnosticForNode(r,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(a,o)}Dn.add(a)}}jy(t)&&jn(t,e.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer)}(t)}));var r=cS(t.expression),n=IS(r,!0,t,e.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return n!==r||mo(n)||3&r.flags||Un(!1,e.createDiagnosticForNode(t,e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression)),n}function kx(e){return Nx(e,2112)?wx(e,3)||Nx(e,296)?gt:Ze:Ye}function Ax(e,t){if(Nx(e,t))return!0;var r=Gc(e);return!!r&&Nx(r,t)}function Nx(e,t){if(e.flags&t)return!0;if(3145728&e.flags)for(var r=0,n=e.types;r1&&t.charCodeAt(r-1)>=48&&t.charCodeAt(r-1)<=57;)r--;for(var n=t.slice(0,r),i=1;;i++){var a=n+i;if(!rS(e,a))return a}}function iS(e){var t=Kv(e);if(t&&!t.typeParameters)return Bl(t)}function aS(t){var r=oS(t);if(r)return r;if(134217728&t.flags&&kr){var n=kr[O(t)];if(n)return n}var i=Yr,a=cS(t);Yr!==i&&((kr||(kr=[]))[O(t)]=a,e.setNodeFlags(t,134217728|t.flags));return a}function oS(t){var r=e.skipParentheses(t,!0);if(e.isJSDocTypeAssertion(r)){var n=e.getJSDocTypeAssertionType(r);if(!e.isConstTypeReference(n))return J_(n)}if(r=e.skipParentheses(t),!e.isCallExpression(r)||106===r.expression.kind||e.isRequireCall(r,!0)||Nb(r)){if(e.isAssertionExpression(r)&&!e.isConstTypeReference(r.type))return J_(r.type);if(8===t.kind||10===t.kind||110===t.kind||95===t.kind)return cS(t)}else{if(n=e.isCallChain(r)?function(e){var t=cS(e.expression),r=im(t,e.expression),n=iS(t);return n&&nm(n,e,r!==t)}(r):iS(Xh(r.expression)))return n}}function sS(e){var t=ni(e);if(t.contextFreeType)return t.contextFreeType;var r=e.contextualType;e.contextualType=Le;try{return t.contextFreeType=cS(e,4)}finally{e.contextualType=r}}function cS(t,r,n){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkExpression",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var a=u;u=t,E=0;var o=function(t,r,n){var a=t.kind;if(i)switch(a){case 226:case 213:case 214:i.throwIfCancellationRequested()}switch(a){case 79:return Ty(t,r);case 80:return cv(t);case 108:return Fy(t);case 106:return Oy(t);case 104:return Xe;case 14:case 10:return A_(F_(t.text));case 8:return SE(t),A_(P_(+t.text));case 9:return function(t){if(!(e.isLiteralTypeNode(t.parent)||e.isPrefixUnaryExpression(t.parent)&&e.isLiteralTypeNode(t.parent.parent))&&G<7&&vE(t,e.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020))return!0}(t),A_(I_({negative:!1,base10Value:e.parsePseudoBigInt(t.text)}));case 110:return rt;case 95:return et;case 223:return Ux(t);case 13:return Wt;case 204:return fh(t,r,n);case 205:return xh(t,r);case 206:return iv(t,r);case 161:return av(t,r);case 207:return Pv(t,r);case 208:if(100===t.expression.kind)return wb(t);case 209:return function(t,r){var n;ZT(t,t.typeArguments);var i=Db(t,void 0,r);if(i===Mr)return lt;if(kb(i,t),106===t.expression.kind)return ot;if(209===t.kind){var a=i.declaration;if(a&&171!==a.kind&&175!==a.kind&&180!==a.kind&&!e.isJSDocConstructSignature(a)&&!Cb(a))return Z&&jn(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),Le}if(e.isInJSFile(t)&&Ob(t))return Ol(t.arguments[0]);var o=Bl(i);if(12288&o.flags&&Nb(t))return M_(e.walkUpParenthesizedExpressions(t.parent));if(208===t.kind&&!t.questionDotToken&&238===t.parent.kind&&16384&o.flags&&Ll(i))if(e.isDottedName(t.expression)){if(!cy(t)){var s=jn(t.expression,e.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);sy(t.expression,s)}}else jn(t.expression,e.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(e.isInJSFile(t)){var c=Eb(t,!1);if(null===(n=null==c?void 0:c.exports)||void 0===n?void 0:n.size){var l=Na(c,c.exports,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=4096,Td([o,l])}}return o}(t,r);case 210:return Mb(t);case 212:return function(t,r){if(e.hasJSDocNodes(t)&&e.isJSDocTypeAssertion(t)){var n=e.getJSDocTypeAssertionType(t);return Rb(n,n,t.expression,r)}return cS(t.expression,r)}(t,r);case 226:return function(e){return uC(e),UC(e),as(da(e))}(t);case 213:case 214:return vx(t,r);case 216:return function(e){return cS(e.expression),En}(t);case 211:case 229:return function(t){if(211===t.kind){var r=e.getSourceFileOfNode(t);r&&e.fileExtensionIsOneOf(r.fileName,[".cts",".mts"])&&vE(t,e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead)}return Rb(t,t.type,t.expression)}(t);case 230:return Bb(t);case 228:return Jb(t);case 231:return jb(t);case 215:return Tx(t);case 217:return function(e){return cS(e.expression),qe}(t);case 218:return Ex(t);case 219:return function(t){var r=cS(t.operand);if(r===ct)return ct;switch(t.operand.kind){case 8:switch(t.operator){case 40:return A_(P_(-t.operand.text));case 39:return A_(P_(+t.operand.text))}break;case 9:if(40===t.operator)return A_(I_({negative:!0,base10Value:e.parsePseudoBigInt(t.operand.text)}))}switch(t.operator){case 39:case 40:case 54:return rv(r,t.operand),Ax(r,12288)&&jn(t.operand,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(t.operator)),39===t.operator?(Nx(r,2112)&&jn(t.operand,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1,e.tokenToString(t.operator),Wa(Rf(r))),Ye):kx(r);case 53:CD(t.operand);var n=12582912&Dg(r);return 4194304===n?et:8388608===n?rt:it;case 45:case 46:return bx(t.operand,rv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Cx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),kx(r)}return Je}(t);case 220:return function(t){var r=cS(t.operand);return r===ct?ct:(bx(t.operand,rv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Cx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),kx(r))}(t);case 221:return ae(t,r);case 222:return function(e,t){return CD(e.condition),SD(e.condition,e.whenTrue),yd([cS(e.whenTrue,t),cS(e.whenFalse,t)],2)}(t,r);case 225:return function(e,t){return G<2&&zT(e,z.downlevelIteration?1536:1024),AD(33,cS(e.expression,t),Ge,e.expression)}(t,r);case 227:return qe;case 224:return function(t){g((function(){8192&t.flags||yE(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),jy(t)&&jn(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer)}));var r=e.getContainingFunction(t);if(!r)return Le;var n=e.getFunctionFlags(r);if(!(1&n))return Le;var i=0!=(2&n);t.asteriskToken&&(i&&G<99&&zT(t,26624),!i&&G<2&&z.downlevelIteration&&zT(t,256));var a=Jl(r),o=a&&YD(a,i),s=o&&o.yieldType||Le,c=o&&o.nextType||Le,l=i?RS(c)||Le:c,u=t.expression?cS(t.expression):qe,d=px(t,u,l,i);if(a&&d&&Np(d,s,t.expression||t,t.expression),t.asteriskToken)return wD(i?19:17,1,u,t.expression)||Le;if(a)return $D(2,a,i)||Le;var _=Uy(2,r);return _||(_=Le,g((function(){if(Z&&!e.expressionResultIsUnused(t)){var r=ah(t);r&&!fo(r)||jn(t,e.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation)}}))),_}(t);case 232:return function(e){return e.isSpread?t_(e.type,Ye):e.type}(t);case 288:return zh(t,r);case 278:case 279:return function(e,t){return UC(e),Jh(e)||Le}(t);case 282:return function(t){Uh(t.openingFragment);var r=e.getSourceFileOfNode(t);return!e.getJSXTransformEnabled(z)||!z.jsxFactory&&!r.pragmas.has("jsx")||z.jsxFragmentFactory||r.pragmas.has("jsxfrag")||jn(t,z.jsxFactory?e.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:e.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),Eh(t),Jh(t)||Le}(t);case 286:return Ah(t,r);case 280:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement")}return Je}(t,r,n),s=Zx(t,o,r);return Px(s)&&function(t,r){206===t.parent.kind&&t.parent.expression===t||207===t.parent.kind&&t.parent.expression===t||(79===t.kind||161===t.kind)&&ZC(t)||181===t.parent.kind&&t.parent.exprName===t||275===t.parent.kind||jn(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);if(z.isolatedModules){e.Debug.assert(!!(128&r.symbol.flags)),16777216&r.symbol.valueDeclaration.flags&&jn(t,e.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided)}}(t,s),u=a,null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function lS(t){WT(t),t.expression&&yE(t.expression,e.Diagnostics.Type_expected),JC(t.constraint),JC(t.default);var r=Ps(da(t));zc(r),function(e){return Hc(e)!==wt}(r)||jn(t.default,e.Diagnostics.Type_parameter_0_has_a_circular_default,Wa(r));var n=Jc(r),i=Qc(r);n&&i&&Ap(i,Zs(up(n,W_(r,i)),i),t.default,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1),UC(t),g((function(){return oC(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0)}))}function uS(t){qT(t),gD(t);var r=e.getContainingFunction(t);e.hasSyntacticModifier(t,16476)&&(171===r.kind&&e.nodeIsPresent(r.body)||jn(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation),171===r.kind&&e.isIdentifier(t.name)&&"constructor"===t.name.escapedText&&jn(t.name,e.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name)),t.questionToken&&e.isBindingPattern(t.name)&&r.body&&jn(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),t.name&&e.isIdentifier(t.name)&&("this"===t.name.escapedText||"new"===t.name.escapedText)&&(0!==r.parameters.indexOf(t)&&jn(t,e.Diagnostics.A_0_parameter_must_be_the_first_parameter,t.name.escapedText),171!==r.kind&&175!==r.kind&&180!==r.kind||jn(t,e.Diagnostics.A_constructor_cannot_have_a_this_parameter),214===r.kind&&jn(t,e.Diagnostics.An_arrow_function_cannot_have_a_this_parameter),172!==r.kind&&173!==r.kind||jn(t,e.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters)),!t.dotDotDotToken||e.isBindingPattern(t.name)||Cp(nl(as(t.symbol)),$t)||jn(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type)}function dS(t,r,n){for(var i=0,a=t.elements;i=2||!e.hasRestParameter(t)||16777216&t.flags||e.nodeIsMissing(t.body))return;e.forEach(t.parameters,(function(t){t.name&&!e.isBindingPattern(t.name)&&t.name.escapedText===_e.escapedName&&Bn("noEmit",t,e.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)}))}(t);var r=e.getEffectiveReturnTypeNode(t);if(Z&&!r)switch(t.kind){case 175:jn(t,e.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 174:jn(t,e.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)}if(r){var n=e.getFunctionFlags(t);if(1==(5&n)){var i=J_(r);if(i===ot)jn(r,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else{var a=$D(0,i,0!=(2&n))||Le,o=$D(1,i,0!=(2&n))||a,s=$D(2,i,0!=(2&n))||Ke;Ap(_x(a,o,s,!!(2&n)),i,r)}}else 2==(3&n)&&function(t,r){var n=J_(r);if(G>=2){if(mo(n))return;var i=Uu(!0);if(i!==kt&&!ss(n,i))return void jn(r,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,Wa(BS(n)||ot))}else{if(function(t){jS(t&&e.getEntityNameFromTypeNode(t),!1)}(r),mo(n))return;var a=e.getEntityNameFromTypeNode(r);if(void 0===a)return void jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,Wa(n));var o=Wi(a,111551,!0),s=o?as(o):Je;if(mo(s))return void(79===a.kind&&"Promise"===a.escapedText&&cs(n)===Uu(!1)?jn(r,e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a)));var c=(d=!0,or||(or=Mu("PromiseConstructorLike",0,d))||Dt);if(c===Dt)return void jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a));if(!Ap(s,c,r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value))return;var l=a&&e.getFirstIdentifier(a),u=ai(t.locals,l.escapedText,111551);if(u)return void jn(u.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,e.idText(l),e.entityNameToString(a))}var d;IS(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)}(t,r)}176!==t.kind&&317!==t.kind&&HS(t)}))}function pS(t){for(var r=new e.Map,n=0,i=t.members;n0&&r.declarations[0]!==t)return}var n=Ql(da(t));if(null==n?void 0:n.declarations){for(var i=new e.Map,a=function(e){1===e.parameters.length&&e.parameters[0].type&&Ug(J_(e.parameters[0].type),(function(t){var r=i.get(ud(t));r?r.declarations.push(e):i.set(ud(t),{type:t,declarations:[e]})}))},o=0,s=n.declarations;o1)for(var r=0,n=t.declarations;r0}function MS(e){var t;if(16777216&e.flags){var r=qu(!1);return!!r&&e.aliasSymbol===r&&1===(null===(t=e.aliasTypeArguments)||void 0===t?void 0:t.length)}return!1}function LS(e){return 1048576&e.flags?Wg(e,LS):MS(e)?e.aliasTypeArguments[0]:e}function RS(t,r,n,i){var a=BS(t,r,n,i);return a&&function(t){if(fo(t))return t;if(MS(t))return t;if(Hd(t)){var r=zc(t);if(!r||3&r.flags||Vp(r)||OS(r)){var n=qu(!0);if(n)return fu(n,[LS(t)])}}return e.Debug.assert(void 0===PS(t),"type provided should not be a non-generic 'promise'-like."),t}(a)}function BS(t,r,n,i){if(fo(t))return t;if(MS(t))return t;var a=t;if(a.awaitedTypeOfType)return a.awaitedTypeOfType;if(1048576&t.flags){var o=r?function(e){return BS(e,r,n,i)}:BS;return a.awaitedTypeOfType=Wg(t,o)}var s=PS(t);if(s){if(t.id===s.id||Sn.lastIndexOf(s.id)>=0)return void(r&&jn(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));Sn.push(t.id);var c=BS(s,r,n,i);if(Sn.pop(),!c)return;return a.awaitedTypeOfType=c}if(!OS(t))return a.awaitedTypeOfType=t;r&&(e.Debug.assertIsDefined(n),jn(r,n,i))}function JS(t){var r=Db(t);kb(r,t);var n=Bl(r);if(!(1&n.flags)){var i,a;switch(t.parent.kind){case 257:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=yd([as(da(t.parent)),ot]);break;case 167:case 164:i=e.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any,a=ot;break;case 169:case 172:case 173:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=yd([Hu(nT(t.parent)),ot]);break;default:return e.Debug.fail()}Ap(n,a,t,i)}}function jS(t,r){if(t){var n=e.getFirstIdentifier(t),i=2097152|(79===t.kind?788968:1920),a=li(n,n.escapedText,i,void 0,void 0,!0);if(a&&2097152&a.flags)if(!ha(a)||bT(Ji(a))||Vi(a)){if(r&&z.isolatedModules&&e.getEmitModuleKind(z)>=e.ModuleKind.ES2015&&!ha(a)&&!e.some(a.declarations,e.isTypeOnlyImportOrExportDeclaration)){var o=jn(t,e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled),s=e.find(a.declarations||e.emptyArray,Si);s&&e.addRelatedInfo(o,e.createDiagnosticForNode(s,e.Diagnostics._0_was_imported_here,e.idText(n)))}}else zi(a)}}function US(t){var r=VS(t);r&&e.isEntityName(r)&&jS(r,!0)}function VS(e){if(e)switch(e.kind){case 188:case 187:return KS(e.types);case 189:return KS([e.trueType,e.falseType]);case 191:case 197:return VS(e.type);case 178:return e.typeName}}function KS(t){for(var r,n=0,i=t;n=e.ModuleKind.ES2015)||q>=e.ModuleKind.Node16&&e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&r&&(lD(t,r,"require")||lD(t,r,"exports"))&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=_o(t);305===n.kind&&e.isExternalOrCommonJsModule(n)&&Bn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,e.declarationNameToString(r),e.declarationNameToString(r))}}(t,r),function(t,r){if(r&&!(G>=4)&&lD(t,r,"Promise")&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=_o(t);305===n.kind&&e.isExternalOrCommonJsModule(n)&&2048&n.flags&&Bn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,e.declarationNameToString(r),e.declarationNameToString(r))}}(t,r),function(e,t){G<=8&&(lD(e,t,"WeakMap")||lD(e,t,"WeakSet"))&&bn.push(e)}(t,r),function(e,t){t&&G>=2&&G<=8&&lD(e,t,"Reflect")&&xn.push(e)}(t,r),e.isClassLike(t)?(oC(r,e.Diagnostics.Class_name_cannot_be_0),16777216&t.flags||function(t){G>=1&&"Object"===t.escapedText&&(q1&&e.some(_.declarations,(function(r){return r!==t&&e.isVariableLike(r)&&!hD(r,t)}))&&jn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name))}else{var m=mD(Vo(t));mo(p)||mo(m)||vp(p,m)||67108864&_.flags||yD(_.valueDeclaration,p,t,m),t.initializer&&Np(zx(t.initializer),m,t,t.initializer,void 0),_.valueDeclaration&&!hD(t,_.valueDeclaration)&&jn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name))}167!==t.kind&&166!==t.kind&&(wS(t),254!==t.kind&&203!==t.kind||function(t){if(0==(3&e.getCombinedNodeFlags(t))&&!e.isParameterDeclaration(t)&&(254!==t.kind||t.initializer)){var r=da(t);if(1&r.flags){if(!e.isIdentifier(t.name))return e.Debug.fail();var n=li(t,t.name.escapedText,3,void 0,void 0,!1);if(n&&n!==r&&2&n.flags&&3&Gh(n)){var i=e.getAncestor(n.valueDeclaration,255),a=237===i.parent.kind&&i.parent.parent?i.parent.parent:void 0;if(!a||!(235===a.kind&&e.isFunctionLike(a.parent)||262===a.kind||261===a.kind||305===a.kind)){var o=Ga(n);jn(t,e.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,o,o)}}}}}(t),fD(t,t.name))}}}}function yD(t,r,n,i){var a=e.getNameOfDeclaration(n),o=167===n.kind||166===n.kind?e.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:e.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,s=e.declarationNameToString(a),c=jn(a,o,s,Wa(r),Wa(i));t&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,e.Diagnostics._0_was_also_declared_here,s))}function hD(t,r){if(164===t.kind&&254===r.kind||254===t.kind&&164===r.kind)return!0;if(e.hasQuestionToken(t)!==e.hasQuestionToken(r))return!1;return e.getSelectedEffectiveModifierFlags(t,504)===e.getSelectedEffectiveModifierFlags(r,504)}function vD(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath}),function(t){if(243!==t.parent.parent.kind&&244!==t.parent.parent.kind)if(16777216&t.flags)dE(t);else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return vE(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isVarConst(t))return vE(t,e.Diagnostics.const_declarations_must_be_initialized)}if(t.exclamationToken&&(237!==t.parent.parent.kind||!t.type||t.initializer||16777216&t.flags)){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return vE(t.exclamationToken,r)}!(q=1&&vD(t.declarations[0])}function kD(e){return AD(e.awaitModifier?15:13,Xh(e.expression),Ge,e.expression)}function AD(e,t,r,n){return fo(t)?t:ND(e,t,r,n,!0)||Le}function ND(t,r,n,i,a){var o=0!=(2&t);if(r!==st){var s=G>=2,c=!s&&z.downlevelIteration,l=z.noUncheckedIndexedAccess&&!!(128&t);if(s||c||o){var u=MD(r,t,s?i:void 0);if(a&&u){var d=8&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&t?e.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;d&&Ap(n,u.nextType,i,d)}if(u||s)return l?Ag(u&&u.yieldType):u&&u.yieldType}var _=r,p=!1,f=!1;if(4&t){if(1048576&_.flags){var m=r.types,g=e.filter(m,(function(e){return!(402653316&e.flags)}));g!==m&&(_=yd(g,2))}else 402653316&_.flags&&(_=st);if((f=_!==r)&&(G<1&&i&&(jn(i,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),p=!0),131072&_.flags))return l?Ag($e):$e}if(!kf(_)){if(i&&!p){var y=function(n,i){var a;if(i)return n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0];if(wD(t,0,r,void 0))return[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!1];if(function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return!0}return!1}(null===(a=r.symbol)||void 0===a?void 0:a.escapedName))return[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0];return n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,!0]:[e.Diagnostics.Type_0_is_not_an_array_type,!0]}(!!(4&t)&&!f,c),h=y[0];Kn(i,y[1]&&!!FS(_),h,Wa(_))}return f?l?Ag($e):$e:void 0}var v=yl(_,Ye);return f&&v?402653316&v.flags&&!z.noUncheckedIndexedAccess?$e:yd(l?[v,$e,Ge]:[v,$e],2):128&t?Ag(v):v}VD(i,r,o)}function wD(e,t,r,n){if(!fo(r)){var i=MD(r,e,n);return i&&i[J(t)]}}function FD(e,t,r){if(void 0===e&&(e=st),void 0===t&&(t=st),void 0===r&&(r=Ke),67359327&e.flags&&180227&t.flags&&180227&r.flags){var n=au([e,t,r]),i=Br.get(n);return i||(i={yieldType:e,returnType:t,nextType:r},Br.set(n,i)),i}return{yieldType:e,returnType:t,nextType:r}}function PD(t){for(var r,n,i,a=0,o=t;a1)for(var p=0,f=i;pi)return!1;for(var u=0;u1)return yE(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);r=!0}else{if(e.Debug.assert(117===o.token),n)return yE(o,e.Diagnostics.implements_clause_already_seen);n=!0}eE(o)}})(t)||XT(t.typeParameters,r)}(t),GS(t),fD(t,t.name),sC(e.getEffectiveTypeParameterDeclarations(t)),wS(t);var r=da(t),n=Is(r),i=Zs(n),a=as(r);cC(r),NS(r),function(t){for(var r=new e.Map,n=new e.Map,i=new e.Map,a=0,o=t.members;a>a;case 49:return i>>>a;case 47:return i<1){var i=e.isEnumConst(t);e.forEach(r.declarations,(function(t){e.isEnumDeclaration(t)&&e.isEnumConst(t)!==i&&jn(e.getNameOfDeclaration(t),e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const)}))}var a=!1;e.forEach(r.declarations,(function(t){if(260!==t.kind)return!1;var r=t;if(!r.members.length)return!1;var n=r.members[0];n.initializer||(a?jn(n.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):a=!0)}))}}(t)}))}function SC(t){e.isPrivateIdentifier(t.name)&&jn(t,e.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier)}function DC(t){t.body&&(JC(t.body),e.isGlobalScopeAugmentation(t)||HS(t)),g((function(){var r=e.isGlobalScopeAugmentation(t),n=16777216&t.flags;r&&!n&&jn(t.name,e.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);var i=e.isAmbientModule(t),a=i?e.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:e.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(IC(t,a))return;qT(t)||n||10!==t.name.kind||vE(t.name,e.Diagnostics.Only_ambient_modules_can_use_quoted_names);e.isIdentifier(t.name)&&fD(t,t.name);wS(t);var o=da(t);if(512&o.flags&&!n&&o.declarations&&o.declarations.length>1&&L(t,e.shouldPreserveConstEnums(z))){var s=function(t){var r=t.declarations;if(r)for(var n=0,i=r;n1&&!BC(n))for(var o=0,s=n;o1&&t.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&(e.isExportsIdentifier(t.expression)||e.isModuleExportsAccessExpression(t.expression))}))}function JC(t){if(t){var r=u;u=t,E=0,function(t){e.isInJSFile(t)&&e.forEach(t.jsDoc,(function(t){var r=t.tags;return e.forEach(r,JC)}));var r=t.kind;if(i)switch(r){case 261:case 257:case 258:case 256:i.throwIfCancellationRequested()}r>=237&&r<=253&&t.flowNode&&!uy(t.flowNode)&&Vn(!1===z.allowUnreachableCode,t,e.Diagnostics.Unreachable_code_detected);switch(r){case 163:return lS(t);case 164:return uS(t);case 167:return mS(t);case 166:return function(t){return e.isPrivateIdentifier(t.name)&&jn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),mS(t)}(t);case 180:case 179:case 174:case 175:case 176:return _S(t);case 169:case 168:return function(t){lE(t)||rE(t.name),WS(t),e.hasSyntacticModifier(t,128)&&169===t.kind&&t.body&&jn(t,e.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,e.declarationNameToString(t.name)),e.isPrivateIdentifier(t.name)&&!e.getContainingClass(t)&&jn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),gS(t)}(t);case 170:return function(t){qT(t),e.forEachChild(t,JC)}(t);case 171:return yS(t);case 172:case 173:return vS(t);case 178:return DS(t);case 177:return function(t){var r=function(e){switch(e.parent.kind){case 214:case 174:case 256:case 213:case 179:case 169:case 168:var t=e.parent;if(e===t.type)return t}}(t);if(r){var n=wl(r),i=Ll(n);if(i){JC(t.type);var a=t.parameterName;if(0===i.kind||2===i.kind)L_(a);else if(i.parameterIndex>=0)j(n)&&i.parameterIndex===n.parameters.length-1?jn(a,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):i.type&&Ap(i.type,as(n.parameters[i.parameterIndex]),t.type,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type)}));else if(a){for(var o=!1,s=0,c=r.parameters;s1){var n=ri(r);if(!n.typeParametersChecked){n.typeParametersChecked=!0;var i=Ps(r),a=e.getDeclarationsOfKind(r,163);if(!lC(a,[i],(function(e){return[e]})))for(var o=Ga(r),s=0,c=a;s0),n.length>1&&jn(n[1],e.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);var i=qS(t.class.expression),a=e.getClassExtendsHeritageElement(r);if(a){var o=qS(a.expression);o&&i.escapedText!==o.escapedText&&jn(i,e.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause,e.idText(t.tagName),e.idText(i),e.idText(o))}}else jn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName))}(t);case 329:return function(t){var r=e.getEffectiveJSDocHost(t);r&&(e.isClassDeclaration(r)||e.isClassExpression(r))||jn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName))}(t);case 345:case 338:case 339:return function(t){t.typeExpression||jn(t.name,e.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),t.name&&oC(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),JC(t.typeExpression),sC(e.getEffectiveTypeParameterDeclarations(t))}(t);case 344:return function(e){JC(e.constraint);for(var t=0,r=e.typeParameters;t=e.ModuleKind.ES2015&&void 0===e.getSourceFileOfNode(t).impliedNodeFormat)||t.isTypeOnly||16777216&t.flags||vE(t,e.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead)}(t);case 272:return PC(t);case 271:return function(t){if(!IC(t,t.isExportEquals?e.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration)){var r=305===t.parent.kind?t.parent:t.parent.parent;if(261!==r.kind||e.isAmbientModule(r)){!qT(t)&&e.hasEffectiveModifiers(t)&&yE(t,e.Diagnostics.An_export_assignment_cannot_have_modifiers);var n=e.getEffectiveTypeAnnotationNode(t);if(n&&Ap(zx(t.expression),J_(n),t.expression),79===t.expression.kind){var i=t.expression,a=Wi(i,67108863,!0,!0,t);if(a){Cy(a,i);var o=2097152&a.flags?Ji(a):a;(o===Pe||111551&o.flags)&&zx(t.expression)}else zx(t.expression);e.getEmitDeclarations(z)&&oo(t.expression,!0)}else zx(t.expression);RC(r),16777216&t.flags&&!e.isEntityNameExpression(t.expression)&&vE(t.expression,e.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),!t.isExportEquals||16777216&t.flags||(q>=e.ModuleKind.ES2015&&e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.CommonJS?vE(t,e.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):q===e.ModuleKind.System&&vE(t,e.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system))}else t.isExportEquals?jn(t,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace):jn(t,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module)}}(t);case 236:case 253:return void xE(t);case 276:(function(e){GS(e)})(t)}}(t),u=r}}function jC(t){e.isInJSFile(t)||vE(t,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments)}function UC(t){var r=ni(e.getSourceFileOfNode(t));1&r.flags||(r.deferredNodes||(r.deferredNodes=new e.Set),r.deferredNodes.add(t))}function VC(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkDeferredNode",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var r=u;switch(u=t,E=0,t.kind){case 208:case 209:case 210:case 165:case 280:Mv(t);break;case 213:case 214:case 169:case 168:!function(t){e.Debug.assert(169!==t.kind||e.isObjectLiteralMethod(t));var r=e.getFunctionFlags(t),n=Jl(t);if(hx(t,n),t.body)if(e.getEffectiveReturnTypeNode(t)||Bl(wl(t)),235===t.body.kind)JC(t.body);else{var i=cS(t.body),a=n&&eC(n,r);a&&Np(2==(3&r)?IS(i,!1,t.body,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,a,t.body,t.body)}}(t);break;case 172:case 173:vS(t);break;case 226:!function(t){e.forEach(t.members,JC),HS(t)}(t);break;case 163:!function(t){if(e.isInterfaceDeclaration(t.parent)||e.isClassLike(t.parent)||e.isTypeAliasDeclaration(t.parent)){var r=Ps(da(t)),n=lf(r);if(n){var i=da(t.parent);if(!e.isTypeAliasDeclaration(t.parent)||48&e.getObjectFlags(Is(i))){if(32768===n||65536===n){var a=sf(i,r,65536===n?It:Pt),o=sf(i,r,65536===n?Pt:It),s=r;d=r,Ap(a,o,t,e.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation),d=s}}else jn(t,e.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types)}}}(t);break;case 279:!function(e){Uh(e)}(t);break;case 278:!function(e){Uh(e.openingElement),Ch(e.closingElement.tagName)?wh(e.closingElement):cS(e.closingElement.tagName),Eh(e)}(t)}u=r,null===e.tracing||void 0===e.tracing||e.tracing.pop()}function KC(r){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkSourceFile",{path:r.path},!0),e.performance.mark("beforeCheck"),function(r){var n=ni(r);if(!(1&n.flags)){if(e.skipTypeChecking(r,z,t))return;!function(t){!!(16777216&t.flags)&&function(t){for(var r=0,n=t.statements;r0?e.concatenate(o,a):a}return e.forEach(t.getSourceFiles(),HC),Dn.getDiagnostics()}(r)}finally{i=void 0}}function WC(){for(var e=0,t=m;e1||1===r.length&&r[0].declaration!==t}return!1}function DT(t){return!(!Q||Tl(t)||e.isJSDocParameterTag(t)||!t.initializer||e.hasSyntacticModifier(t,16476))}function CT(t){return Q&&Tl(t)&&!t.initializer&&e.hasSyntacticModifier(t,16476)}function TT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return!1;var n=da(r);return!!(n&&16&n.flags)&&!!e.forEachEntry(oa(n),(function(t){return 111551&t.flags&&t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)}))}function ET(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return e.emptyArray;var n=da(r);return n&&Rc(as(n))||e.emptyArray}function kT(e){var t,r=e.id||0;return r<0||r>=ln.length?0:(null===(t=ln[r])||void 0===t?void 0:t.flags)||0}function AT(e){return hC(e.parent),ni(e).enumMemberValue}function NT(e){switch(e.kind){case 299:case 206:case 207:return!0}return!1}function wT(t){if(299===t.kind)return AT(t);var r=ni(t).resolvedSymbol;if(r&&8&r.flags){var n=r.valueDeclaration;if(e.isEnumConst(n.parent))return AT(n)}}function FT(e){return!!(524288&e.flags)&&ul(e,0).length>0}function PT(t,r){var n,i,a=e.getParseTreeNode(t,e.isEntityName);if(!a)return e.TypeReferenceSerializationKind.Unknown;if(r&&!(r=e.getParseTreeNode(r)))return e.TypeReferenceSerializationKind.Unknown;var o=!1;if(e.isQualifiedName(a)){var s=Wi(e.getFirstIdentifier(a),111551,!0,!0,r);o=!!(null===(n=null==s?void 0:s.declarations)||void 0===n?void 0:n.every(e.isTypeOnlyImportOrExportDeclaration))}var c=Wi(a,111551,!0,!0,r),l=c&&2097152&c.flags?Ji(c):c;o||(o=!!(null===(i=null==c?void 0:c.declarations)||void 0===i?void 0:i.every(e.isTypeOnlyImportOrExportDeclaration)));var u=Wi(a,788968,!0,!1,r);if(l&&l===u){var d=Ku(!1);if(d&&l===d)return e.TypeReferenceSerializationKind.Promise;var _=as(l);if(_&&ms(_))return o?e.TypeReferenceSerializationKind.TypeWithCallSignature:e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue}if(!u)return o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown;var p=Is(u);return mo(p)?o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown:3&p.flags?e.TypeReferenceSerializationKind.ObjectType:wx(p,245760)?e.TypeReferenceSerializationKind.VoidNullableOrNeverType:wx(p,528)?e.TypeReferenceSerializationKind.BooleanType:wx(p,296)?e.TypeReferenceSerializationKind.NumberLikeType:wx(p,2112)?e.TypeReferenceSerializationKind.BigIntLikeType:wx(p,402653316)?e.TypeReferenceSerializationKind.StringLikeType:Vf(p)?e.TypeReferenceSerializationKind.ArrayLikeType:wx(p,12288)?e.TypeReferenceSerializationKind.ESSymbolType:FT(p)?e.TypeReferenceSerializationKind.TypeWithCallSignature:Sf(p)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function IT(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isVariableLikeOrAccessor);if(!o)return e.factory.createToken(130);var s=da(o),c=!s||133120&s.flags?Je:Bf(as(s));return 8192&c.flags&&c.symbol===s&&(n|=1048576),a&&(c=Zf(c)),se.typeToTypeNode(c,r,1024|n,i)}function OT(t,r,n,i){var a=e.getParseTreeNode(t,e.isFunctionLike);if(!a)return e.factory.createToken(130);var o=wl(a);return se.typeToTypeNode(Bl(o),r,1024|n,i)}function MT(t,r,n,i){var a=e.getParseTreeNode(t,e.isExpression);if(!a)return e.factory.createToken(130);var o=gm(aT(a));return se.typeToTypeNode(o,r,1024|n,i)}function LT(t){return ce.has(e.escapeLeadingUnderscores(t))}function RT(t,r){var n=ni(t).resolvedSymbol;if(n)return n;var i=t;if(r){var a=t.parent;e.isDeclaration(a)&&t===a.name&&(i=_o(a))}return li(i,t.escapedText,3257279,void 0,void 0,!0)}function BT(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=RT(r);if(n)return ya(n).valueDeclaration}}}function JT(t){return!!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&w_(as(da(t)))}function jT(t,r){return function(t,r,n){var i=1024&t.flags?se.symbolToExpression(t.symbol,111551,r,void 0,n):t===rt?e.factory.createTrue():t===et&&e.factory.createFalse();if(i)return i;var a=t.value;return"object"==typeof a?e.factory.createBigIntLiteral(a):"number"==typeof a?e.factory.createNumericLiteral(a):e.factory.createStringLiteral(a)}(as(da(t)),t,r)}function UT(t){return t?(Mn(t),e.getSourceFileOfNode(t).localJsxFactory||Nr):Nr}function VT(t){if(t){var r=e.getSourceFileOfNode(t);if(r){if(r.localJsxFragmentFactory)return r.localJsxFragmentFactory;var n=r.pragmas.get("jsxfrag"),i=e.isArray(n)?n[0]:n;if(i)return r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,G),r.localJsxFragmentFactory}}if(z.jsxFragmentFactory)return e.parseIsolatedEntityName(z.jsxFragmentFactory,G)}function KT(t){var r=261===t.kind?e.tryCast(t.name,e.isStringLiteral):e.getExternalModuleName(t),n=Xi(r,r,void 0);if(n)return e.getDeclarationOfKind(n,305)}function zT(t,r){if((o&r)!==r&&z.importHelpers){var n=e.getSourceFileOfNode(t);if(e.isEffectiveExternalModule(n,z)&&!(16777216&t.flags)){var i=function(t,r){s||(s=$i(t,e.externalHelpersModuleNameText,e.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,r)||Pe);return s}(n,t);if(i!==Pe)for(var a=r&~o,c=1;c<=4194304;c<<=1)if(a&c){var l=GT(c),u=ai(i.exports,e.escapeLeadingUnderscores(l),111551);u?524288&c?e.some(Il(u),(function(e){return Yb(e)>3}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,4):1048576&c?e.some(Il(u),(function(e){return Yb(e)>4}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,5):1024&c&&(e.some(Il(u),(function(e){return Yb(e)>2}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,3)):jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l)}o|=r}}}function GT(t){switch(t){case 1:return"__extends";case 2:return"__assign";case 4:return"__rest";case 8:return"__decorate";case 16:return"__metadata";case 32:return"__param";case 64:return"__awaiter";case 128:return"__generator";case 256:return"__values";case 512:return"__read";case 1024:return"__spreadArray";case 2048:return"__await";case 4096:return"__asyncGenerator";case 8192:return"__asyncDelegator";case 16384:return"__asyncValues";case 32768:return"__exportStar";case 65536:return"__importStar";case 131072:return"__importDefault";case 262144:return"__makeTemplateObject";case 524288:return"__classPrivateFieldGet";case 1048576:return"__classPrivateFieldSet";case 2097152:return"__classPrivateFieldIn";case 4194304:return"__createBinding";default:return e.Debug.fail("Unrecognized helper")}}function qT(t){return function(t){if(!t.decorators)return!1;if(!e.nodeCanBeDecorated(t,t.parent,t.parent.parent))return 169!==t.kind||e.nodeIsPresent(t.body)?yE(t,e.Diagnostics.Decorators_are_not_valid_here):yE(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(172===t.kind||173===t.kind){var r=e.getAllAccessorDeclarations(t.parent.members,t);if(r.firstAccessor.decorators&&t===r.secondAccessor)return yE(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return!1}(t)||WT(t)}function WT(t){var r,n,i,a,o=function(t){return!!t.modifiers&&(function(t){switch(t.kind){case 172:case 173:case 171:case 167:case 166:case 169:case 168:case 176:case 261:case 266:case 265:case 272:case 271:case 213:case 214:case 164:case 163:return!1;default:if(262===t.parent.kind||305===t.parent.kind)return!1;switch(t.kind){case 256:return HT(t,131);case 257:case 180:return HT(t,126);case 258:case 237:case 259:case 170:return!0;case 260:return HT(t,85);default:e.Debug.fail()}}}(t)?yE(t,e.Diagnostics.Modifiers_cannot_appear_here):void 0)}(t);if(void 0!==o)return o;for(var s=0,c=0,l=t.modifiers;c1||e.modifiers[0].kind!==t}function QT(t,r){return void 0===r&&(r=e.Diagnostics.Trailing_comma_not_allowed),!(!t||!t.hasTrailingComma)&&hE(t[0],t.end-",".length,",".length,r)}function XT(t,r){if(t&&0===t.length){var n=t.pos-"<".length;return hE(r,n,e.skipTrivia(r.text,t.end)+">".length-n,e.Diagnostics.Type_parameter_list_cannot_be_empty)}return!1}function $T(t){if(G>=3){var n=t.body&&e.isBlock(t.body)&&e.findUseStrictPrologue(t.body.statements);if(n){var i=(o=t.parameters,e.filter(o,(function(t){return!!t.initializer||e.isBindingPattern(t.name)||e.isRestParameter(t)})));if(e.length(i)){e.forEach(i,(function(t){e.addRelatedInfo(jn(t,e.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive),e.createDiagnosticForNode(n,e.Diagnostics.use_strict_directive_used_here))}));var a=i.map((function(t,r){return 0===r?e.createDiagnosticForNode(t,e.Diagnostics.Non_simple_parameter_declared_here):e.createDiagnosticForNode(t,e.Diagnostics.and_here)}));return e.addRelatedInfo.apply(void 0,r([jn(n,e.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)],a,!1)),!0}}}var o;return!1}function YT(t){var r=e.getSourceFileOfNode(t);return qT(t)||XT(t.typeParameters,r)||function(t){for(var r=!1,n=t.length,i=0;i1||t.typeParameters.hasTrailingComma||t.typeParameters[0].constraint)&&r&&e.fileExtensionIsOneOf(r.fileName,[".mts",".cts"])&&vE(t.typeParameters[0],e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);var n=t.equalsGreaterThanToken,i=e.getLineAndCharacterOfPosition(r,n.pos).line,a=e.getLineAndCharacterOfPosition(r,n.end).line;return i!==a&&vE(n,e.Diagnostics.Line_terminator_not_permitted_before_arrow)}(t,r)||e.isFunctionLikeDeclaration(t)&&$T(t)}function ZT(t,r){return QT(r)||function(t,r){if(r&&0===r.length){var n=e.getSourceFileOfNode(t),i=r.pos-"<".length;return hE(n,i,e.skipTrivia(n.text,r.end)+">".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}return!1}(t,r)}function eE(t){var r=t.types;if(QT(r))return!0;if(r&&0===r.length){var n=e.tokenToString(t.token);return hE(t,r.pos,0,e.Diagnostics._0_list_cannot_be_empty,n)}return e.some(r,tE)}function tE(t){return e.isExpressionWithTypeArguments(t)&&e.isImportKeyword(t.expression)&&t.typeArguments?vE(t,e.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments):ZT(t,t.typeArguments)}function rE(t){if(162!==t.kind)return!1;var r=t;return 221===r.expression.kind&&27===r.expression.operatorToken.kind&&vE(r.expression,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function nE(t){if(t.asteriskToken){if(e.Debug.assert(256===t.kind||213===t.kind||169===t.kind),16777216&t.flags)return vE(t.asteriskToken,e.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);if(!t.body)return vE(t.asteriskToken,e.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator)}}function iE(e,t){return!!e&&vE(e,t)}function aE(e,t){return!!e&&vE(e,t)}function oE(t){if(xE(t))return!0;if(244===t.kind&&t.awaitModifier&&!(32768&t.flags)){var r=e.getSourceFileOfNode(t);if(e.isInTopLevelContext(t)){if(!gE(r))switch(e.isEffectiveExternalModule(r,z)||Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),q){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:if(r.impliedNodeFormat===e.ModuleKind.CommonJS){Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.System:if(G>=4)break;default:Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher))}}else if(!gE(r)){var n=e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),i=e.getContainingFunction(t);if(i&&171!==i.kind){e.Debug.assert(0==(2&e.getFunctionFlags(i)),"Enclosing function should never be an async function.");var a=e.createDiagnosticForNode(i,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(n,a)}return Dn.add(n),!0}return!1}if(e.isForOfStatement(t)&&!(32768&t.flags)&&e.isIdentifier(t.initializer)&&"async"===t.initializer.escapedText)return vE(t.initializer,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(255===t.initializer.kind){var o=t.initializer;if(!fE(o)){var s=o.declarations;if(!s.length)return!1;if(s.length>1){n=243===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return yE(o.declarations[1],n)}var c=s[0];if(c.initializer){var n=243===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return vE(c.name,n)}if(c.type)return vE(c,n=243===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}return!1}function sE(t){if(t.parameters.length===(172===t.kind?1:2))return e.getThisParameter(t)}function cE(t,r){if(function(t){return e.isDynamicName(t)&&!zs(t)}(t))return vE(t,r)}function lE(t){if(YT(t))return!0;if(169===t.kind){if(205===t.parent.kind){if(t.modifiers&&(1!==t.modifiers.length||131!==e.first(t.modifiers).kind))return yE(t,e.Diagnostics.Modifiers_cannot_appear_here);if(iE(t.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional))return!0;if(aE(t.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context))return!0;if(void 0===t.body)return hE(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(nE(t))return!0}if(e.isClassLike(t.parent)){if(G<2&&e.isPrivateIdentifier(t.name))return vE(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(16777216&t.flags)return cE(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(169===t.kind&&!t.body)return cE(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else{if(258===t.parent.kind)return cE(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(182===t.parent.kind)return cE(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function uE(t){return e.isStringOrNumericLiteralLike(t)||219===t.kind&&40===t.operator&&8===t.operand.kind}function dE(t){var r,n=t.initializer;if(n){var i=!(uE(n)||function(t){if((e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)&&uE(t.argumentExpression))&&e.isEntityNameExpression(t.expression))return!!(1024&zx(t).flags)}(n)||110===n.kind||95===n.kind||(r=n,9===r.kind||219===r.kind&&40===r.operator&&9===r.operand.kind)),a=e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t);if(!a||t.type)return vE(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);if(i)return vE(n,e.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);if(!a||i)return vE(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}}function _E(t){if(79===t.kind){if("__esModule"===e.idText(t))return function(t,r,n,i,a,o){if(!gE(e.getSourceFileOfNode(r)))return Bn(t,r,n,i,a,o),!0;return!1}("noEmit",t,e.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules)}else for(var r=0,n=t.elements;r0}function yE(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!gE(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return Dn.add(e.createFileDiagnostic(o,s.start,s.length,r,n,i,a)),!0}return!1}function hE(t,r,n,i,a,o,s){var c=e.getSourceFileOfNode(t);return!gE(c)&&(Dn.add(e.createFileDiagnostic(c,r,n,i,a,o,s)),!0)}function vE(t,r,n,i,a){return!gE(e.getSourceFileOfNode(t))&&(Dn.add(e.createDiagnosticForNode(t,r,n,i,a)),!0)}function bE(t){return 258!==t.kind&&259!==t.kind&&266!==t.kind&&265!==t.kind&&272!==t.kind&&271!==t.kind&&264!==t.kind&&!e.hasSyntacticModifier(t,515)&&yE(t,e.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function xE(t){if(16777216&t.flags){if(!ni(t).hasReportedStatementInAmbientContext&&(e.isFunctionLike(t.parent)||e.isAccessor(t.parent)))return ni(t).hasReportedStatementInAmbientContext=yE(t,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);if(235===t.parent.kind||262===t.parent.kind||305===t.parent.kind){var r=ni(t.parent);if(!r.hasReportedStatementInAmbientContext)return r.hasReportedStatementInAmbientContext=yE(t,e.Diagnostics.Statements_are_not_allowed_in_ambient_contexts)}}return!1}function SE(t){if(32&t.numericLiteralFlags){var r=void 0;if(G>=1?r=e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:e.isChildOfNodeWithKind(t,196)?r=e.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:e.isChildOfNodeWithKind(t,299)&&(r=e.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0),r){var n=e.isPrefixUnaryExpression(t.parent)&&40===t.parent.operator,i=(n?"-":"")+"0o"+t.text;return vE(n?t.parent:t,r,i)}}return function(t){var r=-1!==e.getTextOfNode(t).indexOf("."),n=16&t.numericLiteralFlags;if(r||n)return;if(+t.text<=Math.pow(2,53)-1)return;Un(!1,e.createDiagnosticForNode(t,e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers))}(t),!1}function DE(t){return!!e.forEach(t.elements,(function(t){if(t.isTypeOnly)return yE(t,270===t.kind?e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}))}function CE(t,r,n,i){if(1048576&r.flags&&2621440&t.flags){var a=yg(r,t);if(a)return a;var o=Rc(t);if(o){var s=fg(o,r);if(s)return tf(r,e.map(s,(function(e){return[function(){return as(e)},e.escapedName]})),n,void 0,i)}}}},function(e){e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes"}(w||(w={})),e.signatureHasRestParameter=j,e.signatureHasLiteralTypes=U}(c||(c={})),function(e){function t(t,r,n,i){if(void 0===t||void 0===r)return t;var a,o=r(t);return o===t?t:void 0!==o?(a=e.isArray(o)?(i||c)(o):o,e.Debug.assertNode(a,n),a):void 0}function r(t,r,n,i,a){if(void 0===t||void 0===r)return t;var o,s,c=t.length;(void 0===i||i<0)&&(i=0),(void 0===a||a>c-i)&&(a=c-i);var l=-1,u=-1;(i>0||a=2&&(s=function(t,r){for(var n,i=0;i0&&p<=160||192===p)return a;var f=l.factory;switch(p){case 79:return e.Debug.type(a),f.updateIdentifier(a,u(a.typeArguments,c,e.isTypeNodeOrTypeParameterDeclaration));case 161:return e.Debug.type(a),f.updateQualifiedName(a,_(a.left,c,e.isEntityName),_(a.right,c,e.isIdentifier));case 162:return e.Debug.type(a),f.updateComputedPropertyName(a,_(a.expression,c,e.isExpression));case 163:return e.Debug.type(a),f.updateTypeParameterDeclaration(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),_(a.constraint,c,e.isTypeNode),_(a.default,c,e.isTypeNode));case 164:return e.Debug.type(a),f.updateParameterDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.dotDotDotToken,d,e.isDotDotDotToken),_(a.name,c,e.isBindingName),_(a.questionToken,d,e.isQuestionToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 165:return e.Debug.type(a),f.updateDecorator(a,_(a.expression,c,e.isExpression));case 166:return e.Debug.type(a),f.updatePropertySignature(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isToken),_(a.type,c,e.isTypeNode));case 167:return e.Debug.type(a),f.updatePropertyDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken||a.exclamationToken,d,e.isQuestionOrExclamationToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 168:return e.Debug.type(a),f.updateMethodSignature(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 169:return e.Debug.type(a),f.updateMethodDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 171:return e.Debug.type(a),f.updateConstructorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),i(a.parameters,c,l,u),o(a.body,c,l,_));case 172:return e.Debug.type(a),f.updateGetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 173:return e.Debug.type(a),f.updateSetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),o(a.body,c,l,_));case 170:return e.Debug.type(a),l.startLexicalEnvironment(),l.suspendLexicalEnvironment(),f.updateClassStaticBlockDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),o(a.body,c,l,_));case 174:return e.Debug.type(a),f.updateCallSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 175:return e.Debug.type(a),f.updateConstructSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 176:return e.Debug.type(a),f.updateIndexSignature(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 177:return e.Debug.type(a),f.updateTypePredicateNode(a,_(a.assertsModifier,c,e.isAssertsKeyword),_(a.parameterName,c,e.isIdentifierOrThisTypeNode),_(a.type,c,e.isTypeNode));case 178:return e.Debug.type(a),f.updateTypeReferenceNode(a,_(a.typeName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 179:return e.Debug.type(a),f.updateFunctionTypeNode(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 180:return e.Debug.type(a),f.updateConstructorTypeNode(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 181:return e.Debug.type(a),f.updateTypeQueryNode(a,_(a.exprName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 182:return e.Debug.type(a),f.updateTypeLiteralNode(a,u(a.members,c,e.isTypeElement));case 183:return e.Debug.type(a),f.updateArrayTypeNode(a,_(a.elementType,c,e.isTypeNode));case 184:return e.Debug.type(a),f.updateTupleTypeNode(a,u(a.elements,c,e.isTypeNode));case 185:return e.Debug.type(a),f.updateOptionalTypeNode(a,_(a.type,c,e.isTypeNode));case 186:return e.Debug.type(a),f.updateRestTypeNode(a,_(a.type,c,e.isTypeNode));case 187:return e.Debug.type(a),f.updateUnionTypeNode(a,u(a.types,c,e.isTypeNode));case 188:return e.Debug.type(a),f.updateIntersectionTypeNode(a,u(a.types,c,e.isTypeNode));case 189:return e.Debug.type(a),f.updateConditionalTypeNode(a,_(a.checkType,c,e.isTypeNode),_(a.extendsType,c,e.isTypeNode),_(a.trueType,c,e.isTypeNode),_(a.falseType,c,e.isTypeNode));case 190:return e.Debug.type(a),f.updateInferTypeNode(a,_(a.typeParameter,c,e.isTypeParameterDeclaration));case 200:return e.Debug.type(a),f.updateImportTypeNode(a,_(a.argument,c,e.isTypeNode),_(a.assertions,c,e.isNode),_(a.qualifier,c,e.isEntityName),r(a.typeArguments,c,e.isTypeNode),a.isTypeOf);case 295:return e.Debug.type(a),f.updateImportTypeAssertionContainer(a,_(a.assertClause,c,e.isNode),a.multiLine);case 197:return e.Debug.type(a),f.updateNamedTupleMember(a,t(a.dotDotDotToken,c,e.isDotDotDotToken),t(a.name,c,e.isIdentifier),t(a.questionToken,c,e.isQuestionToken),t(a.type,c,e.isTypeNode));case 191:return e.Debug.type(a),f.updateParenthesizedType(a,_(a.type,c,e.isTypeNode));case 193:return e.Debug.type(a),f.updateTypeOperatorNode(a,_(a.type,c,e.isTypeNode));case 194:return e.Debug.type(a),f.updateIndexedAccessTypeNode(a,_(a.objectType,c,e.isTypeNode),_(a.indexType,c,e.isTypeNode));case 195:return e.Debug.type(a),f.updateMappedTypeNode(a,_(a.readonlyToken,d,e.isReadonlyKeywordOrPlusOrMinusToken),_(a.typeParameter,c,e.isTypeParameterDeclaration),_(a.nameType,c,e.isTypeNode),_(a.questionToken,d,e.isQuestionOrPlusOrMinusToken),_(a.type,c,e.isTypeNode),u(a.members,c,e.isTypeElement));case 196:return e.Debug.type(a),f.updateLiteralTypeNode(a,_(a.literal,c,e.isExpression));case 198:return e.Debug.type(a),f.updateTemplateLiteralType(a,_(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateLiteralTypeSpan));case 199:return e.Debug.type(a),f.updateTemplateLiteralTypeSpan(a,_(a.type,c,e.isTypeNode),_(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 201:return e.Debug.type(a),f.updateObjectBindingPattern(a,u(a.elements,c,e.isBindingElement));case 202:return e.Debug.type(a),f.updateArrayBindingPattern(a,u(a.elements,c,e.isArrayBindingElement));case 203:return e.Debug.type(a),f.updateBindingElement(a,_(a.dotDotDotToken,d,e.isDotDotDotToken),_(a.propertyName,c,e.isPropertyName),_(a.name,c,e.isBindingName),_(a.initializer,c,e.isExpression));case 204:return e.Debug.type(a),f.updateArrayLiteralExpression(a,u(a.elements,c,e.isExpression));case 205:return e.Debug.type(a),f.updateObjectLiteralExpression(a,u(a.properties,c,e.isObjectLiteralElementLike));case 206:return 32&a.flags?(e.Debug.type(a),f.updatePropertyAccessChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),_(a.name,c,e.isMemberName))):(e.Debug.type(a),f.updatePropertyAccessExpression(a,_(a.expression,c,e.isExpression),_(a.name,c,e.isMemberName)));case 207:return 32&a.flags?(e.Debug.type(a),f.updateElementAccessChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),_(a.argumentExpression,c,e.isExpression))):(e.Debug.type(a),f.updateElementAccessExpression(a,_(a.expression,c,e.isExpression),_(a.argumentExpression,c,e.isExpression)));case 208:return 32&a.flags?(e.Debug.type(a),f.updateCallChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression))):(e.Debug.type(a),f.updateCallExpression(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression)));case 209:return e.Debug.type(a),f.updateNewExpression(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression));case 210:return e.Debug.type(a),f.updateTaggedTemplateExpression(a,_(a.tag,c,e.isExpression),r(a.typeArguments,c,e.isTypeNode),_(a.template,c,e.isTemplateLiteral));case 211:return e.Debug.type(a),f.updateTypeAssertion(a,_(a.type,c,e.isTypeNode),_(a.expression,c,e.isExpression));case 212:return e.Debug.type(a),f.updateParenthesizedExpression(a,_(a.expression,c,e.isExpression));case 213:return e.Debug.type(a),f.updateFunctionExpression(a,u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 214:return e.Debug.type(a),f.updateArrowFunction(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),_(a.equalsGreaterThanToken,d,e.isEqualsGreaterThanToken),o(a.body,c,l,_));case 215:return e.Debug.type(a),f.updateDeleteExpression(a,_(a.expression,c,e.isExpression));case 216:return e.Debug.type(a),f.updateTypeOfExpression(a,_(a.expression,c,e.isExpression));case 217:return e.Debug.type(a),f.updateVoidExpression(a,_(a.expression,c,e.isExpression));case 218:return e.Debug.type(a),f.updateAwaitExpression(a,_(a.expression,c,e.isExpression));case 219:return e.Debug.type(a),f.updatePrefixUnaryExpression(a,_(a.operand,c,e.isExpression));case 220:return e.Debug.type(a),f.updatePostfixUnaryExpression(a,_(a.operand,c,e.isExpression));case 221:return e.Debug.type(a),f.updateBinaryExpression(a,_(a.left,c,e.isExpression),_(a.operatorToken,d,e.isBinaryOperatorToken),_(a.right,c,e.isExpression));case 222:return e.Debug.type(a),f.updateConditionalExpression(a,_(a.condition,c,e.isExpression),_(a.questionToken,d,e.isQuestionToken),_(a.whenTrue,c,e.isExpression),_(a.colonToken,d,e.isColonToken),_(a.whenFalse,c,e.isExpression));case 223:return e.Debug.type(a),f.updateTemplateExpression(a,_(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateSpan));case 224:return e.Debug.type(a),f.updateYieldExpression(a,_(a.asteriskToken,d,e.isAsteriskToken),_(a.expression,c,e.isExpression));case 225:return e.Debug.type(a),f.updateSpreadElement(a,_(a.expression,c,e.isExpression));case 226:return e.Debug.type(a),f.updateClassExpression(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 228:return e.Debug.type(a),f.updateExpressionWithTypeArguments(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode));case 229:return e.Debug.type(a),f.updateAsExpression(a,_(a.expression,c,e.isExpression),_(a.type,c,e.isTypeNode));case 230:return 32&a.flags?(e.Debug.type(a),f.updateNonNullChain(a,_(a.expression,c,e.isExpression))):(e.Debug.type(a),f.updateNonNullExpression(a,_(a.expression,c,e.isExpression)));case 231:return e.Debug.type(a),f.updateMetaProperty(a,_(a.name,c,e.isIdentifier));case 233:return e.Debug.type(a),f.updateTemplateSpan(a,_(a.expression,c,e.isExpression),_(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 235:return e.Debug.type(a),f.updateBlock(a,u(a.statements,c,e.isStatement));case 237:return e.Debug.type(a),f.updateVariableStatement(a,u(a.modifiers,c,e.isModifier),_(a.declarationList,c,e.isVariableDeclarationList));case 238:return e.Debug.type(a),f.updateExpressionStatement(a,_(a.expression,c,e.isExpression));case 239:return e.Debug.type(a),f.updateIfStatement(a,_(a.expression,c,e.isExpression),_(a.thenStatement,c,e.isStatement,f.liftToBlock),_(a.elseStatement,c,e.isStatement,f.liftToBlock));case 240:return e.Debug.type(a),f.updateDoStatement(a,s(a.statement,c,l),_(a.expression,c,e.isExpression));case 241:return e.Debug.type(a),f.updateWhileStatement(a,_(a.expression,c,e.isExpression),s(a.statement,c,l));case 242:return e.Debug.type(a),f.updateForStatement(a,_(a.initializer,c,e.isForInitializer),_(a.condition,c,e.isExpression),_(a.incrementor,c,e.isExpression),s(a.statement,c,l));case 243:return e.Debug.type(a),f.updateForInStatement(a,_(a.initializer,c,e.isForInitializer),_(a.expression,c,e.isExpression),s(a.statement,c,l));case 244:return e.Debug.type(a),f.updateForOfStatement(a,_(a.awaitModifier,d,e.isAwaitKeyword),_(a.initializer,c,e.isForInitializer),_(a.expression,c,e.isExpression),s(a.statement,c,l));case 245:return e.Debug.type(a),f.updateContinueStatement(a,_(a.label,c,e.isIdentifier));case 246:return e.Debug.type(a),f.updateBreakStatement(a,_(a.label,c,e.isIdentifier));case 247:return e.Debug.type(a),f.updateReturnStatement(a,_(a.expression,c,e.isExpression));case 248:return e.Debug.type(a),f.updateWithStatement(a,_(a.expression,c,e.isExpression),_(a.statement,c,e.isStatement,f.liftToBlock));case 249:return e.Debug.type(a),f.updateSwitchStatement(a,_(a.expression,c,e.isExpression),_(a.caseBlock,c,e.isCaseBlock));case 250:return e.Debug.type(a),f.updateLabeledStatement(a,_(a.label,c,e.isIdentifier),_(a.statement,c,e.isStatement,f.liftToBlock));case 251:return e.Debug.type(a),f.updateThrowStatement(a,_(a.expression,c,e.isExpression));case 252:return e.Debug.type(a),f.updateTryStatement(a,_(a.tryBlock,c,e.isBlock),_(a.catchClause,c,e.isCatchClause),_(a.finallyBlock,c,e.isBlock));case 254:return e.Debug.type(a),f.updateVariableDeclaration(a,_(a.name,c,e.isBindingName),_(a.exclamationToken,d,e.isExclamationToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 255:return e.Debug.type(a),f.updateVariableDeclarationList(a,u(a.declarations,c,e.isVariableDeclaration));case 256:return e.Debug.type(a),f.updateFunctionDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 257:return e.Debug.type(a),f.updateClassDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 258:return e.Debug.type(a),f.updateInterfaceDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isTypeElement));case 259:return e.Debug.type(a),f.updateTypeAliasDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),_(a.type,c,e.isTypeNode));case 260:return e.Debug.type(a),f.updateEnumDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.members,c,e.isEnumMember));case 261:return e.Debug.type(a),f.updateModuleDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isModuleName),_(a.body,c,e.isModuleBody));case 262:return e.Debug.type(a),f.updateModuleBlock(a,u(a.statements,c,e.isStatement));case 263:return e.Debug.type(a),f.updateCaseBlock(a,u(a.clauses,c,e.isCaseOrDefaultClause));case 264:return e.Debug.type(a),f.updateNamespaceExportDeclaration(a,_(a.name,c,e.isIdentifier));case 265:return e.Debug.type(a),f.updateImportEqualsDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,_(a.name,c,e.isIdentifier),_(a.moduleReference,c,e.isModuleReference));case 266:return e.Debug.type(a),f.updateImportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.importClause,c,e.isImportClause),_(a.moduleSpecifier,c,e.isExpression),_(a.assertClause,c,e.isAssertClause));case 293:return e.Debug.type(a),f.updateAssertClause(a,u(a.elements,c,e.isAssertEntry),a.multiLine);case 294:return e.Debug.type(a),f.updateAssertEntry(a,_(a.name,c,e.isAssertionKey),_(a.value,c,e.isExpressionNode));case 267:return e.Debug.type(a),f.updateImportClause(a,a.isTypeOnly,_(a.name,c,e.isIdentifier),_(a.namedBindings,c,e.isNamedImportBindings));case 268:return e.Debug.type(a),f.updateNamespaceImport(a,_(a.name,c,e.isIdentifier));case 274:return e.Debug.type(a),f.updateNamespaceExport(a,_(a.name,c,e.isIdentifier));case 269:return e.Debug.type(a),f.updateNamedImports(a,u(a.elements,c,e.isImportSpecifier));case 270:return e.Debug.type(a),f.updateImportSpecifier(a,a.isTypeOnly,_(a.propertyName,c,e.isIdentifier),_(a.name,c,e.isIdentifier));case 271:return e.Debug.type(a),f.updateExportAssignment(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.expression,c,e.isExpression));case 272:return e.Debug.type(a),f.updateExportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,_(a.exportClause,c,e.isNamedExportBindings),_(a.moduleSpecifier,c,e.isExpression),_(a.assertClause,c,e.isAssertClause));case 273:return e.Debug.type(a),f.updateNamedExports(a,u(a.elements,c,e.isExportSpecifier));case 275:return e.Debug.type(a),f.updateExportSpecifier(a,a.isTypeOnly,_(a.propertyName,c,e.isIdentifier),_(a.name,c,e.isIdentifier));case 277:return e.Debug.type(a),f.updateExternalModuleReference(a,_(a.expression,c,e.isExpression));case 278:return e.Debug.type(a),f.updateJsxElement(a,_(a.openingElement,c,e.isJsxOpeningElement),u(a.children,c,e.isJsxChild),_(a.closingElement,c,e.isJsxClosingElement));case 279:return e.Debug.type(a),f.updateJsxSelfClosingElement(a,_(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),_(a.attributes,c,e.isJsxAttributes));case 280:return e.Debug.type(a),f.updateJsxOpeningElement(a,_(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),_(a.attributes,c,e.isJsxAttributes));case 281:return e.Debug.type(a),f.updateJsxClosingElement(a,_(a.tagName,c,e.isJsxTagNameExpression));case 282:return e.Debug.type(a),f.updateJsxFragment(a,_(a.openingFragment,c,e.isJsxOpeningFragment),u(a.children,c,e.isJsxChild),_(a.closingFragment,c,e.isJsxClosingFragment));case 285:return e.Debug.type(a),f.updateJsxAttribute(a,_(a.name,c,e.isIdentifier),_(a.initializer,c,e.isStringLiteralOrJsxExpression));case 286:return e.Debug.type(a),f.updateJsxAttributes(a,u(a.properties,c,e.isJsxAttributeLike));case 287:return e.Debug.type(a),f.updateJsxSpreadAttribute(a,_(a.expression,c,e.isExpression));case 288:return e.Debug.type(a),f.updateJsxExpression(a,_(a.expression,c,e.isExpression));case 289:return e.Debug.type(a),f.updateCaseClause(a,_(a.expression,c,e.isExpression),u(a.statements,c,e.isStatement));case 290:return e.Debug.type(a),f.updateDefaultClause(a,u(a.statements,c,e.isStatement));case 291:return e.Debug.type(a),f.updateHeritageClause(a,u(a.types,c,e.isExpressionWithTypeArguments));case 292:return e.Debug.type(a),f.updateCatchClause(a,_(a.variableDeclaration,c,e.isVariableDeclaration),_(a.block,c,e.isBlock));case 296:return e.Debug.type(a),f.updatePropertyAssignment(a,_(a.name,c,e.isPropertyName),_(a.initializer,c,e.isExpression));case 297:return e.Debug.type(a),f.updateShorthandPropertyAssignment(a,_(a.name,c,e.isIdentifier),_(a.objectAssignmentInitializer,c,e.isExpression));case 298:return e.Debug.type(a),f.updateSpreadAssignment(a,_(a.expression,c,e.isExpression));case 299:return e.Debug.type(a),f.updateEnumMember(a,_(a.name,c,e.isPropertyName),_(a.initializer,c,e.isExpression));case 305:return e.Debug.type(a),f.updateSourceFile(a,n(a.statements,c,l));case 350:return e.Debug.type(a),f.updatePartiallyEmittedExpression(a,_(a.expression,c,e.isExpression));case 351:return e.Debug.type(a),f.updateCommaListExpression(a,u(a.elements,c,e.isExpression));default:return a}}}}(c||(c={})),function(e){e.createSourceMapGenerator=function(t,r,n,i,o){var s,c,l=o.extendedDiagnostics?e.performance.createTimer("Source Map","beforeSourcemap","afterSourcemap"):e.performance.nullTimer,u=l.enter,d=l.exit,_=[],p=[],f=new e.Map,m=[],g=[],y="",h=0,v=0,b=0,x=0,S=0,D=0,C=!1,T=0,E=0,k=0,A=0,N=0,w=0,F=!1,P=!1,I=!1;return{getSources:function(){return _},addSource:O,setSourceContent:M,addName:L,addMapping:R,appendSourceMap:function(t,r,n,i,o,s){e.Debug.assert(t>=T,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),u();for(var c,l=[],_=a(n.mappings),p=_.next();!p.done;p=_.next()){var f=p.value;if(s&&(f.generatedLine>s.line||f.generatedLine===s.line&&f.generatedCharacter>s.character))break;if(!o||!(f.generatedLine=T,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),e.Debug.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),e.Debug.assert(void 0===i||i>=0,"sourceLine cannot be negative"),e.Debug.assert(void 0===a||a>=0,"sourceCharacter cannot be negative"),u(),(function(e,t){return!F||T!==e||E!==t}(t,r)||function(e,t,r){return void 0!==e&&void 0!==t&&void 0!==r&&k===e&&(A>t||A===t&&N>r)}(n,i,a))&&(J(),T=t,E=r,P=!1,I=!1,F=!0),void 0!==n&&void 0!==i&&void 0!==a&&(k=n,A=i,N=a,P=!0,void 0!==o&&(w=o,I=!0)),d()}function B(e){g.push(e),g.length>=1024&&j()}function J(){if(F&&(!C||h!==T||v!==E||b!==k||x!==A||S!==N||D!==w)){if(u(),h0&&(y+=String.fromCharCode.apply(void 0,g),g.length=0)}function U(){return J(),j(),{version:3,file:r,sourceRoot:n,sources:p,names:m,mappings:y,sourcesContent:s}}function V(t){t<0?t=1+(-t<<1):t<<=1;do{var r=31&t;(t>>=5)>0&&(r|=32),B((n=r)>=0&&n<26?65+n:n>=26&&n<52?97+n-26:n>=52&&n<62?48+n-52:62===n?43:63===n?47:e.Debug.fail("".concat(n,": not a base64 value")))}while(t>0);var n}};var t=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,r=/^\s*(\/\/[@#] .*)?$/;function n(e){return"string"==typeof e||null===e}function i(t){return null!==t&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&e.isArray(t.sources)&&e.every(t.sources,e.isString)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||e.isArray(t.sourcesContent)&&e.every(t.sourcesContent,n))&&(void 0===t.names||null===t.names||e.isArray(t.names)&&e.every(t.names,e.isString))}function a(e){var t,r=!1,n=0,i=0,a=0,o=0,s=0,c=0,l=0;return{get pos(){return n},get error(){return t},get state(){return u(!0,!0)},next:function(){for(;!r&&n=e.length)return _("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;var o=(t=e.charCodeAt(n))>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:43===t?62:47===t?63:-1;if(-1===o)return _("Invalid character in VLQ"),-1;r=0!=(32&o),a|=(31&o)<>=1:a=-(a>>=1),a}}function o(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function s(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function c(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function l(t,r){return e.Debug.assert(t.sourceIndex===r.sourceIndex),e.compareValues(t.sourcePosition,r.sourcePosition)}function u(t,r){return e.compareValues(t.generatedPosition,r.generatedPosition)}function d(e){return e.sourcePosition}function _(e){return e.generatedPosition}e.getLineInfo=function(e,t){return{getLineCount:function(){return t.length},getLineText:function(r){return e.substring(t[r],t[r+1])}}},e.tryGetSourceMappingURL=function(n){for(var i=n.getLineCount()-1;i>=0;i--){var a=n.getLineText(i),o=t.exec(a);if(o)return e.trimStringEnd(o[1]);if(!a.match(r))break}},e.isRawSourceMap=i,e.tryParseRawSourceMap=function(e){try{var t=JSON.parse(e);if(i(t))return t}catch(e){}},e.decodeMappings=a,e.sameMapping=function(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex},e.isSourceMapping=o,e.createDocumentPositionMapper=function(t,r,n){var i,p,f,m=e.getDirectoryPath(n),g=r.sourceRoot?e.getNormalizedAbsolutePath(r.sourceRoot,m):m,y=e.getNormalizedAbsolutePath(r.file,m),h=t.getSourceFileLike(y),v=r.sources.map((function(t){return e.getNormalizedAbsolutePath(t,g)})),b=new e.Map(v.map((function(e,r){return[t.getCanonicalFileName(e),r]})));return{getSourcePosition:function(t){var r=C();if(!e.some(r))return t;var n=e.binarySearchKey(r,t.pos,_,e.compareValues);n<0&&(n=~n);var i=r[n];if(void 0===i||!s(i))return t;return{fileName:v[i.sourceIndex],pos:i.sourcePosition}},getGeneratedPosition:function(r){var n=b.get(t.getCanonicalFileName(r.fileName));if(void 0===n)return r;var i=D(n);if(!e.some(i))return r;var a=e.binarySearchKey(i,r.pos,d,e.compareValues);a<0&&(a=~a);var o=i[a];if(void 0===o||o.sourceIndex!==n)return r;return{fileName:y,pos:o.generatedPosition}}};function x(n){var i,a,s=void 0!==h?e.getPositionOfLineAndCharacter(h,n.generatedLine,n.generatedCharacter,!0):-1;if(o(n)){var c=t.getSourceFileLike(v[n.sourceIndex]);i=r.sources[n.sourceIndex],a=void 0!==c?e.getPositionOfLineAndCharacter(c,n.sourceLine,n.sourceCharacter,!0):-1}return{generatedPosition:s,source:i,sourceIndex:n.sourceIndex,sourcePosition:a,nameIndex:n.nameIndex}}function S(){if(void 0===i){var n=a(r.mappings),o=e.arrayFrom(n,x);void 0!==n.error?(t.log&&t.log("Encountered error while decoding sourcemap: ".concat(n.error)),i=e.emptyArray):i=o}return i}function D(t){if(void 0===f){for(var r=[],n=0,i=S();n0&&i!==n.elements.length||!!(n.elements.length-i)&&e.isDefaultImport(t)}function i(t){return!n(t)&&(e.isDefaultImport(t)||!!t.importClause&&e.isNamedImports(t.importClause.namedBindings)&&function(t){return!!t&&!!e.isNamedImports(t)&&e.some(t.elements,r)}(t.importClause.namedBindings))}function a(t,r,n){if(e.isBindingPattern(t.name))for(var i=0,o=t.name.elements;i=64&&e<=78},e.getNonAssignmentOperatorForCompoundAssignment=function(e){switch(e){case 64:return 39;case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 47;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 78:return 52;case 75:return 56;case 76:return 55;case 77:return 60}},e.getSuperCallFromStatement=c,e.findSuperStatementIndex=function(e,t){for(var r=t;r=1)||49152&f.transformFlags||49152&e.getTargetOfBindingOrAssignmentElement(f).transformFlags||e.isComputedPropertyName(m)){l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),a,c,n),l=void 0);var g=o(t,a,m);e.isComputedPropertyName(m)&&(u=e.append(u,g.argumentExpression)),i(t,f,g,f)}else l=e.append(l,e.visitNode(f,t.visitor))}}l&&t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),a,c,n)}(t,r,u,n,c):e.isArrayBindingOrAssignmentPattern(u)?function(t,r,n,o,c){var l,u,d=e.getElementsOfBindingOrAssignmentPattern(n),_=d.length;if(t.level<1&&t.downlevelIteration)o=s(t,e.setTextRange(t.context.getEmitHelperFactory().createReadHelper(o,_>0&&e.getRestIndicatorOfBindingOrAssignmentElement(d[_-1])?void 0:_),c),!1,c);else if(1!==_&&(t.level<1||0===_)||e.every(d,e.isOmittedExpression)){o=s(t,o,!e.isDeclarationBindingElement(r)||0!==_,c)}for(var p=0;p<_;p++){var f=d[p];if(t.level>=1)if(32768&f.transformFlags||t.hasTransformedPriorElement&&!a(f)){t.hasTransformedPriorElement=!0;var m=t.context.factory.createTempVariable(void 0);t.hoistTempVariables&&t.context.hoistVariableDeclaration(m),u=e.append(u,[m,f]),l=e.append(l,t.createArrayBindingOrAssignmentElement(m))}else l=e.append(l,f);else{if(e.isOmittedExpression(f))continue;if(e.getRestIndicatorOfBindingOrAssignmentElement(f)){if(p===_-1){g=t.context.factory.createArraySliceCall(o,p);i(t,f,g,f)}}else{var g=t.context.factory.createElementAccessExpression(o,p);i(t,f,g,f)}}}l&&t.emitBindingOrAssignment(t.createArrayBindingOrAssignmentPattern(l),o,c,n);if(u)for(var y=0,h=u;y1&&(l.push(p.createEndOfDeclarationMarker(r)),e.setEmitFlags(c,4194304|e.getEmitFlags(c)));return e.singleOrMany(l)}(r);case 226:return function(r){if(!j(r))return e.visitEachChild(r,A,t);var n=p.createClassExpression(void 0,void 0,r.name,void 0,e.visitNodes(r.heritageClauses,A,e.isHeritageClause),U(r));return e.setOriginalNode(n,r),e.setTextRange(n,r),n}(r);case 291:return function(r){if(117===r.token)return;return e.visitEachChild(r,A,t)}(r);case 228:return function(t){return p.updateExpressionWithTypeArguments(t,e.visitNode(t.expression,A,e.isLeftHandSideExpression),void 0)}(r);case 169:return function(r){if(!se(r))return;var n=p.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,oe(r),void 0,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 172:return function(r){if(!de(r))return;var n=p.updateGetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),oe(r),e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 173:return function(r){if(!de(r))return;var n=p.updateSetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),oe(r),e.visitParameterList(r.parameters,A,t),e.visitFunctionBody(r.body,A,t)||p.createBlock([]));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 256:return function(r){if(!se(r))return p.createNotEmittedStatement(r);var n=p.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]));if(Te(r)){var i=[n];return Ne(i,r),i}return n}(r);case 213:return function(r){if(!se(r))return p.createOmittedExpression();return p.updateFunctionExpression(r,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]))}(r);case 214:return function(r){return p.updateArrowFunction(r,e.visitNodes(r.modifiers,L,e.isModifier),void 0,e.visitParameterList(r.parameters,A,t),void 0,r.equalsGreaterThanToken,e.visitFunctionBody(r.body,A,t))}(r);case 164:return function(t){if(e.parameterIsThisKeyword(t))return;var r=p.updateParameterDeclaration(t,void 0,void 0,t.dotDotDotToken,e.visitNode(t.name,A,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,A,e.isExpression));r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32));return r}(r);case 212:return function(r){var n=e.skipOuterExpressions(r.expression,-7);if(e.isAssertionExpression(n)){var i=e.visitNode(r.expression,A,e.isExpression);return p.createPartiallyEmittedExpression(i,r)}return e.visitEachChild(r,A,t)}(r);case 211:case 229:return function(t){var r=e.visitNode(t.expression,A,e.isExpression);return p.createPartiallyEmittedExpression(r,t)}(r);case 208:return function(t){return p.updateCallExpression(t,e.visitNode(t.expression,A,e.isExpression),void 0,e.visitNodes(t.arguments,A,e.isExpression))}(r);case 209:return function(t){return p.updateNewExpression(t,e.visitNode(t.expression,A,e.isExpression),void 0,e.visitNodes(t.arguments,A,e.isExpression))}(r);case 210:return function(t){return p.updateTaggedTemplateExpression(t,e.visitNode(t.tag,A,e.isExpression),void 0,e.visitNode(t.template,A,e.isExpression))}(r);case 230:return function(t){var r=e.visitNode(t.expression,A,e.isLeftHandSideExpression);return p.createPartiallyEmittedExpression(r,t)}(r);case 260:return function(t){if(!function(t){return!e.isEnumConst(t)||e.shouldPreserveConstEnums(b)}(t))return p.createNotEmittedStatement(t);var r=[],i=2,s=ye(r,t);s&&(D===e.ModuleKind.System&&o===n||(i|=512));var c=Pe(t),l=Ie(t),u=e.hasSyntacticModifier(t,1)?p.getExternalModuleOrNamespaceExportName(a,t,!1,!0):p.getLocalName(t,!1,!0),d=p.createLogicalOr(u,p.createAssignment(u,p.createObjectLiteralExpression()));if(fe(t)){var _=p.getLocalName(t,!1,!0);d=p.createAssignment(_,d)}var f=p.createExpressionStatement(p.createCallExpression(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,c)],void 0,function(t,r){var n=a;a=r;var i=[];m();var o=e.map(t.members,pe);return e.insertStatementsAfterStandardPrologue(i,y()),e.addRange(i,o),a=n,p.createBlock(e.setTextRange(p.createNodeArray(i),t.members),!0)}(t,l)),void 0,[d]));e.setOriginalNode(f,t),s&&(e.setSyntheticLeadingComments(f,void 0),e.setSyntheticTrailingComments(f,void 0));return e.setTextRange(f,t),e.addEmitFlags(f,i),r.push(f),r.push(p.createEndOfDeclarationMarker(t)),r}(r);case 237:return function(r){if(Te(r)){var n=e.getInitializedVariables(r.declarationList);if(0===n.length)return;return e.setTextRange(p.createExpressionStatement(p.inlineExpressions(e.map(n,_e))),r)}return e.visitEachChild(r,A,t)}(r);case 254:return function(t){var r=p.updateVariableDeclaration(t,e.visitNode(t.name,A,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,A,e.isExpression));t.type&&e.setTypeNode(r.name,t.type);return r}(r);case 261:return he(r);case 265:return Ce(r);case 279:return function(t){return p.updateJsxSelfClosingElement(t,e.visitNode(t.tagName,A,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,A,e.isJsxAttributes))}(r);case 280:return function(t){return p.updateJsxOpeningElement(t,e.visitNode(t.tagName,A,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,A,e.isJsxAttributes))}(r);default:return e.visitEachChild(r,A,t)}}function B(r){var n=e.getStrictOptionValue(b,"alwaysStrict")&&!(e.isExternalModule(r)&&D>=e.ModuleKind.ES2015)&&!e.isJsonSourceFile(r);return p.updateSourceFile(r,e.visitLexicalEnvironment(r.statements,w,t,0,n))}function J(e){return!!(4096&e.transformFlags)}function j(t){return e.some(t.decorators)||e.some(t.typeParameters)||e.some(t.heritageClauses,J)||e.some(t.members,J)}function U(t){var r=[],n=e.getFirstConstructorWithBody(t),i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(i)for(var a=0,o=i;a0&&e.parameterIsThisKeyword(n[0]),a=i?1:0,o=i?n.length-1:n.length,s=0;s0?167===r.kind?p.createVoidZero():p.createNull():void 0,s=f().createDecorateHelper(n,i,a,o);return e.setTextRange(s,e.moveRangePastDecorators(r)),e.setEmitFlags(s,1536),s}}function Q(t){return e.visitNode(t.expression,A,e.isExpression)}function X(t,r){var n;if(t){n=[];for(var i=0,a=t;i=0&&e.addRange(o,e.visitNodes(n.statements,A,e.isStatement,s,c+1-s));var l=e.mapDefined(a,ue);c>=0?e.addRange(o,l):o=r(r(r([],o.slice(0,s),!0),l,!0),o.slice(s),!0);e.addRange(o,e.visitNodes(n.statements,A,e.isStatement,c+1+s)),o=p.mergeLexicalEnvironment(o,y());var u=p.createBlock(e.setTextRange(p.createNodeArray(o),n.statements),!0);return e.setTextRange(u,n),e.setOriginalNode(u,n),u}(n.body,n))}function ue(t){var r=t.name;if(e.isIdentifier(r)){var n=e.setParent(e.setTextRange(p.cloneNode(r),r),r.parent);e.setEmitFlags(n,1584);var i=e.setParent(e.setTextRange(p.cloneNode(r),r),r.parent);return e.setEmitFlags(i,1536),e.startOnNewLine(e.removeAllComments(e.setTextRange(e.setOriginalNode(p.createExpressionStatement(p.createAssignment(e.setTextRange(p.createPropertyAccessExpression(p.createThis(),n),t.name),i)),t),e.moveRangePos(t,-1))))}}function de(t){return!(e.nodeIsMissing(t.body)&&e.hasSyntacticModifier(t,128))}function _e(r){var n=r.name;return e.isBindingPattern(n)?e.flattenDestructuringAssignment(r,A,t,0,!1,we):e.setTextRange(p.createAssignment(Fe(n),e.visitNode(r.initializer,A,e.isExpression)),r)}function pe(r){var n=ae(r,!1),i=function(r){var n=v.getConstantValue(r);return void 0!==n?"string"==typeof n?p.createStringLiteral(n):p.createNumericLiteral(n):(0==(8&u)&&(u|=8,t.enableSubstitution(79)),r.initializer?e.visitNode(r.initializer,A,e.isExpression):p.createVoidZero())}(r),o=p.createAssignment(p.createElementAccessExpression(a,n),i),s=10===i.kind?o:p.createAssignment(p.createElementAccessExpression(a,o),n);return e.setTextRange(p.createExpressionStatement(e.setTextRange(s,r)),r)}function fe(t){return Te(t)||Ee(t)&&D!==e.ModuleKind.ES2015&&D!==e.ModuleKind.ES2020&&D!==e.ModuleKind.ES2022&&D!==e.ModuleKind.ESNext&&D!==e.ModuleKind.System}function me(t){c||(c=new e.Map);var r=ge(t);c.has(r)||c.set(r,t)}function ge(t){return e.Debug.assertNode(t.name,e.isIdentifier),t.name.escapedText}function ye(t,r){var n=p.createVariableStatement(e.visitNodes(r.modifiers,L,e.isModifier),p.createVariableDeclarationList([p.createVariableDeclaration(p.getLocalName(r,!1,!0))],305===o.kind?0:1));if(e.setOriginalNode(n,r),me(r),function(e){if(c){var t=ge(e);return c.get(t)===e}return!0}(r))return 260===r.kind?e.setSourceMapRange(n.declarationList,r):e.setSourceMapRange(n,r),e.setCommentRange(n,r),e.addEmitFlags(n,4195328),t.push(n),!0;var i=p.createMergeDeclarationMarker(n);return e.setEmitFlags(i,4195840),t.push(i),!1}function he(r){if(!function(t){var r=e.getParseTreeNode(t,e.isModuleDeclaration);return!r||e.isInstantiatedModule(r,e.shouldPreserveConstEnums(b))}(r))return p.createNotEmittedStatement(r);e.Debug.assertNode(r.name,e.isIdentifier,"A TypeScript namespace should have an Identifier name."),0==(2&u)&&(u|=2,t.enableSubstitution(79),t.enableSubstitution(297),t.enableEmitNotification(261));var s=[],l=2,d=ye(s,r);d&&(D===e.ModuleKind.System&&o===n||(l|=512));var _=Pe(r),f=Ie(r),g=e.hasSyntacticModifier(r,1)?p.getExternalModuleOrNamespaceExportName(a,r,!1,!0):p.getLocalName(r,!1,!0),h=p.createLogicalOr(g,p.createAssignment(g,p.createObjectLiteralExpression()));if(fe(r)){var v=p.getLocalName(r,!1,!0);h=p.createAssignment(v,h)}var x=p.createExpressionStatement(p.createCallExpression(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,_)],void 0,function(t,r){var n=a,o=i,s=c;a=r,i=t,c=void 0;var l,u,d=[];if(m(),t.body)if(262===t.body.kind)k(t.body,(function(t){return e.addRange(d,e.visitNodes(t.statements,P,e.isStatement))})),l=t.body.statements,u=t.body;else{var _=he(t.body);_&&(e.isArray(_)?e.addRange(d,_):d.push(_));var f=ve(t).body;l=e.moveRangePos(f.statements,-1)}e.insertStatementsAfterStandardPrologue(d,y()),a=n,i=o,c=s;var g=p.createBlock(e.setTextRange(p.createNodeArray(d),l),!0);e.setTextRange(g,u),t.body&&262===t.body.kind||e.setEmitFlags(g,1536|e.getEmitFlags(g));return g}(r,f)),void 0,[h]));return e.setOriginalNode(x,r),d&&(e.setSyntheticLeadingComments(x,void 0),e.setSyntheticTrailingComments(x,void 0)),e.setTextRange(x,r),e.addEmitFlags(x,l),s.push(x),s.push(p.createEndOfDeclarationMarker(r)),s}function ve(e){if(261===e.body.kind)return ve(e.body)||e.body}function be(t){e.Debug.assert(!t.isTypeOnly);var r=Le(t)?t.name:void 0,n=e.visitNode(t.namedBindings,xe,e.isNamedImportBindings);return r||n?p.updateImportClause(t,!1,r,n):void 0}function xe(t){if(268===t.kind)return Le(t)?t:void 0;var r=b.preserveValueImports&&(1===b.importsNotUsedAsValues||2===b.importsNotUsedAsValues),n=e.visitNodes(t.elements,Se,e.isImportSpecifier);return r||e.some(n)?p.updateNamedImports(t,n):void 0}function Se(e){return!e.isTypeOnly&&Le(e)?e:void 0}function De(e){return!e.isTypeOnly&&v.isValueAliasDeclaration(e)?e:void 0}function Ce(r){if(!r.isTypeOnly){if(e.isExternalModuleImportEqualsDeclaration(r)){var i=Le(r);return i||1!==b.importsNotUsedAsValues?i?e.visitEachChild(r,A,t):void 0:e.setOriginalNode(e.setTextRange(p.createImportDeclaration(void 0,void 0,void 0,r.moduleReference.expression,void 0),r),r)}if(function(t){return Le(t)||!e.isExternalModule(n)&&v.isTopLevelValueImportEqualsWithEntityName(t)}(r)){var o,s,c,l=e.createExpressionFromEntityName(p,r.moduleReference);return e.setEmitFlags(l,3584),ke(r)||!Te(r)?e.setOriginalNode(e.setTextRange(p.createVariableStatement(e.visitNodes(r.modifiers,L,e.isModifier),p.createVariableDeclarationList([e.setOriginalNode(p.createVariableDeclaration(r.name,void 0,void 0,l),r)])),r),r):e.setOriginalNode((o=r.name,s=l,c=r,e.setTextRange(p.createExpressionStatement(p.createAssignment(p.getNamespaceMemberName(a,o,!1,!0),s)),c)),r)}}}function Te(t){return void 0!==i&&e.hasSyntacticModifier(t,1)}function Ee(t){return void 0===i&&e.hasSyntacticModifier(t,1)}function ke(t){return Ee(t)&&!e.hasSyntacticModifier(t,512)}function Ae(e){return p.createExpressionStatement(e)}function Ne(t,r){var n=p.createAssignment(p.getExternalModuleOrNamespaceExportName(a,r,!1,!0),p.getLocalName(r));e.setSourceMapRange(n,e.createRange(r.name?r.name.pos:r.pos,r.end));var i=p.createExpressionStatement(n);e.setSourceMapRange(i,e.createRange(-1,r.end)),t.push(i)}function we(t,r,n){return e.setTextRange(p.createAssignment(Fe(t),r),n)}function Fe(e){return p.getNamespaceMemberName(a,e,!1,!0)}function Pe(t){var r=p.getGeneratedNameForNode(t);return e.setSourceMapRange(r,t.name),r}function Ie(e){return p.getGeneratedNameForNode(e)}function Oe(t){if(u&_&&!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var r=v.getReferencedExportContainer(t,!1);if(r&&305!==r.kind)if(2&_&&261===r.kind||8&_&&260===r.kind)return e.setTextRange(p.createPropertyAccessExpression(p.getGeneratedNameForNode(r),t),t)}}function Me(t){var r=function(t){if(b.isolatedModules)return;return e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)?v.getConstantValue(t):void 0}(t);if(void 0!==r){e.setConstantValue(t,r);var n="string"==typeof r?p.createStringLiteral(r):p.createNumericLiteral(r);if(!b.removeComments){var i=e.getOriginalNode(t,e.isAccessExpression);e.addSyntheticTrailingComment(n,3," ".concat(e.getTextOfNode(i).replace(/\*\//g,"*_/")," "))}return n}return t}function Le(e){return b.preserveValueImports?v.isValueAliasDeclaration(e):v.isReferencedAliasDeclaration(e)}}}(c||(c={})),function(e){var t,n,i;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.ClassStaticThisOrSuperReference=2]="ClassStaticThisOrSuperReference"}(t||(t={})),(n=e.PrivateIdentifierKind||(e.PrivateIdentifierKind={})).Field="f",n.Method="m",n.Accessor="a",function(e){e[e.None=0]="None",e[e.ClassWasDecorated=1]="ClassWasDecorated",e[e.NeedsClassConstructorReference=2]="NeedsClassConstructorReference",e[e.NeedsClassSuperReference=4]="NeedsClassSuperReference",e[e.NeedsSubstitutionForThisInClassStaticField=8]="NeedsSubstitutionForThisInClassStaticField"}(i||(i={})),e.transformClassFields=function(t){var n=t.factory,i=t.hoistVariableDeclaration,a=t.endLexicalEnvironment,o=t.startLexicalEnvironment,s=t.resumeLexicalEnvironment,c=t.addBlockScopedVariable,l=t.getEmitResolver(),u=t.getCompilerOptions(),d=e.getEmitScriptTarget(u),_=e.getUseDefineForClassFields(u),p=d<9,f=d<9,m=f&&d>=2,g=t.onSubstituteNode;t.onSubstituteNode=function(t,r){if(r=g(t,r),1===t)return function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&y&&33554432&l.getNodeCheckFlags(t)){var r=l.getReferencedValueDeclaration(t);if(r){var i=h[r.id];if(i){var a=n.cloneNode(i);return e.setSourceMapRange(a,t),e.setCommentRange(a,t),a}}}return}(t)||t}(t);case 108:return function(t){if(2&y&&S){var r=S.facts,i=S.classConstructor;if(1&r)return n.createParenthesizedExpression(n.createVoidZero());if(i)return e.setTextRange(e.setOriginalNode(n.cloneNode(i),t),t)}return t}(t)}return t}(r);return r};var y,h,v,b,x=t.onEmitNode;t.onEmitNode=function(t,r,n){var i=e.getOriginalNode(r);if(i.id){var a=E.get(i.id);if(a){var o=S,s=D;return S=a,D=a,x(t,r,n),S=o,void(D=s)}}switch(r.kind){case 213:if(e.isArrowFunction(i)||262144&e.getEmitFlags(r))break;case 256:case 171:o=S,s=D;return S=void 0,D=void 0,x(t,r,n),S=o,void(D=s);case 172:case 173:case 169:case 167:o=S,s=D;return D=S,S=void 0,x(t,r,n),S=o,void(D=s);case 162:o=S,s=D;return S=D,D=void 0,x(t,r,n),S=o,void(D=s)}x(t,r,n)};var S,D,C,T=[],E=new e.Map;return e.chainBundle(t,(function(r){var n=t.getCompilerOptions();if(r.isDeclarationFile||_&&e.getEmitScriptTarget(n)>=9)return r;var i=e.visitEachChild(r,N,t);return e.addEmitHelpers(i,t.readEmitHelpers()),i}));function k(a,o){if(8388608&a.transformFlags)switch(a.kind){case 226:case 257:return function(r){if(!e.forEach(r.members,J))return e.visitEachChild(r,N,t);var a=v;if(v=void 0,function(){T.push(S),S=void 0}(),p){var o=e.getNameOfDeclaration(r);o&&e.isIdentifier(o)&&(X().className=e.idText(o));var s=j(r);e.some(s)&&(X().weakSetName=Z("instances",s[0].name))}var u=e.isClassDeclaration(r)?function(t){var r,a=U(t);a&&(Q().facts=a);8&a&&W();if(2&a){var o=n.createTempVariable(i,!0);Q().classConstructor=n.cloneNode(o),r=n.createAssignment(o,n.getInternalName(t))}var s=e.getEffectiveBaseTypeNode(t),c=!(!s||104===e.skipOuterExpressions(s.expression).kind),l=[n.updateClassDeclaration(t,void 0,t.modifiers,t.name,void 0,e.visitNodes(t.heritageClauses,w,e.isHeritageClause),V(t,c))];r&&$().unshift(r);e.some(v)&&l.push(n.createExpressionStatement(n.inlineExpressions(v)));var u=e.getStaticPropertiesAndClassStaticBlock(t);e.some(u)&&z(l,u,n.getInternalName(t));return l}(r):function(r){var a=U(r);a&&(Q().facts=a);8&a&&W();var o,s=!!(1&a),u=e.getStaticPropertiesAndClassStaticBlock(r),d=e.getEffectiveBaseTypeNode(r),_=!(!d||104===e.skipOuterExpressions(d.expression).kind),f=16777216&l.getNodeCheckFlags(r);function m(){var e=l.getNodeCheckFlags(r),t=16777216&e,a=524288&e;return n.createTempVariable(a?c:i,!!t)}2&a&&(o=m(),Q().classConstructor=n.cloneNode(o));var g=n.updateClassExpression(r,e.visitNodes(r.decorators,N,e.isDecorator),r.modifiers,r.name,void 0,e.visitNodes(r.heritageClauses,w,e.isHeritageClause),V(r,_));if(p&&e.some(u,(function(t){return e.isClassStaticBlockDeclaration(t)||!!t.initializer||e.isPrivateIdentifier(t.name)}))||e.some(v)){if(s)return e.Debug.assertIsDefined(b,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),b&&v&&e.some(v)&&b.push(n.createExpressionStatement(n.inlineExpressions(v))),b&&e.some(u)&&z(b,u,n.getInternalName(r)),o?n.inlineExpressions([n.createAssignment(o,g),o]):g;var x=[];if(o||(o=m()),f){0==(1&y)&&(y|=1,t.enableSubstitution(79),h=[]);var S=n.cloneNode(o);S.autoGenerateFlags&=-9,h[e.getOriginalNodeId(r)]=S}return e.setEmitFlags(g,65536|e.getEmitFlags(g)),x.push(e.startOnNewLine(n.createAssignment(o,g))),e.addRange(x,e.map(v,e.startOnNewLine)),e.addRange(x,function(t,r){for(var n=[],i=0,a=t;i=0?(g=h+1,v=r(r(r([],v.slice(0,y),!0),e.visitNodes(o.body.statements,N,e.isStatement,y,g-y),!0),v.slice(y),!0)):y>=0&&(g=y));m&&v.push(n.createExpressionStatement(n.createCallExpression(n.createSuper(),void 0,[n.createSpreadElement(n.createIdentifier("arguments"))])));var b=0;if(null==o?void 0:o.body)if(_)v=v.filter((function(t){return!e.isParameterPropertyDeclaration(e.getOriginalNode(t),o)}));else{for(var x=0,S=o.body.statements;x0){var C=e.visitNodes(o.body.statements,N,e.isStatement,g,b);if(h>=0)e.addRange(v,C);else{var T=y;m&&T++,v=r(r(r([],v.slice(0,T),!0),C,!0),v.slice(T),!0)}g+=b}}var E=n.createThis();(function(t,r,i){if(!p||!e.some(r))return;var a=X().weakSetName;e.Debug.assert(a,"weakSetName should be set in private identifier environment"),t.push(n.createExpressionStatement(function(t,r){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(r,"add"),void 0,[t])}(i,a)))})(v,d,E),z(v,u,E),o&&e.addRange(v,e.visitNodes(o.body.statements,k,e.isStatement,g));return v=n.mergeLexicalEnvironment(v,a()),e.setTextRange(n.createBlock(e.setTextRange(n.createNodeArray(v),o?o.body.statements:i.members),!0),o?o.body:void 0);function k(t){if(!_||!e.isParameterPropertyDeclaration(e.getOriginalNode(t),o))return N(t)}}(i,c,o);if(!d)return;return e.startOnNewLine(e.setOriginalNode(e.setTextRange(n.createConstructorDeclaration(void 0,void 0,null!=u?u:[],d),c||i),c))}(i,o),g=e.visitNodes(i.members,P,e.isClassElement);return m&&l.push(m),!p&&e.some(v)&&(l.push(n.createClassStaticBlockDeclaration(void 0,void 0,n.createBlock([n.createExpressionStatement(n.inlineExpressions(v))]))),v=void 0),e.addRange(l,g),e.setTextRange(n.createNodeArray(l),i.members)}function K(t){return!e.isStatic(t)&&!e.hasSyntacticModifier(e.getOriginalNode(t),128)&&(_?d<9:e.isInitializedProperty(t)||p&&e.isPrivateIdentifierClassElementDeclaration(t))}function z(t,r,n){for(var i=0,a=r;i=0;--r){var n,i=T[r];if(i)if(n=null===(t=i.privateIdentifierEnvironment)||void 0===t?void 0:t.identifiers.get(e.escapedText))return n}}function re(r){var a=n.getGeneratedNameForNode(r),o=te(r.name);if(!o)return e.visitEachChild(r,N,t);var s=r.expression;return(e.isThisProperty(r)||e.isSuperProperty(r)||!e.isSimpleCopiableExpression(r.expression))&&(s=n.createTempVariable(i,!0),$().push(n.createBinaryExpression(s,63,e.visitNode(r.expression,N,e.isExpression)))),n.createAssignmentTargetWrapper(a,B(o,s,a,63))}function ne(t){var r=e.getTargetOfBindingOrAssignmentElement(t);if(r){var i=void 0;if(e.isPrivateIdentifierPropertyAccessExpression(r))i=re(r);else if(m&&e.isSuperProperty(r)&&C&&S){var a=S.classConstructor,o=S.superClassReference;if(1&S.facts)i=H(r);else if(a&&o){var s=e.isElementAccessExpression(r)?e.visitNode(r.argumentExpression,N,e.isExpression):e.isIdentifier(r.name)?n.createStringLiteralFromNode(r.name):void 0;if(s){var c=n.createTempVariable(void 0);i=n.createAssignmentTargetWrapper(c,n.createReflectSetCall(o,s,c,a))}}}if(i)return e.isAssignmentExpression(t)?n.updateBinaryExpression(t,i,t.operatorToken,e.visitNode(t.right,N,e.isExpression)):e.isSpreadElement(t)?n.updateSpreadElement(t,i):i}return e.visitNode(t,F)}function ie(t){if(e.isObjectBindingOrAssignmentElement(t)&&!e.isShorthandPropertyAssignment(t)){var r=e.getTargetOfBindingOrAssignmentElement(t),i=void 0;if(r)if(e.isPrivateIdentifierPropertyAccessExpression(r))i=re(r);else if(m&&e.isSuperProperty(r)&&C&&S){var a=S.classConstructor,o=S.superClassReference;if(1&S.facts)i=H(r);else if(a&&o){var s=e.isElementAccessExpression(r)?e.visitNode(r.argumentExpression,N,e.isExpression):e.isIdentifier(r.name)?n.createStringLiteralFromNode(r.name):void 0;if(s){var c=n.createTempVariable(void 0);i=n.createAssignmentTargetWrapper(c,n.createReflectSetCall(o,s,c,a))}}}if(e.isPropertyAssignment(t)){var l=e.getInitializerOfBindingOrAssignmentElement(t);return n.updatePropertyAssignment(t,e.visitNode(t.name,N,e.isPropertyName),i?l?n.createAssignment(i,e.visitNode(l,N)):i:e.visitNode(t.initializer,F,e.isExpression))}if(e.isSpreadAssignment(t))return n.updateSpreadAssignment(t,i||e.visitNode(t.expression,F,e.isExpression));e.Debug.assert(void 0===i,"Should not have generated a wrapped target")}return e.visitNode(t,N)}}}(c||(c={})),function(e){var t,n;function i(t,r,n,i){var a=0!=(4096&r.getNodeCheckFlags(n)),o=[];return i.forEach((function(r,n){var i=e.unescapeLeadingUnderscores(n),s=[];s.push(t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[],void 0,void 0,e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4)))),a&&s.push(t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,t.createAssignment(e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4),t.createIdentifier("v"))))),o.push(t.createPropertyAssignment(i,t.createObjectLiteralExpression(s)))})),t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_super",48),void 0,void 0,t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[t.createNull(),t.createObjectLiteralExpression(o,!0)]))],2))}!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper"}(t||(t={})),function(e){e[e.NonTopLevel=1]="NonTopLevel",e[e.HasLexicalThis=2]="HasLexicalThis"}(n||(n={})),e.transformES2017=function(t){var n,a,o,s,c=t.factory,l=t.getEmitHelperFactory,u=t.resumeLexicalEnvironment,d=t.endLexicalEnvironment,_=t.hoistVariableDeclaration,p=t.getEmitResolver(),f=t.getCompilerOptions(),m=e.getEmitScriptTarget(f),g=0,y=[],h=0,v=t.onEmitNode,b=t.onSubstituteNode;return t.onEmitNode=function(t,r,i){if(1&n&&function(e){var t=e.kind;return 257===t||171===t||169===t||172===t||173===t}(r)){var a=6144&p.getNodeCheckFlags(r);if(a!==g){var o=g;return g=a,v(t,r,i),void(g=o)}}else if(n&&y[e.getNodeId(r)]){o=g;return g=0,v(t,r,i),void(g=o)}v(t,r,i)},t.onSubstituteNode=function(t,n){if(n=b(t,n),1===t&&g)return function(t){switch(t.kind){case 206:return j(t);case 207:return U(t);case 208:return function(t){var n=t.expression;if(e.isSuperProperty(n)){var i=e.isPropertyAccessExpression(n)?j(n):U(n);return c.createCallExpression(c.createPropertyAccessExpression(i,"call"),void 0,r([c.createThis()],t.arguments,!0))}return t}(t)}return t}(n);return n},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;x(1,!1),x(2,!e.isEffectiveStrictModeSourceFile(r,f));var n=e.visitEachChild(r,E,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function x(e,t){h=t?h|e:h&~e}function S(e){return 0!=(h&e)}function D(){return S(2)}function C(e,t,r){var n=e&~h;if(n){x(n,!0);var i=t(r);return x(n,!1),i}return t(r)}function T(r){return e.visitEachChild(r,E,t)}function E(r){if(0==(256&r.transformFlags))return r;switch(r.kind){case 131:return;case 218:return function(r){if(!S(1))return e.visitEachChild(r,E,t);return e.setOriginalNode(e.setTextRange(c.createYieldExpression(void 0,e.visitNode(r.expression,E,e.isExpression)),r),r)}(r);case 169:return C(3,A,r);case 256:return C(3,N,r);case 213:return C(3,w,r);case 214:return C(1,F,r);case 206:return o&&e.isPropertyAccessExpression(r)&&106===r.expression.kind&&o.add(r.name.escapedText),e.visitEachChild(r,E,t);case 207:return o&&106===r.expression.kind&&(s=!0),e.visitEachChild(r,E,t);case 172:case 173:case 171:case 257:case 226:return C(3,T,r);default:return e.visitEachChild(r,E,t)}}function k(r){if(e.isNodeWithPossibleHoistedDeclaration(r))switch(r.kind){case 237:return function(r){if(I(r.declarationList)){var n=O(r.declarationList,!1);return n?c.createExpressionStatement(n):void 0}return e.visitEachChild(r,E,t)}(r);case 242:return function(r){var n=r.initializer;return c.updateForStatement(r,I(n)?O(n,!1):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.condition,E,e.isExpression),e.visitNode(r.incrementor,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 243:return function(r){return c.updateForInStatement(r,I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 244:return function(r){return c.updateForOfStatement(r,e.visitNode(r.awaitModifier,E,e.isToken),I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 292:return function(r){var n,i=new e.Set;if(P(r.variableDeclaration,i),i.forEach((function(t,r){a.has(r)&&(n||(n=new e.Set(a)),n.delete(r))})),n){var o=a;a=n;var s=e.visitEachChild(r,k,t);return a=o,s}return e.visitEachChild(r,k,t)}(r);case 235:case 249:case 263:case 289:case 290:case 252:case 240:case 241:case 239:case 248:case 250:return e.visitEachChild(r,k,t);default:return e.Debug.assertNever(r,"Unhandled node.")}return E(r)}function A(r){return c.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function N(r){return c.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function w(r){return c.updateFunctionExpression(r,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function F(r){return c.updateArrowFunction(r,e.visitNodes(r.modifiers,E,e.isModifier),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function P(t,r){var n=t.name;if(e.isIdentifier(n))r.add(n.escapedText);else for(var i=0,a=n.elements;i=2&&6144&p.getNodeCheckFlags(r);if(F&&(0==(1&n)&&(n|=1,t.enableSubstitution(208),t.enableSubstitution(206),t.enableSubstitution(207),t.enableEmitNotification(257),t.enableEmitNotification(169),t.enableEmitNotification(172),t.enableEmitNotification(173),t.enableEmitNotification(171),t.enableEmitNotification(237)),o.size)){var I=i(c,p,r,o);y[e.getNodeId(I)]=!0,e.insertStatementsAfterStandardPrologue(N,[I])}var O=c.createBlock(N,!0);e.setTextRange(O,r.body),F&&s&&(4096&p.getNodeCheckFlags(r)?e.addEmitHelper(O,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(r)&&e.addEmitHelper(O,e.asyncSuperHelper)),S=O}return a=v,g||(o=C,s=T),S}function J(t,r){return e.isBlock(t)?c.updateBlock(t,e.visitNodes(t.statements,k,e.isStatement,r)):c.converters.convertToFunctionBlock(e.visitNode(t,k,e.isConciseBody))}function j(t){return 106===t.expression.kind?e.setTextRange(c.createPropertyAccessExpression(c.createUniqueName("_super",48),t.name),t):t}function U(t){return 106===t.expression.kind?(r=t.argumentExpression,n=t,4096&g?e.setTextRange(c.createPropertyAccessExpression(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),"value"),n):e.setTextRange(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),n)):t;var r,n}},e.createSuperAccessVariableStatement=i}(c||(c={})),function(e){var t,n;!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper"}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasLexicalThis=1]="HasLexicalThis",e[e.IterationContainer=2]="IterationContainer",e[e.AncestorFactsMask=3]="AncestorFactsMask",e[e.SourceFileIncludes=1]="SourceFileIncludes",e[e.SourceFileExcludes=2]="SourceFileExcludes",e[e.StrictModeSourceFileIncludes=0]="StrictModeSourceFileIncludes",e[e.ClassOrFunctionIncludes=1]="ClassOrFunctionIncludes",e[e.ClassOrFunctionExcludes=2]="ClassOrFunctionExcludes",e[e.ArrowFunctionIncludes=0]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=2]="ArrowFunctionExcludes",e[e.IterationStatementIncludes=2]="IterationStatementIncludes",e[e.IterationStatementExcludes=0]="IterationStatementExcludes"}(n||(n={})),e.transformES2018=function(t){var n=t.factory,i=t.getEmitHelperFactory,a=t.resumeLexicalEnvironment,o=t.endLexicalEnvironment,s=t.hoistVariableDeclaration,c=t.getEmitResolver(),l=t.getCompilerOptions(),u=e.getEmitScriptTarget(l),d=t.onEmitNode;t.onEmitNode=function(t,r,n){if(1&p&&function(e){var t=e.kind;return 257===t||171===t||169===t||172===t||173===t}(r)){var i=6144&c.getNodeCheckFlags(r);if(i!==x){var a=x;return x=i,d(t,r,n),void(x=a)}}else if(p&&D[e.getNodeId(r)]){a=x;return x=0,d(t,r,n),void(x=a)}d(t,r,n)};var _=t.onSubstituteNode;t.onSubstituteNode=function(t,i){if(i=_(t,i),1===t&&x)return function(t){switch(t.kind){case 206:return X(t);case 207:return $(t);case 208:return function(t){var i=t.expression;if(e.isSuperProperty(i)){var a=e.isPropertyAccessExpression(i)?X(i):$(i);return n.createCallExpression(n.createPropertyAccessExpression(a,"call"),void 0,r([n.createThis()],t.arguments,!0))}return t}(t)}return t}(i);return i};var p,f,m,g,y,h,v,b=!1,x=0,S=0,D=[];return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;g=r;var i=function(r){var i=C(2,e.isEffectiveStrictModeSourceFile(r,l)?0:1);b=!1;var a=e.visitEachChild(r,k,t),o=e.concatenate(a.statements,y&&[n.createVariableStatement(void 0,n.createVariableDeclarationList(y))]),s=n.updateSourceFile(a,e.setTextRange(n.createNodeArray(o),r.statements));return T(i),s}(r);return e.addEmitHelpers(i,t.readEmitHelpers()),g=void 0,y=void 0,i}));function C(e,t){var r=S;return S=3&(S&~e|t),r}function T(e){S=e}function E(t){y=e.append(y,n.createVariableDeclaration(t))}function k(e){return P(e,!1)}function A(e){return P(e,!0)}function N(e){if(131!==e.kind)return e}function w(e,t,r,n){if(function(e,t){return S!==(S&~e|t)}(r,n)){var i=C(r,n),a=e(t);return T(i),a}return e(t)}function F(r){return e.visitEachChild(r,k,t)}function P(a,o){if(0==(128&a.transformFlags))return a;switch(a.kind){case 218:return function(r){if(2&f&&1&f)return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,i().createAwaitHelper(e.visitNode(r.expression,k,e.isExpression))),r),r);return e.visitEachChild(r,k,t)}(a);case 224:return function(r){if(2&f&&1&f){if(r.asteriskToken){var a=e.visitNode(e.Debug.checkDefined(r.expression),k,e.isExpression);return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,i().createAwaitHelper(n.updateYieldExpression(r,r.asteriskToken,e.setTextRange(i().createAsyncDelegatorHelper(e.setTextRange(i().createAsyncValuesHelper(a),a)),a)))),r),r)}return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,L(r.expression?e.visitNode(r.expression,k,e.isExpression):n.createVoidZero())),r),r)}return e.visitEachChild(r,k,t)}(a);case 247:return function(r){if(2&f&&1&f)return n.updateReturnStatement(r,L(r.expression?e.visitNode(r.expression,k,e.isExpression):n.createVoidZero()));return e.visitEachChild(r,k,t)}(a);case 250:return function(r){if(2&f){var i=e.unwrapInnermostStatementOfLabel(r);return 244===i.kind&&i.awaitModifier?M(i,r):n.restoreEnclosingLabel(e.visitNode(i,k,e.isStatement,n.liftToBlock),r)}return e.visitEachChild(r,k,t)}(a);case 205:return function(r){if(32768&r.transformFlags){var a=function(t){for(var r,i=[],a=0,o=t;a1){for(var s=1;s=2&&6144&c.getNodeCheckFlags(r);if(m){0==(1&p)&&(p|=1,t.enableSubstitution(208),t.enableSubstitution(206),t.enableSubstitution(207),t.enableEmitNotification(257),t.enableEmitNotification(169),t.enableEmitNotification(172),t.enableEmitNotification(173),t.enableEmitNotification(171),t.enableEmitNotification(237));var g=e.createSuperAccessVariableStatement(n,c,r,h);D[e.getNodeId(g)]=!0,e.insertStatementsAfterStandardPrologue(s,[g])}s.push(f),e.insertStatementsAfterStandardPrologue(s,o());var y=n.updateBlock(r.body,s);return m&&v&&(4096&c.getNodeCheckFlags(r)?e.addEmitHelper(y,e.advancedAsyncSuperHelper):2048&c.getNodeCheckFlags(r)&&e.addEmitHelper(y,e.asyncSuperHelper)),h=d,v=_,y}function H(t){var r;a();var i=0,s=[],c=null!==(r=e.visitNode(t.body,k,e.isConciseBody))&&void 0!==r?r:n.createBlock([]);e.isBlock(c)&&(i=n.copyPrologue(c.statements,s,!1,k)),e.addRange(s,Q(void 0,t));var l=o();if(i>0||e.some(s)||e.some(l)){var u=n.converters.convertToFunctionBlock(c,!0);return e.insertStatementsAfterStandardPrologue(s,l),e.addRange(s,u.statements.slice(i)),n.updateBlock(u,e.setTextRange(n.createNodeArray(s),u.statements))}return c}function Q(r,i){for(var a=!1,o=0,s=i.parameters;o0){var l=e.flattenDestructuringBinding(c,k,t,0,n.getGeneratedNameForNode(c));if(e.some(l)){var u=n.createVariableDeclarationList(l),d=n.createVariableStatement(void 0,u);e.setEmitFlags(d,1048576),r=e.append(r,d)}}else if(c.initializer){var _=n.getGeneratedNameForNode(c),p=e.visitNode(c.initializer,k,e.isExpression),f=n.createAssignment(_,p);d=n.createExpressionStatement(f);e.setEmitFlags(d,1048576),r=e.append(r,d)}}else if(c.initializer){_=n.cloneNode(c.name);e.setTextRange(_,c.name),e.setEmitFlags(_,48);p=e.visitNode(c.initializer,k,e.isExpression);e.addEmitFlags(p,1584);f=n.createAssignment(_,p);e.setTextRange(f,c),e.setEmitFlags(f,1536);var m=n.createBlock([n.createExpressionStatement(f)]);e.setTextRange(m,c),e.setEmitFlags(m,1953);var g=n.createTypeCheck(n.cloneNode(c.name),"undefined");d=n.createIfStatement(g,m);e.startOnNewLine(d),e.setTextRange(d,c),e.setEmitFlags(d,1050528),r=e.append(r,d)}}else if(32768&c.transformFlags){a=!0;l=e.flattenDestructuringBinding(c,k,t,1,n.getGeneratedNameForNode(c),!1,!0);if(e.some(l)){u=n.createVariableDeclarationList(l),d=n.createVariableStatement(void 0,u);e.setEmitFlags(d,1048576),r=e.append(r,d)}}}return r}function X(t){return 106===t.expression.kind?e.setTextRange(n.createPropertyAccessExpression(n.createUniqueName("_super",48),t.name),t):t}function $(t){return 106===t.expression.kind?(r=t.argumentExpression,i=t,4096&x?e.setTextRange(n.createPropertyAccessExpression(n.createCallExpression(n.createIdentifier("_superIndex"),void 0,[r]),"value"),i):e.setTextRange(n.createCallExpression(n.createIdentifier("_superIndex"),void 0,[r]),i)):t;var r,i}}}(c||(c={})),function(e){e.transformES2019=function(t){var r=t.factory;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,n,t)}));function n(i){return 0==(64&i.transformFlags)?i:292===i.kind?function(i){if(!i.variableDeclaration)return r.updateCatchClause(i,r.createVariableDeclaration(r.createTempVariable(void 0)),e.visitNode(i.block,n,e.isBlock));return e.visitEachChild(i,n,t)}(i):e.visitEachChild(i,n,t)}}}(c||(c={})),function(e){e.transformES2020=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,i,t)}));function i(a){if(0==(32&a.transformFlags))return a;switch(a.kind){case 208:var u=o(a,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u;case 206:case 207:if(e.isOptionalChain(a)){u=c(a,!1,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u}return e.visitEachChild(a,i,t);case 221:return 60===a.operatorToken.kind?function(t){var a=e.visitNode(t.left,i,e.isExpression),o=a;e.isSimpleCopiableExpression(a)||(o=r.createTempVariable(n),a=r.createAssignment(o,a));return e.setTextRange(r.createConditionalExpression(l(a,o),void 0,o,void 0,e.visitNode(t.right,i,e.isExpression)),t)}(a):e.visitEachChild(a,i,t);case 215:return function(t){return e.isOptionalChain(e.skipParentheses(t.expression))?e.setOriginalNode(s(t.expression,!1,!0),t):r.updateDeleteExpression(t,e.visitNode(t.expression,i,e.isExpression))}(a);default:return e.visitEachChild(a,i,t)}}function a(t,n,i){var a=s(t.expression,n,i);return e.isSyntheticReference(a)?r.createSyntheticReferenceExpression(r.updateParenthesizedExpression(t,a.expression),a.thisArg):r.updateParenthesizedExpression(t,a)}function o(n,o){if(e.isOptionalChain(n))return c(n,o,!1);if(e.isParenthesizedExpression(n.expression)&&e.isOptionalChain(e.skipParentheses(n.expression))){var s=a(n.expression,!0,!1),l=e.visitNodes(n.arguments,i,e.isExpression);return e.isSyntheticReference(s)?e.setTextRange(r.createFunctionCallCall(s.expression,s.thisArg,l),n):r.updateCallExpression(n,s,void 0,l)}return e.visitEachChild(n,i,t)}function s(t,s,l){switch(t.kind){case 212:return a(t,s,l);case 206:case 207:return function(t,a,o){if(e.isOptionalChain(t))return c(t,a,o);var s,l=e.visitNode(t.expression,i,e.isExpression);return e.Debug.assertNotNode(l,e.isSyntheticReference),a&&(e.isSimpleCopiableExpression(l)?s=l:(s=r.createTempVariable(n),l=r.createAssignment(s,l))),l=206===t.kind?r.updatePropertyAccessExpression(t,l,e.visitNode(t.name,i,e.isIdentifier)):r.updateElementAccessExpression(t,l,e.visitNode(t.argumentExpression,i,e.isExpression)),s?r.createSyntheticReferenceExpression(l,s):l}(t,s,l);case 208:return o(t,s);default:return e.visitNode(t,i,e.isExpression)}}function c(t,a,o){var c=function(t){e.Debug.assertNotNode(t,e.isNonNullChain);for(var r=[t];!t.questionDotToken&&!e.isTaggedTemplateExpression(t);)t=e.cast(e.skipPartiallyEmittedExpressions(t.expression),e.isOptionalChain),e.Debug.assertNotNode(t,e.isNonNullChain),r.unshift(t);return{expression:t.expression,chain:r}}(t),u=c.expression,d=c.chain,_=s(e.skipPartiallyEmittedExpressions(u),e.isCallChain(d[0]),!1),p=e.isSyntheticReference(_)?_.thisArg:void 0,f=e.isSyntheticReference(_)?_.expression:_,m=r.restoreOuterExpressions(u,f,8);e.isSimpleCopiableExpression(f)||(f=r.createTempVariable(n),m=r.createAssignment(f,m));for(var g,y=f,h=0;h1||!!(null===(_=p[0])||void 0===_?void 0:_.dotDotDotToken),m=[t,r];if(i&&m.push(E(i.initializer)),5===s.jsx){var g=e.getOriginalNode(n);if(g&&e.isSourceFile(g)){void 0===i&&m.push(a.createVoidZero()),m.push(f?a.createTrue():a.createFalse());var y=e.getLineAndCharacterOfPosition(g,d.pos);m.push(a.createObjectLiteralExpression([a.createPropertyAssignment("fileName",c()),a.createPropertyAssignment("lineNumber",a.createNumericLiteral(y.line+1)),a.createPropertyAssignment("columnNumber",a.createNumericLiteral(y.character+1))])),m.push(a.createThis())}}var h=e.setTextRange(a.createCallExpression(l(f),void 0,m),d);return u&&e.startOnNewLine(h),h}function b(t,o,c,l){var d=N(t),p=t.attributes.properties,f=e.length(p)?D(p):a.createNull(),m=void 0===i.importSpecifier?e.createJsxFactoryExpression(a,r.getEmitResolver().getJsxFactoryEntity(n),s.reactNamespace,t):u("createElement"),g=e.createExpressionForJsxElement(a,m,d,f,e.mapDefined(o,_),l);return c&&e.startOnNewLine(g),g}function x(e,t,r,n){var i;if(t&&t.length){var o=function(e){var t=y(e);return t&&a.createObjectLiteralExpression([t])}(t);o&&(i=o)}return v(u("Fragment"),i||a.createObjectLiteralExpression([]),void 0,t,r,n)}function S(t,i,o,c){var l=e.createExpressionForJsxFragment(a,r.getEmitResolver().getJsxFactoryEntity(n),r.getEmitResolver().getJsxFragmentFactoryEntity(n),s.reactNamespace,e.mapDefined(i,_),t,c);return o&&e.startOnNewLine(l),l}function D(t,r){var n=e.getEmitScriptTarget(s);return n&&n>=5?a.createObjectLiteralExpression(function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return e.map(t,(function(t){return r?function(t){return a.createSpreadAssignment(e.visitNode(t.expression,d,e.isExpression))}(t):T(t)}))})));r&&n.push(r);return n}(t,r)):function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return r?e.map(t,C):a.createObjectLiteralExpression(e.map(t,T))})));e.isJsxSpreadAttribute(t[0])&&n.unshift(a.createObjectLiteralExpression());r&&n.push(a.createObjectLiteralExpression([r]));return e.singleOrUndefined(n)||o().createAssignHelper(n)}(t,r)}function C(t){return e.visitNode(t.expression,d,e.isExpression)}function T(t){var r=function(t){var r=t.name,n=e.idText(r);return/^[A-Za-z_]\w*$/.test(n)?r:a.createStringLiteral(n)}(t),n=E(t.initializer);return a.createPropertyAssignment(r,n)}function E(t){if(void 0===t)return a.createTrue();if(10===t.kind){var r=void 0!==t.singleQuote?t.singleQuote:!e.isStringDoubleQuoted(t,n),i=a.createStringLiteral((o=t.text,((s=A(o))===o?void 0:s)||t.text),r);return e.setTextRange(i,t)}return 288===t.kind?void 0===t.expression?a.createTrue():e.visitNode(t.expression,d,e.isExpression):e.Debug.failBadSyntaxKind(t);var o,s}function k(e,t){var r=A(t);return void 0===e?r:e+" "+r}function A(r){return r.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(function(r,n,i,a,o,s,c){if(o)return e.utf16EncodeAsString(parseInt(o,10));if(s)return e.utf16EncodeAsString(parseInt(s,16));var l=t.get(c);return l?e.utf16EncodeAsString(l):r}))}function N(t){if(278===t.kind)return N(t.openingElement);var r=t.tagName;return e.isIdentifier(r)&&e.isIntrinsicJsxName(r.escapedText)?a.createStringLiteral(e.idText(r)):e.createExpressionFromEntityName(a,r)}function w(t){var r=e.visitNode(t.expression,d,e.isExpression);return t.dotDotDotToken?a.createSpreadElement(r):r}};var t=new e.Map(e.getEntries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}))}(c||(c={})),function(e){e.transformES2016=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,i,t)}));function i(a){return 0==(512&a.transformFlags)?a:221===a.kind?function(a){switch(a.operatorToken.kind){case 67:return function(t){var a,o,s=e.visitNode(t.left,i,e.isExpression),c=e.visitNode(t.right,i,e.isExpression);if(e.isElementAccessExpression(s)){var l=r.createTempVariable(n),u=r.createTempVariable(n);a=e.setTextRange(r.createElementAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),e.setTextRange(r.createAssignment(u,s.argumentExpression),s.argumentExpression)),s),o=e.setTextRange(r.createElementAccessExpression(l,u),s)}else if(e.isPropertyAccessExpression(s)){l=r.createTempVariable(n);a=e.setTextRange(r.createPropertyAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),s.name),s),o=e.setTextRange(r.createPropertyAccessExpression(l,s.name),s)}else a=s,o=s;return e.setTextRange(r.createAssignment(a,e.setTextRange(r.createGlobalMethodCall("Math","pow",[o,c]),t)),t)}(a);case 42:return function(t){var n=e.visitNode(t.left,i,e.isExpression),a=e.visitNode(t.right,i,e.isExpression);return e.setTextRange(r.createGlobalMethodCall("Math","pow",[n,a]),t)}(a);default:return e.visitEachChild(a,i,t)}}(a):e.visitEachChild(a,i,t)}}}(c||(c={})),function(e){var t,n,i,a,o,s;function c(e,t){return{kind:e,expression:t}}!function(e){e[e.CapturedThis=1]="CapturedThis",e[e.BlockScopedBindings=2]="BlockScopedBindings"}(t||(t={})),function(e){e[e.Body=1]="Body",e[e.Initializer=2]="Initializer"}(n||(n={})),function(e){e[e.ToOriginal=0]="ToOriginal",e[e.ToOutParameter=1]="ToOutParameter"}(i||(i={})),function(e){e[e.Break=2]="Break",e[e.Continue=4]="Continue",e[e.Return=8]="Return"}(a||(a={})),function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.ArrowFunction=2]="ArrowFunction",e[e.AsyncFunctionBody=4]="AsyncFunctionBody",e[e.NonStaticClassElement=8]="NonStaticClassElement",e[e.CapturesThis=16]="CapturesThis",e[e.ExportedVariableStatement=32]="ExportedVariableStatement",e[e.TopLevel=64]="TopLevel",e[e.Block=128]="Block",e[e.IterationStatement=256]="IterationStatement",e[e.IterationStatementBlock=512]="IterationStatementBlock",e[e.IterationContainer=1024]="IterationContainer",e[e.ForStatement=2048]="ForStatement",e[e.ForInOrForOfStatement=4096]="ForInOrForOfStatement",e[e.ConstructorWithCapturedSuper=8192]="ConstructorWithCapturedSuper",e[e.StaticInitializer=16384]="StaticInitializer",e[e.AncestorFactsMask=32767]="AncestorFactsMask",e[e.BlockScopeIncludes=0]="BlockScopeIncludes",e[e.BlockScopeExcludes=7104]="BlockScopeExcludes",e[e.SourceFileIncludes=64]="SourceFileIncludes",e[e.SourceFileExcludes=8064]="SourceFileExcludes",e[e.FunctionIncludes=65]="FunctionIncludes",e[e.FunctionExcludes=32670]="FunctionExcludes",e[e.AsyncFunctionBodyIncludes=69]="AsyncFunctionBodyIncludes",e[e.AsyncFunctionBodyExcludes=32662]="AsyncFunctionBodyExcludes",e[e.ArrowFunctionIncludes=66]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=15232]="ArrowFunctionExcludes",e[e.ConstructorIncludes=73]="ConstructorIncludes",e[e.ConstructorExcludes=32662]="ConstructorExcludes",e[e.DoOrWhileStatementIncludes=1280]="DoOrWhileStatementIncludes",e[e.DoOrWhileStatementExcludes=0]="DoOrWhileStatementExcludes",e[e.ForStatementIncludes=3328]="ForStatementIncludes",e[e.ForStatementExcludes=5056]="ForStatementExcludes",e[e.ForInOrForOfStatementIncludes=5376]="ForInOrForOfStatementIncludes",e[e.ForInOrForOfStatementExcludes=3008]="ForInOrForOfStatementExcludes",e[e.BlockIncludes=128]="BlockIncludes",e[e.BlockExcludes=6976]="BlockExcludes",e[e.IterationStatementBlockIncludes=512]="IterationStatementBlockIncludes",e[e.IterationStatementBlockExcludes=7104]="IterationStatementBlockExcludes",e[e.StaticInitializerIncludes=16449]="StaticInitializerIncludes",e[e.StaticInitializerExcludes=32670]="StaticInitializerExcludes",e[e.NewTarget=32768]="NewTarget",e[e.CapturedLexicalThis=65536]="CapturedLexicalThis",e[e.SubtreeFactsMask=-32768]="SubtreeFactsMask",e[e.ArrowFunctionSubtreeExcludes=0]="ArrowFunctionSubtreeExcludes",e[e.FunctionSubtreeExcludes=98304]="FunctionSubtreeExcludes"}(o||(o={})),function(e){e[e.None=0]="None",e[e.UnpackedSpread=1]="UnpackedSpread",e[e.PackedSpread=2]="PackedSpread"}(s||(s={})),e.transformES2015=function(t){var n,i,a,o,s,l,u=t.factory,d=t.getEmitHelperFactory,_=t.startLexicalEnvironment,p=t.resumeLexicalEnvironment,f=t.endLexicalEnvironment,m=t.hoistVariableDeclaration,g=t.getCompilerOptions(),y=t.getEmitResolver(),h=t.onSubstituteNode,v=t.onEmitNode;function b(t){o=e.append(o,u.createVariableDeclaration(t))}return t.onEmitNode=function(t,r,n){if(1&l&&e.isFunctionLike(r)){var i=x(32670,8&e.getEmitFlags(r)?81:65);return v(t,r,n),void S(i,0,0)}v(t,r,n)},t.onSubstituteNode=function(t,r){if(r=h(t,r),1===t)return function(t){switch(t.kind){case 79:return function(t){if(2&l&&!e.isInternalName(t)){var r=y.getReferencedDeclarationWithCollidingName(t);if(r&&(!e.isClassLike(r)||!function(t,r){var n=e.getParseTreeNode(r);if(!n||n===t||n.end<=t.pos||n.pos>=t.end)return!1;var i=e.getEnclosingBlockScopeContainer(t);for(;n;){if(n===i||n===t)return!1;if(e.isClassElement(n)&&n.parent===t)return!0;n=n.parent}return!1}(r,t)))return e.setTextRange(u.getGeneratedNameForNode(e.getNameOfDeclaration(r)),t)}return t}(t);case 108:return function(t){if(1&l&&16&a)return e.setTextRange(u.createUniqueName("_this",48),t);return t}(t)}return t}(r);if(e.isIdentifier(r))return function(t){if(2&l&&!e.isInternalName(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r&&function(e){switch(e.parent.kind){case 203:case 257:case 260:case 254:return e.parent.name===e&&y.isDeclarationWithCollidingName(e.parent)}return!1}(r))return e.setTextRange(u.getGeneratedNameForNode(r),t)}return t}(r);return r},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;n=r,i=r.text;var s=function(t){var r=x(8064,64),n=[],i=[];_();var a=u.copyPrologue(t.statements,n,!1,T);e.addRange(i,e.visitNodes(t.statements,T,e.isStatement,a)),o&&i.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(o)));return u.mergeLexicalEnvironment(n,f()),U(n,t),S(r,0,0),u.updateSourceFile(t,e.setTextRange(u.createNodeArray(e.concatenate(n,i)),t.statements))}(r);return e.addEmitHelpers(s,t.readEmitHelpers()),n=void 0,i=void 0,o=void 0,a=0,s}));function x(e,t){var r=a;return a=32767&(a&~e|t),r}function S(e,t,r){a=-32768&(a&~t|r)|e}function D(e){return 0!=(8192&a)&&247===e.kind&&!e.expression}function C(t){return 0!=(1024&t.transformFlags)||void 0!==s||8192&a&&function(t){return 2097152&t.transformFlags&&(e.isReturnStatement(t)||e.isIfStatement(t)||e.isWithStatement(t)||e.isSwitchStatement(t)||e.isCaseBlock(t)||e.isCaseClause(t)||e.isDefaultClause(t)||e.isTryStatement(t)||e.isCatchClause(t)||e.isLabeledStatement(t)||e.isIterationStatement(t,!1)||e.isBlock(t))}(t)||e.isIterationStatement(t,!1)&&fe(t)||0!=(33554432&e.getEmitFlags(t))}function T(e){return C(e)?N(e,!1):e}function E(e){return C(e)?N(e,!0):e}function k(t){if(C(t)){var r=e.getOriginalNode(t);if(e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)){var n=x(32670,16449),i=N(t,!1);return S(n,98304,0),i}return N(t,!1)}return t}function A(e){return 106===e.kind?Ie(!0):T(e)}function N(i,o){switch(i.kind){case 124:return;case 257:return function(t){var r=u.createVariableDeclaration(u.getLocalName(t,!0),void 0,void 0,P(t));e.setOriginalNode(r,t);var n=[],i=u.createVariableStatement(void 0,u.createVariableDeclarationList([r]));if(e.setOriginalNode(i,t),e.setTextRange(i,t),e.startOnNewLine(i),n.push(i),e.hasSyntacticModifier(t,1)){var a=e.hasSyntacticModifier(t,512)?u.createExportDefault(u.getLocalName(t)):u.createExternalModuleExport(u.getLocalName(t));e.setOriginalNode(a,i),n.push(a)}var o=e.getEmitFlags(t);0==(4194304&o)&&(n.push(u.createEndOfDeclarationMarker(t)),e.setEmitFlags(i,4194304|o));return e.singleOrMany(n)}(i);case 226:return function(e){return P(e)}(i);case 164:return function(t){return t.dotDotDotToken?void 0:e.isBindingPattern(t.name)?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,u.getGeneratedNameForNode(t),void 0,void 0,void 0),t),t):t.initializer?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,t.name,void 0,void 0,void 0),t),t):t}(i);case 256:return function(r){var n=s;s=void 0;var i=x(32670,65),o=e.visitParameterList(r.parameters,T,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return S(i,98304,0),s=n,u.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,T,e.isModifier),r.asteriskToken,l,void 0,o,void 0,c)}(i);case 214:return function(r){8192&r.transformFlags&&!(16384&a)&&(a|=65536);var n=s;s=void 0;var i=x(15232,66),o=u.createFunctionExpression(void 0,void 0,void 0,void 0,e.visitParameterList(r.parameters,T,t),void 0,Q(r));return e.setTextRange(o,r),e.setOriginalNode(o,r),e.setEmitFlags(o,8),S(i,0,0),s=n,o}(i);case 213:return function(r){var n=262144&e.getEmitFlags(r)?x(32662,69):x(32670,65),i=s;s=void 0;var o=e.visitParameterList(r.parameters,T,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return S(n,98304,0),s=i,u.updateFunctionExpression(r,void 0,r.asteriskToken,l,void 0,o,void 0,c)}(i);case 254:return Y(i);case 79:return F(i);case 255:return function(r){if(3&r.flags||262144&r.transformFlags){3&r.flags&&Oe();var n=e.flatMap(r.declarations,1&r.flags?$:Y),i=u.createVariableDeclarationList(n);return e.setOriginalNode(i,r),e.setTextRange(i,r),e.setCommentRange(i,r),262144&r.transformFlags&&(e.isBindingPattern(r.declarations[0].name)||e.isBindingPattern(e.last(r.declarations).name))&&e.setSourceMapRange(i,function(t){for(var r=-1,n=-1,i=0,a=t;i0&&o.push(u.createStringLiteral(a.literal.text)),r=u.createCallExpression(u.createPropertyAccessExpression(r,"concat"),void 0,o)}return e.setTextRange(r,t)}(i);case 225:return function(t){return e.visitNode(t.expression,T,e.isExpression)}(i);case 106:return Ie(!1);case 108:return function(e){2&a&&!(16384&a)&&(a|=65536);if(s)return 2&a?(s.containsLexicalThis=!0,e):s.thisName||(s.thisName=u.createUniqueName("this"));return e}(i);case 231:return function(e){if(103===e.keywordToken&&"target"===e.name.escapedText)return a|=32768,u.createUniqueName("_newTarget",48);return e}(i);case 169:return function(t){e.Debug.assert(!e.isComputedPropertyName(t.name));var r=H(t,e.moveRangePos(t,-1),void 0,void 0);return e.setEmitFlags(r,512|e.getEmitFlags(r)),e.setTextRange(u.createPropertyAssignment(t.name,r),t)}(i);case 172:case 173:return function(r){e.Debug.assert(!e.isComputedPropertyName(r.name));var n=s;s=void 0;var i,a=x(32670,65),o=e.visitParameterList(r.parameters,T,t),c=Q(r);i=172===r.kind?u.updateGetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,r.type,c):u.updateSetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,c);return S(a,98304,0),s=n,i}(i);case 237:return function(r){var n,i=x(0,e.hasSyntacticModifier(r,1)?32:0);if(s&&0==(3&r.declarationList.flags)&&!function(t){return 1===t.declarationList.declarations.length&&!!t.declarationList.declarations[0].initializer&&!!(33554432&e.getEmitFlags(t.declarationList.declarations[0].initializer))}(r)){for(var a=void 0,o=0,c=r.declarationList.declarations;o0?(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(n,T,t,0,u.getGeneratedNameForNode(n)))),1048576)),!0):!!a&&(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createExpressionStatement(u.createAssignment(u.getGeneratedNameForNode(n),e.visitNode(a,T,e.isExpression))),1048576)),!0)}function J(t,r,n,i){i=e.visitNode(i,T,e.isExpression);var a=u.createIfStatement(u.createTypeCheck(u.cloneNode(n),"undefined"),e.setEmitFlags(e.setTextRange(u.createBlock([u.createExpressionStatement(e.setEmitFlags(e.setTextRange(u.createAssignment(e.setEmitFlags(e.setParent(e.setTextRange(u.cloneNode(n),n),n.parent),48),e.setEmitFlags(i,1584|e.getEmitFlags(i))),r),1536))]),r),1953));e.startOnNewLine(a),e.setTextRange(a,r),e.setEmitFlags(a,1050528),e.insertStatementAfterCustomPrologue(t,a)}function j(r,n,i){var a=[],o=e.lastOrUndefined(n.parameters);if(!function(e,t){return!(!e||!e.dotDotDotToken||t)}(o,i))return!1;var s=79===o.name.kind?e.setParent(e.setTextRange(u.cloneNode(o.name),o.name),o.name.parent):u.createTempVariable(void 0);e.setEmitFlags(s,48);var c=79===o.name.kind?u.cloneNode(o.name):s,l=n.parameters.length-1,d=u.createLoopVariable();a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(s,void 0,void 0,u.createArrayLiteralExpression([]))])),o),1048576));var _=u.createForStatement(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(d,void 0,void 0,u.createNumericLiteral(l))]),o),e.setTextRange(u.createLessThan(d,u.createPropertyAccessExpression(u.createIdentifier("arguments"),"length")),o),e.setTextRange(u.createPostfixIncrement(d),o),u.createBlock([e.startOnNewLine(e.setTextRange(u.createExpressionStatement(u.createAssignment(u.createElementAccessExpression(c,0===l?d:u.createSubtract(d,u.createNumericLiteral(l))),u.createElementAccessExpression(u.createIdentifier("arguments"),d))),o))]));return e.setEmitFlags(_,1048576),e.startOnNewLine(_),a.push(_),79!==o.name.kind&&a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(o,T,t,0,c))),o),1048576)),e.insertStatementsAfterCustomPrologue(r,a),!0}function U(e,t){return!!(65536&a&&214!==t.kind)&&(V(e,t,u.createThis()),!0)}function V(t,r,n){Me();var i=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_this",48),void 0,void 0,n)]));e.setEmitFlags(i,1050112),e.setSourceMapRange(i,r),e.insertStatementAfterCustomPrologue(t,i)}function K(t,r,n){if(32768&a){var i=void 0;switch(r.kind){case 214:return t;case 169:case 172:case 173:i=u.createVoidZero();break;case 171:i=u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor");break;case 256:case 213:i=u.createConditionalExpression(u.createLogicalAnd(e.setEmitFlags(u.createThis(),4),u.createBinaryExpression(e.setEmitFlags(u.createThis(),4),102,u.getLocalName(r))),void 0,u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor"),void 0,u.createVoidZero());break;default:return e.Debug.failBadSyntaxKind(r)}var o=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_newTarget",48),void 0,void 0,i)]));e.setEmitFlags(o,1050112),n&&(t=t.slice()),e.insertStatementAfterCustomPrologue(t,o)}return t}function z(t){return e.setTextRange(u.createEmptyStatement(),t)}function G(r,n,i){var a,o=e.getCommentRange(n),s=e.getSourceMapRange(n),c=H(n,n,void 0,i),l=e.visitNode(n.name,T,e.isPropertyName);if(!e.isPrivateIdentifier(l)&&e.getUseDefineForClassFields(t.getCompilerOptions())){var d=e.isComputedPropertyName(l)?l.expression:e.isIdentifier(l)?u.createStringLiteral(e.unescapeLeadingUnderscores(l.escapedText)):l;a=u.createObjectDefinePropertyCall(r,d,u.createPropertyDescriptor({value:c,enumerable:!1,writable:!0,configurable:!0}))}else{var _=e.createMemberAccessForPropertyName(u,r,l,n.name);a=u.createAssignment(_,c)}e.setEmitFlags(c,1536),e.setSourceMapRange(c,s);var p=e.setTextRange(u.createExpressionStatement(a),n);return e.setOriginalNode(p,n),e.setCommentRange(p,o),e.setEmitFlags(p,48),p}function q(t,r,n){var i=u.createExpressionStatement(W(t,r,n,!1));return e.setEmitFlags(i,1536),e.setSourceMapRange(i,e.getSourceMapRange(r.firstAccessor)),i}function W(t,r,n,i){var a=r.firstAccessor,o=r.getAccessor,s=r.setAccessor,c=e.setParent(e.setTextRange(u.cloneNode(t),t),t.parent);e.setEmitFlags(c,1568),e.setSourceMapRange(c,a.name);var l=e.visitNode(a.name,T,e.isPropertyName);if(e.isPrivateIdentifier(l))return e.Debug.failBadSyntaxKind(l,"Encountered unhandled private identifier while transforming ES2015.");var d=e.createExpressionForPropertyName(u,l);e.setEmitFlags(d,1552),e.setSourceMapRange(d,a.name);var _=[];if(o){var p=H(o,void 0,void 0,n);e.setSourceMapRange(p,e.getSourceMapRange(o)),e.setEmitFlags(p,512);var f=u.createPropertyAssignment("get",p);e.setCommentRange(f,e.getCommentRange(o)),_.push(f)}if(s){var m=H(s,void 0,void 0,n);e.setSourceMapRange(m,e.getSourceMapRange(s)),e.setEmitFlags(m,512);var g=u.createPropertyAssignment("set",m);e.setCommentRange(g,e.getCommentRange(s)),_.push(g)}_.push(u.createPropertyAssignment("enumerable",o||s?u.createFalse():u.createTrue()),u.createPropertyAssignment("configurable",u.createTrue()));var y=u.createCallExpression(u.createPropertyAccessExpression(u.createIdentifier("Object"),"defineProperty"),void 0,[c,d,u.createObjectLiteralExpression(_,!0)]);return i&&e.startOnNewLine(y),y}function H(r,n,i,o){var c=s;s=void 0;var l=o&&e.isClassLike(o)&&!e.isStatic(r)?x(32670,73):x(32670,65),d=e.visitParameterList(r.parameters,T,t),_=Q(r);return 32768&a&&!i&&(256===r.kind||213===r.kind)&&(i=u.getGeneratedNameForNode(r)),S(l,98304,0),s=c,e.setOriginalNode(e.setTextRange(u.createFunctionExpression(void 0,r.asteriskToken,i,void 0,d,void 0,_),n),r)}function Q(t){var r,i,a,o=!1,s=!1,c=[],l=[],d=t.body;if(p(),e.isBlock(d)&&(a=u.copyStandardPrologue(d.statements,c,0,!1),a=u.copyCustomPrologue(d.statements,l,a,T,e.isHoistedFunction),a=u.copyCustomPrologue(d.statements,l,a,T,e.isHoistedVariableStatement)),o=R(l,t)||o,o=j(l,t,!1)||o,e.isBlock(d))a=u.copyCustomPrologue(d.statements,l,a,T),r=d.statements,e.addRange(l,e.visitNodes(d.statements,T,e.isStatement,a)),!o&&d.multiLine&&(o=!0);else{e.Debug.assert(214===t.kind),r=e.moveRangeEnd(d,-1);var _=t.equalsGreaterThanToken;e.nodeIsSynthesized(_)||e.nodeIsSynthesized(d)||(e.rangeEndIsOnSameLineAsRangeStart(_,d,n)?s=!0:o=!0);var m=e.visitNode(d,T,e.isExpression),g=u.createReturnStatement(m);e.setTextRange(g,d),e.moveSyntheticComments(g,d),e.setEmitFlags(g,1440),l.push(g),i=d}if(u.mergeLexicalEnvironment(c,f()),K(c,t,!1),U(c,t),e.some(c)&&(o=!0),l.unshift.apply(l,c),e.isBlock(d)&&e.arrayIsEqualTo(l,d.statements))return d;var y=u.createBlock(e.setTextRange(u.createNodeArray(l),r),o);return e.setTextRange(y,t.body),!o&&s&&e.setEmitFlags(y,1),i&&e.setTokenSourceMapRange(y,19,i),e.setOriginalNode(y,t.body),y}function X(r,n){return e.isDestructuringAssignment(r)?e.flattenDestructuringAssignment(r,T,t,0,!n):27===r.operatorToken.kind?u.updateBinaryExpression(r,e.visitNode(r.left,E,e.isExpression),r.operatorToken,e.visitNode(r.right,n?E:T,e.isExpression)):e.visitEachChild(r,T,t)}function $(r){var n=r.name;return e.isBindingPattern(n)?Y(r):!r.initializer&&function(e){var t=y.getNodeCheckFlags(e),r=262144&t,n=524288&t;return!(0!=(64&a)||r&&n&&0!=(512&a))&&0==(4096&a)&&(!y.isDeclarationWithCollidingName(e)||n&&!r&&0==(6144&a))}(r)?u.updateVariableDeclaration(r,r.name,void 0,void 0,u.createVoidZero()):e.visitEachChild(r,T,t)}function Y(r){var n,i=x(32,0);return n=e.isBindingPattern(r.name)?e.flattenDestructuringBinding(r,T,t,0,void 0,0!=(32&i)):e.visitEachChild(r,T,t),S(i,0,0),n}function Z(t){s.labels.set(e.idText(t.label),!0)}function ee(t){s.labels.set(e.idText(t.label),!1)}function te(r,n,i,o,c){var l=x(r,n),d=function(r,n,i,o){if(!fe(r)){var c=void 0;s&&(c=s.allowedNonLabeledJumps,s.allowedNonLabeledJumps=6);var l=o?o(r,n,void 0,i):u.restoreEnclosingLabel(e.isForStatement(r)?function(t){return u.updateForStatement(t,e.visitNode(t.initializer,E,e.isForInitializer),e.visitNode(t.condition,T,e.isExpression),e.visitNode(t.incrementor,E,e.isExpression),e.visitNode(t.statement,T,e.isStatement,u.liftToBlock))}(r):e.visitEachChild(r,T,t),n,s&&ee);return s&&(s.allowedNonLabeledJumps=c),l}var d=function(t){var r;switch(t.kind){case 242:case 243:case 244:var n=t.initializer;n&&255===n.kind&&(r=n)}var i=[],a=[];if(r&&3&e.getCombinedNodeFlags(r))for(var o=de(t)||_e(t)||pe(t),c=0,l=r.declarations;c=81&&r<=116)return e.setTextRange(i.createStringLiteralFromNode(t),t)}}}(c||(c={})),function(e){var t,n,i,a,o;!function(e){e[e.Nop=0]="Nop",e[e.Statement=1]="Statement",e[e.Assign=2]="Assign",e[e.Break=3]="Break",e[e.BreakWhenTrue=4]="BreakWhenTrue",e[e.BreakWhenFalse=5]="BreakWhenFalse",e[e.Yield=6]="Yield",e[e.YieldStar=7]="YieldStar",e[e.Return=8]="Return",e[e.Throw=9]="Throw",e[e.Endfinally=10]="Endfinally"}(t||(t={})),function(e){e[e.Open=0]="Open",e[e.Close=1]="Close"}(n||(n={})),function(e){e[e.Exception=0]="Exception",e[e.With=1]="With",e[e.Switch=2]="Switch",e[e.Loop=3]="Loop",e[e.Labeled=4]="Labeled"}(i||(i={})),function(e){e[e.Try=0]="Try",e[e.Catch=1]="Catch",e[e.Finally=2]="Finally",e[e.Done=3]="Done"}(a||(a={})),function(e){e[e.Next=0]="Next",e[e.Throw=1]="Throw",e[e.Return=2]="Return",e[e.Break=3]="Break",e[e.Yield=4]="Yield",e[e.YieldStar=5]="YieldStar",e[e.Catch=6]="Catch",e[e.Endfinally=7]="Endfinally"}(o||(o={})),e.transformGenerators=function(t){var n,i,a,o,s,c,l,u,d,_,p=t.factory,f=t.getEmitHelperFactory,m=t.resumeLexicalEnvironment,g=t.endLexicalEnvironment,y=t.hoistFunctionDeclaration,h=t.hoistVariableDeclaration,v=t.getCompilerOptions(),b=e.getEmitScriptTarget(v),x=t.getEmitResolver(),S=t.onSubstituteNode;t.onSubstituteNode=function(t,r){if(r=S(t,r),1===t)return function(t){if(e.isIdentifier(t))return function(t){if(!e.isGeneratedIdentifier(t)&&n&&n.has(e.idText(t))){var r=e.getOriginalNode(t);if(e.isIdentifier(r)&&r.parent){var a=x.getReferencedValueDeclaration(r);if(a){var o=i[e.getOriginalNodeId(a)];if(o){var s=e.setParent(e.setTextRange(p.cloneNode(o),o),o.parent);return e.setSourceMapRange(s,t),e.setCommentRange(s,t),s}}}}return t}(t);return t}(r);return r};var D,C,T,E,k,A,N,w,F,P,I,O,M=1,L=0,R=0;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||0==(2048&r.transformFlags))return r;var n=e.visitEachChild(r,B,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function B(r){var n=r.transformFlags;return o?function(r){switch(r.kind){case 240:case 241:return function(r){return o?(oe(),r=e.visitEachChild(r,B,t),ce(),r):e.visitEachChild(r,B,t)}(r);case 249:return function(r){o&&re({kind:2,isScript:!0,breakLabel:-1});r=e.visitEachChild(r,B,t),o&&le();return r}(r);case 250:return function(r){o&&re({kind:4,isScript:!0,labelText:e.idText(r.label),breakLabel:-1});r=e.visitEachChild(r,B,t),o&&ue();return r}(r);default:return J(r)}}(r):a?J(r):e.isFunctionLikeDeclaration(r)&&r.asteriskToken?function(t){switch(t.kind){case 256:return j(t);case 213:return U(t);default:return e.Debug.failBadSyntaxKind(t)}}(r):2048&n?e.visitEachChild(r,B,t):r}function J(r){switch(r.kind){case 256:return j(r);case 213:return U(r);case 172:case 173:return function(r){var n=a,i=o;return a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i,r}(r);case 237:return function(t){if(524288&t.transformFlags)return void H(t.declarationList);if(1048576&e.getEmitFlags(t))return t;for(var r=0,n=t.declarationList.declarations;r0?p.inlineExpressions(e.map(c,Q)):void 0,e.visitNode(r.condition,B,e.isExpression),e.visitNode(r.incrementor,B,e.isExpression),e.visitIterationBody(r.statement,B,t))}else r=e.visitEachChild(r,B,t);o&&ce();return r}(r);case 243:return function(r){o&&oe();var n=r.initializer;if(e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i0)return ve(n,r)}return e.visitEachChild(r,B,t)}(r);case 245:return function(r){if(o){var n=ge(r.label&&e.idText(r.label));if(n>0)return ve(n,r)}return e.visitEachChild(r,B,t)}(r);case 247:return function(t){return r=e.visitNode(t.expression,B,e.isExpression),n=t,e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(r?[he(2),r]:[he(2)])),n);var r,n}(r);default:return 524288&r.transformFlags?function(r){switch(r.kind){case 221:return function(r){var n=e.getExpressionAssociativity(r);switch(n){case 0:return function(r){if(X(r.right))return e.isLogicalOperator(r.operatorToken.kind)?function(t){var r=ee(),n=Z();Se(n,e.visitNode(t.left,B,e.isExpression),t.left),55===t.operatorToken.kind?Te(r,n,t.left):Ce(r,n,t.left);return Se(n,e.visitNode(t.right,B,e.isExpression),t.right),te(r),n}(r):27===r.operatorToken.kind?K(r):p.updateBinaryExpression(r,Y(e.visitNode(r.left,B,e.isExpression)),r.operatorToken,e.visitNode(r.right,B,e.isExpression));return e.visitEachChild(r,B,t)}(r);case 1:return function(r){var n=r.left,i=r.right;if(X(i)){var a=void 0;switch(n.kind){case 206:a=p.updatePropertyAccessExpression(n,Y(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),n.name);break;case 207:a=p.updateElementAccessExpression(n,Y(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),Y(e.visitNode(n.argumentExpression,B,e.isExpression)));break;default:a=e.visitNode(n,B,e.isExpression)}var o=r.operatorToken.kind;return e.isCompoundAssignment(o)?e.setTextRange(p.createAssignment(a,e.setTextRange(p.createBinaryExpression(Y(a),e.getNonAssignmentOperatorForCompoundAssignment(o),e.visitNode(i,B,e.isExpression)),r)),r):p.updateBinaryExpression(r,a,r.operatorToken,e.visitNode(i,B,e.isExpression))}return e.visitEachChild(r,B,t)}(r);default:return e.Debug.assertNever(n)}}(r);case 351:return function(t){for(var r=[],n=0,i=t.elements;n0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(a,B,e.isExpression)))}return p.inlineExpressions(r)}(r);case 222:return function(r){if(X(r.whenTrue)||X(r.whenFalse)){var n=ee(),i=ee(),a=Z();return Te(n,e.visitNode(r.condition,B,e.isExpression),r.condition),Se(a,e.visitNode(r.whenTrue,B,e.isExpression),r.whenTrue),De(i),te(n),Se(a,e.visitNode(r.whenFalse,B,e.isExpression),r.whenFalse),te(i),a}return e.visitEachChild(r,B,t)}(r);case 224:return function(t){var r=ee(),n=e.visitNode(t.expression,B,e.isExpression);if(t.asteriskToken){!function(e,t){Ee(7,[e],t)}(0==(8388608&e.getEmitFlags(t.expression))?e.setTextRange(f().createValuesHelper(n),t):n,t)}else!function(e,t){Ee(6,[e],t)}(n,t);return te(r),function(t){return e.setTextRange(p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[]),t)}(t)}(r);case 204:return function(e){return z(e.elements,void 0,void 0,e.multiLine)}(r);case 205:return function(t){var r=t.properties,n=t.multiLine,i=$(r),a=Z();Se(a,p.createObjectLiteralExpression(e.visitNodes(r,B,e.isObjectLiteralElementLike,0,i),n));var o=e.reduceLeft(r,s,[],i);return o.push(n?e.startOnNewLine(e.setParent(e.setTextRange(p.cloneNode(a),a),a.parent)):a),p.inlineExpressions(o);function s(r,i){X(i)&&r.length>0&&(xe(p.createExpressionStatement(p.inlineExpressions(r))),r=[]);var o=e.createExpressionForObjectLiteralElementLike(p,t,i,a),s=e.visitNode(o,B,e.isExpression);return s&&(n&&e.startOnNewLine(s),r.push(s)),r}}(r);case 207:return function(r){if(X(r.argumentExpression))return p.updateElementAccessExpression(r,Y(e.visitNode(r.expression,B,e.isLeftHandSideExpression)),e.visitNode(r.argumentExpression,B,e.isExpression));return e.visitEachChild(r,B,t)}(r);case 208:return function(r){if(!e.isImportCall(r)&&e.forEach(r.arguments,X)){var n=p.createCallBinding(r.expression,h,b,!0),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createFunctionApplyCall(Y(e.visitNode(i,B,e.isLeftHandSideExpression)),a,z(r.arguments)),r),r)}return e.visitEachChild(r,B,t)}(r);case 209:return function(r){if(e.forEach(r.arguments,X)){var n=p.createCallBinding(p.createPropertyAccessExpression(r.expression,"bind"),h),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createNewExpression(p.createFunctionApplyCall(Y(e.visitNode(i,B,e.isExpression)),a,z(r.arguments,p.createVoidZero())),void 0,[]),r),r)}return e.visitEachChild(r,B,t)}(r);default:return e.visitEachChild(r,B,t)}}(r):2099200&r.transformFlags?e.visitEachChild(r,B,t):r}}function j(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionDeclaration(void 0,r.modifiers,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,V(r.body)),r),r);else{var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i}return a?void y(r):r}function U(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionExpression(void 0,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,V(r.body)),r),r);else{var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i}return r}function V(t){var r=[],n=a,i=o,f=s,y=c,h=l,v=u,b=d,x=_,S=M,k=D,A=C,N=T,w=E;a=!0,o=!1,s=void 0,c=void 0,l=void 0,u=void 0,d=void 0,_=void 0,M=1,D=void 0,C=void 0,T=void 0,E=p.createTempVariable(void 0),m();var F=p.copyPrologue(t.statements,r,!1,B);G(t.statements,F);var P=ke();return e.insertStatementsAfterStandardPrologue(r,g()),r.push(p.createReturnStatement(P)),a=n,o=i,s=f,c=y,l=h,u=v,d=b,_=x,M=S,D=k,C=A,T=N,E=w,e.setTextRange(p.createBlock(r,t.multiLine),t)}function K(t){var r=[];return n(t.left),n(t.right),p.inlineExpressions(r);function n(t){e.isBinaryExpression(t)&&27===t.operatorToken.kind?(n(t.left),n(t.right)):(X(t)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(t,B,e.isExpression)))}}function z(t,n,i,a){var o,s=$(t);if(s>0){o=Z();var c=e.visitNodes(t,B,e.isExpression,0,s);Se(o,p.createArrayLiteralExpression(n?r([n],c,!0):c)),n=void 0}var l=e.reduceLeft(t,(function(t,i){if(X(i)&&t.length>0){var s=void 0!==o;o||(o=Z()),Se(o,s?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(t,a)]):p.createArrayLiteralExpression(n?r([n],t,!0):t,a)),n=void 0,t=[]}return t.push(e.visitNode(i,B,e.isExpression)),t}),[],s);return o?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(l,a)]):e.setTextRange(p.createArrayLiteralExpression(n?r([n],l,!0):l,a),i)}function G(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n0?De(r,t):xe(t)}(r);case 246:return function(t){var r=me(t.label?e.idText(t.label):void 0);r>0?De(r,t):xe(t)}(r);case 247:return function(t){r=e.visitNode(t.expression,B,e.isExpression),n=t,Ee(8,[r],n);var r,n}(r);case 248:return function(t){X(t)?(r=Y(e.visitNode(t.expression,B,e.isExpression)),n=ee(),i=ee(),te(n),re({kind:1,expression:r,startLabel:n,endLabel:i}),q(t.statement),e.Debug.assert(1===ae()),te(ne().endLabel)):xe(e.visitNode(t,B,e.isStatement));var r,n,i}(r);case 249:return function(t){if(X(t.caseBlock)){for(var r=t.caseBlock,n=r.clauses.length,i=(re({kind:2,isScript:!1,breakLabel:f=ee()}),f),a=Y(e.visitNode(t.expression,B,e.isExpression)),o=[],s=-1,c=0;c0)break;d.push(p.createCaseClause(e.visitNode(l.expression,B,e.isExpression),[ve(o[c],l.expression)]))}else _++}d.length&&(xe(p.createSwitchStatement(a,p.createCaseBlock(d))),u+=d.length,d=[]),_>0&&(u+=_,_=0)}De(s>=0?o[s]:i);for(c=0;c0)break;l.push(Q(i))}l.length&&(xe(p.createExpressionStatement(p.inlineExpressions(l))),c+=l.length,l=[])}}function Q(t){return e.setSourceMapRange(p.createAssignment(e.setSourceMapRange(p.cloneNode(t.name),t.name),e.visitNode(t.initializer,B,e.isExpression)),t)}function X(e){return!!e&&0!=(524288&e.transformFlags)}function $(e){for(var t=e.length,r=0;r=0;r--){var n=u[r];if(!_e(n))break;if(n.labelText===e)return!0}return!1}function me(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(_e(r=u[t])&&r.labelText===e)return r.breakLabel;if(de(r)&&fe(e,t-1))return r.breakLabel}else for(t=u.length-1;t>=0;t--){var r;if(de(r=u[t]))return r.breakLabel}return 0}function ge(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(pe(r=u[t])&&fe(e,t-1))return r.continueLabel}else for(t=u.length-1;t>=0;t--){var r;if(pe(r=u[t]))return r.continueLabel}return 0}function ye(e){if(void 0!==e&&e>0){void 0===_&&(_=[]);var t=p.createNumericLiteral(-1);return void 0===_[e]?_[e]=[t]:_[e].push(t),t}return p.createOmittedExpression()}function he(t){var r=p.createNumericLiteral(t);return e.addSyntheticTrailingComment(r,3,function(e){switch(e){case 2:return"return";case 3:return"break";case 4:return"yield";case 5:return"yield*";case 7:return"endfinally";default:return}}(t)),r}function ve(t,r){return e.Debug.assertLessThan(0,t,"Invalid label"),e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([he(3),ye(t)])),r)}function be(){Ee(0)}function xe(e){e?Ee(1,[e]):be()}function Se(e,t,r){Ee(2,[e,t],r)}function De(e,t){Ee(3,[e],t)}function Ce(e,t,r){Ee(4,[e,t],r)}function Te(e,t,r){Ee(5,[e,t],r)}function Ee(e,t,r){void 0===D&&(D=[],C=[],T=[]),void 0===d&&te(ee());var n=D.length;D[n]=e,C[n]=t,T[n]=r}function ke(){L=0,R=0,k=void 0,A=!1,N=!1,w=void 0,F=void 0,P=void 0,I=void 0,O=void 0;var t=function(){if(D){for(var t=0;t0)),524288))}function Ae(e){(function(e){if(!N)return!0;if(!d||!_)return!1;for(var t=0;t=0;t--){var r=O[t];F=[p.createWithStatement(r.expression,p.createBlock(F))]}if(I){var n=I.startLabel,i=I.catchLabel,a=I.finallyLabel,o=I.endLabel;F.unshift(p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(p.createPropertyAccessExpression(E,"trys"),"push"),void 0,[p.createArrayLiteralExpression([ye(n),ye(i),ye(a),ye(o)])]))),I=void 0}e&&F.push(p.createExpressionStatement(p.createAssignment(p.createPropertyAccessExpression(E,"label"),p.createNumericLiteral(R+1))))}w.push(p.createCaseClause(p.createNumericLiteral(R),F||[])),F=void 0}function we(e){if(d)for(var t=0;t=2?2:0)),t),t))}else n&&e.isDefaultImport(t)&&(r=e.append(r,i.createVariableStatement(void 0,i.createVariableDeclarationList([e.setOriginalNode(e.setTextRange(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)),t),t)],_>=2?2:0))));if(U(t)){var o=e.getOriginalNodeId(t);b[o]=V(b[o],t)}else r=V(r,t);return e.singleOrMany(r)}(t);case 265:return function(t){var r;e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),p!==e.ModuleKind.AMD?r=e.hasSyntacticModifier(t,1)?e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(t.name,B(t))),t),t)):e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(i.cloneNode(t.name),void 0,void 0,B(t))],_>=2?2:0)),t),t)):e.hasSyntacticModifier(t,1)&&(r=e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(t),i.getLocalName(t))),t),t)));if(U(t)){var n=e.getOriginalNodeId(t);b[n]=K(b[n],t)}else r=K(r,t);return e.singleOrMany(r)}(t);case 272:return function(t){if(!t.moduleSpecifier)return;var r=i.getGeneratedNameForNode(t);if(t.exportClause&&e.isNamedExports(t.exportClause)){var n=[];p!==e.ModuleKind.AMD&&n.push(e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(r,void 0,void 0,B(t))])),t),t));for(var o=0,s=t.exportClause.elements;o(e.isExportName(t)?1:0);return!1}function M(t,r){var n,o=i.createUniqueName("resolve"),s=i.createUniqueName("reject"),c=[i.createParameterDeclaration(void 0,void 0,void 0,o),i.createParameterDeclaration(void 0,void 0,void 0,s)],u=i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("require"),void 0,[i.createArrayLiteralExpression([t||i.createOmittedExpression()]),o,s]))]);_>=2?n=i.createArrowFunction(void 0,void 0,c,void 0,void 0,u):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,u),r&&e.setEmitFlags(n,8));var d=i.createNewExpression(i.createIdentifier("Promise"),void 0,[n]);return e.getESModuleInterop(l)?i.createCallExpression(i.createPropertyAccessExpression(d,i.createIdentifier("then")),void 0,[a().createImportStarCallbackHelper()]):d}function L(t,r){var n,o=i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Promise"),"resolve"),void 0,[]),s=i.createCallExpression(i.createIdentifier("require"),void 0,t?[t]:[]);return e.getESModuleInterop(l)&&(s=a().createImportStarHelper(s)),_>=2?n=i.createArrowFunction(void 0,void 0,[],void 0,void 0,s):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(s)])),r&&e.setEmitFlags(n,8)),i.createCallExpression(i.createPropertyAccessExpression(o,"then"),void 0,[n])}function R(t,r){return!e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getImportNeedsImportStarHelper(t)?a().createImportStarHelper(r):e.getImportNeedsImportDefaultHelper(t)?a().createImportDefaultHelper(r):r}function B(t){var r=e.getExternalModuleNameLiteral(i,t,g,d,u,l),n=[];return r&&n.push(r),i.createCallExpression(i.createIdentifier("require"),void 0,n)}function J(t,r,n){var a=Z(t);if(a){for(var o=e.isExportName(t)?r:i.createAssignment(t,r),s=0,c=a;s=e.ModuleKind.ES2020?function(t){var r;return e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),r=function(t,r){e.hasSyntacticModifier(r,1)&&(t=e.append(t,o.createExportDeclaration(void 0,void 0,r.isTypeOnly,o.createNamedExports([o.createExportSpecifier(!1,void 0,e.idText(r.name))]))));return t}(r=e.append(r,e.setOriginalNode(e.setTextRange(o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(o.cloneNode(t.name),void 0,void 0,m(t))],d>=2?2:0)),t),t)),t),e.singleOrMany(r)}(t):void 0;case 271:return function(e){return e.isExportEquals?void 0:e}(t);case 272:return function(t){if(void 0!==u.module&&u.module>e.ModuleKind.ES2015)return t;if(!t.exportClause||!e.isNamespaceExport(t.exportClause)||!t.moduleSpecifier)return t;var r=t.exportClause.name,n=o.getGeneratedNameForNode(r),i=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamespaceImport(n)),t.moduleSpecifier,t.assertClause);e.setOriginalNode(i,t.exportClause);var a=e.isExportNamespaceAsDefaultDeclaration(t)?o.createExportDefault(n):o.createExportDeclaration(void 0,void 0,!1,o.createNamedExports([o.createExportSpecifier(!1,n,r)]));return e.setOriginalNode(a,t),[i,a]}(t)}return t}function m(t){var r=e.getExternalModuleNameLiteral(o,t,e.Debug.checkDefined(i),c,l,u),n=[];if(r&&n.push(r),!a){var s=o.createUniqueName("_createRequire",48),_=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamedImports([o.createImportSpecifier(!1,o.createIdentifier("createRequire"),s)])),o.createStringLiteral("module")),p=o.createUniqueName("__require",48),f=o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(p,void 0,void 0,o.createCallExpression(o.cloneNode(s),void 0,[o.createPropertyAccessExpression(o.createMetaProperty(100,o.createIdentifier("meta")),o.createIdentifier("url"))]))],d>=2?2:0));a=[_,f]}var m=a[1].declarationList.declarations[0].name;return e.Debug.assertNode(m,e.isIdentifier),o.createCallExpression(o.cloneNode(m),void 0,n)}}}(c||(c={})),function(e){e.transformNodeModule=function(t){var r=t.onSubstituteNode,n=t.onEmitNode,i=e.transformECMAScriptModule(t),a=t.onSubstituteNode,o=t.onEmitNode;t.onSubstituteNode=r,t.onEmitNode=n;var s,c=e.transformModule(t),l=t.onSubstituteNode,u=t.onEmitNode;return t.onSubstituteNode=function(t,n){return e.isSourceFile(n)?(s=n,r(t,n)):s?s.impliedNodeFormat===e.ModuleKind.ESNext?a(t,n):l(t,n):r(t,n)},t.onEmitNode=function(t,r,i){e.isSourceFile(r)&&(s=r);if(!s)return n(t,r,i);if(s.impliedNodeFormat===e.ModuleKind.ESNext)return o(t,r,i);return u(t,r,i)},t.enableSubstitution(305),t.enableEmitNotification(305),function(r){return 305===r.kind?d(r):function(r){return t.factory.createBundle(e.map(r.sourceFiles,d),r.prepends)}(r)};function d(t){if(t.isDeclarationFile)return t;s=t;var r=(t.impliedNodeFormat===e.ModuleKind.ESNext?i:c)(t);return s=void 0,e.Debug.assert(e.isSourceFile(r)),r}}}(c||(c={})),function(e){function t(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isPropertyAccessExpression(t)||e.isBindingElement(t)||e.isConstructorDeclaration(t)?r:e.isSetAccessor(t)||e.isGetAccessor(t)?function(r){var n;n=173===t.kind?e.isStatic(t)?r.errorModuleName?e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1;return{diagnosticMessage:n,errorNode:t.name,typeName:t.name}}:e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isIndexSignatureDeclaration(t)?function(r){var n;switch(t.kind){case 175:n=r.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 174:n=r.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 176:n=r.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 169:case 168:n=e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:257===t.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 256:n=r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return e.Debug.fail("This is unknown kind for signature: "+t.kind)}return{diagnosticMessage:n,errorNode:t.name||t}}:e.isParameter(t)?e.isParameterPropertyDeclaration(t,t.parent)&&e.hasSyntacticModifier(t.parent,8)?r:function(r){var n=function(r){switch(t.parent.kind){case 171:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 175:case 180:return r.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 174:return r.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 176:return r.errorModuleName?e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 169:case 168:return e.isStatic(t.parent)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:257===t.parent.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 256:case 179:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 173:case 172:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return e.Debug.fail("Unknown parent for parameter: ".concat(e.SyntaxKind[t.parent.kind]))}}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}:e.isTypeParameterDeclaration(t)?function(){var r;switch(t.parent.kind){case 257:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 258:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 195:r=e.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 180:case 175:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 174:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 169:case 168:r=e.isStatic(t.parent)?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:257===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 179:case 256:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 259:r=e.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return{diagnosticMessage:r,errorNode:t,typeName:t.name}}:e.isExpressionWithTypeArguments(t)?function(){var r;r=e.isClassDeclaration(t.parent.parent)?e.isHeritageClause(t.parent)&&117===t.parent.token?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t.parent.parent.name?e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0:e.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1;return{diagnosticMessage:r,errorNode:t,typeName:e.getNameOfDeclaration(t.parent.parent)}}:e.isImportEqualsDeclaration(t)?function(){return{diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}:e.isTypeAliasDeclaration(t)||e.isJSDocTypeAlias(t)?function(r){return{diagnosticMessage:r.errorModuleName?e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:e.isJSDocTypeAlias(t)?e.Debug.checkDefined(t.typeExpression):t.type,typeName:e.isJSDocTypeAlias(t)?e.getNameOfDeclaration(t):t.name}}:e.Debug.assertNever(t,"Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(e.SyntaxKind[t.kind]));function r(r){var n=function(r){return 254===t.kind||203===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:167===t.kind||206===t.kind||166===t.kind||164===t.kind&&e.hasSyntacticModifier(t.parent,8)?e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:257===t.parent.kind||164===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}}e.canProduceDiagnostics=function(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isBindingElement(t)||e.isSetAccessor(t)||e.isGetAccessor(t)||e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isParameter(t)||e.isTypeParameterDeclaration(t)||e.isExpressionWithTypeArguments(t)||e.isImportEqualsDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isConstructorDeclaration(t)||e.isIndexSignatureDeclaration(t)||e.isPropertyAccessExpression(t)||e.isJSDocTypeAlias(t)},e.createGetSymbolAccessibilityDiagnosticForNodeName=function(r){return e.isSetAccessor(r)||e.isGetAccessor(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:257===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:e.isMethodSignature(r)||e.isMethodDeclaration(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:257===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:t(r)},e.createGetSymbolAccessibilityDiagnosticForNode=t}(c||(c={})),function(e){function t(t,r){var n=r.text.substring(t.pos,t.end);return e.stringContains(n,"@internal")}function i(r,n){var i=e.getParseTreeNode(r);if(i&&164===i.kind){var a=i.parent.parameters.indexOf(i),o=a>0?i.parent.parameters[a-1]:void 0,s=n.text,c=o?e.concatenate(e.getTrailingCommentRanges(s,e.skipTrivia(s,o.end+1,!1,!0)),e.getLeadingCommentRanges(s,r.pos)):e.getTrailingCommentRanges(s,e.skipTrivia(s,r.pos,!1,!0));return c&&c.length&&t(e.last(c),n)}var l=i&&e.getLeadingCommentRangesOfNode(i,n);return!!e.forEach(l,(function(e){return t(e,n)}))}e.getDeclarationDiagnostics=function(t,r,n){var i=t.getCompilerOptions();return e.transformNodes(r,t,e.factory,i,n?[n]:e.filter(t.getSourceFiles(),e.isSourceFileNotJson),[o],!1).diagnostics},e.isInternalDeclaration=i;var a=531469;function o(t){var o,l,u,d,_,p,f,m,g,y,h,v,b=function(){return e.Debug.fail("Diagnostic emitted without context")},x=b,S=!0,D=!1,C=!1,T=!1,E=!1,k=t.factory,A=t.getEmitHost(),N={trackSymbol:function(e,t,r){if(262144&e.flags)return!1;var n=M(w.isSymbolAccessible(e,t,r,!0));return O(w.getTypeReferenceDirectivesForSymbol(e,r)),n},reportInaccessibleThisError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"this"))},reportInaccessibleUniqueSymbolError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"unique symbol"))},reportCyclicStructureError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,L()))},reportPrivateInBaseOfClassExpression:function(r){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected,r))},reportLikelyUnsafeImportRequiredError:function(r){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,L(),r))},reportTruncationError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed))},moduleResolverHost:A,trackReferencedAmbientModule:function(t,r){var n=w.getTypeReferenceDirectivesForSymbol(r,67108863);if(e.length(n))return O(n);var i=e.getSourceFileOfNode(t);y.set(e.getOriginalNodeId(i),i)},trackExternalModuleSymbolOfImportTypeNode:function(e){D||(p||(p=[])).push(e)},reportNonlocalAugmentation:function(r,n,i){var a,o=null===(a=n.declarations)||void 0===a?void 0:a.find((function(t){return e.getSourceFileOfNode(t)===r})),s=e.filter(i.declarations,(function(t){return e.getSourceFileOfNode(t)!==r}));if(s)for(var c=0,l=s;c0?e.parameters[0].type:void 0}e.transformDeclarations=o}(c||(c={})),function(e){var t,n;function i(t,r,n){if(n)return e.emptyArray;var i=e.getEmitScriptTarget(t),a=e.getEmitModuleKind(t),o=[];return e.addRange(o,r&&e.map(r.before,s)),o.push(e.transformTypeScript),o.push(e.transformClassFields),e.getJSXTransformEnabled(t)&&o.push(e.transformJsx),i<99&&o.push(e.transformESNext),i<8&&o.push(e.transformES2021),i<7&&o.push(e.transformES2020),i<6&&o.push(e.transformES2019),i<5&&o.push(e.transformES2018),i<4&&o.push(e.transformES2017),i<3&&o.push(e.transformES2016),i<2&&(o.push(e.transformES2015),o.push(e.transformGenerators)),o.push(function(t){switch(t){case e.ModuleKind.ESNext:case e.ModuleKind.ES2022:case e.ModuleKind.ES2020:case e.ModuleKind.ES2015:return e.transformECMAScriptModule;case e.ModuleKind.System:return e.transformSystemModule;case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return e.transformNodeModule;default:return e.transformModule}}(a)),i<1&&o.push(e.transformES5),e.addRange(o,r&&e.map(r.after,s)),o}function a(t){var r=[];return r.push(e.transformDeclarations),e.addRange(r,t&&e.map(t.afterDeclarations,c)),r}function o(t,r){return function(n){var i=t(n);return"function"==typeof i?r(n,i):function(t){return function(r){return e.isBundle(r)?t.transformBundle(r):t.transformSourceFile(r)}}(i)}}function s(t){return o(t,e.chainBundle)}function c(e){return o(e,(function(e,t){return t}))}function l(e,t){return t}function u(e,t,r){r(e,t)}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Completed=2]="Completed",e[e.Disposed=3]="Disposed"}(t||(t={})),function(e){e[e.Substitution=1]="Substitution",e[e.EmitNotifications=2]="EmitNotifications"}(n||(n={})),e.noTransformers={scriptTransformers:e.emptyArray,declarationTransformers:e.emptyArray},e.getTransformers=function(e,t,r){return{scriptTransformers:i(e,t,r),declarationTransformers:a(t)}},e.noEmitSubstitution=l,e.noEmitNotification=u,e.transformNodes=function(t,n,i,a,o,s,c){for(var d,_,p,f,m,g=new Array(355),y=0,h=[],v=[],b=[],x=[],S=0,D=!1,C=[],T=0,E=l,k=u,A=0,N=[],w={factory:i,getCompilerOptions:function(){return a},getEmitResolver:function(){return t},getEmitHost:function(){return n},getEmitHelperFactory:e.memoize((function(){return e.createEmitHelperFactory(w)})),startLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is suspended."),h[S]=d,v[S]=_,b[S]=p,x[S]=y,S++,d=void 0,_=void 0,p=void 0,y=0},suspendLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is already suspended."),D=!0},resumeLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(D,"Lexical environment is not suspended."),D=!1},endLexicalEnvironment:function(){var t;if(e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is suspended."),d||_||p){if(_&&(t=r([],_,!0)),d){var n=i.createVariableStatement(void 0,i.createVariableDeclarationList(d));e.setEmitFlags(n,1048576),t?t.push(n):t=[n]}p&&(t=r(t?r([],t,!0):[],p,!0))}S--,d=h[S],_=v[S],p=b[S],y=x[S],0===S&&(h=[],v=[],b=[],x=[]);return t},setLexicalEnvironmentFlags:function(e,t){y=t?y|e:y&~e},getLexicalEnvironmentFlags:function(){return y},hoistVariableDeclaration:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed.");var r=e.setEmitFlags(i.createVariableDeclaration(t),64);d?d.push(r):d=[r];1&y&&(y|=2)},hoistFunctionDeclaration:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),_?_.push(t):_=[t]},addInitializationStatement:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),p?p.push(t):p=[t]},startBlockScope:function(){e.Debug.assert(A>0,"Cannot start a block scope during initialization."),e.Debug.assert(A<2,"Cannot start a block scope after transformation has completed."),C[T]=f,T++,f=void 0},endBlockScope:function(){e.Debug.assert(A>0,"Cannot end a block scope during initialization."),e.Debug.assert(A<2,"Cannot end a block scope after transformation has completed.");var t=e.some(f)?[i.createVariableStatement(void 0,i.createVariableDeclarationList(f.map((function(e){return i.createVariableDeclaration(e)})),1))]:void 0;T--,f=C[T],0===T&&(C=[]);return t},addBlockScopedVariable:function(t){e.Debug.assert(T>0,"Cannot add a block scoped variable outside of an iteration body."),(f||(f=[])).push(t)},requestEmitHelper:function t(r){if(e.Debug.assert(A>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),e.Debug.assert(!r.scoped,"Cannot request a scoped emit helper."),r.dependencies)for(var n=0,i=r.dependencies;n0,"Cannot modify the transformation context during initialization."),e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed.");var t=m;return m=void 0,t},enableSubstitution:function(t){e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),g[t]|=1},enableEmitNotification:function(t){e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),g[t]|=2},isSubstitutionEnabled:j,isEmitNotificationEnabled:U,get onSubstituteNode(){return E},set onSubstituteNode(t){e.Debug.assert(A<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),E=t},get onEmitNode(){return k},set onEmitNode(t){e.Debug.assert(A<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),k=t},addDiagnostic:function(e){N.push(e)}},F=0,P=o;F"],e[8192]=["[","]"],e}();function a(t,r,n,i,a,s){void 0===i&&(i=!1);var l=e.isArray(n)?n:e.getSourceFilesToEmit(t,n,i),u=t.getCompilerOptions();if(e.outFile(u)){var d=t.getPrependNodes();if(l.length||d.length){var _=e.factory.createBundle(l,d);if(m=r(c(_,t,i),_))return m}}else{if(!a)for(var p=0,f=l;p0){var i=t.preserveSourceNewlinesStack[t.stackIndex],a=t.containerPosStack[t.stackIndex],o=t.containerEndStack[t.stackIndex],s=t.declarationListContainerEndStack[t.stackIndex],c=t.shouldEmitCommentsStack[t.stackIndex],l=t.shouldEmitSourceMapsStack[t.stackIndex];Pe(i),l&&sn(e),c&&Br(e,a,o,s),null==I||I(e),t.stackIndex--}}),void 0);function t(t,r,n){var i="left"===n?oe.getParenthesizeLeftSideOfBinaryForOperator(r.operatorToken.kind):oe.getParenthesizeRightSideOfBinaryForOperator(r.operatorToken.kind),a=Le(0,1,t);if(a===Ue&&(e.Debug.assertIsDefined(x),a=Re(1,1,t=i(e.cast(x,e.isExpression))),x=void 0),(a===Lr||a===an||a===Je)&&e.isBinaryExpression(t))return t;S=i,a(1,t)}}();return Te(),{printNode:function(t,r,n){switch(t){case 0:e.Debug.assert(e.isSourceFile(r),"Expected a SourceFile node.");break;case 2:e.Debug.assert(e.isIdentifier(r),"Expected an Identifier node.");break;case 1:e.Debug.assert(e.isExpression(r),"Expected an Expression node.")}switch(r.kind){case 305:return ue(r);case 306:return le(r);case 307:return function(e,t){var r=p;Ce(t,void 0),Se(4,e,void 0),Te(),p=r}(r,be()),xe()}return de(t,r,n,be()),xe()},printList:function(e,t,r){return _e(e,t,r,be()),xe()},printFile:ue,printBundle:le,writeNode:de,writeList:_e,writeFile:ve,writeBundle:he,bundleFileInfo:z};function le(e){return he(e,be(),void 0),xe()}function ue(e){return ve(e,be(),void 0),xe()}function de(e,t,r,n){var i=p;Ce(n,void 0),Se(e,t,r),Te(),p=i}function _e(e,t,r,n){var i=p;Ce(n,void 0),r&&De(r),Ut(void 0,t,e),Te(),p=i}function pe(){return p.getTextPosWithWriteLine?p.getTextPosWithWriteLine():p.getTextPos()}function fe(t,r,n){var i=e.lastOrUndefined(z.sections);i&&i.kind===n?i.end=r:z.sections.push({pos:t,end:r,kind:n})}function me(t){if(q&&z&&n&&(e.isDeclaration(t)||e.isVariableStatement(t))&&e.isInternalDeclaration(t,n)&&"internal"!==H){var r=H;return ye(p.getTextPos()),W=pe(),H="internal",r}}function ge(e){e&&(ye(p.getTextPos()),W=pe(),H=e)}function ye(e){return W"),Yt(),ke(e.type),Cr(e)}(r);case 180:return function(e){Dr(e),Nt(e,e.modifiers),Ht("new"),Yt(),Rt(e,e.typeParameters),Bt(e,e.parameters),Yt(),qt("=>"),Yt(),ke(e.type),Cr(e)}(r);case 181:return function(e){Ht("typeof"),Yt(),ke(e.exprName),Lt(e,e.typeArguments)}(r);case 182:return function(t){qt("{");var r=1&e.getEmitFlags(t)?768:32897;Ut(t,t.members,524288|r),qt("}")}(r);case 183:return function(e){ke(e.elementType,oe.parenthesizeNonArrayTypeOfPostfixType),qt("["),qt("]")}(r);case 184:return function(t){et(22,t.pos,qt,t);var r=1&e.getEmitFlags(t)?528:657;Ut(t,t.elements,524288|r,oe.parenthesizeElementTypeOfTupleType),et(23,t.elements.end,qt,t)}(r);case 185:return function(e){ke(e.type,oe.parenthesizeTypeOfOptionalType),qt("?")}(r);case 187:return function(e){Ut(e,e.types,516,oe.parenthesizeConstituentTypeOfUnionType)}(r);case 188:return function(e){Ut(e,e.types,520,oe.parenthesizeConstituentTypeOfIntersectionType)}(r);case 189:return function(e){ke(e.checkType,oe.parenthesizeCheckTypeOfConditionalType),Yt(),Ht("extends"),Yt(),ke(e.extendsType,oe.parenthesizeExtendsTypeOfConditionalType),Yt(),qt("?"),Yt(),ke(e.trueType),Yt(),qt(":"),Yt(),ke(e.falseType)}(r);case 190:return function(e){Ht("infer"),Yt(),ke(e.typeParameter)}(r);case 191:return function(e){qt("("),ke(e.type),qt(")")}(r);case 228:return Qe(r);case 192:return void Ht("this");case 193:return function(e){or(e.operator,Ht),Yt();var t=145===e.operator?oe.parenthesizeOperandOfReadonlyTypeOperator:oe.parenthesizeOperandOfTypeOperator;ke(e.type,t)}(r);case 194:return function(e){ke(e.objectType,oe.parenthesizeNonArrayTypeOfPostfixType),qt("["),ke(e.indexType),qt("]")}(r);case 195:return function(t){var r=e.getEmitFlags(t);qt("{"),1&r?Yt():(tr(),rr());t.readonlyToken&&(ke(t.readonlyToken),145!==t.readonlyToken.kind&&Ht("readonly"),Yt());qt("["),Ie(3,t.typeParameter),t.nameType&&(Yt(),Ht("as"),Yt(),ke(t.nameType));qt("]"),t.questionToken&&(ke(t.questionToken),57!==t.questionToken.kind&&qt("?"));qt(":"),Yt(),ke(t.type),Wt(),1&r?Yt():(tr(),nr());Ut(t,t.members,2),qt("}")}(r);case 196:return function(e){Ne(e.literal)}(r);case 197:return function(e){ke(e.dotDotDotToken),ke(e.name),ke(e.questionToken),et(58,e.name.end,qt,e),Yt(),ke(e.type)}(r);case 198:return function(e){ke(e.head),Ut(e,e.templateSpans,262144)}(r);case 199:return function(e){ke(e.type),ke(e.literal)}(r);case 200:return function(e){e.isTypeOf&&(Ht("typeof"),Yt());if(Ht("import"),qt("("),ke(e.argument),e.assertions){qt(","),Yt(),qt("{"),Yt(),Ht("assert"),qt(":"),Yt();var t=e.assertions.assertClause.elements;Ut(e.assertions.assertClause,t,526226),Yt(),qt("}")}qt(")"),e.qualifier&&(qt("."),ke(e.qualifier));Lt(e,e.typeArguments)}(r);case 201:return function(e){qt("{"),Ut(e,e.elements,525136),qt("}")}(r);case 202:return function(e){qt("["),Ut(e,e.elements,524880),qt("]")}(r);case 203:return function(e){ke(e.dotDotDotToken),e.propertyName&&(ke(e.propertyName),qt(":"),Yt());ke(e.name),Ft(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 233:return function(e){Ne(e.expression),ke(e.literal)}(r);case 234:return void Wt();case 235:return function(e){Xe(e,!e.multiLine&&vr(e))}(r);case 237:return function(e){Nt(e,e.modifiers),ke(e.declarationList),Wt()}(r);case 236:return $e(!1);case 238:return function(t){Ne(t.expression,oe.parenthesizeExpressionOfExpressionStatement),n&&e.isJsonSourceFile(n)&&!e.nodeIsSynthesized(t.expression)||Wt()}(r);case 239:return function(e){var t=et(99,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.thenStatement),e.elseStatement&&(sr(e,e.thenStatement,e.elseStatement),et(91,e.thenStatement.end,Ht,e),239===e.elseStatement.kind?(Yt(),ke(e.elseStatement)):Ot(e,e.elseStatement))}(r);case 240:return function(t){et(90,t.pos,Ht,t),Ot(t,t.statement),e.isBlock(t.statement)&&!V?Yt():sr(t,t.statement,t.expression);Ye(t,t.statement.end),Wt()}(r);case 241:return function(e){Ye(e,e.pos),Ot(e,e.statement)}(r);case 242:return function(e){var t=et(97,e.pos,Ht,e);Yt();var r=et(20,t,qt,e);Ze(e.initializer),r=et(26,e.initializer?e.initializer.end:r,qt,e),It(e.condition),r=et(26,e.condition?e.condition.end:r,qt,e),It(e.incrementor),et(21,e.incrementor?e.incrementor.end:r,qt,e),Ot(e,e.statement)}(r);case 243:return function(e){var t=et(97,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ze(e.initializer),Yt(),et(101,e.initializer.end,Ht,e),Yt(),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 244:return function(e){var t=et(97,e.pos,Ht,e);Yt(),function(e){e&&(ke(e),Yt())}(e.awaitModifier),et(20,t,qt,e),Ze(e.initializer),Yt(),et(160,e.initializer.end,Ht,e),Yt(),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 245:return function(e){et(86,e.pos,Ht,e),Pt(e.label),Wt()}(r);case 246:return function(e){et(81,e.pos,Ht,e),Pt(e.label),Wt()}(r);case 247:return function(e){et(105,e.pos,Ht,e),It(e.expression&&nt(e.expression),nt),Wt()}(r);case 248:return function(e){var t=et(116,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 249:return function(e){var t=et(107,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Yt(),ke(e.caseBlock)}(r);case 250:return function(e){ke(e.label),et(58,e.label.end,qt,e),Yt(),ke(e.statement)}(r);case 251:return function(e){et(109,e.pos,Ht,e),It(nt(e.expression),nt),Wt()}(r);case 252:return function(e){et(111,e.pos,Ht,e),Yt(),ke(e.tryBlock),e.catchClause&&(sr(e,e.tryBlock,e.catchClause),ke(e.catchClause));e.finallyBlock&&(sr(e,e.catchClause||e.tryBlock,e.finallyBlock),et(96,(e.catchClause||e.tryBlock).end,Ht,e),Yt(),ke(e.finallyBlock))}(r);case 253:return function(e){ir(87,e.pos,Ht),Wt()}(r);case 254:return function(e){var t,r,n,i,a;ke(e.name),ke(e.exclamationToken),wt(e.type),Ft(e.initializer,null!==(a=null!==(r=null===(t=e.type)||void 0===t?void 0:t.end)&&void 0!==r?r:null===(i=null===(n=e.name.emitNode)||void 0===n?void 0:n.typeNode)||void 0===i?void 0:i.end)&&void 0!==a?a:e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 255:return function(t){Ht(e.isLet(t)?"let":e.isVarConst(t)?"const":"var"),Yt(),Ut(t,t.declarations,528)}(r);case 256:return function(e){at(e)}(r);case 257:return function(e){dt(e)}(r);case 258:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),Ht("interface"),Yt(),ke(e.name),Rt(e,e.typeParameters),Ut(e,e.heritageClauses,512),Yt(),qt("{"),Ut(e,e.members,129),qt("}")}(r);case 259:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),Ht("type"),Yt(),ke(e.name),Rt(e,e.typeParameters),Yt(),qt("="),Yt(),ke(e.type),Wt()}(r);case 260:return function(e){Nt(e,e.modifiers),Ht("enum"),Yt(),ke(e.name),Yt(),qt("{"),Ut(e,e.members,145),qt("}")}(r);case 261:return function(t){Nt(t,t.modifiers),1024&~t.flags&&(Ht(16&t.flags?"namespace":"module"),Yt());ke(t.name);var r=t.body;if(!r)return Wt();for(;r&&e.isModuleDeclaration(r);)qt("."),ke(r.name),r=r.body;Yt(),ke(r)}(r);case 262:return function(t){Dr(t),e.forEach(t.statements,Er),Xe(t,vr(t)),Cr(t)}(r);case 263:return function(e){et(18,e.pos,qt,e),Ut(e,e.clauses,129),et(19,e.clauses.end,qt,e,!0)}(r);case 264:return function(e){var t=et(93,e.pos,Ht,e);Yt(),t=et(127,t,Ht,e),Yt(),t=et(142,t,Ht,e),Yt(),ke(e.name),Wt()}(r);case 265:return function(e){Nt(e,e.modifiers),et(100,e.modifiers?e.modifiers.end:e.pos,Ht,e),Yt(),e.isTypeOnly&&(et(152,e.pos,Ht,e),Yt());ke(e.name),Yt(),et(63,e.name.end,qt,e),Yt(),function(e){79===e.kind?Ne(e):ke(e)}(e.moduleReference),Wt()}(r);case 266:return function(e){Nt(e,e.modifiers),et(100,e.modifiers?e.modifiers.end:e.pos,Ht,e),Yt(),e.importClause&&(ke(e.importClause),Yt(),et(156,e.importClause.end,Ht,e),Yt());Ne(e.moduleSpecifier),e.assertClause&&Pt(e.assertClause);Wt()}(r);case 267:return function(e){e.isTypeOnly&&(et(152,e.pos,Ht,e),Yt());ke(e.name),e.name&&e.namedBindings&&(et(27,e.name.end,qt,e),Yt());ke(e.namedBindings)}(r);case 268:return function(e){var t=et(41,e.pos,qt,e);Yt(),et(127,t,Ht,e),Yt(),ke(e.name)}(r);case 274:return function(e){var t=et(41,e.pos,qt,e);Yt(),et(127,t,Ht,e),Yt(),ke(e.name)}(r);case 269:case 273:return function(e){_t(e)}(r);case 270:case 275:return function(e){pt(e)}(r);case 271:return function(e){var t=et(93,e.pos,Ht,e);Yt(),e.isExportEquals?et(63,t,Qt,e):et(88,t,Ht,e);Yt(),Ne(e.expression,e.isExportEquals?oe.getParenthesizeRightSideOfBinaryForOperator(63):oe.parenthesizeExpressionOfExportDefault),Wt()}(r);case 272:return function(e){var t=et(93,e.pos,Ht,e);Yt(),e.isTypeOnly&&(t=et(152,t,Ht,e),Yt());e.exportClause?ke(e.exportClause):t=et(41,t,qt,e);if(e.moduleSpecifier){Yt(),et(156,e.exportClause?e.exportClause.end:t,Ht,e),Yt(),Ne(e.moduleSpecifier)}e.assertClause&&Pt(e.assertClause);Wt()}(r);case 293:return function(e){et(129,e.pos,Ht,e),Yt();var t=e.elements;Ut(e,t,526226)}(r);case 294:return function(t){ke(t.name),qt(":"),Yt();var r=t.value;if(0==(512&e.getEmitFlags(r))){$r(e.getCommentRange(r).pos)}ke(r)}(r);case 276:case 319:case 330:case 331:case 333:case 334:case 335:case 336:case 349:case 353:case 352:return;case 277:return function(e){Ht("require"),qt("("),Ne(e.expression),qt(")")}(r);case 11:return function(e){p.writeLiteral(e.text)}(r);case 280:case 283:return function(t){if(qt("<"),e.isJsxOpeningElement(t)){var r=mr(t.tagName,t);ft(t.tagName),Lt(t,t.typeArguments),t.attributes.properties&&t.attributes.properties.length>0&&Yt(),ke(t.attributes),gr(t.attributes,t),ur(r)}qt(">")}(r);case 281:case 284:return function(t){qt("")}(r);case 285:return function(e){ke(e.name),function(e,t,r,n){r&&(t(e),n(r))}("=",qt,e.initializer,we)}(r);case 286:return function(e){Ut(e,e.properties,262656)}(r);case 287:return function(e){qt("{..."),Ne(e.expression),qt("}")}(r);case 288:return function(t){var r;if(t.expression||!re&&!e.nodeIsSynthesized(t)&&(o=t.pos,function(t){var r=!1;return e.forEachTrailingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(o)||function(t){var r=!1;return e.forEachLeadingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(o))){var i=n&&!e.nodeIsSynthesized(t)&&e.getLineAndCharacterOfPosition(n,t.pos).line!==e.getLineAndCharacterOfPosition(n,t.end).line;i&&p.increaseIndent();var a=et(18,t.pos,qt,t);ke(t.dotDotDotToken),Ne(t.expression),et(19,(null===(r=t.expression)||void 0===r?void 0:r.end)||a,qt,t),i&&p.decreaseIndent()}var o}(r);case 289:return function(e){et(82,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma),mt(e,e.statements,e.expression.end)}(r);case 290:return function(e){var t=et(88,e.pos,Ht,e);mt(e,e.statements,t)}(r);case 291:return function(e){Yt(),or(e.token,Ht),Yt(),Ut(e,e.types,528)}(r);case 292:return function(e){var t=et(83,e.pos,Ht,e);Yt(),e.variableDeclaration&&(et(20,t,qt,e),ke(e.variableDeclaration),et(21,e.variableDeclaration.end,qt,e),Yt());ke(e.block)}(r);case 296:return function(t){ke(t.name),qt(":"),Yt();var r=t.initializer;if(0==(512&e.getEmitFlags(r))){$r(e.getCommentRange(r).pos)}Ne(r,oe.parenthesizeExpressionForDisallowedComma)}(r);case 297:return function(e){ke(e.name),e.objectAssignmentInitializer&&(Yt(),qt("="),Yt(),Ne(e.objectAssignmentInitializer,oe.parenthesizeExpressionForDisallowedComma))}(r);case 298:return function(e){e.expression&&(et(25,e.pos,qt,e),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma))}(r);case 299:return function(e){ke(e.name),Ft(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 300:return Ge(r);case 307:case 301:return function(e){for(var t=0,r=e.texts;t=1&&!e.isJsonSourceFile(n)?64:0;Ut(t,t.properties,526226|a|i),r&&nr()}(r);case 206:return function(t){Ne(t.expression,oe.parenthesizeLeftSideOfAccess);var r=t.questionDotToken||e.setTextRangePosEnd(e.factory.createToken(24),t.expression.end,t.name.pos),n=hr(t,t.expression,r),i=hr(t,r,t.name);lr(n,!1),28===r.kind||!function(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isNumericLiteral(t)){var r=Sr(t,!0,!1);return!t.numericLiteralFlags&&!e.stringContains(r,e.tokenToString(24))}if(e.isAccessExpression(t)){var n=e.getConstantValue(t);return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n}}(t.expression)||p.hasTrailingComment()||p.hasTrailingWhitespace()||qt(".");t.questionDotToken?ke(r):et(r.kind,t.expression.end,qt,t);lr(i,!1),ke(t.name),ur(n,i)}(r);case 207:return function(e){Ne(e.expression,oe.parenthesizeLeftSideOfAccess),ke(e.questionDotToken),et(22,e.expression.end,qt,e),Ne(e.argumentExpression),et(23,e.argumentExpression.end,qt,e)}(r);case 208:return function(t){var r=536870912&e.getEmitFlags(t);r&&(qt("("),zt("0"),qt(","),Yt());Ne(t.expression,oe.parenthesizeLeftSideOfAccess),r&&qt(")");ke(t.questionDotToken),Lt(t,t.typeArguments),Vt(t,t.arguments,2576,oe.parenthesizeExpressionForDisallowedComma)}(r);case 209:return function(e){et(103,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeExpressionOfNew),Lt(e,e.typeArguments),Vt(e,e.arguments,18960,oe.parenthesizeExpressionForDisallowedComma)}(r);case 210:return function(t){var r=536870912&e.getEmitFlags(t);r&&(qt("("),zt("0"),qt(","),Yt());Ne(t.tag,oe.parenthesizeLeftSideOfAccess),r&&qt(")");Lt(t,t.typeArguments),Yt(),Ne(t.template)}(r);case 211:return function(e){qt("<"),ke(e.type),qt(">"),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 212:return function(e){var t=et(20,e.pos,qt,e),r=mr(e.expression,e);Ne(e.expression,void 0),gr(e.expression,e),ur(r),et(21,e.expression?e.expression.end:t,qt,e)}(r);case 213:return function(e){Ar(e.name),at(e)}(r);case 214:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),ot(e,He)}(r);case 215:return function(e){et(89,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 216:return function(e){et(112,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 217:return function(e){et(114,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 218:return function(e){et(132,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 219:return function(e){or(e.operator,Qt),function(e){var t=e.operand;return 219===t.kind&&(39===e.operator&&(39===t.operator||45===t.operator)||40===e.operator&&(40===t.operator||46===t.operator))}(e)&&Yt();Ne(e.operand,oe.parenthesizeOperandOfPrefixUnary)}(r);case 220:return function(e){Ne(e.operand,oe.parenthesizeOperandOfPostfixUnary),or(e.operator,Qt)}(r);case 221:return ce(r);case 222:return function(e){var t=hr(e,e.condition,e.questionToken),r=hr(e,e.questionToken,e.whenTrue),n=hr(e,e.whenTrue,e.colonToken),i=hr(e,e.colonToken,e.whenFalse);Ne(e.condition,oe.parenthesizeConditionOfConditionalExpression),lr(t,!0),ke(e.questionToken),lr(r,!0),Ne(e.whenTrue,oe.parenthesizeBranchOfConditionalExpression),ur(t,r),lr(n,!0),ke(e.colonToken),lr(i,!0),Ne(e.whenFalse,oe.parenthesizeBranchOfConditionalExpression),ur(n,i)}(r);case 223:return function(e){ke(e.head),Ut(e,e.templateSpans,262144)}(r);case 224:return function(e){et(125,e.pos,Ht,e),ke(e.asteriskToken),It(e.expression&&nt(e.expression),it)}(r);case 225:return function(e){et(25,e.pos,qt,e),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma)}(r);case 226:return function(e){Ar(e.name),dt(e)}(r);case 227:case 349:case 352:case 353:return;case 229:return function(e){Ne(e.expression,void 0),e.type&&(Yt(),Ht("as"),Yt(),ke(e.type))}(r);case 230:return function(e){Ne(e.expression,oe.parenthesizeLeftSideOfAccess),Qt("!")}(r);case 228:return Qe(r);case 231:return function(e){ir(e.keywordToken,e.pos,qt),qt("."),ke(e.name)}(r);case 232:return e.Debug.fail("SyntheticExpression should never be printed.");case 278:return function(e){ke(e.openingElement),Ut(e,e.children,262144),ke(e.closingElement)}(r);case 279:return function(e){qt("<"),ft(e.tagName),Lt(e,e.typeArguments),Yt(),ke(e.attributes),qt("/>")}(r);case 282:return function(e){ke(e.openingFragment),Ut(e,e.children,262144),ke(e.closingFragment)}(r);case 348:return e.Debug.fail("SyntaxList should not be printed");case 350:return function(t){var r=e.getEmitFlags(t);512&r||t.pos===t.expression.pos||$r(t.expression.pos);Ne(t.expression),1024&r||t.end===t.expression.end||Qr(t.expression.end)}(r);case 351:return function(e){Vt(e,e.elements,528,void 0)}(r);case 354:return e.Debug.fail("SyntheticReferenceExpression should not be printed")}return e.isKeyword(r.kind)?ar(r,Ht):e.isTokenKind(r.kind)?ar(r,qt):void e.Debug.fail("Unhandled SyntaxKind: ".concat(e.Debug.formatSyntaxKind(r.kind),"."))}function Ue(t,r){var n=Re(1,t,r);e.Debug.assertIsDefined(x),r=x,x=void 0,n(t,r)}function Ve(r){var i=!1,a=306===r.kind?r:void 0;if(!a||j!==e.ModuleKind.None){for(var o=a?a.prepends.length:0,s=a?a.sourceFiles.length+o:1,c=0;c0)return!1;r=o}return!0}(t)?lt:ut;Kr(t,t.statements,r),nr(),ir(19,t.statements.end,qt,t),null==I||I(t)}function lt(e){ut(e,!0)}function ut(e,t){var r=Ct(e.statements),n=p.getTextPos();Ve(e),0===r&&n===p.getTextPos()&&t?(nr(),Ut(e,e.statements,768),rr()):Ut(e,e.statements,1,void 0,r)}function dt(t){e.forEach(t.members,kr),Mt(t,t.decorators),Nt(t,t.modifiers),Ht("class"),t.name&&(Yt(),Ae(t.name));var r=65536&e.getEmitFlags(t);r&&rr(),Rt(t,t.typeParameters),Ut(t,t.heritageClauses,0),Yt(),qt("{"),Ut(t,t.members,129),qt("}"),r&&nr()}function _t(e){qt("{"),Ut(e,e.elements,525136),qt("}")}function pt(e){e.isTypeOnly&&(Ht("type"),Yt()),e.propertyName&&(ke(e.propertyName),Yt(),et(127,e.propertyName.end,Ht,e),Yt()),ke(e.name)}function ft(e){79===e.kind?Ne(e):ke(e)}function mt(t,r,i){var a=163969;1===r.length&&(!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r[0])||e.rangeStartPositionsAreOnSameLine(t,r[0],n))?(ir(58,i,qt,t),Yt(),a&=-130):et(58,i,qt,t),Ut(t,r,a)}function gt(t){Ut(t,e.factory.createNodeArray(t.jsDocPropertyTags),33)}function yt(t){t.typeParameters&&Ut(t,e.factory.createNodeArray(t.typeParameters),33),t.parameters&&Ut(t,e.factory.createNodeArray(t.parameters),33),t.type&&(tr(),Yt(),qt("*"),Yt(),ke(t.type))}function ht(e){qt("@"),ke(e)}function vt(t){var r=e.getTextOfJSDocComment(t);r&&(Yt(),K(r))}function bt(e){e&&(Yt(),qt("{"),ke(e.type),qt("}"))}function xt(t){tr();var r=t.statements;0===r.length||!e.isPrologueDirective(r[0])||e.nodeIsSynthesized(r[0])?Kr(t,r,Dt):Dt(t)}function St(t,r,i,a){if(t){var o=p.getTextPos();$t('/// '),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"no-default-lib"}),tr()}if(n&&n.moduleName&&($t('/// ')),tr()),n&&n.amdDependencies)for(var s=0,c=n.amdDependencies;s')):$t('/// ')),tr()}for(var u=0,d=r;u')),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"reference",data:_.fileName}),tr()}for(var f=0,m=i;f")),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:_.resolutionMode?_.resolutionMode===e.ModuleKind.ESNext?"type-import":"type-require":"type",data:_.fileName}),tr()}for(var y=0,h=a;y')),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"lib",data:_.fileName}),tr()}}function Dt(t){var r=t.statements;Dr(t),e.forEach(t.statements,Er),Ve(t);var n=e.findIndex(r,(function(t){return!e.isPrologueDirective(t)}));!function(e){e.isDeclarationFile&&St(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives)}(t),Ut(t,r,1,void 0,-1===n?r.length:n),Cr(t)}function Ct(t,r,n,i){for(var a=!!r,o=0;o=a.length||0===l;if(u&&32768&o)return O&&O(a),void(M&&M(a));if(15360&o&&(qt(function(e){return i[15360&e][0]}(o)),u&&a&&$r(a.pos,!0)),O&&O(a),u)!(1&o)||V&&(!r||n&&e.rangeIsOnSingleLine(r,n))?256&o&&!(524288&o)&&Yt():tr();else{e.Debug.type(a);var d=0==(262144&o),p=d,f=dr(r,a,o);f?(tr(f),p=!1):256&o&&Yt(),128&o&&rr();for(var m=function(e,t){return 1===e.length?D:"object"==typeof t?C:T}(t,s),g=void 0,y=void 0,h=!1,v=0;v0?(0==(131&o)&&(rr(),h=!0),tr(x),p=!1):g&&512&o&&Yt()}if(y=me(b),p)$r(e.getCommentRange(b).pos);else p=d;_=b.pos,m(b,t,s,v),h&&(nr(),h=!1),g=b}var S=g?e.getEmitFlags(g):0,E=re||!!(1024&S),k=(null==a?void 0:a.hasTrailingComma)&&64&o&&16&o;k&&(g&&!E?et(27,g.end,qt,g):qt(",")),g&&(r?r.end:-1)!==g.end&&60&o&&!E&&Qr(k&&(null==a?void 0:a.end)?a.end:g.end),128&o&&nr(),ge(y);var A=pr(r,a,o);A?tr(A):2097408&o&&Yt()}M&&M(a),15360&o&&(u&&a&&Qr(a.end),qt(function(e){return i[15360&e][1]}(o)))}}function zt(e){p.writeLiteral(e)}function Gt(e,t){p.writeSymbol(e,t)}function qt(e){p.writePunctuation(e)}function Wt(){p.writeTrailingSemicolon(";")}function Ht(e){p.writeKeyword(e)}function Qt(e){p.writeOperator(e)}function Xt(e){p.writeParameter(e)}function $t(e){p.writeComment(e)}function Yt(){p.writeSpace(" ")}function Zt(e){p.writeProperty(e)}function er(e){p.nonEscapingWrite?p.nonEscapingWrite(e):p.write(e)}function tr(e){void 0===e&&(e=1);for(var t=0;t0)}function rr(){p.increaseIndent()}function nr(){p.decreaseIndent()}function ir(t,r,n,i){return Q?or(t,n,r):function(t,r,n,i,a){if(Q||t&&e.isInJsonFile(t))return a(r,n,i);var o=t&&t.emitNode,s=o&&o.flags||0,c=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[r],l=c&&c.source||y;i=cn(l,c?c.pos:i),0==(128&s)&&i>=0&&un(l,i);i=a(r,n,i),c&&(i=c.end);0==(256&s)&&i>=0&&un(l,i);return i}(i,t,n,r,or)}function ar(t,r){L&&L(t),r(e.tokenToString(t.kind)),R&&R(t)}function or(t,r,n){var i=e.tokenToString(t);return r(i),n<0?n:n+i.length}function sr(t,r,n){if(1&e.getEmitFlags(t))Yt();else if(V){var i=hr(t,r,n);i?tr(i):Yt()}else tr()}function cr(t){for(var r=t.split(/\r\n?|\n/g),n=e.guessIndentation(r),i=0,a=r;i-1&&i.indexOf(r)===a+1}(t,r)?fr((function(i){return e.getLinesBetweenRangeEndAndRangeStart(t,r,n,i)})):!V&&(a=t,o=r,(a=e.getOriginalNode(a)).parent&&a.parent===e.getOriginalNode(o).parent)?e.rangeEndIsOnSameLineAsRangeStart(t,r,n)?0:1:65536&i?1:0;if(yr(t,i)||yr(r,i))return 1}else if(e.getStartsOnNewLine(r))return 1;var a,o;return 1&i?1:0}function pr(t,r,i){if(2&i||V){if(65536&i)return 1;var a=e.lastOrUndefined(r);if(void 0===a)return!t||n&&e.rangeIsOnSingleLine(t,n)?0:1;if(n&&t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||a.parent===t)){if(V){var o=e.isNodeArray(r)&&!e.positionIsSynthesized(r.end)?r.end:a.end;return fr((function(r){return e.getLinesBetweenPositionAndNextNonWhitespaceCharacter(o,t.end,n,r)}))}return e.rangeEndPositionsAreOnSameLine(t,a,n)?0:1}if(yr(a,i))return 1}return 1&i&&!(131072&i)?1:0}function fr(t){e.Debug.assert(!!V);var r=t(!0);return 0===r?t(!1):r}function mr(e,t){var r=V&&dr(t,[e],0);return r&&lr(r,!1),!!r}function gr(e,t){var r=V&&pr(t,[e],0);r&&tr(r)}function yr(t,r){if(e.nodeIsSynthesized(t)){var n=e.getStartsOnNewLine(t);return void 0===n?0!=(65536&r):n}return 0!=(65536&r)}function hr(t,r,i){return 131072&e.getEmitFlags(t)?0:(t=br(t),r=br(r),i=br(i),e.getStartsOnNewLine(i)?1:!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r)||e.nodeIsSynthesized(i)?0:V?fr((function(t){return e.getLinesBetweenRangeEndAndRangeStart(r,i,n,t)})):e.rangeEndIsOnSameLineAsRangeStart(r,i,n)?0:1)}function vr(t){return 0===t.statements.length&&(!n||e.rangeEndIsOnSameLineAsRangeStart(t,t,n))}function br(t){for(;212===t.kind&&e.nodeIsSynthesized(t);)t=t.expression;return t}function xr(t,r){if(e.isGeneratedIdentifier(t))return Nr(t);if(e.isStringLiteral(t)&&t.textSourceNode)return xr(t.textSourceNode,r);var i=n,a=!!i&&!!t.parent&&!e.nodeIsSynthesized(t);if(e.isMemberName(t)){if(!a||e.getSourceFileOfNode(t)!==e.getOriginalNode(i))return e.idText(t)}else if(e.Debug.assertNode(t,e.isLiteralExpression),!a)return t.text;return e.getSourceTextOfNodeFromSourceFile(i,t,r)}function Sr(r,i,a){if(10===r.kind&&r.textSourceNode){var o=r.textSourceNode;if(e.isIdentifier(o)||e.isNumericLiteral(o)){var s=e.isNumericLiteral(o)?o.text:xr(o);return a?'"'.concat(e.escapeJsxAttributeString(s),'"'):i||16777216&e.getEmitFlags(r)?'"'.concat(e.escapeString(s),'"'):'"'.concat(e.escapeNonAsciiString(s),'"')}return Sr(o,i,a)}var c=(i?1:0)|(a?2:0)|(t.terminateUnterminatedLiterals?4:0)|(t.target&&99===t.target?8:0);return e.getLiteralText(r,n,c)}function Dr(t){t&&524288&e.getEmitFlags(t)||(c.push(l),l=0,u.push(d))}function Cr(t){t&&524288&e.getEmitFlags(t)||(l=c.pop(),d=u.pop())}function Tr(t){d&&d!==e.lastOrUndefined(u)||(d=new e.Set),d.add(t)}function Er(t){if(t)switch(t.kind){case 235:case 289:case 290:e.forEach(t.statements,Er);break;case 250:case 248:case 240:case 241:Er(t.statement);break;case 239:Er(t.thenStatement),Er(t.elseStatement);break;case 242:case 244:case 243:Er(t.initializer),Er(t.statement);break;case 249:Er(t.caseBlock);break;case 263:e.forEach(t.clauses,Er);break;case 252:Er(t.tryBlock),Er(t.catchClause),Er(t.finallyBlock);break;case 292:Er(t.variableDeclaration),Er(t.block);break;case 237:Er(t.declarationList);break;case 255:e.forEach(t.declarations,Er);break;case 254:case 164:case 203:case 257:case 268:case 274:Ar(t.name);break;case 256:Ar(t.name),524288&e.getEmitFlags(t)&&(e.forEach(t.parameters,Er),Er(t.body));break;case 201:case 202:case 269:e.forEach(t.elements,Er);break;case 266:Er(t.importClause);break;case 267:Ar(t.name),Er(t.namedBindings);break;case 270:Ar(t.propertyName||t.name)}}function kr(e){if(e)switch(e.kind){case 296:case 297:case 167:case 169:case 172:case 173:Ar(e.name)}}function Ar(t){t&&(e.isGeneratedIdentifier(t)?Nr(t):e.isBindingPattern(t)&&Er(t))}function Nr(t){if(4==(7&t.autoGenerateFlags))return wr(function(t){var r=t.autoGenerateId,n=t,i=n.original;for(;i&&(n=i,!(e.isIdentifier(n)&&4&n.autoGenerateFlags&&n.autoGenerateId!==r));)i=n.original;return n}(t),t.autoGenerateFlags);var r=t.autoGenerateId;return o[r]||(o[r]=function(t){switch(7&t.autoGenerateFlags){case 1:return Ir(0,!!(8&t.autoGenerateFlags));case 2:return Ir(268435456,!!(8&t.autoGenerateFlags));case 3:return Or(e.idText(t),32&t.autoGenerateFlags?Pr:Fr,!!(16&t.autoGenerateFlags),!!(8&t.autoGenerateFlags))}return e.Debug.fail("Unsupported GeneratedIdentifierKind.")}(t))}function wr(t,r){var n=e.getNodeId(t);return a[n]||(a[n]=function(t,r){switch(t.kind){case 79:return Or(xr(t),Fr,!!(16&r),!!(8&r));case 261:case 260:return function(t){var r=xr(t.name);return function(t,r){for(var n=r;e.isNodeDescendantOf(n,r);n=n.nextContainer)if(n.locals){var i=n.locals.get(e.escapeLeadingUnderscores(t));if(i&&3257279&i.flags)return!1}return!0}(r,t)?r:Or(r)}(t);case 266:case 272:return function(t){var r=e.getExternalModuleName(t);return Or(e.isStringLiteral(r)?e.makeIdentifierFromModuleName(r.text):"module")}(t);case 256:case 257:case 271:return Or("default");case 226:return Or("class");case 169:case 172:case 173:return function(t){if(e.isIdentifier(t.name))return wr(t.name);return Ir(0)}(t);case 162:return Ir(0,!0);default:return Ir(0)}}(t,r))}function Fr(e){return Pr(e)&&!s.has(e)&&!(d&&d.has(e))}function Pr(t){return!n||e.isFileLevelUniqueName(n,t,E)}function Ir(e,t){if(e&&!(l&e)&&Fr(r=268435456===e?"_i":"_n"))return l|=e,t&&Tr(r),r;for(;;){var r,n=268435455&l;if(l++,8!==n&&13!==n)if(Fr(r=n<26?"_"+String.fromCharCode(97+n):"_"+(n-26)))return t&&Tr(r),r}}function Or(e,t,r,n){if(void 0===t&&(t=Fr),r&&t(e))return n?Tr(e):s.add(e),e;95!==e.charCodeAt(e.length-1)&&(e+="_");for(var i=1;;){var a=e+i;if(t(a))return n?Tr(a):s.add(a),a;i++}}function Mr(e){return Or(e,Pr,!0)}function Lr(e,t){var r=Re(2,e,t),n=Y,i=Z,a=ee;Rr(t),r(e,t),Br(t,n,i,a)}function Rr(t){var r=e.getEmitFlags(t),n=e.getCommentRange(t);!function(t,r,n,i){ie(),te=!1;var a=n<0||0!=(512&r)||11===t.kind,o=i<0||0!=(1024&r)||11===t.kind;(n>0||i>0)&&n!==i&&(a||zr(n,349!==t.kind),(!a||n>=0&&0!=(512&r))&&(Y=n),(!o||i>=0&&0!=(1024&r))&&(Z=i,255===t.kind&&(ee=i)));e.forEach(e.getSyntheticLeadingComments(t),jr),ae()}(t,r,n.pos,n.end),2048&r&&(re=!0)}function Br(t,r,n,i){var a=e.getEmitFlags(t),o=e.getCommentRange(t);2048&a&&(re=!1),Jr(t,a,o.pos,o.end,r,n,i);var s=e.getTypeNode(t);s&&Jr(t,a,s.pos,s.end,r,n,i)}function Jr(t,r,n,i,a,o,s){ie();var c=i<0||0!=(1024&r)||11===t.kind;e.forEach(e.getSyntheticTrailingComments(t),Ur),(n>0||i>0)&&n!==i&&(Y=a,Z=o,ee=s,c||349===t.kind||function(e){tn(e,Xr)}(i)),ae()}function jr(e){(e.hasLeadingNewline||2===e.kind)&&p.writeLine(),Vr(e),e.hasTrailingNewLine||2===e.kind?p.writeLine():p.writeSpace(" ")}function Ur(e){p.isAtStartOfLine()||p.writeSpace(" "),Vr(e),e.hasTrailingNewLine&&p.writeLine()}function Vr(t){var r=function(e){return 3===e.kind?"/*".concat(e.text,"*/"):"//".concat(e.text)}(t),n=3===t.kind?e.computeLineStarts(r):void 0;e.writeCommentRange(r,n,p,0,r.length,J)}function Kr(t,r,i){ie();var a=r.pos,o=r.end,s=e.getEmitFlags(t),c=re||o<0||0!=(1024&s);a<0||0!=(512&s)||function(t){var r=n&&e.emitDetachedComments(n.text,Ee(),p,rn,t,J,re);r&&(b?b.push(r):b=[r])}(r),ae(),2048&s&&!re?(re=!0,i(t),re=!1):i(t),ie(),c||(zr(r.end,!0),te&&!p.isAtStartOfLine()&&p.writeLine()),ae()}function zr(e,t){te=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?en(e,qr):en(e,Hr):0===e&&en(e,Gr)}function Gr(e,t,r,n,i){nn(e,t)&&Hr(e,t,r,n,i)}function qr(e,t,r,n,i){nn(e,t)||Hr(e,t,r,n,i)}function Wr(r,n){return!t.onlyPrintJsDocStyle||(e.isJSDocLikeText(r,n)||e.isPinnedComment(r,n))}function Hr(t,r,i,a,o){n&&Wr(n.text,t)&&(te||(e.emitNewLineBeforeLeadingCommentOfPosition(Ee(),p,o,t),te=!0),ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a?p.writeLine():3===i&&p.writeSpace(" "))}function Qr(e){re||-1===e||zr(e,!0)}function Xr(t,r,i,a){n&&Wr(n.text,t)&&(p.isAtStartOfLine()||p.writeSpace(" "),ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a&&p.writeLine())}function $r(e,t,r){re||(ie(),tn(e,t?Xr:r?Yr:Zr),ae())}function Yr(t,r,i){n&&(ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),2===i&&p.writeLine())}function Zr(t,r,i,a){n&&(ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a?p.writeLine():p.writeSpace(" "))}function en(t,r){!n||-1!==Y&&t===Y||(function(t){return void 0!==b&&e.last(b).nodePos===t}(t)?function(t){if(!n)return;var r=e.last(b).detachedCommentEndPos;b.length-1?b.pop():b=void 0;e.forEachLeadingCommentRange(n.text,r,t,r)}(r):e.forEachLeadingCommentRange(n.text,t,r,t))}function tn(t,r){n&&(-1===Z||t!==Z&&t!==ee)&&e.forEachTrailingCommentRange(n.text,t,r)}function rn(t,r,i,a,o,s){n&&Wr(n.text,a)&&(ln(a),e.writeCommentRange(t,r,i,a,o,s),ln(o))}function nn(t,r){return!!n&&e.isRecognizedTripleSlashComment(n.text,t,r)}function an(e,t){var r=Re(3,e,t);on(t),r(e,t),sn(t)}function on(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);if(e.isUnparsedNode(t)){e.Debug.assertIsDefined(t.parent,"UnparsedNodes must have parent pointers");var i=function(t){return void 0===t.parsedSourceMap&&void 0!==t.sourceMapText&&(t.parsedSourceMap=e.tryParseRawSourceMap(t.sourceMapText)||!1),t.parsedSourceMap||void 0}(t.parent);i&&g&&g.appendSourceMap(p.getLine(),p.getColumn(),i,t.parent.sourceMapPath,t.parent.getLineAndCharacterOfPosition(t.pos),t.parent.getLineAndCharacterOfPosition(t.end))}else{var a=n.source||y;349!==t.kind&&0==(16&r)&&n.pos>=0&&un(n.source||y,cn(a,n.pos)),64&r&&(Q=!0)}}function sn(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);e.isUnparsedNode(t)||(64&r&&(Q=!1),349!==t.kind&&0==(32&r)&&n.end>=0&&un(n.source||y,n.end))}function cn(t,r){return t.skipTrivia?t.skipTrivia(r):e.skipTrivia(t.text,r)}function ln(t){if(!(Q||e.positionIsSynthesized(t)||_n(y))){var r=e.getLineAndCharacterOfPosition(y,t),n=r.line,i=r.character;g.addMapping(p.getLine(),p.getColumn(),X,n,i,void 0)}}function un(e,t){if(e!==y){var r=y,n=X;dn(e),ln(t),function(e,t){y=e,X=t}(r,n)}else ln(t)}function dn(e){Q||(y=e,e!==h?_n(e)||(X=g.addSource(e.fileName),t.inlineSources&&g.setSourceContent(X,e.text),h=e,$=X):X=$)}function _n(t){return e.fileExtensionIs(t.fileName,".json")}}function D(e,t,r,n){t(e)}function C(e,t,r,n){t(e,r.select(n))}function T(e,t,r,n){t(e,r)}e.isBuildInfoFile=function(t){return e.fileExtensionIs(t,".tsbuildinfo")},e.forEachEmittedFile=a,e.getTsBuildInfoEmitOutputFilePath=o,e.getOutputPathsForBundle=s,e.getOutputPathsFor=c,e.getOutputExtension=u,e.getOutputDeclarationFileName=_,e.getCommonSourceDirectory=y,e.getCommonSourceDirectoryOfConfig=h,e.getAllProjectOutputs=function(t,r){var n=f(),i=n.addOutput,a=n.getOutputs;if(e.outFile(t.options))m(t,i);else{for(var s=e.memoize((function(){return h(t,r)})),c=0,l=t.fileNames;c=4,h=(f+1+"").length;y&&(h=Math.max("...".length,h));for(var v="",b=u;b<=f;b++){v+=o.getNewLine(),y&&u+11}))&&ir(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir")}J.useDefineForClassFields&&0===d&&ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields");J.checkJs&&!e.getAllowJSCompilerOption(J)&&ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs"));J.emitDeclarationOnly&&(e.getEmitDeclarations(J)||ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),J.noEmit&&ir(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit"));J.emitDecoratorMetadata&&!J.experimentalDecorators&&ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators");J.jsxFactory?(J.reactNamespace&&ir(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFactory,d)||ar("jsxFactory",e.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFactory)):J.reactNamespace&&!e.isIdentifierText(J.reactNamespace,d)&&ar("reactNamespace",e.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,J.reactNamespace);J.jsxFragmentFactory&&(J.jsxFactory||ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFragmentFactory,d)||ar("jsxFragmentFactory",e.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFragmentFactory));J.reactNamespace&&(4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e.inverseJsxOptionMap.get(""+J.jsx)));J.jsxImportSource&&2===J.jsx&&ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e.inverseJsxOptionMap.get(""+J.jsx));J.preserveValueImports&&e.getEmitModuleKind(J)=e.length(null==o?void 0:o.imports)+e.length(null==o?void 0:o.moduleAugmentations))return!1;var n=e.getResolvedModule(o,t,o&&y(o,r)),i=n&&V.getSourceFile(n.resolvedFileName);if(n&&i)return!1;var a=K.get(t);return!!a&&(e.isTraceEnabled(J,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified,t,a),!0)}}function et(t){return{getPrependNodes:nt,getCanonicalFileName:Wt,getCommonSourceDirectory:ze.getCommonSourceDirectory,getCompilerOptions:ze.getCompilerOptions,getCurrentDirectory:function(){return le},getNewLine:function(){return ne.getNewLine()},getSourceFile:ze.getSourceFile,getSourceFileByPath:ze.getSourceFileByPath,getSourceFiles:ze.getSourceFiles,getLibFileFromReference:ze.getLibFileFromReference,isSourceFileFromExternalLibrary:it,getResolvedProjectReferenceToRedirect:Rt,getProjectReferenceRedirect:Ot,isSourceOfProjectReferenceRedirect:jt,getSymlinkCache:_r,writeFile:t||tt,isEmitBlocked:ot,readFile:function(e){return ne.readFile(e)},fileExists:function(t){var r=$e(t);return!!ct(r)||!e.contains(ge,r)&&ne.fileExists(t)},useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getProgramBuildInfo:function(){return ze.getProgramBuildInfo&&ze.getProgramBuildInfo()},getSourceFileFromReference:function(e,t){return ze.getSourceFileFromReference(e,t)},redirectTargetsMap:De,getFileIncludeReasons:ze.getFileIncludeReasons}}function tt(e,t,r,n,i,a){ne.writeFile(e,t,r,n,i,a)}function rt(){return ye}function nt(){return w(U,(function(e,t){var r;return null===(r=ye[t])||void 0===r?void 0:r.commandLine}),(function(e){var t=$e(e),r=ct(t);return r?r.text:Te.has(t)?void 0:ne.readFile(t)}))}function it(e){return!!$.get(e.path)}function at(){return O||(O=e.createTypeChecker(ze))}function ot(e){return _e.has($e(e))}function st(e){return ct($e(e))}function ct(e){return Te.get(e)||void 0}function lt(t,r,n){return t?r(t,n):e.sortAndDeduplicateDiagnostics(e.flatMap(ze.getSourceFiles(),(function(e){return n&&n.throwIfCancellationRequested(),r(e,n)})))}function ut(t){var r;if(e.skipTypeChecking(t,J,ze))return e.emptyArray;var n=ce.getDiagnostics(t.fileName);return(null===(r=t.commentDirectives)||void 0===r?void 0:r.length)?gt(t,t.commentDirectives,n).diagnostics:n}function dt(t){return e.isSourceFileJS(t)?(t.additionalSyntacticDiagnostics||(t.additionalSyntacticDiagnostics=function(t){return _t((function(){var r=[];return n(t,t),e.forEachChildRecursively(t,n,i),r;function n(t,n){switch(n.kind){case 164:case 167:case 169:if(n.questionToken===t)return r.push(s(t,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 168:case 171:case 172:case 173:case 213:case 256:case 214:case 254:if(n.type===t)return r.push(s(t,e.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(t.kind){case 267:if(t.isTypeOnly)return r.push(s(n,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 272:if(t.isTypeOnly)return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 270:case 275:if(t.isTypeOnly)return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,e.isImportSpecifier(t)?"import...type":"export...type")),"skip";break;case 265:return r.push(s(t,e.Diagnostics.import_can_only_be_used_in_TypeScript_files)),"skip";case 271:if(t.isExportEquals)return r.push(s(t,e.Diagnostics.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 291:if(117===t.token)return r.push(s(t,e.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 258:var i=e.tokenToString(118);return e.Debug.assertIsDefined(i),r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 261:var a=16&t.flags?e.tokenToString(142):e.tokenToString(141);return e.Debug.assertIsDefined(a),r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,a)),"skip";case 259:return r.push(s(t,e.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 260:var o=e.Debug.checkDefined(e.tokenToString(92));return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 230:return r.push(s(t,e.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 229:return r.push(s(t.type,e.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 211:e.Debug.fail()}}function i(t,n){switch(n.decorators!==t||J.experimentalDecorators||r.push(s(n,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)),n.kind){case 257:case 226:case 169:case 171:case 172:case 173:case 213:case 256:case 214:if(t===n.typeParameters)return r.push(o(t,e.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 237:if(t===n.modifiers)return a(n.modifiers,237===n.kind),"skip";break;case 167:if(t===n.modifiers){for(var i=0,c=t;i=0;){if(r.markUsed(o))return o;var s=n.text.slice(a[o],a[o+1]).trim();if(""!==s&&!/^(\s*)\/\/(.*)$/.test(s))return-1;o--}return-1}(t,i)}));return{diagnostics:a,directives:i}}function yt(e,t){return vt(e,t,q,ht)}function ht(t,r){return _t((function(){var n=at().getEmitResolver(t,r);return e.getDeclarationDiagnostics(et(e.noop),n,t)||e.emptyArray}))}function vt(t,r,n,i){var a,o=t?null===(a=n.perFile)||void 0===a?void 0:a.get(t.path):n.allDiagnostics;if(o)return o;var s=i(t,r);return t?(n.perFile||(n.perFile=new e.Map)).set(t.path,s):n.allDiagnostics=s,s}function bt(e,t){return e.isDeclarationFile?[]:yt(e,t)}function xt(t,r,n,i){kt(e.normalizePath(t),r,n,void 0,i)}function St(e,t){return e.fileName===t.fileName}function Dt(e,t){return 79===e.kind?79===t.kind&&e.escapedText===t.escapedText:10===t.kind&&e.text===t.text}function Ct(t,r){var n=e.factory.createStringLiteral(t),i=e.factory.createImportDeclaration(void 0,void 0,void 0,n,void 0);return e.addEmitFlags(i,67108864),e.setParent(n,i),e.setParent(i,r),n.flags&=-9,i.flags&=-9,n}function Tt(t){if(!t.imports){var r,n,i,a=e.isSourceFileJS(t),o=e.isExternalModule(t);if((J.isolatedModules||o)&&!t.isDeclarationFile){J.importHelpers&&(r=[Ct(e.externalHelpersModuleNameText,t)]);var s=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(J,t),J);s&&(r||(r=[])).push(Ct(s,t))}for(var c=0,l=t.statements;c=1&&e.isStringLiteralLike(i.arguments[0])?(e.setParentRecursive(i,!1),r=e.append(r,i.arguments[0])):e.isLiteralImportTypeNode(i)&&(e.setParentRecursive(i,!1),r=e.append(r,i.argument.literal))}}(t),t.imports=r||e.emptyArray,t.moduleAugmentations=n||e.emptyArray,void(t.ambientModuleNames=i||e.emptyArray)}function u(a,s){if(e.isAnyImportOrReExport(a)){var c=e.getExternalModuleName(a);!(c&&e.isStringLiteral(c)&&c.text)||s&&e.isExternalModuleNameRelative(c.text)||(e.setParentRecursive(a,!1),r=e.append(r,c),Ce||0!==Q||t.isDeclarationFile||(Ce=e.startsWith(c.text,"node:")))}else if(e.isModuleDeclaration(a)&&e.isAmbientModule(a)&&(s||e.hasSyntacticModifier(a,2)||t.isDeclarationFile)){a.name.parent=a;var l=e.getTextOfIdentifierOrLiteral(a.name);if(o||s&&!e.isExternalModuleNameRelative(l))(n||(n=[])).push(a.name);else if(!s){t.isDeclarationFile&&(i||(i=[])).push(l);var d=a.body;if(d)for(var _=0,p=d.statements;_0),Object.defineProperties(o,{id:{get:function(){return this.redirectInfo.redirectTarget.id},set:function(e){this.redirectInfo.redirectTarget.id=e}},symbol:{get:function(){return this.redirectInfo.redirectTarget.symbol},set:function(e){this.redirectInfo.redirectTarget.symbol=e}}}),o}(b,h,t,o,$e(t),d);return De.add(b.path,t),It(x,o,u),Pt(x,i),Se.set(o,e.packageIdToPackageName(a)),f.push(x),x}h&&(xe.set(v,h),Se.set(o,e.packageIdToPackageName(a)))}if(It(h,o,u),h){if($.set(o,Q>0),h.fileName=t,h.path=o,h.resolvedPath=$e(t),h.originalFileName=d,Pt(h,i),ne.useCaseSensitiveFileNames()){var S=e.toFileNameLowerCase(o),C=Ee.get(S);C?Nt(t,C,i):Ee.set(S,h)}ae=ae||h.hasNoDefaultLib&&!n,J.noResolve||(Vt(h,r),Kt(h)),J.noLib||qt(h),Ht(h),r?p.push(h):f.push(h)}return h}(t,r,n,i,a);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function Ft(t,r,n,i){var a=E($e(t),null==r?void 0:r.getPackageJsonInfoCache(),n,i);return{languageVersion:e.getEmitScriptTarget(i),impliedNodeFormat:a,setExternalModuleIndicator:e.getSetExternalModuleIndicator(i)}}function Pt(e,t){e&&z.add(e.path,t)}function It(e,t,r){r?(Te.set(r,e),Te.set(t,e||!1)):Te.set(t,e)}function Ot(e){var t=Mt(e);return t&&Lt(t,e)}function Mt(t){if(ye&&ye.length&&!e.isDeclarationFileName(t)&&!e.fileExtensionIs(t,".json"))return Rt(t)}function Lt(t,r){var n=e.outFile(t.commandLine.options);return n?e.changeExtension(n,".d.ts"):e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames())}function Rt(t){void 0===ve&&(ve=new e.Map,Bt((function(e){$e(J.configFilePath)!==e.sourceFile.path&&e.commandLine.fileNames.forEach((function(t){return ve.set($e(t),e.sourceFile.path)}))})));var r=ve.get($e(t));return r&&Ut(r)}function Bt(t){return e.forEachResolvedProjectReference(ye,t)}function Jt(t){if(e.isDeclarationFileName(t))return void 0===be&&(be=new e.Map,Bt((function(t){var r=e.outFile(t.commandLine.options);if(r){var n=e.changeExtension(r,".d.ts");be.set($e(n),!0)}else{var i=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())}));e.forEach(t.commandLine.fileNames,(function(r){if(!e.isDeclarationFileName(r)&&!e.fileExtensionIs(r,".json")){var n=e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames(),i);be.set($e(n),r)}}))}}))),be.get(t)}function jt(e){return ke&&!!Rt(e)}function Ut(e){if(he)return he.get(e)||void 0}function Vt(r,n){e.forEach(r.referencedFiles,(function(i,a){kt(t(i.fileName,r.fileName),n,!1,void 0,{kind:e.FileIncludeKind.ReferenceFile,file:r.path,index:a})}))}function Kt(t){var r=t.typeReferenceDirectives;if(r)for(var n=We(r,t),i=0;iH,p=d&&!P(a,s)&&!a.noResolve&&o_?e.createDiagnosticForNodeInSourceFile(d,p.elements[_],t.kind===e.FileIncludeKind.OutputFromProjectReference?e.Diagnostics.File_is_output_from_referenced_project_specified_here:e.Diagnostics.File_is_source_from_referenced_project_specified_here):void 0;case e.FileIncludeKind.AutomaticTypeDirectiveFile:if(!J.types)return;i=nr("types",t.typeReference),a=e.Diagnostics.File_is_entry_point_of_type_library_specified_here;break;case e.FileIncludeKind.LibFile:if(void 0!==t.index){i=nr("lib",J.lib[t.index]),a=e.Diagnostics.File_is_library_specified_here;break}var f=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(J)?r:void 0}));i=f?function(t,r){var n=tr(t);return n&&e.firstDefined(n,(function(t){return e.isStringLiteral(t.initializer)&&t.initializer.text===r?t.initializer:void 0}))}("target",f):void 0,a=e.Diagnostics.File_is_default_library_for_target_specified_here;break;default:e.Debug.assertNever(t)}return i&&e.createDiagnosticForNodeInSourceFile(J.configFile,i,a)}(t))),t===n&&(n=void 0)}}function $t(e,t,r,n){(L||(L=[])).push({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:r,args:n})}function Yt(e,t,r){ce.add(Xt(e,void 0,t,r))}function Zt(t,r,n,i,a,o){for(var s=!0,c=0,l=rr();cr&&(ce.add(e.createDiagnosticForNodeInSourceFile(J.configFile,p.elements[r],n,i,a,o)),s=!1)}}s&&ce.add(e.createCompilerDiagnostic(n,i,a,o))}function er(t,r,n,i){for(var a=!0,o=0,s=rr();or?ce.add(e.createDiagnosticForNodeInSourceFile(t||J.configFile,o.elements[r],n,i,a)):ce.add(e.createCompilerDiagnostic(n,i,a))}function sr(t,r,n,i,a,o,s){var c=cr();(!c||!lr(c,t,r,n,i,a,o,s))&&ce.add(e.createCompilerDiagnostic(i,a,o,s))}function cr(){if(void 0===Y){Y=!1;var t=e.getTsConfigObjectLiteralExpression(J.configFile);if(t)for(var r=0,n=e.getPropertyAssignment(t,"compilerOptions");r0)for(var a=t.getTypeChecker(),c=0,l=r.imports;c0)for(var _=0,p=r.referencedFiles;_1&&S(x)}return i;function S(t){if(t.declarations)for(var n=0,i=t.declarations;n0;){var d=u.pop();if(!l.has(d)){var p=r.getSourceFileByPath(d);l.set(d,p),p&&_(t,r,p,i,a,o,s)&&u.push.apply(u,m(t,p.resolvedPath))}}return e.arrayFrom(e.mapDefinedIterator(l.values(),(function(e){return e})))}r.createManyToManyPathMap=n,r.canReuseOldState=l,r.create=function(t,r,i,a){var o=new e.Map,s=t.getCompilerOptions().module!==e.ModuleKind.None?n():void 0,u=s?n():void 0,d=new e.Set,_=l(s,i);t.getTypeChecker();for(var p=0,f=t.getSourceFiles();p0;){var c=s.pop();if(!o.has(c)){if(o.set(c,!0),m(t,c,n,i,a))return;if(d(t,c,n,i,a),p(t,c)){var l=e.Debug.checkDefined(t.program).getSourceFileByPath(c);s.push.apply(s,e.BuilderState.getReferencedByPaths(t,l.resolvedPath))}}}}e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap);var u=new e.Set;f(t,r.resolvedPath,(function(r){if(m(t,r,n,i,a))return!0;var o=t.referencedMap.getKeys(r);return o&&e.forEachKey(o,(function(e){return g(t,e,u,n,i,a)}))}))}(t,r,n,i,a)}function d(t,r,n,i,a){if(_(t,r),!t.changedFilesSet.has(r)){var o=e.Debug.checkDefined(t.program),s=o.getSourceFileByPath(r);s&&(e.BuilderState.updateShapeSignature(t,o,s,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap,!a.disableUseFileVersionAsSignature),e.getEmitDeclarations(t.compilerOptions)&&T(t,r,0))}}function _(e,t){return!e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function p(t,r){return e.Debug.checkDefined(t.currentAffectedFilesSignatures).get(r)!==e.Debug.checkDefined(t.fileInfos.get(r)).signature}function f(t,r,n){var i=t.currentAffectedFilesExportedModulesMap.getKeys(r),a=i&&e.forEachKey(i,n);return a||(i=t.exportedModulesMap.getKeys(r))&&e.forEachKey(i,(function(e){var r;return t.currentAffectedFilesExportedModulesMap.hasKey(e)||(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))?void 0:n(e)}))}function m(t,r,n,i,a){var o;return!!(null===(o=t.fileInfos.get(r))||void 0===o?void 0:o.affectsGlobalScope)&&(e.BuilderState.getAllFilesExcludingDefaultLibraryFile(t,t.program,void 0).forEach((function(e){return d(t,e.resolvedPath,n,i,a)})),l(t),!0)}function g(t,r,n,i,a,o){var s;if(e.tryAddToSet(n,r)){if(m(t,r,i,a,o))return!0;d(t,r,i,a,o),e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap),f(t,r,(function(e){return g(t,e,n,i,a,o)})),null===(s=t.referencedMap.getKeys(r))||void 0===s||s.forEach((function(e){return!n.has(e)&&d(t,e,i,a,o)}))}}function y(t,r,n,i,a){a?t.buildInfoEmitPending=!1:r===t.program?(t.changedFilesSet.clear(),t.programEmitComplete=!0):(t.seenAffectedFiles.add(r.resolvedPath),void 0!==n&&(t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map)).set(r.resolvedPath,n),i?(t.affectedFilesPendingEmitIndex++,t.buildInfoEmitPending=!0):t.affectedFilesIndex++)}function h(e,t,r){return y(e,r),{result:t,affected:r}}function v(e,t,r,n,i,a){return y(e,r,n,i,a),{result:t,affected:r}}function b(t,r,n){return e.concatenate(function(t,r,n){var i=r.resolvedPath;if(t.semanticDiagnosticsPerFile){var a=t.semanticDiagnosticsPerFile.get(i);if(a)return e.filterSemanticDiagnostics(a,t.compilerOptions)}var o=e.Debug.checkDefined(t.program).getBindAndCheckDiagnostics(r,n);t.semanticDiagnosticsPerFile&&t.semanticDiagnosticsPerFile.set(i,o);return e.filterSemanticDiagnostics(o,t.compilerOptions)}(t,r,n),e.Debug.checkDefined(t.program).getProgramDiagnostics(r))}function x(t,r){for(var n,i=e.getOptionsNameMap().optionsNameMap,a=0,o=e.getOwnKeys(t).sort(e.compareStringsCaseSensitive);a1||47!==t.charCodeAt(0);if(a&&0!==t.search(/[a-zA-Z]:/)&&0===i.search(/[a-zA-z]\$\//)){if(-1===(n=t.indexOf(e.directorySeparator,n+1)))return!1;i=t.substring(r+i.length,n+1)}if(a&&0!==i.search(/users\//i))return!0;for(var o=n+1,s=2;s>0;s--)if(0===(o=t.indexOf(e.directorySeparator,o)+1))return!1;return!0}function n(e){var t,r;return!(!(null===(t=e.resolvedModule)||void 0===t?void 0:t.originalPath)&&!(null===(r=e.resolvedTypeReferenceDirective)||void 0===r?void 0:r.originalPath))}e.removeIgnoredPath=t,e.canWatchDirectory=r,e.createResolutionCache=function(i,a,o){var s,c,l,u,d,_,p=e.createMultiMap(),f=[],m=e.createMultiMap(),g=!1,y=e.memoize((function(){return i.getCurrentDirectory()})),h=i.getCachedDirectoryStructureHost(),v=new e.Map,b=e.createCacheWithRedirects(),x=e.createCacheWithRedirects(),S=e.createModuleResolutionCache(y(),i.getCanonicalFileName,void 0,b,x),D=new e.Map,C=e.createCacheWithRedirects(),T=e.createTypeReferenceDirectiveResolutionCache(y(),i.getCanonicalFileName,void 0,S.getPackageJsonInfoCache(),C),E=[".ts",".tsx",".js",".jsx",".json"],k=new e.Map,A=new e.Map,N=a&&e.removeTrailingDirectorySeparator(e.getNormalizedAbsolutePath(a,y())),w=N&&i.toPath(N),F=void 0!==w?w.split(e.directorySeparator).length:0,P=new e.Map;return{getModuleResolutionCache:function(){return S},startRecordingFilesWithChangedResolutions:function(){s=[]},finishRecordingFilesWithChangedResolutions:function(){var e=s;return s=void 0,e},startCachingPerDirectoryResolution:R,finishCachingPerDirectoryResolution:function(){l=void 0,R(),A.forEach((function(e,t){0===e.refCount&&(A.delete(t),e.watcher.close())})),g=!1},resolveModuleNames:function(t,r,n,i,a){return j({names:t,containingFile:r,redirectedReference:i,cache:v,perDirectoryCacheWithRedirects:b,loader:B,getResolutionWithResolvedFileName:I,shouldRetryResolution:function(t){return!t.resolvedModule||!e.resolutionExtensionIsTSOrJson(t.resolvedModule.extension)},reusedNames:n,logChanges:o,containingSourceFile:a})},getResolvedModuleWithFailedLookupLocationsFromCache:function(e,t,r){var n=v.get(i.toPath(t));return n?n.get(e,r):void 0},resolveTypeReferenceDirectives:function(e,t,r,n){return j({names:e,containingFile:t,redirectedReference:r,cache:D,perDirectoryCacheWithRedirects:C,loader:J,getResolutionWithResolvedFileName:O,shouldRetryResolution:function(e){return void 0===e.resolvedTypeReferenceDirective},containingSourceFileMode:n})},removeResolutionsFromProjectReferenceRedirects:function(t){if(!e.fileExtensionIs(t,".json"))return;var r=i.getCurrentProgram();if(!r)return;var n=r.getResolvedProjectReferenceByPath(t);if(!n)return;n.commandLine.fileNames.forEach((function(e){return Z(i.toPath(e))}))},removeResolutionsOfFile:Z,hasChangedAutomaticTypeDirectiveNames:function(){return g},invalidateResolutionOfFile:function(t){Z(t);var r=g;ee(m.get(t),e.returnTrue)&&g&&!r&&i.onChangedAutomaticTypeDirectiveNames()},invalidateResolutionsOfFailedLookupLocations:re,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(t){e.Debug.assert(l===t||void 0===l),l=t},createHasInvalidatedResolution:function(t){if(re(),t)return c=void 0,e.returnTrue;var r=c;return c=void 0,function(e){return!!r&&r.has(e)||L(e)}},isFileWithInvalidatedNonRelativeUnresolvedImports:L,updateTypeRootsWatch:function(){var t=i.getCompilationSettings();if(t.types)return void ie();var r=e.getEffectiveTypeRoots(t,{directoryExists:oe,getCurrentDirectory:y});r?e.mutateMap(P,e.arrayToMap(r,(function(e){return i.toPath(e)})),{createNewValue:ae,onDeleteValue:e.closeFileWatcher}):ie()},closeTypeRootsWatch:ie,clear:function(){e.clearMap(A,e.closeFileWatcherOf),k.clear(),p.clear(),ie(),v.clear(),D.clear(),m.clear(),f.length=0,u=void 0,d=void 0,_=void 0,R(),g=!1}};function I(e){return e.resolvedModule}function O(e){return e.resolvedTypeReferenceDirective}function M(t,r){return!(void 0===t||r.length<=t.length)&&(e.startsWith(r,t)&&r[t.length]===e.directorySeparator)}function L(e){if(!l)return!1;var t=l.get(e);return!!t&&!!t.length}function R(){S.clear(),T.clear(),p.forEach(W),p.clear()}function B(t,r,n,a,o,s,c){var l,u=e.resolveModuleName(t,r,n,a,S,o,c);if(!i.getGlobalCache)return u;var d=i.getGlobalCache();if(!(void 0===d||e.isExternalModuleNameRelative(t)||u.resolvedModule&&e.extensionIsTS(u.resolvedModule.extension))){var _=e.loadModuleFromGlobalCache(e.Debug.checkDefined(i.globalCacheResolutionModuleName)(t),i.projectName,n,a,d,S),p=_.resolvedModule,f=_.failedLookupLocations;if(p)return u.resolvedModule=p,(l=u.failedLookupLocations).push.apply(l,f),u}return u}function J(t,r,n,i,a,o,s){return e.resolveTypeReferenceDirective(t,r,n,i,a,T,s)}function j(t){var r,a,o,c=t.names,l=t.containingFile,u=t.redirectedReference,d=t.cache,_=t.perDirectoryCacheWithRedirects,p=t.loader,f=t.getResolutionWithResolvedFileName,m=t.shouldRetryResolution,g=t.reusedNames,y=t.logChanges,h=t.containingSourceFile,v=t.containingSourceFileMode,b=i.toPath(l),x=d.get(b)||d.set(b,e.createModeAwareCache()).get(b),S=e.getDirectoryPath(b),D=_.getOrCreateMapOfCacheRedirects(u),C=D.get(S);C||(C=e.createModeAwareCache(),D.set(S,C));for(var T=[],E=i.getCompilationSettings(),k=y&&L(b),A=i.getCurrentProgram(),N=A&&A.getResolvedProjectReferenceToRedirect(l),w=N?!u||u.sourceFile.path!==N.sourceFile.path:!!u,F=e.createModeAwareCache(),P=0,I=0,O=c;IF+1?{dir:i.slice(0,F+1).join(e.directorySeparator),dirPath:n.slice(0,F+1).join(e.directorySeparator)}:{dir:N,dirPath:w,nonRecursive:!1}}return K(e.getDirectoryPath(e.getNormalizedAbsolutePath(t,y())),e.getDirectoryPath(r))}function K(t,n){for(;e.pathContainsNodeModules(n);)t=e.getDirectoryPath(t),n=e.getDirectoryPath(n);if(e.isNodeModulesDirectory(n))return r(e.getDirectoryPath(n))?{dir:t,dirPath:n}:void 0;var i,a,o=!0;if(void 0!==w)for(;!M(n,w);){var s=e.getDirectoryPath(n);if(s===n)break;o=!1,i=n,a=t,n=s,t=e.getDirectoryPath(t)}return r(n)?{dir:a||t,dirPath:i||n,nonRecursive:o}:void 0}function z(t){return e.fileExtensionIsOneOf(t,E)}function G(t,r,n,a){if(r.refCount)r.refCount++,e.Debug.assertIsDefined(r.files);else{r.refCount=1,e.Debug.assert(0===e.length(r.files)),e.isExternalModuleNameRelative(t)?q(r):p.add(t,r);var o=a(r);o&&o.resolvedFileName&&m.add(i.toPath(o.resolvedFileName),r)}(r.files||(r.files=[])).push(n)}function q(t){e.Debug.assert(!!t.refCount);var r=t.failedLookupLocations;if(r.length){f.push(t);for(var n=!1,a=0,o=r;a1),k.set(u,p-1))),_===w?o=!0:X(_)}}o&&X(w)}}}function X(e){A.get(e).refCount--}function $(e,t,r){return i.watchDirectoryOfFailedLookupLocation(e,(function(e){var r=i.toPath(e);h&&h.addOrDeleteFileOrDirectory(e,r),te(r,t===r)}),r?0:1)}function Y(e,t,r){var n=e.get(t);n&&(n.forEach((function(e){return Q(e,t,r)})),e.delete(t))}function Z(e){Y(v,e,I),Y(D,e,O)}function ee(t,r){if(!t)return!1;for(var n=!1,i=0,a=t;i1&&r.sort(m),s.push.apply(s,r));var i=e.getDirectoryPath(t);if(i===t)return o=t,"break";o=t=i},l=e.getDirectoryPath(t);0!==a.size;){var u=c(l);if(l=o,"break"===u)break}if(a.size){var d=e.arrayFrom(a.values());d.length>1&&d.sort(m),s.push.apply(s,d)}return s}function b(t,r,n){for(var i in n)for(var a=0,o=n[i];a=u.length+d.length&&e.startsWith(r,u)&&e.endsWith(r,d)||!d&&r===e.removeTrailingDirectorySeparator(u)){var _=r.substr(u.length,r.length-d.length-u.length);return i.replace("*",_)}}else if(c===r||c===t)return i}}function x(t,r,n,i,a,o,s){if(void 0===s&&(s=0),"string"==typeof a){var c=e.getNormalizedAbsolutePath(e.combinePaths(n,a),void 0),l=e.hasTSFileExtension(r)?e.removeFileExtension(r)+E(r,t):void 0;switch(s){case 0:if(0===e.comparePaths(r,c)||l&&0===e.comparePaths(l,c))return{moduleFileToTry:i};break;case 1:if(e.containsPath(c,r)){var u=e.getRelativePathFromDirectory(c,r,!1);return{moduleFileToTry:e.getNormalizedAbsolutePath(e.combinePaths(e.combinePaths(i,a),u),void 0)}}break;case 2:var d=c.indexOf("*"),_=c.slice(0,d),p=c.slice(d+1);if(e.startsWith(r,_)&&e.endsWith(r,p)){var f=r.slice(_.length,r.length-p.length);return{moduleFileToTry:i.replace("*",f)}}if(l&&e.startsWith(l,_)&&e.endsWith(l,p)){f=l.slice(_.length,l.length-p.length);return{moduleFileToTry:i.replace("*",f)}}}}else{if(Array.isArray(a))return e.forEach(a,(function(e){return x(t,r,n,i,e,o)}));if("object"==typeof a&&null!==a){if(e.allKeysStartWithDot(a))return e.forEach(e.getOwnKeys(a),(function(s){var c=e.getNormalizedAbsolutePath(e.combinePaths(i,s),void 0),l=e.endsWith(s,"/")?1:e.stringContains(s,"*")?2:0;return x(t,r,n,c,a[s],o,l)}));for(var m=0,g=e.getOwnKeys(a);m=0||e.isApplicableVersionedTypesKey(o,y)){var h=a[y],v=x(t,r,n,i,h,o);if(v)return v}}}}}function S(t,r,i,a,o,c,l,u){var d=t.path,_=t.isRedirect,p=r.getCanonicalFileName,f=r.sourceDirectory;if(a.fileExists&&a.readFile){var m=e.getNodeModulePathParts(d);if(m){var g=d,y=!1;if(!l)for(var h=s(a,c,o,i),v=m.packageRootIndex,S=void 0;;){var D=O(v),T=D.moduleFileToTry,k=D.packageRootPath,A=D.blockedByExports,N=D.verbatimFromExports;if(e.getEmitModuleResolutionKind(o)!==e.ModuleResolutionKind.Classic){if(A)return;if(N)return T}if(k){g=k,y=!0;break}if(S||(S=T),-1===(v=d.indexOf(e.directorySeparator,v+1))){g=C(S,h.ending,o,a);break}}if(!_||y){var w=a.getGlobalTypingsCacheLocation&&a.getGlobalTypingsCacheLocation(),F=p(g.substring(0,m.topLevelNodeModulesIndex));if(e.startsWith(f,F)||w&&e.startsWith(p(w),F)){var P=g.substring(m.topLevelPackageNameIndex+1),I=e.getPackageNameFromTypesPackageName(P);return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Classic&&I===P?void 0:I}}}}function O(t){var r,s,c=d.substring(0,t),l=e.combinePaths(c,"package.json"),_=d,f=null===(s=null===(r=a.getPackageJsonInfoCache)||void 0===r?void 0:r.call(a))||void 0===s?void 0:s.getPackageJsonInfo(l);if("object"==typeof f||void 0===f&&a.fileExists(l)){var g=(null==f?void 0:f.packageJsonContent)||JSON.parse(a.readFile(l));if(e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeNext){var y=["node",u||i.impliedNodeFormat===e.ModuleKind.ESNext?"import":"require","types"],h=g.exports&&"string"==typeof g.name?x(o,d,c,e.getPackageNameFromTypesPackageName(g.name),g.exports,y):void 0;if(h){var v=e.hasTSFileExtension(h.moduleFileToTry)?{moduleFileToTry:e.removeFileExtension(h.moduleFileToTry)+E(h.moduleFileToTry,o)}:h;return n(n({},v),{verbatimFromExports:!0})}if(g.exports)return{moduleFileToTry:d,blockedByExports:!0}}var S=g.typesVersions?e.getPackageJsonTypesVersionsPaths(g.typesVersions):void 0;if(S){var D=d.slice(c.length+1),T=b(e.removeFileExtension(D),C(D,0,o),S.paths);void 0!==T&&(_=e.combinePaths(c,T))}var k=g.typings||g.types||g.main||"index.js";if(e.isString(k)){var A=e.toPath(k,c,p);if(e.removeFileExtension(A)===e.removeFileExtension(p(_)))return{packageRootPath:c,moduleFileToTry:_}}}else{var N=p(_.substring(m.packageRootIndex+1));if("index.d.ts"===N||"index.js"===N||"index.ts"===N||"index.tsx"===N)return{moduleFileToTry:_,packageRootPath:c}}return{moduleFileToTry:_}}}function D(t,r,n){return e.firstDefined(r,(function(e){var r=k(t,e,n);return void 0!==r&&A(r)?void 0:r}))}function C(t,r,n,i){if(e.fileExtensionIsOneOf(t,[".json",".mjs",".cjs"]))return t;var a=e.removeFileExtension(t);if(t===a)return t;if(e.fileExtensionIsOneOf(t,[".d.mts",".mts",".d.cts",".cts"]))return a+T(t,n);switch(r){case 0:var o=e.removeSuffix(a,"/index");return i&&o!==a&&function(t,r){if(t.fileExists)for(var n=0,i=e.flatten(e.getSupportedExtensions({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));n1?function(t,r){var n=t.filter((function(e,t,r){return t===r.findIndex((function(t){return(null==t?void 0:t.fileName)===(null==e?void 0:e.fileName)}))}));if(0===n.length)return"";var i=function(e){return Math.log(e)*Math.LOG10E+1},a=n.map((function(r){return[r,e.countWhere(t,(function(e){return e.fileName===r.fileName}))]})),o=a.reduce((function(e,t){return Math.max(e,t[1]||0)}),0),s=e.Diagnostics.Errors_Files.message,c=s.split(" ")[0].length,l=Math.max(c,i(o)),d=Math.max(i(o)-c,0),_="";return _+=" ".repeat(d)+s+"\n",a.forEach((function(e){var t=e[0],n=e[1],i=Math.log(n)*Math.LOG10E+1|0,a=i0?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:d.length>0?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.Success}function S(t,r){return void 0===t&&(t=e.sys),{onWatchStatusChange:r||o(t),watchFile:e.maybeBind(t,t.watchFile)||e.returnNoopFileWatcher,watchDirectory:e.maybeBind(t,t.watchDirectory)||e.returnNoopFileWatcher,setTimeout:e.maybeBind(t,t.setTimeout)||e.noop,clearTimeout:e.maybeBind(t,t.clearTimeout)||e.noop}}function D(t,r){var n=e.memoize((function(){return e.getDirectoryPath(e.normalizePath(t.getExecutingFilePath()))}));return{useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames},getNewLine:function(){return t.newLine},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),getDefaultLibLocation:n,getDefaultLibFileName:function(t){return e.combinePaths(n(),e.getDefaultLibFileName(t))},fileExists:function(e){return t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:function(e){return t.directoryExists(e)},getDirectories:function(e){return t.getDirectories(e)},readDirectory:function(e,r,n,i,a){return t.readDirectory(e,r,n,i,a)},realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable),trace:function(e){return t.write(e+t.newLine)},createDirectory:function(e){return t.createDirectory(e)},writeFile:function(e,r,n){return t.writeFile(e,r,n)},createHash:e.maybeBind(t,t.createHash),createProgram:r||e.createEmitAndSemanticDiagnosticsBuilderProgram,disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit}}function C(t,r,n,i){void 0===t&&(t=e.sys);var a=function(e){return t.write(e+t.newLine)},o=D(t,r);return e.copyProperties(o,S(t,i)),o.afterProgramCreate=function(r){var i=r.getCompilerOptions(),s=e.getNewLineCharacter(i,(function(){return t.newLine}));b(r,n,a,(function(t){return o.onWatchStatusChange(e.createCompilerDiagnostic(l(t),t),s,i,t)}))},o}function T(t,r,n){r(n),t.exit(e.ExitStatus.DiagnosticsPresent_OutputsSkipped)}e.createDiagnosticReporter=n,e.screenStartingMessageCodes=[e.Diagnostics.Starting_compilation_in_watch_mode.code,e.Diagnostics.File_change_detected_Starting_incremental_compilation.code],e.getLocaleTimeString=a,e.createWatchStatusReporter=o,e.parseConfigFileWithSystem=function(t,r,n,i,a,o){var s=a;s.onUnRecoverableConfigFileDiagnostic=function(e){return T(a,o,e)};var c=e.getParsedCommandLineOfConfigFile(t,r,s,n,i);return s.onUnRecoverableConfigFileDiagnostic=void 0,c},e.getErrorCountForSummary=s,e.getFilesInErrorForSummary=c,e.getWatchErrorSummaryDiagnosticMessage=l,e.getErrorSummaryText=d,e.isBuilderProgram=_,e.listFiles=p,e.explainFiles=f,e.explainIfFileIsRedirect=m,e.getMatchedFileSpec=g,e.getMatchedIncludeSpec=y,e.fileIncludeReasonToDiagnostics=h,e.emitFilesAndReportErrors=b,e.emitFilesAndReportErrorsAndGetExitStatus=x,e.noopFileWatcher={close:e.noop},e.returnNoopFileWatcher=function(){return e.noopFileWatcher},e.createWatchHost=S,e.WatchType={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file"},e.createWatchFactory=function(t,r){var n=t.trace?r.extendedDiagnostics?e.WatchLogLevel.Verbose:r.diagnostics?e.WatchLogLevel.TriggerOnly:e.WatchLogLevel.None:e.WatchLogLevel.None,i=n!==e.WatchLogLevel.None?function(e){return t.trace(e)}:e.noop,a=e.getWatchFactory(t,n,i);return a.writeLog=i,a},e.createCompilerHostFromProgramHost=function(t,r,n){void 0===n&&(n=t);var i=t.useCaseSensitiveFileNames(),a=e.memoize((function(){return t.getNewLine()}));return{getSourceFile:function(n,i,a){var o;try{e.performance.mark("beforeIORead"),o=t.readFile(n,r().charset),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead")}catch(e){a&&a(e.message),o=""}return void 0!==o?e.createSourceFile(n,o,i):void 0},getDefaultLibLocation:e.maybeBind(t,t.getDefaultLibLocation),getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:function(r,n,i,a){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,n,i,(function(e,r,n){return t.writeFile(e,r,n)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite")}catch(e){a&&a(e.message)}},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return i},getCanonicalFileName:e.createGetCanonicalFileName(i),getNewLine:function(){return e.getNewLineCharacter(r(),a)},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile(e)},trace:e.maybeBind(t,t.trace),directoryExists:e.maybeBind(n,n.directoryExists),getDirectories:e.maybeBind(n,n.getDirectories),realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable)||function(){return""},createHash:e.maybeBind(t,t.createHash),readDirectory:e.maybeBind(t,t.readDirectory),disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit}},e.setGetSourceFileAsHashVersioned=function(t,n){var i=t.getSourceFile,a=e.maybeBind(n,n.createHash)||e.generateDjb2Hash;t.getSourceFile=function(){for(var e=[],n=0;ne?t:e}function l(e){return!!e&&!!e.buildOrder}function u(e){return l(e)?e.buildOrder:e}function d(t,r){return function(n){var i=r?"[".concat(e.formatColorAndReset(e.getLocaleTimeString(t),e.ForegroundColorEscapeSequences.Grey),"] "):"".concat(e.getLocaleTimeString(t)," - ");i+="".concat(e.flattenDiagnosticMessageText(n.messageText,t.newLine)).concat(t.newLine+t.newLine),t.write(i)}}function _(t,r,n,i){var a=e.createProgramHost(t,r);return a.getModifiedTime=t.getModifiedTime?function(e){return t.getModifiedTime(e)}:e.returnUndefined,a.setModifiedTime=t.setModifiedTime?function(e,r){return t.setModifiedTime(e,r)}:e.noop,a.deleteFile=t.deleteFile?function(e){return t.deleteFile(e)}:e.noop,a.reportDiagnostic=n||e.createDiagnosticReporter(t),a.reportSolutionBuilderStatus=i||d(t),a.now=e.maybeBind(t,t.now),a}function p(t,r,n,i,a){var o,s,c=r,l=r,u=c.getCurrentDirectory(),d=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),_=(o=i,s={},e.commonOptionsWithBuild.forEach((function(t){e.hasProperty(o,t.name)&&(s[t.name]=o[t.name])})),s),p=e.createCompilerHostFromProgramHost(c,(function(){return C.projectCompilerOptions}));e.setGetSourceFileAsHashVersioned(p,c),p.getParsedCommandLine=function(e){return h(C,e,m(C,e))},p.resolveModuleNames=e.maybeBind(c,c.resolveModuleNames),p.resolveTypeReferenceDirectives=e.maybeBind(c,c.resolveTypeReferenceDirectives);var f=p.resolveModuleNames?void 0:e.createModuleResolutionCache(u,d),g=p.resolveTypeReferenceDirectives?void 0:e.createTypeReferenceDirectiveResolutionCache(u,d,void 0,null==f?void 0:f.getPackageJsonInfoCache());if(!p.resolveModuleNames){var y=function(t,r,n,i){return e.resolveModuleName(t,n,C.projectCompilerOptions,p,f,i,r).resolvedModule};p.resolveModuleNames=function(t,r,n,i,a,o){return e.loadWithModeAwareCache(e.Debug.checkEachDefined(t),e.Debug.checkDefined(o),r,i,y)},p.getModuleResolutionCache=function(){return f}}if(!p.resolveTypeReferenceDirectives){var v=function(t,r,n,i){return e.resolveTypeReferenceDirective(t,r,C.projectCompilerOptions,p,n,C.typeReferenceDirectiveResolutionCache,i).resolvedTypeReferenceDirective};p.resolveTypeReferenceDirectives=function(t,r,n,i,a){return e.loadWithTypeDirectiveCache(e.Debug.checkEachDefined(t),r,n,a,v)}}var b=e.createWatchFactory(l,i),x=b.watchFile,S=b.watchDirectory,D=b.writeLog,C={host:c,hostWithWatch:l,currentDirectory:u,getCanonicalFileName:d,parseConfigFileHost:e.parseConfigHostFromCompilerHostLike(c),write:e.maybeBind(c,c.trace),options:i,baseCompilerOptions:_,rootNames:n,baseWatchOptions:a,resolvedConfigFilePaths:new e.Map,configFileCache:new e.Map,projectStatus:new e.Map,buildInfoChecked:new e.Map,extendedConfigCache:new e.Map,builderPrograms:new e.Map,diagnostics:new e.Map,projectPendingBuild:new e.Map,projectErrorsReported:new e.Map,compilerHost:p,moduleResolutionCache:f,typeReferenceDirectiveResolutionCache:g,buildOrder:void 0,readFileWithCache:function(e){return c.readFile(e)},projectCompilerOptions:_,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:t,currentInvalidatedProject:void 0,watch:t,allWatchedWildcardDirectories:new e.Map,allWatchedInputFiles:new e.Map,allWatchedConfigFiles:new e.Map,allWatchedExtendedConfigFiles:new e.Map,allWatchedPackageJsonFiles:new e.Map,lastCachedPackageJsonLookups:new e.Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:x,watchDirectory:S,writeLog:D};return C}function f(t,r){return e.toPath(r,t.currentDirectory,t.getCanonicalFileName)}function m(e,t){var r=e.resolvedConfigFilePaths,n=r.get(t);if(void 0!==n)return n;var i=f(e,t);return r.set(t,i),i}function g(e){return!!e.options}function y(e,t){var r=e.configFileCache.get(t);return r&&g(r)?r:void 0}function h(t,r,n){var i,a=t.configFileCache,o=a.get(n);if(o)return g(o)?o:void 0;var s,c=t.parseConfigFileHost,l=t.baseCompilerOptions,u=t.baseWatchOptions,d=t.extendedConfigCache,_=t.host;return _.getParsedCommandLine?(s=_.getParsedCommandLine(r))||(i=e.createCompilerDiagnostic(e.Diagnostics.File_0_not_found,r)):(c.onUnRecoverableConfigFileDiagnostic=function(e){return i=e},s=e.getParsedCommandLineOfConfigFile(r,l,c,d,u),c.onUnRecoverableConfigFileDiagnostic=e.noop),a.set(n,s||i),s}function v(t,r){return e.resolveConfigFileProjectName(e.resolvePath(t.currentDirectory,r))}function b(t,r){for(var n,i,a=new e.Map,o=new e.Map,s=[],c=0,l=r;co)}}}function F(t,r,n){var i=t.options;return!(r.type===e.UpToDateStatusType.OutOfDateWithPrepend&&!i.force)||(0===n.fileNames.length||!!e.getConfigFileParsingDiagnostics(n).length||!e.isIncrementalCompilation(n.options))}function P(t,r,i){if(t.projectPendingBuild.size&&!l(r)){if(t.currentInvalidatedProject)return e.arrayIsEqualTo(t.currentInvalidatedProject.buildOrder,r)?t.currentInvalidatedProject:void 0;for(var a=t.options,o=t.projectPendingBuild,s=0;sl&&(s=p,l=f)}}if(!r.fileNames.length&&!e.canJsonReportNoInputFiles(r.raw))return{type:e.UpToDateStatusType.ContainerOnly};var g,y=e.getAllProjectOutputs(r,!u.useCaseSensitiveFileNames()),v="(none)",b=o,x="(none)",S=a,D=a,C=!1;if(!i)for(var T=0,E=y;TS&&(S=A,x=k),e.isDeclarationFileName(k)&&(D=c(D,e.getModifiedTime(u,k)))}var N,w=!1,F=!1;if(r.projectReferences){t.projectStatus.set(n,{type:e.UpToDateStatusType.ComputingUpstream});for(var P=0,I=r.projectReferences;P=0},t.findArgument=function(t){var r=e.sys.args.indexOf(t);return r>=0&&r214)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){var r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){var n=s(r[1],!1);if(0!==n)return{name:r[1],isScopeName:!0,result:n};var i=s(r[2],!1);return 0!==i?{name:r[2],isScopeName:!1,result:i}:0}}return encodeURIComponent(e)!==e?5:0}function c(t,r,n,i){var a=i?"Scope":"Package";switch(r){case 1:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot be empty");case 2:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' should be less than ").concat(214," characters");case 3:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '.'");case 4:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '_'");case 5:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' contains non URI safe characters");case 0:return e.Debug.fail();default:throw e.Debug.assertNever(r)}}t.validatePackageName=function(e){return s(e,!0)},t.renderPackageNameValidationFailure=function(e,t){return"object"==typeof e?c(t,e.result,e.name,e.isScopeName):c(t,e,t,!1)}}(e.JsTyping||(e.JsTyping={}))}(c||(c={})),function(e){var t,r,n,i,a,o,s,c,l,u,d,_,p,f,m,g,y,h,v,b,x;function S(e){return{indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:u.Smart,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:d.Ignore,trimTrailingWhitespace:!0}}t=e.ScriptSnapshot||(e.ScriptSnapshot={}),r=function(){function e(e){this.text=e}return e.prototype.getText=function(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(){},e}(),t.fromString=function(e){return new r(e)},(n=e.PackageJsonDependencyGroup||(e.PackageJsonDependencyGroup={}))[n.Dependencies=1]="Dependencies",n[n.DevDependencies=2]="DevDependencies",n[n.PeerDependencies=4]="PeerDependencies",n[n.OptionalDependencies=8]="OptionalDependencies",n[n.All=15]="All",(i=e.PackageJsonAutoImportPreference||(e.PackageJsonAutoImportPreference={}))[i.Off=0]="Off",i[i.On=1]="On",i[i.Auto=2]="Auto",(a=e.LanguageServiceMode||(e.LanguageServiceMode={}))[a.Semantic=0]="Semantic",a[a.PartialSemantic=1]="PartialSemantic",a[a.Syntactic=2]="Syntactic",e.emptyOptions={},(o=e.SemanticClassificationFormat||(e.SemanticClassificationFormat={})).Original="original",o.TwentyTwenty="2020",(s=e.CompletionTriggerKind||(e.CompletionTriggerKind={}))[s.Invoked=1]="Invoked",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",(c=e.InlayHintKind||(e.InlayHintKind={})).Type="Type",c.Parameter="Parameter",c.Enum="Enum",(l=e.HighlightSpanKind||(e.HighlightSpanKind={})).none="none",l.definition="definition",l.reference="reference",l.writtenReference="writtenReference",function(e){e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart"}(u=e.IndentStyle||(e.IndentStyle={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(d=e.SemicolonPreference||(e.SemicolonPreference={})),e.getDefaultFormatCodeSettings=S,e.testFormatSettings=S("\n"),(_=e.SymbolDisplayPartKind||(e.SymbolDisplayPartKind={}))[_.aliasName=0]="aliasName",_[_.className=1]="className",_[_.enumName=2]="enumName",_[_.fieldName=3]="fieldName",_[_.interfaceName=4]="interfaceName",_[_.keyword=5]="keyword",_[_.lineBreak=6]="lineBreak",_[_.numericLiteral=7]="numericLiteral",_[_.stringLiteral=8]="stringLiteral",_[_.localName=9]="localName",_[_.methodName=10]="methodName",_[_.moduleName=11]="moduleName",_[_.operator=12]="operator",_[_.parameterName=13]="parameterName",_[_.propertyName=14]="propertyName",_[_.punctuation=15]="punctuation",_[_.space=16]="space",_[_.text=17]="text",_[_.typeParameterName=18]="typeParameterName",_[_.enumMemberName=19]="enumMemberName",_[_.functionName=20]="functionName",_[_.regularExpressionLiteral=21]="regularExpressionLiteral",_[_.link=22]="link",_[_.linkName=23]="linkName",_[_.linkText=24]="linkText",(p=e.CompletionInfoFlags||(e.CompletionInfoFlags={}))[p.None=0]="None",p[p.MayIncludeAutoImports=1]="MayIncludeAutoImports",p[p.IsImportStatementCompletion=2]="IsImportStatementCompletion",p[p.IsContinuation=4]="IsContinuation",p[p.ResolvedModuleSpecifiers=8]="ResolvedModuleSpecifiers",p[p.ResolvedModuleSpecifiersBeyondLimit=16]="ResolvedModuleSpecifiersBeyondLimit",p[p.MayIncludeMethodSnippets=32]="MayIncludeMethodSnippets",(f=e.OutliningSpanKind||(e.OutliningSpanKind={})).Comment="comment",f.Region="region",f.Code="code",f.Imports="imports",(m=e.OutputFileType||(e.OutputFileType={}))[m.JavaScript=0]="JavaScript",m[m.SourceMap=1]="SourceMap",m[m.Declaration=2]="Declaration",(g=e.EndOfLineState||(e.EndOfLineState={}))[g.None=0]="None",g[g.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",g[g.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",g[g.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",g[g.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",g[g.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",g[g.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",(y=e.TokenClass||(e.TokenClass={}))[y.Punctuation=0]="Punctuation",y[y.Keyword=1]="Keyword",y[y.Operator=2]="Operator",y[y.Comment=3]="Comment",y[y.Whitespace=4]="Whitespace",y[y.Identifier=5]="Identifier",y[y.NumberLiteral=6]="NumberLiteral",y[y.BigIntLiteral=7]="BigIntLiteral",y[y.StringLiteral=8]="StringLiteral",y[y.RegExpLiteral=9]="RegExpLiteral",(h=e.ScriptElementKind||(e.ScriptElementKind={})).unknown="",h.warning="warning",h.keyword="keyword",h.scriptElement="script",h.moduleElement="module",h.classElement="class",h.localClassElement="local class",h.interfaceElement="interface",h.typeElement="type",h.enumElement="enum",h.enumMemberElement="enum member",h.variableElement="var",h.localVariableElement="local var",h.functionElement="function",h.localFunctionElement="local function",h.memberFunctionElement="method",h.memberGetAccessorElement="getter",h.memberSetAccessorElement="setter",h.memberVariableElement="property",h.constructorImplementationElement="constructor",h.callSignatureElement="call",h.indexSignatureElement="index",h.constructSignatureElement="construct",h.parameterElement="parameter",h.typeParameterElement="type parameter",h.primitiveType="primitive type",h.label="label",h.alias="alias",h.constElement="const",h.letElement="let",h.directory="directory",h.externalModuleName="external module name",h.jsxAttribute="JSX attribute",h.string="string",h.link="link",h.linkName="link name",h.linkText="link text",(v=e.ScriptElementKindModifier||(e.ScriptElementKindModifier={})).none="",v.publicMemberModifier="public",v.privateMemberModifier="private",v.protectedMemberModifier="protected",v.exportedModifier="export",v.ambientModifier="declare",v.staticModifier="static",v.abstractModifier="abstract",v.optionalModifier="optional",v.deprecatedModifier="deprecated",v.dtsModifier=".d.ts",v.tsModifier=".ts",v.tsxModifier=".tsx",v.jsModifier=".js",v.jsxModifier=".jsx",v.jsonModifier=".json",v.dmtsModifier=".d.mts",v.mtsModifier=".mts",v.mjsModifier=".mjs",v.dctsModifier=".d.cts",v.ctsModifier=".cts",v.cjsModifier=".cjs",(b=e.ClassificationTypeNames||(e.ClassificationTypeNames={})).comment="comment",b.identifier="identifier",b.keyword="keyword",b.numericLiteral="number",b.bigintLiteral="bigint",b.operator="operator",b.stringLiteral="string",b.whiteSpace="whitespace",b.text="text",b.punctuation="punctuation",b.className="class name",b.enumName="enum name",b.interfaceName="interface name",b.moduleName="module name",b.typeParameterName="type parameter name",b.typeAliasName="type alias name",b.parameterName="parameter name",b.docCommentTagName="doc comment tag name",b.jsxOpenTagName="jsx open tag name",b.jsxCloseTagName="jsx close tag name",b.jsxSelfClosingTagName="jsx self closing tag name",b.jsxAttribute="jsx attribute",b.jsxText="jsx text",b.jsxAttributeStringLiteralValue="jsx attribute string literal value",(x=e.ClassificationType||(e.ClassificationType={}))[x.comment=1]="comment",x[x.identifier=2]="identifier",x[x.keyword=3]="keyword",x[x.numericLiteral=4]="numericLiteral",x[x.operator=5]="operator",x[x.stringLiteral=6]="stringLiteral",x[x.regularExpressionLiteral=7]="regularExpressionLiteral",x[x.whiteSpace=8]="whiteSpace",x[x.text=9]="text",x[x.punctuation=10]="punctuation",x[x.className=11]="className",x[x.enumName=12]="enumName",x[x.interfaceName=13]="interfaceName",x[x.moduleName=14]="moduleName",x[x.typeParameterName=15]="typeParameterName",x[x.typeAliasName=16]="typeAliasName",x[x.parameterName=17]="parameterName",x[x.docCommentTagName=18]="docCommentTagName",x[x.jsxOpenTagName=19]="jsxOpenTagName",x[x.jsxCloseTagName=20]="jsxCloseTagName",x[x.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",x[x.jsxAttribute=22]="jsxAttribute",x[x.jsxText=23]="jsxText",x[x.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",x[x.bigintLiteral=25]="bigintLiteral"}(c||(c={})),function(e){var t;function r(t){switch(t.kind){case 254:return e.isInJSFile(t)&&e.getJSDocEnumTag(t)?7:1;case 164:case 203:case 167:case 166:case 296:case 297:case 169:case 168:case 171:case 172:case 173:case 256:case 213:case 214:case 292:case 285:return 1;case 163:case 258:case 259:case 182:return 2;case 345:return void 0===t.name?3:2;case 299:case 257:return 3;case 261:return e.isAmbientModule(t)||1===e.getModuleInstanceState(t)?5:4;case 260:case 269:case 270:case 265:case 266:case 271:case 272:return 7;case 305:return 5}return 7}function i(t){for(;161===t.parent.kind;)t=t.parent;return e.isInternalModuleImportEqualsDeclaration(t.parent)&&t.parent.moduleReference===t}function a(e){return e.expression}function o(e){return e.tag}function s(e){return e.tagName}function c(t,r,n,i,a){var o=i?u(t):l(t);return a&&(o=e.skipOuterExpressions(o)),!!o&&!!o.parent&&r(o.parent)&&n(o.parent)===o}function l(e){return p(e)?e.parent:e}function u(e){return p(e)||f(e)?e.parent:e}function d(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isBreakOrContinueStatement))||void 0===r?void 0:r.label)===t}function _(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isLabeledStatement))||void 0===r?void 0:r.label)===t}function p(t){var r;return(null===(r=e.tryCast(t.parent,e.isPropertyAccessExpression))||void 0===r?void 0:r.name)===t}function f(t){var r;return(null===(r=e.tryCast(t.parent,e.isElementAccessExpression))||void 0===r?void 0:r.argumentExpression)===t}e.scanner=e.createScanner(99,!0),(t=e.SemanticMeaning||(e.SemanticMeaning={}))[t.None=0]="None",t[t.Value=1]="Value",t[t.Type=2]="Type",t[t.Namespace=4]="Namespace",t[t.All=7]="All",e.getMeaningFromDeclaration=r,e.getMeaningFromLocation=function(t){var n=(t=I(t)).parent;return 305===t.kind?1:e.isExportAssignment(n)||e.isExportSpecifier(n)||e.isExternalModuleReference(n)||e.isImportSpecifier(n)||e.isImportClause(n)||e.isImportEqualsDeclaration(n)&&t===n.name?7:i(t)?function(t){var r=161===t.kind?t:e.isQualifiedName(t.parent)&&t.parent.right===t?t.parent:void 0;return r&&265===r.parent.kind?7:4}(t):e.isDeclarationName(t)?r(n):e.isEntityName(t)&&e.findAncestor(t,e.or(e.isJSDocNameReference,e.isJSDocLinkLike,e.isJSDocMemberName))?7:function(t){e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent);switch(t.kind){case 108:return!e.isExpressionNode(t);case 192:return!0}switch(t.parent.kind){case 178:return!0;case 200:return!t.parent.isTypeOf;case 228:return e.isPartOfTypeNode(t.parent)}return!1}(t)?2:function(e){return function(e){var t=e,r=!0;if(161===t.parent.kind){for(;t.parent&&161===t.parent.kind;)t=t.parent;r=t.right===e}return 178===t.parent.kind&&!r}(e)||function(e){var t=e,r=!0;if(206===t.parent.kind){for(;t.parent&&206===t.parent.kind;)t=t.parent;r=t.name===e}if(!r&&228===t.parent.kind&&291===t.parent.parent.kind){var n=t.parent.parent.parent;return 257===n.kind&&117===t.parent.parent.token||258===n.kind&&94===t.parent.parent.token}return!1}(e)}(t)?4:e.isTypeParameterDeclaration(n)?(e.Debug.assert(e.isJSDocTemplateTag(n.parent)),2):e.isLiteralTypeNode(n)?3:1},e.isInRightSideOfInternalImportEqualsDeclaration=i,e.isCallExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isCallExpression,a,r,n)},e.isNewExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isNewExpression,a,r,n)},e.isCallOrNewExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isCallOrNewExpression,a,r,n)},e.isTaggedTemplateTag=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isTaggedTemplateExpression,o,r,n)},e.isDecoratorTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isDecorator,a,r,n)},e.isJsxOpeningLikeElementTagName=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isJsxOpeningLikeElement,s,r,n)},e.climbPastPropertyAccess=l,e.climbPastPropertyOrElementAccess=u,e.getTargetLabel=function(e,t){for(;e;){if(250===e.kind&&e.label.escapedText===t)return e.label;e=e.parent}},e.hasPropertyAccessExpressionWithName=function(t,r){return!!e.isPropertyAccessExpression(t.expression)&&t.expression.name.text===r},e.isJumpStatementTarget=d,e.isLabelOfLabeledStatement=_,e.isLabelName=function(e){return _(e)||d(e)},e.isTagName=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isJSDocTag))||void 0===r?void 0:r.tagName)===t},e.isRightSideOfQualifiedName=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isQualifiedName))||void 0===r?void 0:r.right)===t},e.isRightSideOfPropertyAccess=p,e.isArgumentExpressionOfElementAccess=f,e.isNameOfModuleDeclaration=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isModuleDeclaration))||void 0===r?void 0:r.name)===t},e.isNameOfFunctionDeclaration=function(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isFunctionLike))||void 0===r?void 0:r.name)===t},e.isLiteralNameOfPropertyDeclarationOrIndexAccess=function(t){switch(t.parent.kind){case 167:case 166:case 296:case 299:case 169:case 168:case 172:case 173:case 261:return e.getNameOfDeclaration(t.parent)===t;case 207:return t.parent.argumentExpression===t;case 162:return!0;case 196:return 194===t.parent.parent.kind;default:return!1}},e.isExpressionOfExternalModuleImportEqualsDeclaration=function(t){return e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t},e.getContainerNode=function(t){for(e.isJSDocTypeAlias(t)&&(t=t.parent.parent);;){if(!(t=t.parent))return;switch(t.kind){case 305:case 169:case 168:case 256:case 213:case 172:case 173:case 257:case 258:case 260:case 261:return t}}},e.getNodeKind=function t(r){switch(r.kind){case 305:return e.isExternalModule(r)?"module":"script";case 261:return"module";case 257:case 226:return"class";case 258:return"interface";case 259:case 338:case 345:return"type";case 260:return"enum";case 254:return c(r);case 203:return c(e.getRootDeclaration(r));case 214:case 256:case 213:return"function";case 172:return"getter";case 173:return"setter";case 169:case 168:return"method";case 296:var n=r.initializer;return e.isFunctionLike(n)?"method":"property";case 167:case 166:case 297:case 298:return"property";case 176:return"index";case 175:return"construct";case 174:return"call";case 171:case 170:return"constructor";case 163:return"type parameter";case 299:return"enum member";case 164:return e.hasSyntacticModifier(r,16476)?"property":"parameter";case 265:case 270:case 275:case 268:case 274:return"alias";case 221:var i=e.getAssignmentDeclarationKind(r),a=r.right;switch(i){case 7:case 8:case 9:case 0:return"";case 1:case 2:var o=t(a);return""===o?"const":o;case 3:case 5:return e.isFunctionExpression(a)?"method":"property";case 4:return"property";case 6:return"local class";default:return e.assertType(i),""}case 79:return e.isImportClause(r.parent)?"alias":"";case 271:var s=t(r.expression);return""===s?"const":s;default:return""}function c(t){return e.isVarConst(t)?"const":e.isLet(t)?"let":"var"}},e.isThis=function(t){switch(t.kind){case 108:return!0;case 79:return e.identifierIsThisKeyword(t)&&164===t.parent.kind;default:return!1}};var m,g=/^\/\/\/\s*=r.end}function b(e,t,r,n){return Math.max(e,r)r?1:u(a[e])?a[e-1]&&u(a[e-1])?1:0:i&&s===r&&a[e-1]&&a[e-1].getEnd()===r&&u(a[e-1])?1:-1}));return o?{value:o}:c>=0&&a[c]?(s=a[c],"continue-outer"):{value:s}};;){var l=c();if("object"==typeof l)return l.value}function u(e){if((n?e.getFullStart():e.getStart(t,!0))>r)return!1;var s=e.getEnd();if(rt.end||e.pos===t.end)&&H(e,n)?r(e):void 0}))}(r)}function B(t,r,n,i){var a=function a(o){if(J(o)&&1!==o.kind)return o;var s=o.getChildren(r),c=e.binarySearchKey(s,t,(function(e,t){return t}),(function(e,r){return t=s[e-1].end?0:1:-1}));if(c>=0&&s[c]){var l=s[c];if(t=t||!H(l,r)||V(l)){var u=U(s,c,r,o.kind);return u&&j(u,r)}return a(l)}}e.Debug.assert(void 0!==n||305===o.kind||1===o.kind||e.isJSDocCommentContainingNode(o));var d=U(s,s.length,r,o.kind);return d&&j(d,r)}(n||r);return e.Debug.assert(!(a&&V(a))),a}function J(t){return e.isToken(t)&&!V(t)}function j(e,t){if(J(e))return e;var r=e.getChildren(t);if(0===r.length)return e;var n=U(r,r.length,t,e.kind);return n&&j(n,t)}function U(t,r,n,i){for(var a=r-1;a>=0;a--){if(V(t[a]))0!==a||11!==i&&279!==i||e.Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(H(t[a],n))return t[a]}}function V(t){return e.isJsxText(t)&&t.containsOnlyTriviaWhiteSpaces}function K(t,r,n){var i=e.tokenToString(t.kind),a=e.tokenToString(r),o=t.getFullStart(),s=n.text.lastIndexOf(a,o);if(-1!==s){if(n.text.lastIndexOf(i,o-1)=r}))}function q(t,r){if(-1!==r.text.lastIndexOf("<",t?t.pos:r.text.length))for(var n=t,i=0,a=0;n;){switch(n.kind){case 29:if((n=B(n.getFullStart(),r))&&28===n.kind&&(n=B(n.getFullStart(),r)),!n||!e.isIdentifier(n))return;if(!i)return e.isDeclarationName(n)?void 0:{called:n,nTypeArguments:a};i--;break;case 49:i=3;break;case 48:i=2;break;case 31:i++;break;case 19:if(!(n=K(n,18,r)))return;break;case 21:if(!(n=K(n,20,r)))return;break;case 23:if(!(n=K(n,22,r)))return;break;case 27:a++;break;case 38:case 79:case 10:case 8:case 9:case 110:case 95:case 112:case 94:case 140:case 24:case 51:case 57:case 58:break;default:if(e.isTypeNode(n))break;return}n=B(n.getFullStart(),r)}}function W(t,r,n){return e.formatting.getRangeOfEnclosingComment(t,r,void 0,n)}function H(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function Q(e,t,r){var n=W(e,t,void 0);return!!n&&r===g.test(e.text.substring(n.pos,n.end))}function X(t,r,n){return e.createTextSpanFromBounds(t.getStart(r),(n||t).getEnd())}function $(t){if(!t.isUnterminated)return e.createTextSpanFromBounds(t.getStart()+1,t.getEnd()-1)}function Y(e,t){return{span:e,newText:t}}function Z(e){return 152===e.kind}function ee(t,r){return{fileExists:function(e){return t.fileExists(e)},getCurrentDirectory:function(){return r.getCurrentDirectory()},readFile:e.maybeBind(r,r.readFile),useCaseSensitiveFileNames:e.maybeBind(r,r.useCaseSensitiveFileNames),getSymlinkCache:e.maybeBind(r,r.getSymlinkCache)||t.getSymlinkCache,getModuleSpecifierCache:e.maybeBind(r,r.getModuleSpecifierCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getModuleResolutionCache())||void 0===e?void 0:e.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:e.maybeBind(r,r.getGlobalTypingsCacheLocation),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},getNearestAncestorDirectoryWithPackageJson:e.maybeBind(r,r.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:function(){return t.getFileIncludeReasons()}}}function te(e,t){return n(n({},ee(e,t)),{getCommonSourceDirectory:function(){return e.getCommonSourceDirectory()}})}function re(t,r,n,i,a){return e.factory.createImportDeclaration(void 0,void 0,t||r?e.factory.createImportClause(!!a,t,r&&r.length?e.factory.createNamedImports(r):void 0):void 0,"string"==typeof n?ne(n,i):n,void 0)}function ne(t,r){return e.factory.createStringLiteral(t,0===r)}function ie(t,r){return e.isStringDoubleQuoted(t,r)?1:0}function ae(t,r){if(r.quotePreference&&"auto"!==r.quotePreference)return"single"===r.quotePreference?0:1;var n=t.imports&&e.find(t.imports,(function(t){return e.isStringLiteral(t)&&!e.nodeIsSynthesized(t.parent)}));return n?ie(n,t):1}function oe(t){return"default"!==t.escapedName?t.escapedName:e.firstDefined(t.declarations,(function(t){var r=e.getNameOfDeclaration(t);return r&&79===r.kind?r.escapedText:void 0}))}function se(t,r,n){return e.textSpanContainsPosition(t,r.getStart(n))&&r.getEnd()<=e.textSpanEnd(t)}function ce(e,t){return!!e&&!!t&&e.start===t.start&&e.length===t.length}function le(t){var r=t.declarations?e.firstOrUndefined(t.declarations):void 0;return!!e.findAncestor(r,(function(t){return!!e.isParameter(t)||!(e.isBindingElement(t)||e.isObjectBindingPattern(t)||e.isArrayBindingPattern(t))&&"quit"}))}e.getLineStartPositionForPosition=function(t,r){return e.getLineStarts(r)[r.getLineAndCharacterOfPosition(t).line]},e.rangeContainsRange=y,e.rangeContainsRangeExclusive=function(e,t){return h(e,t.pos)&&h(e,t.end)},e.rangeContainsPosition=function(e,t){return e.pos<=t&&t<=e.end},e.rangeContainsPositionExclusive=h,e.startEndContainsRange=v,e.rangeContainsStartEnd=function(e,t,r){return e.pos<=t&&e.end>=r},e.rangeOverlapsWithStartEnd=function(e,t,r){return b(e.pos,e.end,t,r)},e.nodeOverlapsWithStartEnd=function(e,t,r,n){return b(e.getStart(t),e.end,r,n)},e.startEndOverlapsWithStartEnd=b,e.positionBelongsToNode=function(t,r,n){return e.Debug.assert(t.pos<=r),rn.getStart(t)&&rn.getStart(t)},e.isInJSXText=function(t,r){var n=M(t,r);return!!e.isJsxText(n)||(!(18!==n.kind||!e.isJsxExpression(n.parent)||!e.isJsxElement(n.parent.parent))||!(29!==n.kind||!e.isJsxOpeningLikeElement(n.parent)||!e.isJsxElement(n.parent.parent)))},e.isInsideJsxElement=function(e,t){return function(r){for(;r;)if(r.kind>=279&&r.kind<=288||11===r.kind||29===r.kind||31===r.kind||79===r.kind||19===r.kind||18===r.kind||43===r.kind)r=r.parent;else{if(278!==r.kind)return!1;if(t>r.getStart(e))return!0;r=r.parent}return!1}(M(e,t))},e.findPrecedingMatchingToken=K,e.removeOptionality=z,e.isPossiblyTypeArgumentPosition=function t(r,n,i){var a=q(r,n);return void 0!==a&&(e.isPartOfTypeNode(a.called)||0!==G(a.called,a.nTypeArguments,i).length||t(a.called,n,i))},e.getPossibleGenericSignatures=G,e.getPossibleTypeArgumentsInfo=q,e.isInComment=W,e.hasDocComment=function(t,r){var n=M(t,r);return!!e.findAncestor(n,e.isJSDoc)},e.getNodeModifiers=function(t,r){void 0===r&&(r=0);var n=[],i=e.isDeclaration(t)?e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t)&~r:0;return 8&i&&n.push("private"),16&i&&n.push("protected"),4&i&&n.push("public"),(32&i||e.isClassStaticBlockDeclaration(t))&&n.push("static"),128&i&&n.push("abstract"),1&i&&n.push("export"),8192&i&&n.push("deprecated"),16777216&t.flags&&n.push("declare"),271===t.kind&&n.push("export"),n.length>0?n.join(","):""},e.getTypeArgumentOrTypeParameterList=function(t){return 178===t.kind||208===t.kind?t.typeArguments:e.isFunctionLike(t)||257===t.kind||258===t.kind?t.typeParameters:void 0},e.isComment=function(e){return 2===e||3===e},e.isStringOrRegularExpressionOrTemplateLiteral=function(t){return!(10!==t&&13!==t&&!e.isTemplateLiteralKind(t))},e.isPunctuation=function(e){return 18<=e&&e<=78},e.isInsideTemplateLiteral=function(t,r,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart(n)=2||!!t.noEmit},e.createModuleSpecifierResolutionHost=ee,e.getModuleSpecifierResolverHost=te,e.moduleResolutionRespectsExports=function(t){return t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.moduleResolutionUsesNodeModules=function(t){return t===e.ModuleResolutionKind.NodeJs||t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.makeImportIfNecessary=function(e,t,r,n){return e||t&&t.length?re(e,t,r,n):void 0},e.makeImport=re,e.makeStringLiteral=ne,(m=e.QuotePreference||(e.QuotePreference={}))[m.Single=0]="Single",m[m.Double=1]="Double",e.quotePreferenceFromString=ie,e.getQuotePreference=ae,e.getQuoteFromPreference=function(t){switch(t){case 0:return"'";case 1:return'"';default:return e.Debug.assertNever(t)}},e.symbolNameNoDefault=function(t){var r=oe(t);return void 0===r?void 0:e.unescapeLeadingUnderscores(r)},e.symbolEscapedNameNoDefault=oe,e.isModuleSpecifierLike=function(t){return e.isStringLiteralLike(t)&&(e.isExternalModuleReference(t.parent)||e.isImportDeclaration(t.parent)||e.isRequireCall(t.parent,!1)&&t.parent.arguments[0]===t||e.isImportCall(t.parent)&&t.parent.arguments[0]===t)},e.isObjectBindingElementWithoutPropertyName=function(t){return e.isBindingElement(t)&&e.isObjectBindingPattern(t.parent)&&e.isIdentifier(t.name)&&!t.propertyName},e.getPropertySymbolFromBindingElement=function(e,t){var r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)},e.getParentNodeInSpan=function(t,r,n){if(t)for(;t.parent;){if(e.isSourceFile(t.parent)||!se(n,t.parent,r))return t;t=t.parent}},e.findModifier=function(t,r){return t.modifiers&&e.find(t.modifiers,(function(e){return e.kind===r}))},e.insertImports=function(t,r,n,i){var a=237===(e.isArray(n)?n[0]:n).kind?e.isRequireVariableStatement:e.isAnyImportSyntax,o=e.filter(r.statements,a),s=e.isArray(n)?e.stableSort(n,e.OrganizeImports.compareImportsOrRequireStatements):[n];if(o.length)if(o&&e.OrganizeImports.importsAreSorted(o))for(var c=0,l=s;ca&&r&&"..."!==r&&(e.isWhiteSpaceLike(r.charCodeAt(r.length-1))||t.push(_e(" ",e.SymbolDisplayPartKind.space)),t.push(_e("...",e.SymbolDisplayPartKind.punctuation))),t},writeKeyword:function(t){return c(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return c(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeTrailingSemicolon:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return c(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return c(t,e.SymbolDisplayPartKind.parameterName)},writeProperty:function(t){return c(t,e.SymbolDisplayPartKind.propertyName)},writeLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeSymbol:function(e,r){if(i>a)return;s(),i+=e.length,t.push(de(e,r))},writeLine:function(){if(i>a)return;i+=1,t.push(he()),r=!0},write:o,writeComment:o,getText:function(){return""},getTextPos:function(){return 0},getColumn:function(){return 0},getLine:function(){return 0},isAtStartOfLine:function(){return!1},hasTrailingWhitespace:function(){return!1},hasTrailingComment:function(){return!1},rawWrite:e.notImplemented,getIndent:function(){return n},increaseIndent:function(){n++},decreaseIndent:function(){n--},clear:l,trackSymbol:function(){return!1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop};function s(){if(!(i>a)&&r){var o=e.getIndentString(n);o&&(i+=o.length,t.push(_e(o,e.SymbolDisplayPartKind.space))),r=!1}}function c(e,r){i>a||(s(),i+=e.length,t.push(_e(e,r)))}function l(){t=[],r=!0,n=0,i=0}}();function de(t,r){return _e(t,function(t){var r=t.flags;if(3&r)return le(t)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName;return 4&r||32768&r||65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r||2097152&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(r))}function _e(t,r){return{text:t,kind:e.SymbolDisplayPartKind[r]}}function pe(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function fe(t){return _e(t,e.SymbolDisplayPartKind.text)}function me(t){return _e(t,e.SymbolDisplayPartKind.linkText)}function ge(t,r){return{text:t,kind:e.SymbolDisplayPartKind[e.SymbolDisplayPartKind.linkName],target:{fileName:e.getSourceFileOfNode(r).fileName,textSpan:X(r)}}}function ye(t){return _e(t,e.SymbolDisplayPartKind.link)}e.symbolPart=de,e.displayPart=_e,e.spacePart=function(){return _e(" ",e.SymbolDisplayPartKind.space)},e.keywordPart=pe,e.punctuationPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)},e.operatorPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.operator)},e.parameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.parameterName)},e.propertyNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.propertyName)},e.textOrKeywordPart=function(t){var r=e.stringToToken(t);return void 0===r?fe(t):pe(r)},e.textPart=fe,e.typeAliasNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.aliasName)},e.typeParameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.typeParameterName)},e.linkTextPart=me,e.linkNamePart=ge,e.linkPart=ye,e.buildLinkParts=function(t,r){var n,i=e.isJSDocLink(t)?"link":e.isJSDocLinkCode(t)?"linkcode":"linkplain",a=[ye("{@".concat(i," "))];if(t.name){var o=null==r?void 0:r.getSymbolAtLocation(t.name),s=function(e){if(0===e.indexOf("()"))return 2;if("<"!==e[0])return 0;var t=0,r=0;for(;r"===e[r]&&t--,r++,!t)return r;return 0}(t.text),c=e.getTextOfNode(t.name)+t.text.slice(0,s),l=function(e){var t=0;if(124===e.charCodeAt(t++)){for(;t=5||e.forEachChild(a,i)})),0===r&&n<=1||r/n>.2}function Ge(e,t){return We(e,e.fileExists,t)}function qe(e){try{return e()}catch(e){return}}function We(e,t){for(var r=[],n=2;n-1&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));)r-=1;return r+1},e.getSynthesizedDeepClone=Se,e.getSynthesizedDeepCloneWithReplacements=De,e.getSynthesizedDeepClones=Te,e.getSynthesizedDeepClonesWithReplacements=Ee,e.suppressLeadingAndTrailingTrivia=ke,e.suppressLeadingTrivia=Ae,e.suppressTrailingTrivia=Ne,e.copyComments=function(e,t){var r=e.getSourceFile();!function(e,t){for(var r=e.getFullStart(),n=e.getStart(),i=r;i=0),o},e.copyLeadingComments=Pe,e.copyTrailingComments=Ie,e.copyTrailingAsLeadingComments=Oe,e.needsParentheses=function(t){return e.isBinaryExpression(t)&&27===t.operatorToken.kind||e.isObjectLiteralExpression(t)||e.isAsExpression(t)&&e.isObjectLiteralExpression(t.expression)},e.getContextualTypeFromParent=Re,e.quote=function(t,r,n){var i=ae(t,r),a=JSON.stringify(n);return 0===i?"'".concat(e.stripQuotes(a).replace(/'/g,"\\'").replace(/\\"/g,'"'),"'"):a},e.isEqualityOperatorKind=Be,e.isStringLiteralOrTemplate=function(e){switch(e.kind){case 10:case 14:case 223:case 210:return!0;default:return!1}},e.hasIndexSignature=function(e){return!!e.getStringIndexType()||!!e.getNumberIndexType()},e.getSwitchedType=Je,e.ANONYMOUS="anonymous function",e.getTypeNodeIfAccessible=function(e,t,r,n){var i=r.getTypeChecker(),a=!0,o=function(){return a=!1},s=i.typeToTypeNode(e,t,1,{trackSymbol:function(e,t,r){return!(a=a&&0===i.isSymbolAccessible(e,t,r,!1).accessibility)},reportInaccessibleThisError:o,reportPrivateInBaseOfClassExpression:o,reportInaccessibleUniqueSymbolError:o,moduleResolverHost:te(r,n)});return a?s:void 0},e.syntaxRequiresTrailingSemicolonOrASI=Ke,e.syntaxMayBeASICandidate=e.or(je,Ue,Ve,Ke),e.positionIsASICandidate=function(t,r,n){var i=e.findAncestor(r,(function(r){return r.end!==t?"quit":e.syntaxMayBeASICandidate(r.kind)}));return!!i&&function(t,r){var n=t.getLastToken(r);if(n&&26===n.kind)return!1;if(je(t.kind)){if(n&&27===n.kind)return!1}else if(Ve(t.kind)){if((i=e.last(t.getChildren(r)))&&e.isModuleBlock(i))return!1}else if(Ue(t.kind)){var i;if((i=e.last(t.getChildren(r)))&&e.isFunctionBlock(i))return!1}else if(!Ke(t.kind))return!1;if(240===t.kind)return!0;var a=R(t,e.findAncestor(t,(function(e){return!e.parent})),r);return!a||19===a.kind||r.getLineAndCharacterOfPosition(t.getEnd()).line!==r.getLineAndCharacterOfPosition(a.getStart(r)).line}(i,n)},e.probablyUsesSemicolons=ze,e.tryGetDirectories=function(e,t){return We(e,e.getDirectories,t)||[]},e.tryReadDirectory=function(t,r,n,i,a){return We(t,t.readDirectory,r,n,i,a)||e.emptyArray},e.tryFileExists=Ge,e.tryDirectoryExists=function(t,r){return qe((function(){return e.directoryProbablyExists(r,t)}))||!1},e.tryAndIgnoreErrors=qe,e.tryIOAndConsumeErrors=We,e.findPackageJsons=function(t,r,n){var i=[];return e.forEachAncestorDirectory(t,(function(t){if(t===n)return!0;var a=e.combinePaths(t,"package.json");Ge(r,a)&&i.push(a)})),i},e.findPackageJson=function(t,r){var n;return e.forEachAncestorDirectory(t,(function(t){return"node_modules"===t||(n=e.findConfigFile(t,(function(e){return Ge(r,e)}),"package.json"),!!n||void 0)})),n},e.getPackageJsonsVisibleToFile=He,e.createPackageJsonInfo=Qe,e.createPackageJsonImportFilter=function(t,r,n){var i,a=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(t.fileName)||He(t.fileName,n)).filter((function(e){return e.parseable}));return{allowsImportingAmbientModule:function(t,r){if(!a.length||!t.valueDeclaration)return!0;var n=c(t.valueDeclaration.getSourceFile().fileName,r);if(void 0===n)return!0;var i=e.stripQuotes(t.getName());if(s(i))return!0;return o(n)||o(i)},allowsImportingSourceFile:function(e,t){if(!a.length)return!0;var r=c(e.fileName,t);if(!r)return!0;return o(r)},allowsImportingSpecifier:function(t){if(!a.length||s(t))return!0;if(e.pathIsRelative(t)||e.isRootedDiskPath(t))return!0;return o(t)}};function o(t){for(var r=l(t),n=0,i=a;n=0){var a=r[i];return e.Debug.assertEqual(a.file,t.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),e.cast(a,$e)}},e.getDiagnosticsWithinSpan=function(t,r){var n,i=e.binarySearchKey(r,t.start,(function(e){return e.start}),e.compareValues);for(i<0&&(i=~i);(null===(n=r[i-1])||void 0===n?void 0:n.start)===t.start;)i--;for(var a=[],o=e.textSpanEnd(t);;){var s=e.tryCast(r[i],$e);if(!s||s.start>o)break;e.textSpanContainsTextSpan(t,s)&&a.push(s),i++}return a},e.getRefactorContextSpan=function(t){var r=t.startPosition,n=t.endPosition;return e.createTextSpanFromBounds(r,void 0===n?r:n)},e.getFixableErrorSpanExpression=function(t,r){var n=M(t,r.start),i=e.findAncestor(n,(function(n){return n.getStart(t)e.textSpanEnd(r)?"quit":e.isExpression(n)&&ce(r,X(n,t))}));return i},e.mapOneOrMany=function(t,r,n){return void 0===n&&(n=e.identity),t?e.isArray(t)?n(e.map(t,r)):r(t,0):void 0},e.firstOrOnly=function(t){return e.isArray(t)?e.first(t):t},e.getNamesForExportedSymbol=function(t,r){if(Ye(t)){var n=Ze(t);if(n)return n;var i=e.codefix.moduleSymbolToValidIdentifier(et(t),r,!1),a=e.codefix.moduleSymbolToValidIdentifier(et(t),r,!0);return i===a?i:[i,a]}return t.name},e.getNameForExportedSymbol=function(t,r,n){return Ye(t)?Ze(t)||e.codefix.moduleSymbolToValidIdentifier(et(t),r,!!n):t.name},e.stringContainsAt=function(e,t,r){var n=t.length;if(n+r>e.length)return!1;for(var i=0;ib.indexOf(e.nodeModulesPathPart)&&o.set(m,x);else o.set(m,x)}}}var S=1===_&&e.getLocalSymbolForExportDefault(c)||c,D=0===_||e.isExternalModuleSymbol(S)?e.unescapeLeadingUnderscores(l):e.getNamesForExportedSymbol(S,void 0),C="string"==typeof D?D:D[0],T="string"==typeof D?void 0:D[1],E=e.stripQuotes(u.name),k=n++,A=e.skipAlias(c,f),N=33554432&c.flags?void 0:c,w=33554432&u.flags?void 0:u;N&&w||a.set(k,[c,u]),i.add(function(t,r,n,i){var a=n||"";return"".concat(t,"|").concat(e.getSymbolId(e.skipAlias(r,i)),"|").concat(a)}(C,c,e.isExternalModuleNameRelative(E)?void 0:E,f),{id:k,symbolTableKey:l,symbolName:C,capitalizedSymbolName:T,moduleName:E,moduleFile:d,moduleFileName:null==d?void 0:d.fileName,packageName:m,exportKind:_,targetFlags:A.flags,isFromPackageJson:p,symbol:N,moduleSymbol:w})},get:function(e,t){if(e===r){var n=i.get(t);return null==n?void 0:n.map(c)}},search:function(n,a,s,l){n===r&&i.forEach((function(r,n){var i=function(e){var t=e.substring(0,e.indexOf("|")),r=e.substring(e.lastIndexOf("|")+1),n=""===r?void 0:r;return{symbolName:t,ambientModuleName:n}}(n),u=i.symbolName,d=i.ambientModuleName,_=a&&r[0].capitalizedSymbolName||u;if(s(_,r[0].targetFlags)){var p=r.map(c).filter((function(n,i){return function(r,n){if(!n||!r.moduleFileName)return!0;var i=t.getGlobalTypingsCacheLocation();if(i&&e.startsWith(r.moduleFileName,i))return!0;var a=o.get(n);return!a||e.startsWith(r.moduleFileName,a)}(n,r[i].packageName)}));p.length&&l(p,_,!!d,n)}}))},releaseSymbols:function(){a.clear()},onFileChanged:function(t,n,i){return(!l(t)||!l(n))&&(r&&r!==n.path||i&&e.consumesNodeCoreModules(t)!==e.consumesNodeCoreModules(n)||!e.arrayIsEqualTo(t.moduleAugmentations,n.moduleAugmentations)||!function(t,r){if(!e.arrayIsEqualTo(t.ambientModuleNames,r.ambientModuleNames))return!1;for(var n=-1,i=-1,a=function(a){var o=function(t){return e.isNonGlobalAmbientModule(t)&&t.name.text===a};if(n=e.findIndex(t.statements,o,n+1),i=e.findIndex(r.statements,o,i+1),t.statements[n]!==r.statements[i])return{value:!1}},o=0,s=r.ambientModuleNames;o=i.length){var b=r(o,l,e.lastOrUndefined(d));void 0!==b&&(g=b)}}while(1!==l);function x(){switch(l){case 43:case 68:t[u]||13!==o.reScanSlashToken()||(l=13);break;case 29:79===u&&h++;break;case 31:h>0&&h--;break;case 130:case 150:case 147:case 133:case 151:h>0&&!c&&(l=79);break;case 15:d.push(l);break;case 18:d.length>0&&d.push(l);break;case 19:if(d.length>0){var r=e.lastOrUndefined(d);15===r?17===(l=o.reScanTemplateToken(!1))?d.pop():e.Debug.assertEqual(l,16,"Should have been a template middle."):(e.Debug.assertEqual(r,18,"Should have been an open brace"),d.pop())}break;default:if(!e.isKeyword(l))break;(24===u||e.isKeyword(u)&&e.isKeyword(l)&&!function(t,r){if(!e.isAccessibilityModifier(t))return!0;switch(r){case 136:case 149:case 134:case 124:return!0;default:return!1}}(u,l))&&(l=79)}}return{endOfLineState:g,spans:y}}return{getClassificationsForLine:function(t,r,n){return function(t,r){for(var n=[],a=t.spans,o=0,s=0;s=0){var d=c-o;d>0&&n.push({length:d,classification:e.TokenClass.Whitespace})}n.push({length:l,classification:i(u)}),o=c+l}var _=r.length-o;_>0&&n.push({length:_,classification:e.TokenClass.Whitespace});return{entries:n,finalLexState:t.endOfLineState}}(s(t,r,n),t)},getEncodedLexicalClassifications:s}};var t=e.arrayToNumericMap([79,10,8,9,13,108,45,46,21,23,19,110,95],(function(e){return e}),(function(){return!0}));function r(t,r,n){switch(r){case 10:if(!t.isUnterminated())return;for(var i=t.getTokenText(),a=i.length-1,o=0;92===i.charCodeAt(a-o);)o++;if(0==(1&o))return;return 34===i.charCodeAt(0)?3:2;case 3:return t.isUnterminated()?1:void 0;default:if(e.isTemplateLiteralKind(r)){if(!t.isUnterminated())return;switch(r){case 17:return 5;case 14:return 4;default:return e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+r)}}return 15===n?6:void 0}}function n(e,t,r,n,i){if(8!==n){0===e&&r>0&&(e+=r);var a=t-e;a>0&&i.push(e-r,a,n)}}function i(t){switch(t){case 1:return e.TokenClass.Comment;case 3:return e.TokenClass.Keyword;case 4:return e.TokenClass.NumberLiteral;case 25:return e.TokenClass.BigIntLiteral;case 5:return e.TokenClass.Operator;case 6:return e.TokenClass.StringLiteral;case 8:return e.TokenClass.Whitespace;case 10:return e.TokenClass.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return e.TokenClass.Identifier;default:return}}function a(t){if(e.isKeyword(t))return 3;if(function(e){switch(e){case 41:case 43:case 44:case 39:case 40:case 47:case 48:case 49:case 29:case 31:case 32:case 33:case 102:case 101:case 127:case 34:case 35:case 36:case 37:case 50:case 52:case 51:case 55:case 56:case 74:case 73:case 78:case 70:case 71:case 72:case 64:case 65:case 66:case 68:case 69:case 63:case 27:case 60:case 75:case 76:case 77:return!0;default:return!1}}(t)||function(e){switch(e){case 39:case 40:case 54:case 53:case 45:case 46:return!0;default:return!1}}(t))return 5;if(t>=18&&t<=78)return 10;switch(t){case 8:return 4;case 9:return 25;case 10:return 6;case 13:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;default:return e.isTemplateLiteralKind(t)?6:2}}function o(e,t){switch(t){case 261:case 257:case 258:case 256:case 226:case 213:case 214:e.throwIfCancellationRequested()}}function s(t,r,n,i,a){var s=[];return n.forEachChild((function l(u){if(u&&e.textSpanIntersectsWith(a,u.pos,u.getFullWidth())){if(o(r,u.kind),e.isIdentifier(u)&&!e.nodeIsMissing(u)&&i.has(u.escapedText)){var d=t.getSymbolAtLocation(u),_=d&&c(d,e.getMeaningFromLocation(u),t);_&&function(t,r,n){var i=r-t;e.Debug.assert(i>0,"Classification had non-positive length of ".concat(i)),s.push(t),s.push(i),s.push(n)}(u.getStart(n),u.getEnd(),_)}u.forEachChild(l)}})),{spans:s,endOfLineState:0}}function c(t,r,n){var i=t.getFlags();return 0==(2885600&i)?void 0:32&i?11:384&i?12:524288&i?16:1536&i?4&r||1&r&&function(t){return e.some(t.declarations,(function(t){return e.isModuleDeclaration(t)&&1===e.getModuleInstanceState(t)}))}(t)?14:void 0:2097152&i?c(n.getAliasedSymbol(t),r,n):2&r?64&i?13:262144&i?15:void 0:void 0}function l(e){switch(e){case 1:return"comment";case 2:return"identifier";case 3:return"keyword";case 4:return"number";case 25:return"bigint";case 5:return"operator";case 6:return"string";case 8:return"whitespace";case 9:return"text";case 10:return"punctuation";case 11:return"class name";case 12:return"enum name";case 13:return"interface name";case 14:return"module name";case 15:return"type parameter name";case 16:return"type alias name";case 17:return"parameter name";case 18:return"doc comment tag name";case 19:return"jsx open tag name";case 20:return"jsx close tag name";case 21:return"jsx self closing tag name";case 22:return"jsx attribute";case 23:return"jsx text";case 24:return"jsx attribute string literal value";default:return}}function u(t){e.Debug.assert(t.spans.length%3==0);for(var r=t.spans,n=[],i=0;i])*)(\/>)?)?/im,a=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/gim,o=r.text.substr(t,n),s=i.exec(o);if(!s)return!1;if(!s[3]||!(s[3]in e.commentPragmas))return!1;var c=t;_(c,s[1].length),u(c+=s[1].length,s[2].length,10),u(c+=s[2].length,s[3].length,21),c+=s[3].length;var l=s[4],d=c;for(;;){var p=a.exec(l);if(!p)break;var f=c+p.index+p[1].length;f>d&&(_(d,f-d),d=f),u(d,p[2].length,22),d+=p[2].length,p[3].length&&(_(d,p[3].length),d+=p[3].length),u(d,p[4].length,5),d+=p[4].length,p[5].length&&(_(d,p[5].length),d+=p[5].length),u(d,p[6].length,24),d+=p[6].length}(c+=s[4].length)>d&&_(d,c-d);s[5]&&(u(c,s[5].length,10),c+=s[5].length);var m=t+n;c=0),a>0){var o=n||y(t.kind,t);o&&u(i,a,o)}return!0}function y(t,r){if(e.isKeyword(t))return 3;if((29===t||31===t)&&r&&e.getTypeArgumentOrTypeParameterList(r.parent))return 10;if(e.isPunctuation(t)){if(r){var n=r.parent;if(63===t&&(254===n.kind||167===n.kind||164===n.kind||285===n.kind))return 5;if(221===n.kind||219===n.kind||220===n.kind||222===n.kind)return 5}return 10}if(8===t)return 4;if(9===t)return 25;if(10===t)return r&&285===r.parent.kind?24:6;if(13===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(11===t)return 23;if(79===t){if(r){switch(r.parent.kind){case 257:return r.parent.name===r?11:void 0;case 163:return r.parent.name===r?15:void 0;case 258:return r.parent.name===r?13:void 0;case 260:return r.parent.name===r?12:void 0;case 261:return r.parent.name===r?14:void 0;case 164:return r.parent.name===r?e.isThisIdentifier(r)?3:17:void 0}if(e.isConstTypeReference(r.parent))return 3}return 2}}function h(n){if(n&&e.decodedTextSpanIntersectsWith(i,a,n.pos,n.getFullWidth())){o(t,n.kind);for(var s=0,c=n.getChildren(r);s0})))return 0;if(a((function(e){return e.getCallSignatures().length>0}))&&!a((function(e){return e.getProperties().length>0}))||function(t){for(;c(t);)t=t.parent;return e.isCallExpression(t.parent)&&t.parent.expression===t}(r))return 9===n?11:10}}return n}(o,_,m);var y=f.valueDeclaration;if(y){var h=e.getCombinedModifierFlags(y),v=e.getCombinedNodeFlags(y);32&h&&(g|=2),256&h&&(g|=4),0!==m&&2!==m&&(64&h||2&v||8&f.getFlags())&&(g|=8),7!==m&&10!==m||!function(t,r){return e.isBindingElement(t)&&(t=s(t)),e.isVariableDeclaration(t)?(!e.isSourceFile(t.parent.parent.parent)||e.isCatchClause(t.parent))&&t.getSourceFile()===r:!!e.isFunctionDeclaration(t)&&(!e.isSourceFile(t.parent)&&t.getSourceFile()===r)}(y,r)||(g|=32),t.isSourceFileDefaultLibrary(y.getSourceFile())&&(g|=16)}else f.declarations&&f.declarations.some((function(e){return t.isSourceFileDefaultLibrary(e.getSourceFile())}))&&(g|=16);i(_,m,g)}}}e.forEachChild(_,d),u=p}}d(r)}(t,r,n,(function(e,t,n){a.push(e.getStart(r),e.getWidth(r),(t+1<<8)+n)}),i),a}function s(t){for(;;){if(!e.isBindingElement(t.parent.parent))return t.parent.parent;t=t.parent.parent}}function c(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t}(r=t.TokenEncodingConsts||(t.TokenEncodingConsts={}))[r.typeOffset=8]="typeOffset",r[r.modifierMask=255]="modifierMask",(n=t.TokenType||(t.TokenType={}))[n.class=0]="class",n[n.enum=1]="enum",n[n.interface=2]="interface",n[n.namespace=3]="namespace",n[n.typeParameter=4]="typeParameter",n[n.type=5]="type",n[n.parameter=6]="parameter",n[n.variable=7]="variable",n[n.enumMember=8]="enumMember",n[n.property=9]="property",n[n.function=10]="function",n[n.member=11]="member",(i=t.TokenModifier||(t.TokenModifier={}))[i.declaration=0]="declaration",i[i.static=1]="static",i[i.async=2]="async",i[i.readonly=3]="readonly",i[i.defaultLibrary=4]="defaultLibrary",i[i.local=5]="local",t.getSemanticClassifications=function(t,r,n,i){var o=a(t,r,n,i);e.Debug.assert(o.spans.length%3==0);for(var s=o.spans,c=[],l=0;lr.parameters.length)){var s=r.getTypeParameterAtPosition(n.argumentIndex);if(e.isJsxOpeningLikeElement(t)){var l=i.getTypeOfPropertyOfType(s,c.name.text);l&&(s=l)}return a=a||!!(4&s.flags),d(s,o)}})),isNewIdentifier:a}}(E.invocation,n,E,a):k()}case 266:case 272:case 277:return{kind:0,paths:m(r,n,o,s,a,c)};default:return k()}function k(){return{kind:2,types:d(e.getContextualTypeFromParent(n,a)),isNewIdentifier:!1}}}function l(t){switch(t.kind){case 191:return e.walkUpParenthesizedTypes(t);case 212:return e.walkUpParenthesizedExpressions(t);default:return t}}function u(t){return t&&{kind:1,symbols:e.filter(t.getApparentProperties(),(function(t){return!(t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))})),hasIndexSignature:e.hasIndexSignature(t)}}function d(t,r){return void 0===r&&(r=new e.Map),t?(t=e.skipConstraint(t)).isUnion()?e.flatMap(t.types,(function(e){return d(e,r)})):!t.isStringLiteral()||1024&t.flags||!e.addToSeen(r,t.value)?e.emptyArray:[t]:e.emptyArray}function _(e,t,r){return{name:e,kind:t,extension:r}}function p(e){return _(e,"directory",void 0)}function f(t,r,n){var i=function(t,r){var n=Math.max(t.lastIndexOf(e.directorySeparator),t.lastIndexOf(e.altDirectorySeparator)),i=-1!==n?n+1:0,a=t.length-i;return 0===a||e.isIdentifierText(t.substr(i,a),99)?void 0:e.createTextSpan(r+i,a)}(t,r),a=0===t.length?void 0:e.createTextSpan(r,t.length);return n.map((function(t){var r=t.name,n=t.kind,o=t.extension;return-1!==Math.max(r.indexOf(e.directorySeparator),r.indexOf(e.altDirectorySeparator))?{name:r,kind:n,extension:o,span:a}:{name:r,kind:n,extension:o,span:i}}))}function m(t,n,i,a,o,s){return f(n.text,n.getStart(t)+1,function(t,n,i,a,o,s){var c=e.normalizeSlashes(n.text),l=t.path,u=e.getDirectoryPath(l);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){var t=e.length>=3&&46===e.charCodeAt(1)?2:1,r=e.charCodeAt(t);return 47===r||92===r}return!1}(c)||!i.baseUrl&&(e.isRootedDiskPath(c)||e.isUrl(c))?function(t,n,i,a,o,s){var c=g(i,s);return i.rootDirs?function(t,n,i,a,o,s,c){var l=o.project||s.getCurrentDirectory(),u=!(s.useCaseSensitiveFileNames&&s.useCaseSensitiveFileNames()),d=function(t,n,i,a){t=t.map((function(t){return e.normalizePath(e.isRootedDiskPath(t)?t:e.combinePaths(n,t))}));var o=e.firstDefined(t,(function(t){return e.containsPath(t,i,n,a)?i.substr(t.length):void 0}));return e.deduplicate(r(r([],t.map((function(t){return e.combinePaths(t,o)})),!0),[i],!1),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive)}(t,l,i,u);return e.flatMap(d,(function(e){return v(n,e,a,s,c)}))}(i.rootDirs,t,n,c,i,a,o):v(t,n,c,a,o)}(c,u,i,a,l,d()):function(t,r,n,i,a){var o=n.baseUrl,s=n.paths,c=[],l=g(n);if(o){var u=n.project||i.getCurrentDirectory(),d=e.normalizePath(e.combinePaths(u,o));v(t,d,l,i,void 0,c),s&&b(c,t,d,l.extensions,s,i)}for(var p=x(t),f=0,m=function(t,r,n){var i=n.getAmbientModules().map((function(t){return e.stripQuotes(t.name)})).filter((function(r){return e.startsWith(r,t)}));if(void 0!==r){var a=e.ensureTrailingDirectorySeparator(r);return i.map((function(t){return e.removePrefix(t,a)}))}return i}(t,p,a);f=e.pos&&r<=e.end}));if(s){var c=t.text.slice(s.pos,r),l=C.exec(c);if(l){var u=l[1],d=l[2],_=l[3],p=e.getDirectoryPath(t.path),m="path"===d?v(_,p,g(n,1),i,t.path):"types"===d?D(i,n,p,x(_),g(n)):e.Debug.fail();return f(_,s.pos+u.length,m)}}}(r,n,o,s);return _&&i(_)}if(e.isInString(r,n,a)){if(!a||!e.isStringLiteralLike(a))return;return function(r,n,a,o,s,c,l,u){if(void 0!==r){var d=e.createTextSpanFromStringLiteralLikeContent(n);switch(r.kind){case 0:return i(r.paths);case 1:var _=e.createSortedArray();return t.getCompletionEntriesFromSymbols(r.symbols,_,n,n,a,a,o,s,99,c,4,u,l,void 0),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:r.hasIndexSignature,optionalReplacementSpan:d,entries:_};case 2:return _=r.types.map((function(r){return{name:r.value,kindModifiers:"",kind:"string",sortText:t.SortText.LocationPriority,replacementSpan:e.getReplacementSpanForContextToken(n)}})),{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:r.isNewIdentifier,optionalReplacementSpan:d,entries:_};default:return e.Debug.assertNever(r)}}}(_=c(r,a,n,l.getTypeChecker(),o,s,d),a,r,s,l,u,o,d)}},n.getStringLiteralCompletionDetails=function(r,n,i,o,s,l,u,d,_){if(o&&e.isStringLiteralLike(o)){var p=c(n,o,i,s,l,u,_);return p&&function(r,n,i,o,s,c){switch(i.kind){case 0:return(l=e.find(i.paths,(function(e){return e.name===r})))&&t.createCompletionDetails(r,a(l.extension),l.kind,[e.textPart(r)]);case 1:var l=e.find(i.symbols,(function(e){return e.name===r}));return l&&t.createCompletionDetailsForSymbol(l,s,o,n,c);case 2:return e.find(i.types,(function(e){return e.value===r}))?t.createCompletionDetails(r,"","type",[e.textPart(r)]):void 0;default:return e.Debug.assertNever(i)}}(r,o,p,n,s,d)}},function(e){e[e.Paths=0]="Paths",e[e.Properties=1]="Properties",e[e.Types=2]="Types"}(o||(o={})),function(e){e[e.Exclude=0]="Exclude",e[e.Include=1]="Include",e[e.ModuleSpecifierCompletion=2]="ModuleSpecifierCompletion"}(s||(s={}));var C=/^(\/\/\/\s*0},resolvedBeyondLimit:function(){return v>t.moduleSpecifierResolutionLimit}}),D=x?" (".concat((b/x*100).toFixed(1),"% hit rate)"):"";return null===(d=n.log)||void 0===d||d.call(n,"".concat(r,": resolved ").concat(v," module specifiers, plus ").concat(h," ambient and ").concat(b," from cache").concat(D)),null===(_=n.log)||void 0===_||_.call(n,"".concat(r,": response is ").concat(y?"incomplete":"complete")),null===(p=n.log)||void 0===p||p.call(n,"".concat(r,": ").concat(e.timestamp()-f)),S}function m(t,r){var n,i,a=e.compareStringsCaseSensitiveUI(t.sortText,r.sortText);return 0===a&&(a=e.compareStringsCaseSensitiveUI(t.name,r.name)),0===a&&(null===(n=t.data)||void 0===n?void 0:n.moduleSpecifier)&&(null===(i=r.data)||void 0===i?void 0:i.moduleSpecifier)&&(a=e.compareNumberOfDirectorySeparators(t.data.moduleSpecifier,r.data.moduleSpecifier)),0===a?-1:a}function g(e){return!!(null==e?void 0:e.moduleSpecifier)}function y(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function h(e,t,r){return{kind:4,keywordCompletions:G(e,t),isNewIdentifierLocation:r}}function v(t){return 79===(null==t?void 0:t.kind)?e.createTextSpanFromNode(t):void 0}function b(t,r){return e.isSourceFileJS(t)&&!e.isCheckJsEnabledForFile(t,r)}function x(e){switch(e){case 0:case 3:case 2:return!0;default:return!1}}function S(t,r,n){return"object"==typeof n?e.pseudoBigIntToString(n)+"n":e.isString(n)?e.quote(t,r,n):JSON.stringify(n)}function D(e,r,n){return{name:S(e,r,n),kind:"string",kindModifiers:"",sortText:t.SortText.LocationPriority}}function C(n,i,a,o,s,c,_,f,m,g,y,h,v,b,x,S,D,C,E,k,N,I){var O,M,L,R,B,J,j,U,V=e.getReplacementSpanForContextToken(a),K=P(y),z=f.getTypeChecker(),G=y&&function(e){return!!(16&e.kind)}(y),q=y&&function(e){return!!(2&e.kind)}(y)||g;if(y&&function(e){return!!(1&e.kind)}(y))L=g?"this".concat(G?"?.":"","[").concat(w(c,C,m),"]"):"this".concat(G?"?.":".").concat(m);else if((q||G)&&v){L=q?"[".concat(g?w(c,C,m):m,"]"):m,(G||v.questionDotToken)&&(L="?.".concat(L));var W=e.findChildOfKind(v,24,c)||e.findChildOfKind(v,28,c);if(!W)return;var H=e.startsWith(m,v.name.text)?v.name.end:W.end;V=e.createTextSpanFromBounds(W.getStart(c),H)}if(b&&(void 0===L&&(L=m),L="{".concat(L,"}"),"boolean"!=typeof b&&(V=e.createTextSpanFromNode(b,c))),y&&function(e){return!!(8&e.kind)}(y)&&v){void 0===L&&(L=m);var Q=e.findPrecedingToken(v.pos,c),X="";Q&&e.positionIsASICandidate(Q.end,Q.parent,c)&&(X=";"),X+="(await ".concat(v.expression.getText(),")"),L=g?"".concat(X).concat(L):"".concat(X).concat(G?"?.":".").concat(L),V=e.createTextSpanFromBounds(v.getStart(c),v.end)}if(u(y)&&(J=[e.textPart(y.moduleSpecifier)],x&&(O=function(t,r,n,i,a,o,s){var c,l,u,d=r.getSourceFile(),_=e.createTextSpanFromNode(e.findAncestor(r,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration))||r,d),p=e.quote(d,s,i.moduleSpecifier),f=i.isDefaultExport?1:"export="===i.exportName?2:0,m=s.includeCompletionsWithSnippetText?"$1":"",g=e.codefix.getImportKind(d,f,o,!0),y=(null===(l=null===(c=e.tryCast(r,e.isImportDeclaration))||void 0===c?void 0:c.importClause)||void 0===l?void 0:l.isTypeOnly)||(null===(u=e.tryCast(r,e.isImportEqualsDeclaration))||void 0===u?void 0:u.isTypeOnly),h=ie(r,n),v=y?" ".concat(e.tokenToString(152)," "):" ",b=h?"".concat(e.tokenToString(152)," "):"",x=a?";":"";switch(g){case 3:return{replacementSpan:_,insertText:"import".concat(v).concat(e.escapeSnippetText(t)).concat(m," = require(").concat(p,")").concat(x)};case 1:return{replacementSpan:_,insertText:"import".concat(v).concat(e.escapeSnippetText(t)).concat(m," from ").concat(p).concat(x)};case 2:return{replacementSpan:_,insertText:"import".concat(v,"* as ").concat(e.escapeSnippetText(t)," from ").concat(p).concat(x)};case 0:return{replacementSpan:_,insertText:"import".concat(v,"{ ").concat(b).concat(e.escapeSnippetText(t)).concat(m," } from ").concat(p).concat(x)}}}(m,x,o,y,S,D,C),L=O.insertText,V=O.replacementSpan,B=!!C.includeCompletionsWithSnippetText||void 0)),64===(null==y?void 0:y.kind)&&(j=!0),C.includeCompletionsWithClassMemberSnippets&&C.includeCompletionsWithInsertText&&3===E&&function(t,r){if(e.isInJSFile(r))return!1;var n=106500;return!!(t.flags&n)&&(e.isClassLike(r)||r.parent&&r.parent.parent&&e.isClassElement(r.parent)&&r===r.parent.name&&e.isClassLike(r.parent.parent)||r.parent&&e.isSyntaxList(r)&&e.isClassLike(r.parent))}(n,s)){var $=void 0;L=(M=T(_,f,D,C,m,n,s,o,k)).insertText,B=M.isSnippet,$=M.importAdder,V=M.replacementSpan,i=t.SortText.ClassMemberSnippets,(null==$?void 0:$.hasFixes())&&(j=!0,K=r.ClassMemberSnippet)}if(y&&p(y)&&(L=y.insertText,B=y.isSnippet,U=y.labelDetails,C.useLabelDetailsInCompletionEntries||(m+=U.detail,U=void 0),K=r.ObjectLiteralMethodSnippet,i=t.SortText.SortBelow(i)),N&&!I&&C.includeCompletionsWithSnippetText&&C.jsxAttributeCompletionStyle&&"none"!==C.jsxAttributeCompletionStyle){var Y="braces"===C.jsxAttributeCompletionStyle,Z=z.getTypeOfSymbolAtLocation(n,s);"auto"!==C.jsxAttributeCompletionStyle||528&Z.flags||1048576&Z.flags&&e.find(Z.types,(function(e){return!!(528&e.flags)}))||(402653316&Z.flags||1048576&Z.flags&&e.every(Z.types,(function(e){return!!(402686084&e.flags)}))?(L="".concat(e.escapeSnippetText(m),"=").concat(e.quote(c,C,"$1")),B=!0):Y=!0),Y&&(L="".concat(e.escapeSnippetText(m),"={$1}"),B=!0)}if(void 0===L||C.includeCompletionsWithInsertText)return(l(y)||u(y))&&(R=A(y),j=!x),{name:m,kind:e.SymbolDisplay.getSymbolKind(z,n,s),kindModifiers:e.SymbolDisplay.getSymbolModifiers(z,n),sortText:i,source:K,hasAction:!!j||void 0,isRecommended:F(n,h,z)||void 0,insertText:L,replacementSpan:V,sourceDisplay:J,labelDetails:U,isSnippet:B,isPackageJsonImport:d(y)||void 0,isImportStatementCompletion:!!x||void 0,data:R}}function T(t,r,n,i,a,o,s,c,l){var u,d,_=e.findAncestor(s,e.isClassLike);if(!_)return{insertText:a};var p,f=a,m=r.getTypeChecker(),g=s.getSourceFile(),y=k({removeComments:!0,module:n.module,target:n.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(n,e.maybeBind(t,t.getNewLine)))}),h=e.codefix.createImportAdder(g,r,i,t);if(i.includeCompletionsWithSnippetText){u=!0;var v=e.factory.createEmptyStatement();p=e.factory.createBlock([v],!0),e.setSnippetElement(v,{kind:0,order:0})}else p=e.factory.createBlock([],!0);var b=0,x=function(t){if(!t)return{modifiers:0};var r,n,i=0;(n=function(t){if(e.isModifier(t))return t.kind;if(e.isIdentifier(t)&&t.originalKeywordKind&&e.isModifierKind(t.originalKeywordKind))return t.originalKeywordKind;return}(t))&&(i|=e.modifierToFlag(n),r=e.createTextSpanFromNode(t));e.isPropertyDeclaration(t.parent)&&(i|=e.modifiersToFlags(t.parent.modifiers),r=e.createTextSpanFromNode(t.parent));return{modifiers:i,span:r}}(c),S=x.modifiers,D=x.span,C=!!(128&S),T=[];if(e.codefix.addNewNodeForMemberSymbol(o,_,g,{program:r,host:t},i,h,(function(t){var r=0;C&&(r|=128),e.isClassElement(t)&&1===m.getMemberOverrideModifierStatus(_,t)&&(r|=16384),T.length||(b=t.modifierFlagsCache|r|S),t=e.factory.updateModifiers(t,b),T.push(t)}),p,2,C),T.length){var E=131073;d=D,f=l?y.printAndFormatSnippetList(E,e.factory.createNodeArray(T),g,l):y.printSnippetList(E,e.factory.createNodeArray(T),g)}return{insertText:f,isSnippet:u,importAdder:h,replacementSpan:d}}function E(t,r,n,i,a,o,s,c){var l=s.includeCompletionsWithSnippetText||void 0,u=r,d=n.getSourceFile(),_=function(t,r,n,i,a,o){var s=t.getDeclarations();if(!s||!s.length)return;var c=i.getTypeChecker(),l=s[0],u=e.getSynthesizedDeepClone(e.getNameOfDeclaration(l),!1),d=c.getWidenedType(c.getTypeOfSymbolAtLocation(t,r)),_=0===e.getQuotePreference(n,o)?268435456:void 0;switch(l.kind){case 166:case 167:case 168:case 169:var p=1048576&d.flags&&d.types.length<10?c.getUnionType(d.types,2):d;if(1048576&p.flags){var f=e.filter(p.types,(function(e){return c.getSignaturesOfType(e,0).length>0}));if(1!==f.length)return;p=f[0]}if(1!==c.getSignaturesOfType(p,0).length)return;var m=c.typeToTypeNode(p,r,_,e.codefix.getNoopSymbolTrackerWithResolver({program:i,host:a}));if(!m||!e.isFunctionTypeNode(m))return;var g=void 0;if(o.includeCompletionsWithSnippetText){var y=e.factory.createEmptyStatement();g=e.factory.createBlock([y],!0),e.setSnippetElement(y,{kind:0,order:0})}else g=e.factory.createBlock([],!0);var h=m.parameters.map((function(t){return e.factory.createParameterDeclaration(void 0,void 0,t.dotDotDotToken,t.name,t.questionToken,void 0,t.initializer)}));return e.factory.createMethodDeclaration(void 0,void 0,void 0,u,void 0,void 0,h,void 0,g);default:return}}(t,n,d,i,a,s);if(_){var p=k({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(o,e.maybeBind(a,a.getNewLine)))});u=c?p.printAndFormatSnippetList(80,e.factory.createNodeArray([_],!0),d,c):p.printSnippetList(80,e.factory.createNodeArray([_],!0),d);var f=e.createPrinter({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!0}),m=e.factory.createMethodSignature(void 0,"",_.questionToken,_.typeParameters,_.parameters,_.type);return{isSnippet:l,insertText:u,labelDetails:{detail:f.printNode(4,m,d)}}}}function k(t){var r,i=e.textChanges.createWriter(e.getNewLineCharacter(t)),a=e.createPrinter(t,i),o=n(n({},i),{write:function(e){return s(e,(function(){return i.write(e)}))},nonEscapingWrite:i.write,writeLiteral:function(e){return s(e,(function(){return i.writeLiteral(e)}))},writeStringLiteral:function(e){return s(e,(function(){return i.writeStringLiteral(e)}))},writeSymbol:function(e,t){return s(e,(function(){return i.writeSymbol(e,t)}))},writeParameter:function(e){return s(e,(function(){return i.writeParameter(e)}))},writeComment:function(e){return s(e,(function(){return i.writeComment(e)}))},writeProperty:function(e){return s(e,(function(){return i.writeProperty(e)}))}});return{printSnippetList:function(t,n,i){var a=c(t,n,i);return r?e.textChanges.applyChanges(a,r):a},printAndFormatSnippetList:function(t,i,a,o){var s={text:c(t,i,a),getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}},l=e.getFormatCodeSettingsForWriting(o,a),u=e.flatMap(i,(function(t){var r=e.textChanges.assignPositionsToNode(t);return e.formatting.formatNodeGivenIndentation(r,s,a.languageVariant,0,0,n(n({},o),{options:l}))})),d=r?e.stableSort(e.concatenate(u,r),(function(t,r){return e.compareTextSpans(t.span,r.span)})):u;return e.textChanges.applyChanges(s.text,d)}};function s(t,n){var a=e.escapeSnippetText(t);if(a!==t){var o=i.getTextPos();n();var s=i.getTextPos();r=e.append(r||(r=[]),{newText:a,span:{start:o,length:s-o}})}else n()}function c(e,t,n){return r=void 0,o.clear(),a.writeList(e,t,n,o),o.getText()}}function A(t){var r=t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),n=!!t.isFromPackageJson||void 0;return u(t)?{exportName:t.exportName,moduleSpecifier:t.moduleSpecifier,ambientModuleName:r,fileName:t.fileName,isPackageJsonImport:n}:{exportName:t.exportName,exportMapKey:t.exportMapKey,fileName:t.fileName,ambientModuleName:t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),isPackageJsonImport:!!t.isFromPackageJson||void 0}}function N(e,t,r){var n="default"===e.exportName,i=!!e.isPackageJsonImport;return g(e)?{kind:32,exportName:e.exportName,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}}function w(t,r,n){return/^\d+$/.test(n)?n:e.quote(t,r,n)}function F(e,t,r){return e===t||!!(1048576&e.flags)&&r.getExportSymbolOfSymbol(e)===t}function P(t){return l(t)?e.stripQuotes(t.moduleSymbol.name):u(t)?t.moduleSpecifier:1===(null==t?void 0:t.kind)?r.ThisProperty:64===(null==t?void 0:t.kind)?r.TypeOnlyAlias:void 0}function I(r,n,i,a,o,s,c,l,u,d,f,g,y,h,v,b,x,S,D,T,E,k,A,N){for(var w,F=e.timestamp(),P=function(t){var r=e.findAncestor(t,(function(t){return e.isFunctionBlock(t)||function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t}(t)||e.isBindingPattern(t)?"quit":e.isVariableDeclaration(t)}));return r}(o),I=e.probablyUsesSemicolons(s),O=l.getTypeChecker(),M=new e.Map,L=0;L=t.pos;case 24:case 22:return 202===n;case 58:return 203===n;case 20:return 292===n||Pe(n);case 18:return 260===n;case 29:return 257===n||226===n||258===n||259===n||e.isFunctionLikeKind(n);case 124:return 167===n&&!e.isClassLike(r.parent);case 25:return 164===n||!!r.parent&&202===r.parent.kind;case 123:case 121:case 122:return 164===n&&!e.isConstructorDeclaration(r.parent);case 127:return 270===n||275===n||268===n;case 136:case 149:return!te(t);case 79:if(270===n&&t===r.name&&"type"===t.text)return!1;break;case 84:case 92:case 118:case 98:case 113:case 100:case 119:case 85:case 137:return!0;case 152:return 270!==n;case 41:return e.isFunctionLike(t.parent)&&!e.isMethodDeclaration(t.parent)}if(H(X(t))&&te(t))return!1;if(we(t)&&(!e.isIdentifier(t)||e.isParameterPropertyModifier(X(t))||Le(t)))return!1;switch(X(t)){case 126:case 84:case 85:case 135:case 92:case 98:case 118:case 119:case 121:case 122:case 123:case 124:case 113:return!0;case 131:return e.isPropertyDeclaration(t.parent)}if(e.findAncestor(t.parent,e.isClassLike)&&t===N&&Fe(t,s))return!1;var i=e.getAncestor(t.parent,167);if(i&&t!==N&&e.isClassLike(N.parent.parent)&&s<=N.end){if(Fe(t,N.end))return!1;if(63!==t.kind&&(e.isInitializedProperty(i)||e.hasType(i)))return!0}return e.isDeclarationName(t)&&!e.isShorthandPropertyAssignment(t.parent)&&!e.isJsxAttribute(t.parent)&&!(e.isClassLike(t.parent)&&(t!==N||s>N.end))}(t)||function(e){if(8===e.kind){var t=e.getFullText();return"."===t.charAt(t.length-1)}return!1}(t)||function(e){if(11===e.kind)return!0;if(31===e.kind&&e.parent){if(z===e.parent&&(280===z.kind||279===z.kind))return!1;if(280===e.parent.kind)return 280!==z.parent.kind;if(281===e.parent.kind||279===e.parent.kind)return!!e.parent.parent&&278===e.parent.parent.kind}return!1}(t)||e.isBigIntLiteral(t);return i("getCompletionsAtPosition: isCompletionListBlocker: "+(e.timestamp()-r)),n}(w))return i("Returning an empty list because completion was requested in an invalid position."),G?h(G,k,Ne()):void 0;var ae=w.parent;if(24===w.kind||28===w.kind)switch(M=24===w.kind,L=28===w.kind,ae.kind){case 206:O=(F=ae).expression;var oe=e.getLeftmostAccessExpression(F);if(e.nodeIsMissing(oe)||(e.isCallExpression(O)||e.isFunctionLike(O))&&O.end===w.pos&&O.getChildCount(a)&&21!==e.last(O.getChildren(a)).kind)return;break;case 161:O=ae.left;break;case 261:O=ae.name;break;case 200:O=ae;break;case 231:O=ae.getFirstToken(a),e.Debug.assert(100===O.kind||103===O.kind);break;default:return}else if(!P&&1===a.languageVariant){if(ae&&206===ae.kind&&(w=ae,ae=ae.parent),y.parent===z)switch(y.kind){case 31:278!==y.parent.kind&&280!==y.parent.kind||(z=y);break;case 43:279===y.parent.kind&&(z=y)}switch(ae.kind){case 281:43===w.kind&&(J=!0,z=w);break;case 221:if(!re(ae))break;case 279:case 278:case 280:K=!0,29===w.kind&&(R=!0,z=w);break;case 288:case 287:19===N.kind&&31===y.kind&&(K=!0);break;case 285:if(ae.initializer===N&&N.end0){var b=function(t,r){if(0===r.length)return t;for(var n=new e.Set,i=new e.Set,a=0,o=r;a90))&&(!!l||le(t,o))}),(function(n,i,a,o){var s;if(!l||e.some(n,(function(t){return l.source===e.stripQuotes(t.moduleSymbol.name)}))){var c=e.find(n,y);if(c){var u=r.tryResolve(n,i,a)||{};if("failed"!==u){var d,_=c;"skipped"!==u&&(_=void 0===(s=u.exportInfo)?c:s,d=u.moduleSpecifier);var p=1===_.exportKind;!function(r,n){var i=e.getSymbolId(r);if(me[i]===t.SortText.GlobalsOrKeywords)return;fe[pe.length]=n,me[i]=P?t.SortText.LocationPriority:t.SortText.AutoImportSuggestions,pe.push(r)}(p&&e.getLocalSymbolForExportDefault(_.symbol)||_.symbol,{kind:d?32:4,moduleSpecifier:d,symbolName:i,exportMapKey:o,exportName:2===_.exportKind?"export=":_.symbol.name,fileName:_.moduleFileName,isDefaultExport:p,moduleSymbol:_.moduleSymbol,isFromPackageJson:_.isFromPackageJson})}}}})),_e=r.skippedAny(),Q|=r.resolvedAny()?8:0,Q|=r.resolvedBeyondLimit()?16:0}))}function y(t){var n=e.tryCast(t.moduleSymbol.valueDeclaration,e.isSourceFile);if(!n){var i=e.stripQuotes(t.moduleSymbol.name);return(!e.JsTyping.nodeCoreModules.has(i)||e.startsWith(i,"node:")===e.shouldUseUriStyleNodeCoreModules(a,r))&&(!g||g.allowsImportingAmbientModule(t.moduleSymbol,he(t.isFromPackageJson)))}return e.isImportableFile(t.isFromPackageJson?m:r,a,n,c,g,he(t.isFromPackageJson),d)}}function Ne(){if(w){var e=w.parent.kind,t=X(w);switch(t){case 27:return 208===e||171===e||209===e||204===e||221===e||179===e||205===e;case 20:return 208===e||171===e||209===e||212===e||191===e;case 22:return 204===e||176===e||162===e;case 141:case 142:case 100:return!0;case 24:return 261===e;case 18:return 257===e||205===e;case 63:return 254===e||221===e;case 15:return 223===e;case 16:return 233===e;case 131:return 169===e||297===e;case 41:return 169===e}if(H(t))return!0}return!1}function we(t){return!!t.parent&&e.isParameter(t.parent)&&e.isConstructorDeclaration(t.parent.parent)&&(e.isParameterPropertyModifier(t.kind)||e.isDeclarationName(t))}function Fe(t,r){return 63!==t.kind&&(26===t.kind||!e.positionsAreOnSameLine(t.end,r,a))}function Pe(t){return e.isFunctionLikeKind(t)&&171!==t}function Ie(e,t){var r=e.expression,n=p.getSymbolAtLocation(r),i=n&&p.getTypeOfSymbolAtLocation(n,r),a=i&&i.properties;a&&a.forEach((function(e){t.add(e.name)}))}function Oe(){pe.forEach((function(r){var n;if(16777216&r.flags){var i=e.getSymbolId(r);me[i]=null!==(n=me[i])&&void 0!==n?n:t.SortText.OptionalMember}}))}function Me(r,n){if(0!==r.size)for(var i=0,a=n;i");return{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:e.createTextSpanFromNode(i.tagName),entries:[{name:o,kind:"class",kindModifiers:void 0,sortText:t.SortText.LocationPriority}]}}return}(y,r);if(L)return L}var R=e.createSortedArray();if(b(r,a)){var B=I(d,R,void 0,_,y,r,n,i,e.getEmitScriptTarget(a),o,p,c,a,l,A,h,N,k,F,E,T,O,N,w);!function(r,n,i,a,o){e.getNameTable(r).forEach((function(r,s){if(r!==n){var c=e.unescapeLeadingUnderscores(s);!i.has(c)&&e.isIdentifierText(c,a)&&(i.add(c),e.insertSorted(o,{name:c,kind:"warning",kindModifiers:"",sortText:t.SortText.JavascriptIdentifiers,isFromUncheckedFile:!0},m))}}))}(r,y.pos,B,e.getEmitScriptTarget(a),R)}else{if(!(g||d&&0!==d.length||0!==S))return;I(d,R,void 0,_,y,r,n,i,e.getEmitScriptTarget(a),o,p,c,a,l,A,h,N,k,F,E,T,O,N,w)}if(0!==S)for(var J=new e.Set(R.map((function(e){return e.name}))),j=0,U=G(S,!P&&e.isSourceFileJS(r));j=0&&!l(r,n[i],115);i--);return e.forEach(a(t.statement),(function(e){s(t,e)&&l(r,e.getFirstToken(),81,86)})),r}function d(e){var t=c(e);if(t)switch(t.kind){case 242:case 243:case 244:case 240:case 241:return u(t);case 249:return _(t)}}function _(t){var r=[];return l(r,t.getFirstToken(),107),e.forEach(t.caseBlock.clauses,(function(n){l(r,n.getFirstToken(),82,88),e.forEach(a(n),(function(e){s(t,e)&&l(r,e.getFirstToken(),81)}))})),r}function p(t,r){var n=[];(l(n,t.getFirstToken(),111),t.catchClause&&l(n,t.catchClause.getFirstToken(),83),t.finallyBlock)&&l(n,e.findChildOfKind(t,96,r),96);return n}function f(t,r){var n=function(t){for(var r=t;r.parent;){var n=r.parent;if(e.isFunctionBlock(n)||305===n.kind)return n;if(e.isTryStatement(n)&&n.tryBlock===r&&n.catchClause)return r;r=n}}(t);if(n){var a=[];return e.forEach(i(n),(function(t){a.push(e.findChildOfKind(t,109,r))})),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,(function(t){a.push(e.findChildOfKind(t,105,r))})),a}}function m(t,r){var n=e.getContainingFunction(t);if(n){var a=[];return e.forEachReturnStatement(e.cast(n.body,e.isBlock),(function(t){a.push(e.findChildOfKind(t,105,r))})),e.forEach(i(n.body),(function(t){a.push(e.findChildOfKind(t,109,r))})),a}}function g(t){var r=e.getContainingFunction(t);if(r){var n=[];return r.modifiers&&r.modifiers.forEach((function(e){l(n,e,131)})),e.forEachChild(r,(function(t){y(t,(function(t){e.isAwaitExpression(t)&&l(n,t.getFirstToken(),132)}))})),n}}function y(t,r){r(t),e.isFunctionLike(t)||e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isModuleDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isTypeNode(t)||e.forEachChild(t,(function(e){return y(e,r)}))}t.getDocumentHighlights=function(t,i,a,o,s){var c=e.getTouchingPropertyName(a,o);if(c.parent&&(e.isJsxOpeningElement(c.parent)&&c.parent.tagName===c||e.isJsxClosingElement(c.parent))){var h=c.parent.parent,v=[h.openingElement,h.closingElement].map((function(e){return n(e.tagName,a)}));return[{fileName:a.fileName,highlightSpans:v}]}return function(t,r,n,i,a){var o=new e.Set(a.map((function(e){return e.fileName}))),s=e.FindAllReferences.getReferenceEntriesForNode(t,r,n,a,i,void 0,o);if(!s)return;var c=e.arrayToMultiMap(s.map(e.FindAllReferences.toHighlightSpan),(function(e){return e.fileName}),(function(e){return e.span})),l=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames());return e.mapDefined(e.arrayFrom(c.entries()),(function(t){var r=t[0],i=t[1];if(!o.has(r)){if(!n.redirectTargetsMap.has(e.toPath(r,n.getCurrentDirectory(),l)))return;var s=n.getSourceFile(r),c=e.find(a,(function(e){return!!e.redirectInfo&&e.redirectInfo.redirectTarget===s}));r=c.fileName,e.Debug.assert(o.has(r))}return{fileName:r,highlightSpans:i}}))}(o,c,t,i,s)||function(t,i){var a=function(t,i){switch(t.kind){case 99:case 91:return e.isIfStatement(t.parent)?function(t,r){for(var i=function(t,r){var n=[];for(;e.isIfStatement(t.parent)&&t.parent.elseStatement===t;)t=t.parent;for(;;){var i=t.getChildren(r);l(n,i[0],99);for(var a=i.length-1;a>=0&&!l(n,i[a],91);a--);if(!t.elseStatement||!e.isIfStatement(t.elseStatement))break;t=t.elseStatement}return n}(t,r),a=[],o=0;o=s.end;d--)if(!e.isWhiteSpaceSingleLine(r.text.charCodeAt(d))){u=!1;break}if(u){a.push({fileName:r.fileName,textSpan:e.createTextSpanFromBounds(s.getStart(),c.end),kind:"reference"}),o++;continue}}a.push(n(i[o],r))}return a}(t.parent,i):void 0;case 105:return c(t.parent,e.isReturnStatement,m);case 109:return c(t.parent,e.isThrowStatement,f);case 111:case 83:case 96:return c(83===t.kind?t.parent.parent:t.parent,e.isTryStatement,p);case 107:return c(t.parent,e.isSwitchStatement,_);case 82:case 88:return e.isDefaultClause(t.parent)||e.isCaseClause(t.parent)?c(t.parent.parent.parent,e.isSwitchStatement,_):void 0;case 81:case 86:return c(t.parent,e.isBreakOrContinueStatement,d);case 97:case 115:case 90:return c(t.parent,(function(t){return e.isIterationStatement(t,!0)}),u);case 134:return s(e.isConstructorDeclaration,[134]);case 136:case 149:return s(e.isAccessor,[136,149]);case 132:return c(t.parent,e.isAwaitExpression,g);case 131:return h(g(t));case 125:return h(function(t){var r=e.getContainingFunction(t);if(!r)return;var n=[];return e.forEachChild(r,(function(t){y(t,(function(t){e.isYieldExpression(t)&&l(n,t.getFirstToken(),125)}))})),n}(t));case 101:return;default:return e.isModifierKind(t.kind)&&(e.isDeclaration(t.parent)||e.isVariableStatement(t.parent))?h((a=t.kind,o=t.parent,e.mapDefined(function(t,n){var i=t.parent;switch(i.kind){case 262:case 305:case 235:case 289:case 290:return 128&n&&e.isClassDeclaration(t)?r(r([],t.members,!0),[t],!1):i.statements;case 171:case 169:case 256:return r(r([],i.parameters,!0),e.isClassLike(i.parent)?i.parent.members:[],!0);case 257:case 226:case 258:case 182:var a=i.members;if(92&n){var o=e.find(i.members,e.isConstructorDeclaration);if(o)return r(r([],a,!0),o.parameters,!0)}else if(128&n)return r(r([],a,!0),[i],!1);return a;case 205:return;default:e.Debug.assertNever(i,"Invalid container kind.")}}(o,e.modifierToFlag(a)),(function(t){return e.findModifier(t,a)})))):void 0}var a,o;function s(r,n){return c(t.parent,r,(function(t){return e.mapDefined(t.symbol.declarations,(function(t){return r(t)?e.find(t.getChildren(i),(function(t){return e.contains(n,t.kind)})):void 0}))}))}function c(e,t,r){return t(e)?h(r(e,i)):void 0}function h(e){return e&&e.map((function(e){return n(e,i)}))}}(t,i);return a&&[{fileName:i.fileName,highlightSpans:a}]}(c,a)}}(e.DocumentHighlights||(e.DocumentHighlights={}))}(c||(c={})),function(e){function t(e){return!!e.sourceFile}function r(r,n,a){void 0===n&&(n="");var o=new e.Map,s=e.createGetCanonicalFileName(!!r);function c(e){return"function"==typeof e.getCompilationSettings?e.getCompilationSettings():e}function l(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!0,o)}function u(e,t,r,n,i,a,o){return _(e,t,c(r),n,i,a,!1,o)}function d(r,n){var i=t(r)?r:r.get(e.Debug.checkDefined(n,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return e.Debug.assert(void 0===n||!i||i.sourceFile.scriptKind===n,"Script kind should match provided ScriptKind:".concat(n," and sourceFile.scriptKind: ").concat(null==i?void 0:i.sourceFile.scriptKind,", !entry: ").concat(!i)),i}function _(r,n,i,s,l,u,_,p){var f,m,g,y;p=e.ensureScriptKind(r,p);var h=c(i),v=i===h?void 0:i,b={languageVersion:6===p?100:e.getEmitScriptTarget(h),impliedNodeFormat:v&&e.getImpliedNodeFormatForFile(n,null===(y=null===(g=null===(m=null===(f=v.getCompilerHost)||void 0===f?void 0:f.call(v))||void 0===m?void 0:m.getModuleResolutionCache)||void 0===g?void 0:g.call(m))||void 0===y?void 0:y.getPackageJsonInfoCache(),v,h),setExternalModuleIndicator:e.getSetExternalModuleIndicator(h)},x=o.size,S=e.getOrUpdate(o,s,(function(){return new e.Map}));if(e.tracing){o.size>x&&e.tracing.instant("session","createdDocumentRegistryBucket",{configFilePath:h.configFilePath,key:s});var D=!e.isDeclarationFileName(n)&&e.forEachEntry(o,(function(e,t){return t!==s&&e.has(n)&&t}));D&&e.tracing.instant("session","documentRegistryBucketOverlap",{path:n,key1:D,key2:s})}var C=S.get(n),T=C&&d(C,p);!T&&a&&((E=a.getDocument(s,n))&&(e.Debug.assert(_),T={sourceFile:E,languageServiceRefCount:0},k()));if(T)T.sourceFile.version!==u&&(T.sourceFile=e.updateLanguageServiceSourceFile(T.sourceFile,l,u,l.getChangeRange(T.sourceFile.scriptSnapshot)),a&&a.setDocument(s,n,T.sourceFile)),_&&T.languageServiceRefCount++;else{var E=e.createLanguageServiceSourceFile(r,l,b,u,!1,p);a&&a.setDocument(s,n,E),T={sourceFile:E,languageServiceRefCount:1},k()}return e.Debug.assert(0!==T.languageServiceRefCount),T.sourceFile;function k(){if(C)if(t(C)){var r=new e.Map;r.set(C.sourceFile.scriptKind,C),r.set(p,T),S.set(n,r)}else C.set(p,T);else S.set(n,T)}}function p(r,n,i){var a=e.Debug.checkDefined(o.get(n)),s=a.get(r),c=d(s,i);c.languageServiceRefCount--,e.Debug.assert(c.languageServiceRefCount>=0),0===c.languageServiceRefCount&&(t(s)?a.delete(r):(s.delete(i),1===s.size&&a.set(r,e.firstDefinedIterator(s.values(),e.identity))))}return{acquireDocument:function(t,r,a,o,u){return l(t,e.toPath(t,n,s),r,i(c(r)),a,o,u)},acquireDocumentWithKey:l,updateDocument:function(t,r,a,o,l){return u(t,e.toPath(t,n,s),r,i(c(r)),a,o,l)},updateDocumentWithKey:u,releaseDocument:function(t,r,a){return p(e.toPath(t,n,s),i(r),a)},releaseDocumentWithKey:p,getLanguageServiceRefCounts:function(t,r){return e.arrayFrom(o.entries(),(function(e){var n=e[0],i=e[1].get(t),a=i&&d(i,r);return[n,a&&a.languageServiceRefCount]}))},reportStats:function(){var r=e.arrayFrom(o.keys()).filter((function(e){return e&&"_"===e.charAt(0)})).map((function(e){var r=o.get(e),n=[];return r.forEach((function(e,r){t(e)?n.push({name:r,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((function(e,t){return n.push({name:r,scriptKind:t,refCount:e.languageServiceRefCount})}))})),n.sort((function(e,t){return t.refCount-e.refCount})),{bucket:e,sourceFiles:n}}));return JSON.stringify(r,void 0,2)},getKeyForCompilationSettings:i}}function n(t){var r;if(null===t||"object"!=typeof t)return""+t;if(e.isArray(t))return"[".concat(null===(r=e.map(t,(function(e){return n(e)})))||void 0===r?void 0:r.join(","),"]");var i="{";for(var a in t)e.hasOwnProperty.call(t,a)&&(i+="".concat(a,": ").concat(n(t[a])));return i+"}"}function i(t){return e.sourceFileAffectingCompilerOptions.map((function(r){return n(e.getCompilerOptionValue(t,r))})).join("|")+(t.pathsBasePath?"|".concat(t.pathsBasePath):void 0)}e.createDocumentRegistry=function(e,t){return r(e,t)},e.createDocumentRegistryInternal=r}(c||(c={})),function(e){!function(t){var r,i;function a(t,r){return e.forEach(305===t.kind?t.statements:t.body.statements,(function(t){return r(t)||u(t)&&e.forEach(t.body&&t.body.statements,r)}))}function o(t,r){if(t.externalModuleIndicator||void 0!==t.imports)for(var n=0,i=t.imports;n2&&(e.Debug.assert(void 0===n),i+=1,a-=1),e.createTextSpanFromBounds(i,a)}function x(e){return 0===e.kind?e.textSpan:b(e.node,e.node.getSourceFile())}function S(t){var r=e.getDeclarationFromName(t);return!!r&&function(t){if(16777216&t.flags)return!0;switch(t.kind){case 221:case 203:case 257:case 226:case 88:case 260:case 299:case 275:case 267:case 265:case 270:case 258:case 338:case 345:case 285:case 261:case 264:case 268:case 274:case 164:case 297:case 259:case 163:return!0;case 296:return!e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent);case 256:case 213:case 171:case 169:case 172:case 173:return!!t.body;case 254:case 167:return!!t.initializer||e.isCatchClause(t.parent);case 168:case 166:case 347:case 340:return!1;default:return e.Debug.failBadSyntaxKind(t)}}(r)||88===t.kind||e.isWriteAccess(t)}function D(t,r){var n;if(!r)return!1;var i=e.getDeclarationFromName(t)||(88===t.kind?t.parent:e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)?t.parent.parent:void 0),a=i&&e.isBinaryExpression(i)?i.left:void 0;return!(!i||!(null===(n=r.declarations)||void 0===n?void 0:n.some((function(e){return e===i||e===a}))))}(i=t.DefinitionKind||(t.DefinitionKind={}))[i.Symbol=0]="Symbol",i[i.Label=1]="Label",i[i.Keyword=2]="Keyword",i[i.This=3]="This",i[i.String=4]="String",i[i.TripleSlashReference=5]="TripleSlashReference",(a=t.EntryKind||(t.EntryKind={}))[a.Span=0]="Span",a[a.Node=1]="Node",a[a.StringLiteral=2]="StringLiteral",a[a.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",a[a.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",t.nodeEntry=c,t.isContextWithStartAndEndNode=l,t.getContextNode=d,t.toContextSpan=_,(o=t.FindReferencesUse||(t.FindReferencesUse={}))[o.Other=0]="Other",o[o.References=1]="References",o[o.Rename=2]="Rename",t.findReferencedSymbols=function(t,r,i,a,o){var c=e.getTouchingPropertyName(a,o),l={use:1},u=s.getReferencedSymbolsForNode(o,c,t,i,r,l),p=t.getTypeChecker(),f=s.getAdjustedNode(c,l),m=function(t){return 88===t.kind||!!e.getDeclarationFromName(t)||e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)}(f)?p.getSymbolAtLocation(f):void 0;return u&&u.length?e.mapDefined(u,(function(t){var i=t.definition,a=t.references;return i&&{definition:p.runWithCancellationToken(r,(function(t){return function(t,r,i){var a=function(){switch(t.type){case 0:var a=y(p=t.symbol,r,i),o=a.displayParts,s=a.kind,c=o.map((function(e){return e.text})).join(""),l=p.declarations&&e.firstOrUndefined(p.declarations),u=l?e.getNameOfDeclaration(l)||l:i;return n(n({},g(u)),{name:c,kind:s,displayParts:o,context:d(l)});case 1:u=t.node;return n(n({},g(u)),{name:u.text,kind:"label",displayParts:[e.displayPart(u.text,e.SymbolDisplayPartKind.text)]});case 2:u=t.node;var _=e.tokenToString(u.kind);return n(n({},g(u)),{name:_,kind:"keyword",displayParts:[{text:_,kind:"keyword"}]});case 3:u=t.node;var p,f=(p=r.getSymbolAtLocation(u))&&e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,p,u.getSourceFile(),e.getContainerNode(u),u).displayParts||[e.textPart("this")];return n(n({},g(u)),{name:"this",kind:"var",displayParts:f});case 4:u=t.node;return n(n({},g(u)),{name:u.text,kind:"var",displayParts:[e.displayPart(e.getTextOfNode(u),e.SymbolDisplayPartKind.stringLiteral)]});case 5:return{textSpan:e.createTextSpanFromRange(t.reference),sourceFile:t.file,name:t.reference.fileName,kind:"string",displayParts:[e.displayPart('"'.concat(t.reference.fileName,'"'),e.SymbolDisplayPartKind.stringLiteral)]};default:return e.Debug.assertNever(t)}}(),o=a.sourceFile,s=a.textSpan,c=a.name,l=a.kind,u=a.displayParts,p=a.context;return n({containerKind:"",containerName:"",fileName:o.fileName,kind:l,name:c,textSpan:s,displayParts:u},_(s,o,p))}(i,t,c)})),references:a.map((function(e){return function(e,t){var r=h(e);return t?n(n({},r),{isDefinition:0!==e.kind&&D(e.node,t)}):r}(e,m)}))}})):void 0},t.getImplementationsAtPosition=function(t,i,a,o,s){var c,l=e.getTouchingPropertyName(o,s),u=p(t,i,a,l,s);if(206===l.parent.kind||203===l.parent.kind||207===l.parent.kind||106===l.kind)c=u&&r([],u,!0);else for(var d=u&&r([],u,!0),_=new e.Map;d&&d.length;){var f=d.shift();if(e.addToSeen(_,e.getNodeId(f.node))){c=e.append(c,f);var m=p(t,i,a,f.node,f.node.pos);m&&d.push.apply(d,m)}}var g=t.getTypeChecker();return e.map(c,(function(t){return function(t,r){var i=v(t);if(0!==t.kind){var a=t.node;return n(n({},i),function(t,r){var n=r.getSymbolAtLocation(e.isDeclaration(t)&&t.name?t.name:t);return n?y(n,r,t):205===t.kind?{kind:"interface",displayParts:[e.punctuationPart(20),e.textPart("object literal"),e.punctuationPart(21)]}:226===t.kind?{kind:"local class",displayParts:[e.punctuationPart(20),e.textPart("anonymous local class"),e.punctuationPart(21)]}:{kind:e.getNodeKind(t),displayParts:[]}}(a,r))}return n(n({},i),{kind:"",displayParts:[]})}(t,g)}))},t.findReferenceOrRenameEntries=function(t,r,n,i,a,o,c){return e.map(m(s.getReferencedSymbolsForNode(a,i,t,n,r,o)),(function(e){return c(e,i,t.getTypeChecker())}))},t.getReferenceEntriesForNode=f,t.toRenameLocation=function(t,r,i,a){return n(n({},v(t)),a&&function(t,r,n){if(0!==t.kind&&e.isIdentifier(r)){var i=t.node,a=t.kind,o=i.parent,s=r.text,c=e.isShorthandPropertyAssignment(o);if(c||e.isObjectBindingElementWithoutPropertyName(o)&&o.name===i&&void 0===o.dotDotDotToken){var l={prefixText:s+": "},u={suffixText:": "+s};if(3===a)return l;if(4===a)return u;if(c){var d=o.parent;return e.isObjectLiteralExpression(d)&&e.isBinaryExpression(d.parent)&&e.isModuleExportsAccessExpression(d.parent.left)?l:u}return l}if(e.isImportSpecifier(o)&&!o.propertyName){var _=e.isExportSpecifier(r.parent)?n.getExportSpecifierLocalTargetSymbol(r.parent):n.getSymbolAtLocation(r);return e.contains(_.declarations,o)?{prefixText:s+" as "}:e.emptyOptions}if(e.isExportSpecifier(o)&&!o.propertyName)return r===t.node||n.getSymbolAtLocation(r)===n.getSymbolAtLocation(t.node)?{prefixText:s+" as "}:{suffixText:" as "+s}}return e.emptyOptions}(t,r,i))},t.toReferenceEntry=h,t.toHighlightSpan=function(e){var t=v(e);if(0===e.kind)return{fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};var r=S(e.node),i=n({textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:2===e.kind||void 0},t.contextSpan&&{contextSpan:t.contextSpan});return{fileName:t.fileName,span:i}},t.getTextSpanOfEntry=x,function(r){function n(t,r){return 1===r.use?t=e.getAdjustedReferenceLocation(t):2===r.use&&(t=e.getAdjustedRenameLocation(t)),t}function i(t,r,n){for(var i,a=0,o=r.get(t.path)||e.emptyArray;a=0&&!(c>n.end);){var l=c+s;0!==c&&e.isIdentifierPart(a.charCodeAt(c-1),99)||l!==o&&e.isIdentifierPart(a.charCodeAt(l),99)||i.push(c),c=a.indexOf(r,c+s+1)}return i}function C(t,r){var n=t.getSourceFile(),i=r.text,a=e.mapDefined(S(n,i,t),(function(t){return t===r||e.isJumpStatementTarget(t)&&e.getTargetLabel(t,i)===r?c(t):void 0}));return[{definition:{type:1,node:r},references:a}]}function T(e,t,r,n){return void 0===n&&(n=!0),r.cancellationToken.throwIfCancellationRequested(),E(e,e,t,r,n)}function E(e,t,r,n,i){if(n.markSearchedSymbols(t,r.allSearchSymbols))for(var a=0,o=D(t,r.text,e);a0;o--){S(t,i=n[o])}return[n.length-1,n[0]]}function S(e,t){var r=h(e,t);m(o,r),l.push(o),u.push(s),s=void 0,o=r}function D(){o.children&&(A(o.children,o),O(o.children)),o=l.pop(),s=u.pop()}function C(e,t,r){S(e,r),k(t),D()}function T(t){t.initializer&&function(e){switch(e.kind){case 214:case 213:case 226:return!0;default:return!1}}(t.initializer)?(S(t),e.forEachChild(t.initializer,k),D()):C(t,t.initializer)}function E(t){return!e.hasDynamicName(t)||221!==t.kind&&e.isPropertyAccessExpression(t.name.expression)&&e.isIdentifier(t.name.expression.expression)&&"Symbol"===e.idText(t.name.expression.expression)}function k(t){var r;if(i.throwIfCancellationRequested(),t&&!e.isToken(t))switch(t.kind){case 171:var n=t;C(n,n.body);for(var a=0,o=n.parameters;a0&&(S(j,L),e.forEachChild(j.right,k),D()):e.isFunctionExpression(j.right)||e.isArrowFunction(j.right)?C(t,j.right,L):(S(j,L),C(t,j.right,I.name),D()),void b(M);case 7:case 9:var R=t,B=(L=7===P?R.arguments[0]:R.arguments[0].expression,R.arguments[1]),J=x(t,L);M=J[0];return S(t,J[1]),S(t,e.setTextRange(e.factory.createIdentifier(B.text),B)),k(t.arguments[2]),D(),D(),void b(M);case 5:var j,U=(I=(j=t).left).expression;if(e.isIdentifier(U)&&"prototype"!==e.getElementOrPropertyAccessName(I)&&s&&s.has(U.text))return void(e.isFunctionExpression(j.right)||e.isArrowFunction(j.right)?C(t,j.right,U):e.isBindableStaticAccessExpression(I)&&(S(j,U),C(j.left,j.right,e.getNameOrArgument(I)),D()));break;case 4:case 0:case 8:break;default:e.Debug.assertNever(P)}default:e.hasJSDocNodes(t)&&e.forEach(t.jsDoc,(function(t){e.forEach(t.tags,(function(t){e.isJSDocTypeAlias(t)&&y(t)}))})),e.forEachChild(t,k)}}function A(t,r){var n=new e.Map;e.filterMutate(t,(function(t,i){var a=t.name||e.getNameOfDeclaration(t.node),o=a&&p(a);if(!o)return!0;var s=n.get(o);if(!s)return n.set(o,t),!0;if(s instanceof Array){for(var c=0,l=s;c0)return Q(n)}switch(t.kind){case 305:var i=t;return e.isExternalModule(i)?'"'.concat(e.escapeString(e.getBaseFileName(e.removeFileExtension(e.normalizePath(i.fileName)))),'"'):"";case 271:return e.isExportAssignment(t)&&t.isExportEquals?"export=":"default";case 214:case 256:case 213:case 257:case 226:return 512&e.getSyntacticModifierFlags(t)?"default":W(t);case 171:return"constructor";case 175:return"new()";case 174:return"()";case 176:return"[]";default:return""}}function B(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:q(t.node),spans:j(t),nameSpan:t.name&&G(t.name),childItems:e.map(t.children,B)}}function J(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:q(t.node),spans:j(t),childItems:e.map(t.children,(function(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:e.getNodeModifiers(t.node),spans:j(t),childItems:d,indent:0,bolded:!1,grayed:!1}}))||d,indent:t.indent,bolded:!1,grayed:!1}}function j(e){var t=[G(e.node)];if(e.additionalNodes)for(var r=0,n=e.additionalNodes;r0)return Q(e.declarationNameToString(t.name));if(e.isVariableDeclaration(r))return Q(e.declarationNameToString(r.name));if(e.isBinaryExpression(r)&&63===r.operatorToken.kind)return p(r.left).replace(c,"");if(e.isPropertyAssignment(r))return p(r.name);if(512&e.getSyntacticModifierFlags(t))return"default";if(e.isClassLike(t))return"";if(e.isCallExpression(r)){var n=H(r.expression);if(void 0!==n){if((n=Q(n)).length>150)return"".concat(n," callback");var i=Q(e.mapDefined(r.arguments,(function(t){return e.isStringLiteralLike(t)?t.getText(a):void 0})).join(", "));return"".concat(n,"(").concat(i,") callback")}}return""}function H(t){if(e.isIdentifier(t))return t.text;if(e.isPropertyAccessExpression(t)){var r=H(t.expression),n=t.name.text;return void 0===r?n:"".concat(r,".").concat(n)}}function Q(e){return(e=e.length>150?e.substring(0,150)+"...":e).replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}}(e.NavigationBar||(e.NavigationBar={}))}(c||(c={})),function(e){!function(t){function r(t,r){for(var i=e.createScanner(t.languageVersion,!1,t.languageVariant),a=[],o=0,s=0,c=r;s=2)return!0}return!1}function i(t,r){var n=e.isStringLiteral(r)&&r.text;return e.isString(n)&&e.some(t.moduleAugmentations,(function(t){return e.isStringLiteral(t)&&t.text===n}))}function a(t){return void 0!==t&&e.isStringLiteralLike(t)?t.text:void 0}function o(t){var r;if(0===t.length)return t;var n=function(t){for(var r,n={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]},a=0,o=t;a0?m[0]:h[0],A=0===E.length?S?void 0:e.factory.createNamedImports(e.emptyArray):0===h.length?e.factory.createNamedImports(E):e.factory.updateNamedImports(h[0].importClause.namedBindings,E);f&&S&&A?(s.push(c(k,S,void 0)),s.push(c(null!==(r=h[0])&&void 0!==r?r:k,void 0,A))):s.push(c(k,S,A))}}else{var N=m[0];s.push(c(N,N.importClause.name,y[0].importClause.namedBindings))}}return s}function s(t){if(0===t.length)return t;var r=function(e){for(var t,r=[],n=[],i=0,a=e;i...")}function d(t){var n=e.createTextSpanFromBounds(t.openingFragment.getStart(r),t.closingFragment.getEnd());return l(n,"code",n,!1,"<>...")}function _(e){if(0!==e.properties.length)return s(e.getStart(r),e.getEnd(),"code")}function p(e){if(14!==e.kind||0!==e.text.length)return s(e.getStart(r),e.getEnd(),"code")}function f(t,r){return void 0===r&&(r=18),m(t,!1,!e.isArrayLiteralExpression(t.parent)&&!e.isCallExpression(t.parent),r)}function m(n,i,a,o,s){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=18),void 0===s&&(s=18===o?19:23);var l=e.findChildOfKind(t,o,r),u=e.findChildOfKind(t,s,r);return l&&u&&c(l,u,n,r,i,a)}function g(t){return t.length?l(e.createTextSpanFromRange(t),"code"):void 0}function y(t){if(!e.positionsAreOnSameLine(t.getStart(),t.getEnd(),r))return l(e.createTextSpanFromBounds(t.getStart(),t.getEnd()),"code",e.createTextSpanFromNode(t))}}(r,t);_&&i.push(_),u--,e.isCallExpression(r)?(u++,g(r.expression),u--,r.arguments.forEach(g),null===(d=r.typeArguments)||void 0===d||d.forEach(g)):e.isIfStatement(r)&&r.elseStatement&&e.isIfStatement(r.elseStatement)?(g(r.expression),g(r.thenStatement),u++,g(r.elseStatement),u--):r.forEachChild(g),u++}}}(t,n,u),function(t,r){for(var n=[],a=t.getLineStarts(),o=0,s=a;o1&&a.push(s(c,l,"comment"))}}function o(t,r,n,i){e.isJsxText(t)||a(t.pos,r,n,i)}function s(t,r,n){return l(e.createTextSpanFromBounds(t,r),n)}function c(t,r,n,i,a,o){return void 0===a&&(a=!1),void 0===o&&(o=!0),l(e.createTextSpanFromBounds(o?t.getFullStart():t.getStart(i),r.getEnd()),"code",e.createTextSpanFromNode(n,i),a)}function l(e,t,r,n,i){return void 0===r&&(r=e),void 0===n&&(n=!1),void 0===i&&(i="..."),{textSpan:e,kind:t,hintSpan:r,bannerText:i,autoCollapse:n}}}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}))}(c||(c={})),function(e){var t;function r(e,t){return{kind:e,isCaseSensitive:t}}function n(e,t){var r=t.get(e);return r||t.set(e,r=h(e)),r}function i(i,a,o){var s=function(e,t){for(var r=e.length-t.length,n=function(r){if(T(t,(function(t,n){return _(e.charCodeAt(n+r))===t})))return{value:r}},i=0;i<=r;i++){var a=n(i);if("object"==typeof a)return a.value}return-1}(i,a.textLowerCase);if(0===s)return r(a.text.length===i.length?t.exact:t.prefix,e.startsWith(i,a.text));if(a.isLowerCase){if(-1===s)return;for(var d=0,p=n(i,o);d0)return r(t.substring,!0);if(a.characterSpans.length>0){var m=n(i,o),g=!!l(i,m,a,!1)||!l(i,m,a,!0)&&void 0;if(void 0!==g)return r(t.camelCase,g)}}}function a(e,t,r){if(T(t.totalTextChunk.text,(function(e){return 32!==e&&42!==e}))){var n=i(e,t.totalTextChunk,r);if(n)return n}for(var a,s=0,c=t.subWordTextChunks;s=65&&t<=90)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return!1;var r=String.fromCharCode(t);return r===r.toUpperCase()}function d(t){if(t>=97&&t<=122)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return!1;var r=String.fromCharCode(t);return r===r.toLowerCase()}function _(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){return u(e)||d(e)||p(e)||95===e||36===e}function m(e){for(var t=[],r=0,n=0,i=0;i0&&(t.push(g(e.substr(r,n))),n=0)}return n>0&&t.push(g(e.substr(r,n))),t}function g(e){var t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:y(e)}}function y(e){return v(e,!1)}function h(e){return v(e,!0)}function v(t,r){for(var n=[],i=0,a=1;at.length)return;for(var c=n.length-2,l=t.length-1;c>=0;c-=1,l-=1)s=o(s,a(t[l],n[c],i));return s}(t,i,n,r)},getMatchForLastSegmentOfPattern:function(t){return a(t,e.last(n),r)},patternContainsDots:n.length>1}},e.breakIntoCharacterSpans=y,e.breakIntoWordSpans=h}(c||(c={})),function(e){e.preProcessFile=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i,a,o,s={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},c=[],l=0,u=!1;function d(){return a=o,18===(o=e.scanner.scan())?l++:19===o&&l--,o}function _(){var t=e.scanner.getTokenValue(),r=e.scanner.getTokenPos();return{fileName:t,pos:r,end:r+t.length}}function p(){c.push(_()),f()}function f(){0===l&&(u=!0)}function m(){var t=e.scanner.getToken();return 135===t&&(141===(t=d())&&10===(t=d())&&(i||(i=[]),i.push({ref:_(),depth:l})),!0)}function g(){if(24===a)return!1;var t=e.scanner.getToken();if(100===t){if(20===(t=d())){if(10===(t=d())||14===t)return p(),!0}else{if(10===t)return p(),!0;if(152===t){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 156!==t&&(41===t||18===t||79===t||e.isKeyword(t))}));r&&(t=d())}if(79===t||e.isKeyword(t))if(156===(t=d())){if(10===(t=d()))return p(),!0}else if(63===t){if(h(!0))return!0}else{if(27!==t)return!0;t=d()}if(18===t){for(t=d();19!==t&&1!==t;)t=d();19===t&&156===(t=d())&&10===(t=d())&&p()}else 41===t&&127===(t=d())&&(79===(t=d())||e.isKeyword(t))&&156===(t=d())&&10===(t=d())&&p()}return!0}return!1}function y(){var t=e.scanner.getToken();if(93===t){if(f(),152===(t=d())){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 41===t||18===t}));r&&(t=d())}if(18===t){for(t=d();19!==t&&1!==t;)t=d();19===t&&156===(t=d())&&10===(t=d())&&p()}else if(41===t)156===(t=d())&&10===(t=d())&&p();else if(100===t){if(152===(t=d())){r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 79===t||e.isKeyword(t)}));r&&(t=d())}if((79===t||e.isKeyword(t))&&63===(t=d())&&h(!0))return!0}return!0}return!1}function h(t,r){void 0===r&&(r=!1);var n=t?d():e.scanner.getToken();return 146===n&&(20===(n=d())&&(10===(n=d())||r&&14===n)&&p(),!0)}function v(){var t=e.scanner.getToken();if(79===t&&"define"===e.scanner.getTokenValue()){if(20!==(t=d()))return!0;if(10===(t=d())||14===t){if(27!==(t=d()))return!0;t=d()}if(22!==t)return!0;for(t=d();23!==t&&1!==t;)10!==t&&14!==t||p(),t=d();return!0}return!1}if(r&&function(){for(e.scanner.setText(t),d();1!==e.scanner.getToken();){if(15===e.scanner.getToken()){var r=[e.scanner.getToken()],i=e.scanner.scan();e:for(;e.length(r);){switch(i){case 1:break e;case 100:g();break;case 15:r.push(i);break;case 18:e.length(r)&&r.push(i);break;case 19:e.length(r)&&(15===e.lastOrUndefined(r)?17===e.scanner.reScanTemplateToken(!1)&&r.pop():r.pop())}i=e.scanner.scan()}d()}m()||g()||y()||n&&(h(!1,!0)||v())||d()}e.scanner.setText(void 0)}(),e.processCommentPragmas(s,t),e.processPragmasIntoFields(s,e.noop),u){if(i)for(var b=0,x=i;bt)break e;var h=e.singleOrUndefined(e.getTrailingCommentRanges(i.text,g.end));if(h&&2===h.kind&&D(h.pos,h.end),r(i,t,g)){if(e.isBlock(g)||e.isTemplateSpan(g)||e.isTemplateHead(g)||e.isTemplateTail(g)||m&&e.isTemplateHead(m)||e.isVariableDeclarationList(g)&&e.isVariableStatement(_)||e.isSyntaxList(g)&&e.isVariableDeclarationList(_)||e.isVariableDeclaration(g)&&e.isSyntaxList(_)&&1===p.length||e.isJSDocTypeExpression(g)||e.isJSDocSignature(g)||e.isJSDocTypeLiteral(g)){_=g;break}if(e.isTemplateSpan(_)&&y&&e.isTemplateMiddleOrTemplateTail(y))S(g.getFullStart()-"${".length,y.getStart()+"}".length);var v=e.isSyntaxList(g)&&(c=void 0,18===(c=(s=m)&&s.kind)||22===c||20===c||280===c)&&l(y)&&!e.positionsAreOnSameLine(m.getStart(),y.getStart(),i),b=v?m.getEnd():g.getStart(),x=v?y.getStart():u(i,g);e.hasJSDocNodes(g)&&(null===(o=g.jsDoc)||void 0===o?void 0:o.length)&&S(e.first(g.jsDoc).getStart(),x),S(b,x),(e.isStringLiteral(g)||e.isTemplateLiteral(g))&&S(b+1,x-1),_=g;break}if(f===p.length-1)break e}}return d;function S(r,i){if(r!==i){var a=e.createTextSpanFromBounds(r,i);(!d||!e.textSpansEqual(a,d.textSpan)&&e.textSpanIntersectsWithPosition(a,t))&&(d=n({textSpan:a},d&&{parent:d}))}}function D(e,t){S(e,t);for(var r=e;47===i.text.charCodeAt(r);)r++;S(r,t)}};var i=e.or(e.isImportDeclaration,e.isImportEqualsDeclaration);function a(t){if(e.isSourceFile(t))return o(t.getChildAt(0).getChildren(),i);if(e.isMappedTypeNode(t)){var r=t.getChildren(),n=r[0],a=r.slice(1),l=e.Debug.checkDefined(a.pop());e.Debug.assertEqual(n.kind,18),e.Debug.assertEqual(l.kind,19);var u=o(a,(function(e){return e===t.readonlyToken||145===e.kind||e===t.questionToken||57===e.kind})),d=o(u,(function(e){var t=e.kind;return 22===t||163===t||23===t}));return[n,c(s(d,(function(e){return 58===e.kind}))),l]}if(e.isPropertySignature(t))return s(a=o(t.getChildren(),(function(r){return r===t.name||e.contains(t.modifiers,r)})),(function(e){return 58===e.kind}));if(e.isParameter(t)){var _=o(t.getChildren(),(function(e){return e===t.dotDotDotToken||e===t.name}));return s(o(_,(function(e){return e===_[0]||e===t.questionToken})),(function(e){return 63===e.kind}))}return e.isBindingElement(t)?s(t.getChildren(),(function(e){return 63===e.kind})):t.getChildren()}function o(e,t){for(var r,n=[],i=0,a=e;i0&&27===e.last(n).kind&&i++;return i}(a,e.isInString(n,r,t));0!==o&&e.Debug.assertLessThan(o,s);var c=function(t,r){var n=t.getFullStart(),i=e.skipTrivia(r.text,t.getEnd(),!1);return e.createTextSpan(n,i-n)}(a,n);return{list:a,argumentIndex:o,argumentCount:s,argumentsSpan:c}}}function s(t,r,n){var i=t.parent;if(e.isCallOrNewExpression(i)){var a=i,s=o(t,r,n);if(!s)return;var c=s.list,l=s.argumentIndex,u=s.argumentCount,d=s.argumentsSpan;return{isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:a},argumentsSpan:d,argumentIndex:l,argumentCount:u}}if(e.isNoSubstitutionTemplateLiteral(t)&&e.isTaggedTemplateExpression(i))return e.isInsideTemplateLiteral(t,r,n)?_(i,0,n):void 0;if(e.isTemplateHead(t)&&210===i.parent.kind){var p=i,f=p.parent;return e.Debug.assert(223===p.kind),_(f,l=e.isInsideTemplateLiteral(t,r,n)?0:1,n)}if(e.isTemplateSpan(i)&&e.isTaggedTemplateExpression(i.parent.parent)){var m=i;f=i.parent.parent;if(e.isTemplateTail(t)&&!e.isInsideTemplateLiteral(t,r,n))return;l=function(t,r,n,i){if(e.Debug.assert(n>=r.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralToken(r))return e.isInsideTemplateLiteral(r,n,i)?0:t+2;return t+1}(m.parent.templateSpans.indexOf(m),t,r,n);return _(f,l,n)}if(e.isJsxOpeningLikeElement(i)){var g=i.attributes.pos,y=e.skipTrivia(n.text,i.attributes.end,!1);return{isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:e.createTextSpan(g,y-g),argumentIndex:0,argumentCount:1}}var h=e.getPossibleTypeArgumentsInfo(t,n);if(h){var v=h.called,b=h.nTypeArguments;return{isTypeParameterList:!0,invocation:a={kind:1,called:v},argumentsSpan:d=e.createTextSpanFromBounds(v.getStart(n),t.end),argumentIndex:b,argumentCount:b+1}}}function c(t){return e.isBinaryExpression(t.parent)?c(t.parent):t}function l(t){return e.isBinaryExpression(t.left)?l(t.left)+1:2}function u(t){return"__type"===t.name&&e.firstDefined(t.declarations,(function(t){return e.isFunctionTypeNode(t)?t.parent.symbol:void 0}))||t}function d(e,t){for(var r=0,n=0,i=e.getChildren();n=0&&i.length>a+1),i[a+1]}function m(t){return 0===t.kind?e.getInvokedExpression(t.node):t.called}function g(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}!function(e){e[e.Call=0]="Call",e[e.TypeArgs=1]="TypeArgs",e[e.Contextual=2]="Contextual"}(n||(n={})),t.getSignatureHelpItems=function(t,r,n,i,d){var _=t.getTypeChecker(),p=e.findTokenOnLeftOfPosition(r,n);if(p){var f=!!i&&"characterTyped"===i.kind;if(!f||!e.isInString(r,n,p)&&!e.isInComment(r,n)){var y=!!i&&"invoked"===i.kind,b=function(t,r,n,i,a){for(var d=function(t){e.Debug.assert(e.rangeContainsRange(t.parent,t),"Not a subspan",(function(){return"Child: ".concat(e.Debug.formatSyntaxKind(t.kind),", parent: ").concat(e.Debug.formatSyntaxKind(t.parent.kind))}));var a=function(t,r,n,i){return function(t,r,n,i){var a=function(t,r,n,i){if(20!==t.kind&&27!==t.kind)return;var a=t.parent;switch(a.kind){case 212:case 169:case 213:case 214:var s=o(t,n,r);if(!s)return;var u=s.argumentIndex,d=s.argumentCount,_=s.argumentsSpan,p=e.isMethodDeclaration(a)?i.getContextualTypeForObjectLiteralElement(a):i.getContextualType(a);return p&&{contextualType:p,argumentIndex:u,argumentCount:d,argumentsSpan:_};case 221:var f=c(a),m=i.getContextualType(f),g=20===t.kind?0:l(a)-1,y=l(f);return m&&{contextualType:m,argumentIndex:g,argumentCount:y,argumentsSpan:e.createTextSpanFromNode(a)};default:return}}(t,n,r,i);if(!a)return;var s=a.contextualType,d=a.argumentIndex,_=a.argumentCount,p=a.argumentsSpan,f=s.getNonNullableType(),m=f.symbol;if(void 0===m)return;var g=e.lastOrUndefined(f.getCallSignatures());return void 0===g?void 0:{isTypeParameterList:!1,invocation:{kind:2,signature:g,node:t,symbol:u(m)},argumentsSpan:p,argumentIndex:d,argumentCount:_}}(t,r,n,i)||s(t,r,n)}(t,r,n,i);if(a)return{value:a}},_=t;!e.isSourceFile(_)&&(a||!e.isBlock(_));_=_.parent){var p=d(_);if("object"==typeof p)return p.value}return}(p,n,r,_,y);if(b){d.throwIfCancellationRequested();var x=function(t,r,n,i,o){var s=t.invocation,c=t.argumentCount;switch(s.kind){case 0:if(o&&!function(t,r,n){if(!e.isCallOrNewExpression(r))return!1;var i=r.getChildren(n);switch(t.kind){case 20:return e.contains(i,t);case 27:var o=e.findContainingList(t);return!!o&&e.contains(i,o);case 29:return a(t,n,r.expression);default:return!1}}(i,s.node,n))return;var l=[],u=r.getResolvedSignatureForSignatureHelp(s.node,l,c);return 0===l.length?void 0:{kind:0,candidates:l,resolvedSignature:u};case 1:var d=s.called;if(o&&!a(i,n,e.isIdentifier(d)?d.parent:d))return;if(0!==(l=e.getPossibleGenericSignatures(d,c,r)).length)return{kind:0,candidates:l,resolvedSignature:e.first(l)};var _=r.getSymbolAtLocation(d);return _&&{kind:1,symbol:_};case 2:return{kind:0,candidates:[s.signature],resolvedSignature:s.signature};default:return e.Debug.assertNever(s)}}(b,_,r,p,f);return d.throwIfCancellationRequested(),x?_.runWithCancellationToken(d,(function(e){return 0===x.kind?h(x.candidates,x.resolvedSignature,b,r,e):function(e,t,r,n){var i=t.argumentCount,a=t.argumentsSpan,o=t.invocation,s=t.argumentIndex,c=n.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);return c?{items:[v(e,c,n,g(o),r)],applicableSpan:a,selectedItemIndex:0,argumentIndex:s,argumentCount:i}:void 0}(x.symbol,b,r,e)})):e.isSourceFileJS(r)?function(t,r,n){if(2===t.invocation.kind)return;var i=m(t.invocation),a=e.isPropertyAccessExpression(i)?i.name.text:void 0,o=r.getTypeChecker();return void 0===a?void 0:e.firstDefined(r.getSourceFiles(),(function(r){return e.firstDefined(r.getNamedDeclarations().get(a),(function(e){var i=e.symbol&&o.getTypeOfSymbolAtLocation(e.symbol,e),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,(function(e){return h(a,a[0],t,r,e,!0)}))}))}))}(b,t,d):void 0}}}},function(e){e[e.Candidate=0]="Candidate",e[e.Type=1]="Type"}(i||(i={})),t.getArgumentInfoForCompletions=function(e,t,r){var n=s(e,t,r);return!n||n.isTypeParameterList||0!==n.invocation.kind?void 0:{invocation:n.invocation.node,argumentCount:n.argumentCount,argumentIndex:n.argumentIndex}};var y=70246400;function h(t,n,i,a,o,s){var c,l=i.isTypeParameterList,u=i.argumentCount,d=i.argumentsSpan,_=i.invocation,p=i.argumentIndex,f=g(_),y=2===_.kind?_.symbol:o.getSymbolAtLocation(m(_))||s&&(null===(c=n.declaration)||void 0===c?void 0:c.symbol),h=y?e.symbolToDisplayParts(o,y,s?a:void 0,void 0):e.emptyArray,v=e.map(t,(function(t){return function(t,n,i,a,o,s){var c=(i?x:S)(t,a,o,s);return e.map(c,(function(i){var s=i.isVariadic,c=i.parameters,l=i.prefix,u=i.suffix,d=r(r([],n,!0),l,!0),_=r(r([],u,!0),function(t,r,n){return e.mapToDisplayParts((function(e){e.writePunctuation(":"),e.writeSpace(" ");var i=n.getTypePredicateOfSignature(t);i?n.writeTypePredicate(i,r,void 0,e):n.writeType(n.getReturnTypeOfSignature(t),r,void 0,e)}))}(t,o,a),!0),p=t.getDocumentationComment(a),f=t.getJsDocTags();return{isVariadic:s,prefixDisplayParts:d,suffixDisplayParts:_,separatorDisplayParts:b,parameters:c,documentation:p,tags:f}}))}(t,h,l,o,f,a)}));0!==p&&e.Debug.assertLessThan(p,u);for(var D=0,C=0,T=0;T1))for(var k=0,A=0,N=E;A=u){D=C+k;break}k++}C+=E.length}e.Debug.assert(-1!==D);var F={items:e.flatMapToMutable(v,e.identity),applicableSpan:d,selectedItemIndex:D,argumentIndex:p,argumentCount:u},P=F.items[D];if(P.isVariadic){var I=e.findIndex(P.parameters,(function(e){return!!e.isRest}));-1t?e.substr(0,t-"...".length)+"...":e}function x(t){var r=e.createPrinter({removeComments:!0});return e.usingSingleLineStringWriter((function(i){var a=u.typeToTypeNode(t,void 0,71286784,i);e.Debug.assertIsDefined(a,"should always get typenode"),r.writeNode(4,a,n,i)}))}}}(e.InlayHints||(e.InlayHints={}))}(c||(c={})),function(e){var t=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;function r(t,r,n){var i=e.tryParseRawSourceMap(r);if(i&&i.sources&&i.file&&i.mappings&&(!i.sourcesContent||!i.sourcesContent.some(e.isString)))return e.createDocumentPositionMapper(t,i,n)}e.getSourceMapper=function(t){var r=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),n=t.getCurrentDirectory(),i=new e.Map,a=new e.Map;return{tryGetSourcePosition:function t(r){if(!e.isDeclarationFileName(r.fileName))return;if(!c(r.fileName))return;var n=s(r.fileName).getSourcePosition(r);return n&&n!==r?t(n)||n:void 0},tryGetGeneratedPosition:function(i){if(e.isDeclarationFileName(i.fileName))return;var a=c(i.fileName);if(!a)return;var o=t.getProgram();if(o.isSourceOfProjectReferenceRedirect(a.fileName))return;var l=o.getCompilerOptions(),u=e.outFile(l),d=u?e.removeFileExtension(u)+".d.ts":e.getDeclarationEmitOutputFilePathWorker(i.fileName,o.getCompilerOptions(),n,o.getCommonSourceDirectory(),r);if(void 0===d)return;var _=s(d,i.fileName).getGeneratedPosition(i);return _===i?void 0:_},toLineColumnOffset:function(e,t){return u(e).getLineAndCharacterOfPosition(t)},clearCache:function(){i.clear(),a.clear()}};function o(t){return e.toPath(t,n,r)}function s(n,i){var s,c=o(n),l=a.get(c);if(l)return l;if(t.getDocumentPositionMapper)s=t.getDocumentPositionMapper(n,i);else if(t.readFile){var d=u(n);s=d&&e.getDocumentPositionMapper({getSourceFileLike:u,getCanonicalFileName:r,log:function(e){return t.log(e)}},n,e.getLineInfo(d.text,e.getLineStarts(d)),(function(e){return!t.fileExists||t.fileExists(e)?t.readFile(e):void 0}))}return a.set(c,s||e.identitySourceMapConsumer),s||e.identitySourceMapConsumer}function c(e){var r=t.getProgram();if(r){var n=o(e),i=r.getSourceFileByPath(n);return i&&i.resolvedPath===n?i:void 0}}function l(r){var n=o(r),a=i.get(n);if(void 0!==a)return a||void 0;if(t.readFile&&(!t.fileExists||t.fileExists(n))){var s=t.readFile(n),c=!!s&&function(t,r){return{text:t,lineMap:r,getLineAndCharacterOfPosition:function(t){return e.computeLineAndCharacterOfPosition(e.getLineStarts(this),t)}}}(s);return i.set(n,c),c||void 0}i.set(n,!1)}function u(e){return t.getSourceFileLike?t.getSourceFileLike(e):c(e)||l(e)}},e.getDocumentPositionMapper=function(n,i,a,o){var s=e.tryGetSourceMappingURL(a);if(s){var c=t.exec(s);if(c){if(c[1]){var l=c[1];return r(n,e.base64decode(e.sys,l),i)}s=void 0}}var u=[];s&&u.push(s),u.push(i+".map");for(var d=s&&e.getNormalizedAbsolutePath(s,e.getDirectoryPath(i)),_=0,p=u;_n)&&(t.arguments.length0?e.arrayFrom(n.values()).join(","):""},t.getSymbolDisplayPartsDocumentationAndSymbolKind=function t(a,o,s,c,l,u,d){var _;void 0===u&&(u=e.getMeaningFromLocation(l));var p,f,m,g,y=[],h=[],v=[],b=e.getCombinedLocalAndExportSymbolFlags(o),x=1&u?i(a,o,l):"",S=!1,D=108===l.kind&&e.isInExpressionContext(l)||e.isThisInTypeQuery(l),C=!1;if(108===l.kind&&!D)return{displayParts:[e.keywordPart(108)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==x||32&b||2097152&b){if("getter"===x||"setter"===x)if(q=e.find(o.declarations,(function(e){return e.name===l})))switch(q.kind){case 172:x="getter";break;case 173:x="setter";break;default:e.Debug.assertNever(q)}else x="property";var T=void 0;if(p=D?a.getTypeAtLocation(l):a.getTypeOfSymbolAtLocation(o,l),l.parent&&206===l.parent.kind){var E=l.parent.name;(E===l||E&&0===E.getFullWidth())&&(l=l.parent)}var k=void 0;if(e.isCallOrNewExpression(l)?k=l:(e.isCallExpressionTarget(l)||e.isNewExpressionTarget(l)||l.parent&&(e.isJsxOpeningLikeElement(l.parent)||e.isTaggedTemplateExpression(l.parent))&&e.isFunctionLike(o.valueDeclaration))&&(k=l.parent),k){T=a.getResolvedSignature(k);var A=209===k.kind||e.isCallExpression(k)&&106===k.expression.kind,N=A?p.getConstructSignatures():p.getCallSignatures();if(!T||e.contains(N,T.target)||e.contains(N,T)||(T=N.length?N[0]:void 0),T){switch(A&&32&b?(x="constructor",te(p.symbol,x)):2097152&b?(re(x="alias"),y.push(e.spacePart()),A&&(4&T.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ee(o)):te(o,x),x){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":y.push(e.punctuationPart(58)),y.push(e.spacePart()),16&e.getObjectFlags(p)||!p.symbol||(e.addRange(y,e.symbolToDisplayParts(a,p.symbol,c,void 0,5)),y.push(e.lineBreakPart())),A&&(4&T.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ne(T,N,262144);break;default:ne(T,N)}S=!0,C=N.length>1}}else if(e.isNameOfFunctionDeclaration(l)&&!(98304&b)||134===l.kind&&171===l.parent.kind){var w=l.parent,F=o.declarations&&e.find(o.declarations,(function(e){return e===(134===l.kind?w.parent:w)}));if(F){N=171===w.kind?p.getNonNullableType().getConstructSignatures():p.getNonNullableType().getCallSignatures();T=a.isImplementationOfOverload(w)?N[0]:a.getSignatureFromDeclaration(w),171===w.kind?(x="constructor",te(p.symbol,x)):te(174!==w.kind||2048&p.symbol.flags||4096&p.symbol.flags?o:p.symbol,x),T&&ne(T,N),S=!0,C=N.length>1}}}if(32&b&&!S&&!D&&(Y(),e.getDeclarationOfKind(o,226)?re("local class"):y.push(e.keywordPart(84)),y.push(e.spacePart()),ee(o),ie(o,s)),64&b&&2&u&&($(),y.push(e.keywordPart(118)),y.push(e.spacePart()),ee(o),ie(o,s)),524288&b&&2&u&&($(),y.push(e.keywordPart(152)),y.push(e.spacePart()),ee(o),ie(o,s),y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(a,e.isConstTypeReference(l.parent)?a.getTypeAtLocation(l.parent):a.getDeclaredTypeOfSymbol(o),c,8388608))),384&b&&($(),e.some(o.declarations,(function(t){return e.isEnumDeclaration(t)&&e.isEnumConst(t)}))&&(y.push(e.keywordPart(85)),y.push(e.spacePart())),y.push(e.keywordPart(92)),y.push(e.spacePart()),ee(o)),1536&b&&!D){$();var P=(q=e.getDeclarationOfKind(o,261))&&q.name&&79===q.name.kind;y.push(e.keywordPart(P?142:141)),y.push(e.spacePart()),ee(o)}if(262144&b&&2&u)if($(),y.push(e.punctuationPart(20)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(21)),y.push(e.spacePart()),ee(o),o.parent)Z(),ee(o.parent,c),ie(o.parent,c);else{var I=e.getDeclarationOfKind(o,163);if(void 0===I)return e.Debug.fail();if(q=I.parent)if(e.isFunctionLikeKind(q.kind)){Z();T=a.getSignatureFromDeclaration(q);175===q.kind?(y.push(e.keywordPart(103)),y.push(e.spacePart())):174!==q.kind&&q.name&&ee(q.symbol),e.addRange(y,e.signatureToDisplayParts(a,T,s,32))}else 259===q.kind&&(Z(),y.push(e.keywordPart(152)),y.push(e.spacePart()),ee(q.symbol),ie(q.symbol,s))}if(8&b&&(x="enum member",te(o,"enum member"),299===(null==(q=null===(_=o.declarations)||void 0===_?void 0:_[0])?void 0:q.kind))){var O=a.getConstantValue(q);void 0!==O&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.displayPart(e.getTextOfConstantValue(O),"number"==typeof O?e.SymbolDisplayPartKind.numericLiteral:e.SymbolDisplayPartKind.stringLiteral)))}if(2097152&o.flags){if($(),!S){var M=a.getAliasedSymbol(o);if(M!==o&&M.declarations&&M.declarations.length>0){var L=M.declarations[0],R=e.getNameOfDeclaration(L);if(R){var B=e.isModuleWithStringLiteralName(L)&&e.hasSyntacticModifier(L,2),J="default"!==o.name&&!B,j=t(a,M,e.getSourceFileOfNode(L),L,R,u,J?o:M);y.push.apply(y,j.displayParts),y.push(e.lineBreakPart()),m=j.documentation,g=j.tags}else m=M.getContextualDocumentationComment(L,a),g=M.getJsDocTags(a)}}if(o.declarations)switch(o.declarations[0].kind){case 264:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(142));break;case 271:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(o.declarations[0].isExportEquals?63:88));break;case 275:y.push(e.keywordPart(93));break;default:y.push(e.keywordPart(100))}y.push(e.spacePart()),ee(o),e.forEach(o.declarations,(function(t){if(265===t.kind){var r=t;if(e.isExternalModuleImportEqualsDeclaration(r))y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.keywordPart(146)),y.push(e.punctuationPart(20)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(r)),e.SymbolDisplayPartKind.stringLiteral)),y.push(e.punctuationPart(21));else{var n=a.getSymbolAtLocation(r.moduleReference);n&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),ee(n,c))}return!0}}))}if(!S)if(""!==x){if(p)if(D?($(),y.push(e.keywordPart(108))):te(o,x),"property"===x||"getter"===x||"setter"===x||"JSX attribute"===x||3&b||"local var"===x||D){if(y.push(e.punctuationPart(58)),y.push(e.spacePart()),p.symbol&&262144&p.symbol.flags){var U=e.mapToDisplayParts((function(t){var n=a.typeParameterToDeclaration(p,c,r);X().writeNode(4,n,e.getSourceFileOfNode(e.getParseTreeNode(c)),t)}));e.addRange(y,U)}else e.addRange(y,e.typeToDisplayParts(a,p,c));if(o.target&&o.target.tupleLabelDeclaration){var V=o.target.tupleLabelDeclaration;e.Debug.assertNode(V.name,e.isIdentifier),y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.textPart(e.idText(V.name))),y.push(e.punctuationPart(21))}}else if(16&b||8192&b||16384&b||131072&b||98304&b||"method"===x){(N=p.getNonNullableType().getCallSignatures()).length&&(ne(N[0],N),C=N.length>1)}}else x=n(a,o,l);if(0!==h.length||C||(h=o.getContextualDocumentationComment(c,a)),0===h.length&&4&b&&o.parent&&o.declarations&&e.forEach(o.parent.declarations,(function(e){return 305===e.kind})))for(var K=0,z=o.declarations;K0))break}}if(0===h.length&&e.isIdentifier(l)&&o.valueDeclaration&&e.isBindingElement(o.valueDeclaration)){var q,W=(q=o.valueDeclaration).parent;if(e.isIdentifier(q.name)&&e.isObjectBindingPattern(W)){var H=e.getTextOfIdentifierOrLiteral(q.name),Q=a.getTypeAtLocation(W);h=e.firstDefined(Q.isUnion()?Q.types:[Q],(function(e){var t=e.getProperty(H);return t?t.getDocumentationComment(a):void 0}))||e.emptyArray}}return 0!==v.length||C||(v=o.getContextualJsDocTags(c,a)),0===h.length&&m&&(h=m),0===v.length&&g&&(v=g),{displayParts:y,documentation:h,symbolKind:x,tags:0===v.length?void 0:v};function X(){return f||(f=e.createPrinter({removeComments:!0})),f}function $(){y.length&&y.push(e.lineBreakPart()),Y()}function Y(){d&&(re("alias"),y.push(e.spacePart()))}function Z(){y.push(e.spacePart()),y.push(e.keywordPart(101)),y.push(e.spacePart())}function ee(t,r){d&&t===o&&(t=d);var n=e.symbolToDisplayParts(a,t,r||s,void 0,7);e.addRange(y,n),16777216&o.flags&&y.push(e.punctuationPart(57))}function te(t,r){$(),r&&(re(r),t&&!e.some(t.declarations,(function(t){return e.isArrowFunction(t)||(e.isFunctionExpression(t)||e.isClassExpression(t))&&!t.name}))&&(y.push(e.spacePart()),ee(t)))}function re(t){switch(t){case"var":case"function":case"let":case"const":case"constructor":return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(20)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(21))}}function ne(t,r,n){void 0===n&&(n=0),e.addRange(y,e.signatureToDisplayParts(a,t,c,32|n)),r.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.operatorPart(39)),y.push(e.displayPart((r.length-1).toString(),e.SymbolDisplayPartKind.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===r.length?"overload":"overloads")),y.push(e.punctuationPart(21))),h=t.getDocumentationComment(a),v=t.getJsDocTags(),r.length>1&&0===h.length&&0===v.length&&(h=r[0].getDocumentationComment(a),v=r[0].getJsDocTags())}function ie(t,n){var i=e.mapToDisplayParts((function(i){var o=a.symbolToTypeParameterDeclarations(t,n,r);X().writeList(53776,o,e.getSourceFileOfNode(e.getParseTreeNode(n)),i)}));e.addRange(y,i)}}}(e.SymbolDisplay||(e.SymbolDisplay={}))}(c||(c={})),function(e){function t(t,r){var i=[],a=r.compilerOptions?n(r.compilerOptions,i):{},o=e.getDefaultCompilerOptions();for(var s in o)e.hasProperty(o,s)&&void 0===a[s]&&(a[s]=o[s]);for(var c=0,l=e.transpileOptionValueCompilerOptions;c>=5;return r}(p,_),0,n),a[c]=(d=1+((l=p)>>(u=_)&s),e.Debug.assert((d&s)===d,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),l&~(s<=r.pos?t.pos:a.end:t.pos}(o,r,n),r.end,(function(s){return _(r,o,t.SmartIndenter.getIndentationForNode(o,r,n,i.options),function(e,r,n){for(var i,a=-1;e;){var o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==a&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(r,e,i,n))return r.indentSize;a=o,i=e,e=e.parent}return 0}(o,i.options,n),s,i,a,function(t,r){if(!t.length)return a;var n=t.filter((function(t){return e.rangeOverlapsWithStartEnd(r,t.start,t.start+t.length)})).sort((function(e,t){return e.start-t.start}));if(!n.length)return a;var i=0;return function(t){for(;;){if(i>=n.length)return!1;var r=n[i];if(t.end<=r.start)return!1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,r.start,r.start+r.length))return!0;i++}};function a(){return!1}}(n.parseDiagnostics,r),n)}))}function _(r,n,i,a,o,s,c,l,u){var d,_,f,m,g,y=s.options,h=s.getRules,v=s.host,b=new t.FormattingContext(u,c,y),x=-1,S=[];if(o.advance(),o.isOnToken()){var D=u.getLineAndCharacterOfPosition(n.getStart(u)).line,C=D;n.decorators&&(C=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(n,u)).line),function n(i,a,s,c,d,p){if(!e.rangeOverlapsWithStartEnd(r,i.getStart(u),i.getEnd()))return;var f=N(i,s,d,p),m=a;e.forEachChild(i,(function(e){v(e,-1,i,f,s,c,!1)}),(function(e){b(e,i,s,f)}));for(;o.isOnToken()&&o.getStartPos()Math.min(i.end,r.end))break;S(h,i,f,i)}function v(a,s,c,l,d,_,p,f){if(e.nodeIsMissing(a))return s;var h=a.getStart(u),v=u.getLineAndCharacterOfPosition(h).line,b=v;a.decorators&&(b=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(a,u)).line);var D=-1;if(p&&e.rangeContainsRange(r,c)&&(D=function(r,n,i,a,o){if(e.rangeOverlapsWithStartEnd(a,r,n)||e.rangeContainsStartEnd(a,r,n)){if(-1!==o)return o}else{var s=u.getLineAndCharacterOfPosition(r).line,c=e.getLineStartPositionForPosition(r,u),l=t.SmartIndenter.findFirstNonWhitespaceColumn(c,r,u,y);if(s!==i||r===l){var d=t.SmartIndenter.getBaseIndentation(y);return d>l?d:l}}return-1}(h,a.end,d,r,s),-1!==D&&(s=D)),!e.rangeOverlapsWithStartEnd(r,a.pos,a.end))return a.endr.end)return s;if(C.token.end>h){C.token.pos>h&&o.skipToStartOf(a);break}S(C,i,l,i)}if(!o.isOnToken()||o.getStartPos()>=r.end)return s;if(e.isToken(a)){var C=o.readTokenInfo(a);if(11!==a.kind)return e.Debug.assert(C.token.end===a.end,"Token end is child end"),S(C,i,l,a),s}var T=165===a.kind?v:_,E=function(e,r,n,i,a,o){var s=t.SmartIndenter.shouldIndentChildNode(y,e)?y.indentSize:0;return o===r?{indentation:r===g?x:a.getIndentation(),delta:Math.min(y.indentSize,a.getDelta(e)+s)}:-1===n?20===e.kind&&r===g?{indentation:x,delta:a.getDelta(e)}:t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(i,e,r,u)||t.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(i,e,r,u)||t.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(i,e,r,u)?{indentation:a.getIndentation(),delta:s}:{indentation:a.getIndentation()+a.getDelta(e),delta:s}:{indentation:n,delta:s}}(a,v,D,i,l,T);return n(a,m,v,b,E.indentation,E.delta),m=i,f&&204===c.kind&&-1===s&&(s=E.indentation),s}function b(n,a,s,c){e.Debug.assert(e.isNodeArray(n));var l=function(e,t){switch(e.kind){case 171:case 256:case 213:case 169:case 168:case 214:if(e.typeParameters===t)return 29;if(e.parameters===t)return 20;break;case 208:case 209:if(e.typeArguments===t)return 29;if(e.arguments===t)return 20;break;case 178:if(e.typeArguments===t)return 29;break;case 182:return 18}return 0}(a,n),d=c,_=s;if(e.rangeOverlapsWithStartEnd(r,n.pos,n.end)){if(0!==l)for(;o.isOnToken()&&o.getStartPos()n.pos)break;if(b.token.kind===l){_=u.getLineAndCharacterOfPosition(b.token.pos).line,S(b,a,c,a);var p=void 0;if(-1!==x)p=x;else{var f=e.getLineStartPositionForPosition(b.token.pos,u);p=t.SmartIndenter.findFirstNonWhitespaceColumn(f,b.token.pos,u,y)}d=N(a,s,p,y.indentSize)}else S(b,a,c,a)}for(var m=-1,g=0;g=r.end){var k=o.isOnEOF()?o.readEOFTokenRange():o.isOnToken()?o.readTokenInfo(n).token:void 0;if(k){var A=(null===(d=e.findPrecedingToken(k.end,u,n))||void 0===d?void 0:d.parent)||f;I(k,u.getLineAndCharacterOfPosition(k.pos).line,A,_,m,f,A,void 0)}}return S;function N(r,n,i,a){return{getIndentationForComment:function(e,t,r){switch(e){case 19:case 23:case 21:return i+o(r)}return-1!==t?t:i},getIndentationForToken:function(t,a,s,c){return!c&&function(t,i,a){switch(i){case 18:case 19:case 21:case 91:case 115:case 59:return!1;case 43:case 31:switch(a.kind){case 280:case 281:case 279:case 228:return!1}break;case 22:case 23:if(195!==a.kind)return!1}return n!==t&&!(r.decorators&&i===function(t){if(t.modifiers&&t.modifiers.length)return t.modifiers[0].kind;switch(t.kind){case 257:return 84;case 258:return 118;case 256:return 98;case 260:return 260;case 172:return 136;case 173:return 149;case 169:if(t.asteriskToken)return 41;case 167:case 164:var r=e.getNameOfDeclaration(t);if(r)return r.kind}}(r))}(t,a,s)?i+o(s):i},getIndentation:function(){return i},getDelta:o,recomputeIndentation:function(e,n){t.SmartIndenter.shouldIndentChildNode(y,n,r,u)&&(i+=e?y.indentSize:-y.indentSize,a=t.SmartIndenter.shouldIndentChildNode(y,r)?y.indentSize:0)}};function o(e){return t.SmartIndenter.nodeWillIndentChild(y,r,e,u,!0)?a:0}}function w(t,n,i,a){for(var o=0,s=t;o0){var D=p(S,y);j(b,x.character,D)}else J(b,x.character)}}}else i||O(r.pos,n,!1)}function L(t,r,n){for(var i=t;io)){var s=R(a,o);-1!==s&&(e.Debug.assert(s===a||!e.isWhiteSpaceSingleLine(u.text.charCodeAt(s-1))),J(s,o+1-s))}}}function R(t,r){for(var n=r;n>=t&&e.isWhiteSpaceSingleLine(u.text.charCodeAt(n));)n--;return n!==r?n+1:-1}function B(e,t,r){L(u.getLineAndCharacterOfPosition(e).line,u.getLineAndCharacterOfPosition(t).line+1,r)}function J(t,r){r&&S.push(e.createTextChangeFromStartLength(t,r,""))}function j(t,r,n){(r||n)&&S.push(e.createTextChangeFromStartLength(t,r,n))}}function p(t,r){if((!i||i.tabSize!==r.tabSize||i.indentSize!==r.indentSize)&&(i={tabSize:r.tabSize,indentSize:r.indentSize},a=o=void 0),r.convertTabsToSpaces){var n=void 0,s=Math.floor(t/r.indentSize),c=t%r.indentSize;return o||(o=[]),void 0===o[s]?(n=e.repeatString(" ",r.indentSize*s),o[s]=n):n=o[s],c?n+e.repeatString(" ",c):n}var l=Math.floor(t/r.tabSize),u=t-l*r.tabSize,d=void 0;return a||(a=[]),void 0===a[l]?a[l]=d=e.repeatString("\t",l):d=a[l],u?d+e.repeatString(" ",u):d}t.createTextRangeWithKind=function(t,r,n){var i={pos:t,end:r,kind:n};return e.Debug.isDebugging&&Object.defineProperty(i,"__debugKind",{get:function(){return e.Debug.formatSyntaxKind(n)}}),i},function(e){e[e.Unknown=-1]="Unknown"}(r||(r={})),t.formatOnEnter=function(t,r,n){var i=r.getLineAndCharacterOfPosition(t).line;if(0===i)return[];for(var a=e.getEndLinePosition(i,r);e.isWhiteSpaceSingleLine(r.text.charCodeAt(a));)a--;return e.isLineBreak(r.text.charCodeAt(a))&&a--,d({pos:e.getStartPositionOfLine(i-1,r),end:a+1},r,n,2)},t.formatOnSemicolon=function(e,t,r){return u(c(s(e,26,t)),t,r,3)},t.formatOnOpeningCurly=function(t,r,n){var i=s(t,18,r);if(!i)return[];var a=c(i.parent);return d({pos:e.getLineStartPositionForPosition(a.getStart(r),r),end:t},r,n,4)},t.formatOnClosingCurly=function(e,t,r){return u(c(s(e,19,t)),t,r,5)},t.formatDocument=function(e,t){return d({pos:0,end:e.text.length},e,t,0)},t.formatSelection=function(t,r,n,i){return d({pos:e.getLineStartPositionForPosition(t,n),end:r},n,i,1)},t.formatNodeGivenIndentation=function(e,r,n,i,a,o){var s={pos:e.pos,end:e.end};return t.getFormattingScanner(r.text,n,s.pos,s.end,(function(t){return _(s,e,i,a,t,o,1,(function(e){return!1}),r)}))},function(e){e[e.None=0]="None",e[e.LineAdded=1]="LineAdded",e[e.LineRemoved=2]="LineRemoved"}(n||(n={})),t.getRangeOfEnclosingComment=function(t,r,n,i){void 0===i&&(i=e.getTokenAtPosition(t,r));var a=e.findAncestor(i,e.isJSDoc);if(a&&(i=a.parent),!(i.getStart(t)<=r&&rr.end}var v=s(m,e,i),b=v.line===t.line||_(m,e,t.line,i);if(y){var x=null===(f=p(e,i))||void 0===f?void 0:f[0],D=g(e,i,l,!!x&&u(x,i).line>v.line);if(-1!==D)return D+n;if(-1!==(D=c(e,m,t,b,i,l)))return D+n}S(l,m,e,i,o)&&!b&&(n+=l.indentSize);var C=d(m,e,t.line,i);m=(e=m).parent,t=C?i.getLineAndCharacterOfPosition(e.getStart(i)):v}return n+a(l)}function s(e,t,r){var n=p(t,r),i=n?n.pos:e.getStart(r);return r.getLineAndCharacterOfPosition(i)}function c(t,r,n,i,a,o){return!e.isDeclaration(t)&&!e.isStatementButNotDeclaration(t)||305!==r.kind&&i?-1:h(n,a,o)}function l(t,r,n,i){var a=e.findNextToken(t,r,i);return a?18===a.kind?1:19===a.kind&&n===u(a,i).line?2:0:0}function u(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function d(t,r,n,i){if(!e.isCallExpression(t)||!e.contains(t.arguments,r))return!1;var a=t.expression.getEnd();return e.getLineAndCharacterOfPosition(i,a).line===n}function _(t,r,n,i){if(239===t.kind&&t.elseStatement===r){var a=e.findChildOfKind(t,91,i);return e.Debug.assert(void 0!==a),u(a,i).line===n}return!1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(t,r,n,i){switch(n.kind){case 178:return a(n.typeArguments);case 205:return a(n.properties);case 204:case 269:case 273:case 201:case 202:return a(n.elements);case 182:return a(n.members);case 256:case 213:case 214:case 169:case 168:case 174:case 171:case 180:case 175:return a(n.typeParameters)||a(n.parameters);case 172:return a(n.parameters);case 257:case 226:case 258:case 259:case 344:return a(n.typeParameters);case 209:case 208:return a(n.typeArguments)||a(n.arguments);case 255:return a(n.declarations)}function a(a){return a&&e.rangeContainsStartEnd(function(e,t,r){for(var n=e.getChildren(r),i=1;i=0&&r=0;o--)if(27!==t[o].kind){if(n.getLineAndCharacterOfPosition(t[o].end).line!==a.line)return h(a,n,i);a=u(t[o],n)}return-1}function h(e,t,r){var n=t.getPositionOfLineAndCharacter(e.line,0);return b(n,n+e.character,t,r)}function v(t,r,n,i){for(var a=0,o=0,s=t;sn.text.length)return a(i);if(i.indentStyle===e.IndentStyle.None)return 0;var c=e.findPrecedingToken(r,n,void 0,!0),d=t.getRangeOfEnclosingComment(n,r,c||null);if(d&&3===d.kind)return function(t,r,n,i){var a=e.getLineAndCharacterOfPosition(t,r).line-1,o=e.getLineAndCharacterOfPosition(t,i.pos).line;if(e.Debug.assert(o>=0),a<=o)return b(e.getStartPositionOfLine(o,t),r,t,n);var s=e.getStartPositionOfLine(a,t),c=v(s,r,t,n),l=c.column,u=c.character;return 0===l?l:42===t.text.charCodeAt(s+u)?l-1:l}(n,r,i,d);if(!c)return a(i);if(e.isStringOrRegularExpressionOrTemplateLiteral(c.kind)&&c.getStart(n)<=r&&r0;){var a=t.text.charCodeAt(i);if(!e.isWhiteSpaceLike(a))break;i--}return b(e.getLineStartPositionForPosition(i,t),i,t,n)}(n,r,i);if(27===c.kind&&221!==c.parent.kind){var x=function(t,r,n){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?y(i.list.getChildren(),i.listItemIndex-1,r,n):-1}(c,n,i);if(-1!==x)return x}var D=function(e,t,r){return t&&f(e,e,t,r)}(r,c.parent,n);if(D&&!e.rangeContainsRange(D,c)){var C=-1!==[213,214].indexOf(p.parent.kind)?0:i.indentSize;return m(D,n,i)+C}return function(t,r,n,i,s,c){for(var d,_=n;_;){if(e.positionBelongsToNode(_,r,t)&&S(c,_,d,t,!0)){var p=u(_,t),f=l(n,_,i,t);return o(_,p,void 0,0!==f?s&&2===f?c.indentSize:0:i!==p.line?c.indentSize:0,t,!0,c)}var m=g(_,t,c,!0);if(-1!==m)return m;d=_,_=_.parent}return a(c)}(n,r,c,_,s,i)},r.getIndentationForNode=function(e,t,r,n){var i=r.getLineAndCharacterOfPosition(e.getStart(r));return o(e,i,t,0,r,!1,n)},r.getBaseIndentation=a,function(e){e[e.Unknown=0]="Unknown",e[e.OpenBrace=1]="OpenBrace",e[e.CloseBrace=2]="CloseBrace"}(i||(i={})),r.isArgumentAndStartLineOverlapsExpressionBeingCalled=d,r.childStartsOnTheSameLineWithElseInIfStatement=_,r.childIsUnindentedBranchOfConditionalExpression=function(t,r,n,i){if(e.isConditionalExpression(t)&&(r===t.whenTrue||r===t.whenFalse)){var a=e.getLineAndCharacterOfPosition(i,t.condition.end).line;if(r===t.whenTrue)return n===a;var o=u(t.whenTrue,i).line,s=e.getLineAndCharacterOfPosition(i,t.whenTrue.end).line;return a===o&&s===n}return!1},r.argumentStartsOnSameLineAsPreviousArgument=function(t,r,n,i){if(e.isCallOrNewExpression(t)){if(!t.arguments)return!1;var a=e.find(t.arguments,(function(e){return e.pos===r.pos}));if(!a)return!1;var o=t.arguments.indexOf(a);if(0===o)return!1;var s=t.arguments[o-1];if(n===e.getLineAndCharacterOfPosition(i,s.getEnd()).line)return!0}return!1},r.getContainingList=p,r.findFirstNonWhitespaceCharacterAndColumn=v,r.findFirstNonWhitespaceColumn=b,r.nodeWillIndentChild=x,r.shouldIndentChildNode=S})((t=e.formatting||(e.formatting={})).SmartIndenter||(t.SmartIndenter={}))}(c||(c={})),function(e){!function(t){function i(t){var r=t.__pos;return e.Debug.assert("number"==typeof r),r}function a(t,r){e.Debug.assert("number"==typeof r),t.__pos=r}function o(t){var r=t.__end;return e.Debug.assert("number"==typeof r),r}function s(t,r){e.Debug.assert("number"==typeof r),t.__end=r}var c,l;function u(t,r){return e.skipTrivia(t,r,!1,!0)}!function(e){e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine"}(c=t.LeadingTriviaOption||(t.LeadingTriviaOption={})),function(e){e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include"}(l=t.TrailingTriviaOption||(t.TrailingTriviaOption={}));var d,_={leadingTriviaOption:c.Exclude,trailingTriviaOption:l.Exclude};function p(e,t,r,n){return{pos:f(e,t,n),end:g(e,r,n)}}function f(t,r,n,i){var a,o;void 0===i&&(i=!1);var s=n.leadingTriviaOption;if(s===c.Exclude)return r.getStart(t);if(s===c.StartLine){var l=r.getStart(t),d=e.getLineStartPositionForPosition(l,t);return e.rangeContainsPosition(r,d)?d:l}if(s===c.JSDoc){var _=e.getJSDocCommentRanges(r,t.text);if(null==_?void 0:_.length)return e.getLineStartPositionForPosition(_[0].pos,t)}var p=r.getFullStart(),f=r.getStart(t);if(p===f)return f;var m=e.getLineStartPositionForPosition(p,t);if(e.getLineStartPositionForPosition(f,t)===m)return s===c.IncludeAll?p:f;if(i){var g=(null===(a=e.getLeadingCommentRanges(t.text,p))||void 0===a?void 0:a[0])||(null===(o=e.getTrailingCommentRanges(t.text,p))||void 0===o?void 0:o[0]);if(g)return e.skipTrivia(t.text,g.end,!0,!0)}var y=p>0?1:0,h=e.getStartPositionOfLine(e.getLineOfLocalPosition(t,m)+y,t);return h=u(t.text,h),e.getStartPositionOfLine(e.getLineOfLocalPosition(t,h),t)}function m(t,r,n){var i=r.end;if(n.trailingTriviaOption===l.Include){var a=e.getTrailingCommentRanges(t.text,i);if(a)for(var o=e.getLineOfLocalPosition(t,r.end),s=0,c=a;so)break;if(e.getLineOfLocalPosition(t,u.end)>o)return e.skipTrivia(t.text,u.end,!0,!0)}}}function g(t,r,n){var i,a=r.end,o=n.trailingTriviaOption;if(o===l.Exclude)return a;if(o===l.ExcludeWhitespace){var s=e.concatenate(e.getTrailingCommentRanges(t.text,a),e.getLeadingCommentRanges(t.text,a)),c=null===(i=null==s?void 0:s[s.length-1])||void 0===i?void 0:i.end;return c||a}var u=m(t,r,n);if(u)return u;var d=e.skipTrivia(t.text,a,!0);return d===a||o!==l.Include&&!e.isLineBreak(t.text.charCodeAt(d-1))?a:d}function y(e,t){return!!t&&!!e.parent&&(27===t.kind||26===t.kind&&205===e.parent.kind)}!function(e){e[e.Remove=0]="Remove",e[e.ReplaceWithSingleNode=1]="ReplaceWithSingleNode",e[e.ReplaceWithMultipleNodes=2]="ReplaceWithMultipleNodes",e[e.Text=3]="Text"}(d||(d={})),t.isThisTypeAnnotatable=function(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)};var h,v=function(){function t(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.newFiles=[],this.classesWithNodesInsertedAtStart=new e.Map,this.deletedNodes=[]}return t.fromContext=function(r){return new t(e.getNewLineOrDefaultFromHost(r.host,r.formatContext.options),r.formatContext)},t.with=function(e,r){var n=t.fromContext(e);return r(n),n.getChanges()},t.prototype.pushRaw=function(t,r){e.Debug.assertEqual(t.fileName,r.fileName);for(var n=0,i=r.textChanges;n=t.getLineAndCharacterOfPosition(l.range.end).line+2)break}if(t.statements.length)if(void 0===u&&(u=t.getLineAndCharacterOfPosition(t.statements[0].getStart()).line),u",joiner:", "})},t.prototype.getOptionsForInsertNodeBefore=function(t,r,n){return e.isStatement(t)||e.isClassElement(t)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:e.isVariableDeclaration(t)?{suffix:", "}:e.isParameter(t)?e.isParameter(r)?{suffix:", "}:{}:e.isStringLiteral(t)&&e.isImportDeclaration(t.parent)||e.isNamedImports(t)?{suffix:", "}:e.isImportSpecifier(t)?{suffix:","+(n?this.newLineCharacter:" ")}:e.Debug.failBadSyntaxKind(t)},t.prototype.insertNodeAtConstructorStart=function(t,n,i){var a=e.firstOrUndefined(n.body.statements);a&&n.body.multiLine?this.insertNodeBefore(t,a,i):this.replaceConstructorBody(t,n,r([i],n.body.statements,!0))},t.prototype.insertNodeAtConstructorStartAfterSuperCall=function(t,n,i){var a=e.find(n.body.statements,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}));a&&n.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,n,r(r([],n.body.statements,!0),[i],!1))},t.prototype.insertNodeAtConstructorEnd=function(t,n,i){var a=e.lastOrUndefined(n.body.statements);a&&n.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,n,r(r([],n.body.statements,!0),[i],!1))},t.prototype.replaceConstructorBody=function(t,r,n){this.replaceNode(t,r.body,e.factory.createBlock(n,!0))},t.prototype.insertNodeAtEndOfScope=function(t,r,n){var i=f(t,r.getLastToken(),{});this.insertNodeAt(t,i,n,{prefix:e.isLineBreak(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter})},t.prototype.insertMemberAtStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r)},t.prototype.insertNodeAtObjectStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r)},t.prototype.insertNodeAtStartWorker=function(e,t,r){var n,i=null!==(n=this.guessIndentationFromExistingMembers(e,t))&&void 0!==n?n:this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,x(t).pos,r,this.getInsertNodeAtStartInsertOptions(e,t,i))},t.prototype.guessIndentationFromExistingMembers=function(t,r){for(var n,i=r,a=0,o=x(r);a=0;n--){var i=r[n],a=i.span,o=i.newText;t="".concat(t.substring(0,a.start)).concat(o).concat(t.substring(e.textSpanEnd(a)))}return t}t.ChangeTracker=v,t.getNewFileText=function(e,t,r,n){return h.newFileChangesWorker(void 0,t,e,r,n)},function(t){function r(t,r,n,a,o){var s=n.map((function(e){return 4===e?"":i(e,t,a).text})).join(a),c=e.createSourceFile("any file name",s,99,!0,r);return S(s,e.formatting.formatDocument(c,o))+a}function i(t,r,n){var i=k(n),a=e.getNewLineKind(n);return e.createPrinter({newLine:a,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},i).writeNode(4,t,r,i),{text:i.getText(),node:T(t)}}t.getTextChangesFromChanges=function(t,r,a,o){return e.mapDefined(e.group(t,(function(e){return e.sourceFile.path})),(function(t){for(var s=t[0].sourceFile,c=e.stableSort(t,(function(e,t){return e.range.pos-t.range.pos||e.range.end-t.range.end})),l=function(t){e.Debug.assert(c[t].range.end<=c[t+1].range.pos,"Changes overlap",(function(){return"".concat(JSON.stringify(c[t].range)," and ").concat(JSON.stringify(c[t+1].range))}))},u=0;u0?{fileName:s.fileName,textChanges:_}:void 0}))},t.newFileChanges=function(t,n,i,a,o){var s=r(t,e.getScriptKindFromFileName(n),i,a,o);return{fileName:n,textChanges:[e.createTextChange(e.createTextSpan(0,0),s)],isNewFile:!0}},t.newFileChangesWorker=r,t.getNonformattedText=i}(h||(h={})),t.applyChanges=S;var D,C=n(n({},e.nullTransformationContext),{factory:e.createNodeFactory(1|e.nullTransformationContext.factory.flags,e.nullTransformationContext.factory.baseFactory)});function T(t){var r=e.visitEachChild(t,T,C,E,T),n=e.nodeIsSynthesized(r)?r:Object.create(r);return e.setTextRangePosEnd(n,i(t),o(t)),n}function E(t,r,n,a,s){var c=e.visitNodes(t,r,n,a,s);if(!c)return c;var l=c===t?e.factory.createNodeArray(c.slice(0)):c;return e.setTextRangePosEnd(l,i(t),o(t)),l}function k(t){var r=0,n=e.createTextWriter(t);function i(t,i){if(i||!function(t){return e.skipTrivia(t,0)===t.length}(t)){r=n.getTextPos();for(var a=0;e.isWhiteSpaceLike(t.charCodeAt(t.length-a-1));)a++;r-=a}}return{onBeforeEmitNode:function(e){e&&a(e,r)},onAfterEmitNode:function(e){e&&s(e,r)},onBeforeEmitNodeArray:function(e){e&&a(e,r)},onAfterEmitNodeArray:function(e){e&&s(e,r)},onBeforeEmitToken:function(e){e&&a(e,r)},onAfterEmitToken:function(e){e&&s(e,r)},write:function(e){n.write(e),i(e,!1)},writeComment:function(e){n.writeComment(e)},writeKeyword:function(e){n.writeKeyword(e),i(e,!1)},writeOperator:function(e){n.writeOperator(e),i(e,!1)},writePunctuation:function(e){n.writePunctuation(e),i(e,!1)},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),i(e,!1)},writeParameter:function(e){n.writeParameter(e),i(e,!1)},writeProperty:function(e){n.writeProperty(e),i(e,!1)},writeSpace:function(e){n.writeSpace(e),i(e,!1)},writeStringLiteral:function(e){n.writeStringLiteral(e),i(e,!1)},writeSymbol:function(e,t){n.writeSymbol(e,t),i(e,!1)},writeLine:function(e){n.writeLine(e)},increaseIndent:function(){n.increaseIndent()},decreaseIndent:function(){n.decreaseIndent()},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),i(e,!1)},writeLiteral:function(e){n.writeLiteral(e),i(e,!0)},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:function(){return n.hasTrailingComment()},hasTrailingWhitespace:function(){return n.hasTrailingWhitespace()},clear:function(){n.clear(),r=0}}}function A(t,r){return!(e.isInComment(t,r)||e.isInString(t,r)||e.isInTemplateString(t,r)||e.isInJSXText(t,r))}function N(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(t,r,n),a=g(t,r,n);e.deleteRange(t,{pos:i,end:a})}function w(t,r,n,i){var a=e.Debug.checkDefined(e.formatting.SmartIndenter.getContainingList(i,n)),o=e.indexOfNode(a,i);e.Debug.assert(-1!==o),1!==a.length?(e.Debug.assert(!r.has(i),"Deleting a node twice"),r.add(i),t.deleteRange(n,{pos:b(n,i),end:o===a.length-1?g(n,i,{}):b(n,a[o+1])})):N(t,n,i)}t.assignPositionsToNode=T,t.createWriter=k,t.isValidLocationToAddComment=A,function(t){function r(t,r,n){if(n.parent.name){var i=e.Debug.checkDefined(e.getTokenAtPosition(r,n.pos-1));t.deleteRange(r,{pos:i.getStart(r),end:n.end})}else{N(t,r,e.getAncestor(n,266))}}t.deleteDeclaration=function(t,n,i,a){switch(a.kind){case 164:var o=a.parent;e.isArrowFunction(o)&&1===o.parameters.length&&!e.findChildOfKind(o,20,i)?t.replaceNodeWithText(i,a,"()"):w(t,n,i,a);break;case 266:case 265:N(t,i,a,{leadingTriviaOption:i.imports.length&&a===e.first(i.imports).parent||a===e.find(i.statements,e.isAnyImportSyntax)?c.Exclude:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;case 203:var s=a.parent;202===s.kind&&a!==e.last(s.elements)?N(t,i,a):w(t,n,i,a);break;case 254:!function(t,r,n,i){var a=i.parent;if(292===a.kind)return void t.deleteNodeRange(n,e.findChildOfKind(a,20,n),e.findChildOfKind(a,21,n));if(1!==a.declarations.length)return void w(t,r,n,i);var o=a.parent;switch(o.kind){case 244:case 243:t.replaceNode(n,i,e.factory.createObjectLiteralExpression());break;case 242:N(t,n,a);break;case 237:N(t,n,o,{leadingTriviaOption:e.hasJSDocNodes(o)?c.JSDoc:c.StartLine});break;default:e.Debug.assertNever(o)}}(t,n,i,a);break;case 163:w(t,n,i,a);break;case 270:var u=a.parent;1===u.elements.length?r(t,i,u):w(t,n,i,a);break;case 268:r(t,i,a);break;case 26:N(t,i,a,{trailingTriviaOption:l.Exclude});break;case 98:N(t,i,a,{leadingTriviaOption:c.Exclude});break;case 257:case 256:N(t,i,a,{leadingTriviaOption:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;default:a.parent?e.isImportClause(a.parent)&&a.parent.name===a?function(t,r,n){if(n.namedBindings){var i=n.name.getStart(r),a=e.getTokenAtPosition(r,n.name.end);if(a&&27===a.kind){var o=e.skipTrivia(r.text,a.end,!1,!0);t.deleteRange(r,{pos:i,end:o})}else N(t,r,n.name)}else N(t,r,n.parent)}(t,i,a.parent):e.isCallExpression(a.parent)&&e.contains(a.parent.arguments,a)?w(t,n,i,a):N(t,i,a):N(t,i,a)}}}(D||(D={})),t.deleteNode=N}(e.textChanges||(e.textChanges={}))}(c||(c={})),function(e){!function(t){var i=e.createMultiMap(),a=new e.Map;function s(e,t,r,n,i,a){return{fixName:e,description:t,changes:r,fixId:n,fixAllDescription:i,commands:a?[a]:void 0}}function c(e,t){return{changes:e,commands:t}}function l(t,r,n){for(var i=0,a=u(t);i1)break}var u=a<2;return function(e){var t=e.fixId,r=e.fixAllDescription,i=o(e,["fixId","fixAllDescription"]);return u?i:n(n({},i),{fixId:t,fixAllDescription:r})}}(i,r))}))},t.getAllFixes=function(t){return a.get(e.cast(t.fixId,e.isString)).getAllCodeActions(t)},t.createCombinedCodeActions=c,t.createFileTextChanges=function(e,t){return{fileName:e,textChanges:t}},t.codeFixAll=function(t,r,n){var i=[];return c(e.textChanges.ChangeTracker.with(t,(function(e){return l(t,r,(function(t){return n(e,t,i)}))})),0===i.length?void 0:i)},t.eachDiagnostic=l}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r;t=e.refactor||(e.refactor={}),r=new e.Map,t.registerRefactor=function(e,t){r.set(e,t)},t.getApplicableRefactors=function(n){return e.arrayFrom(e.flatMapIterator(r.values(),(function(e){var r;return n.cancellationToken&&n.cancellationToken.isCancellationRequested()||!(null===(r=e.kinds)||void 0===r?void 0:r.some((function(e){return t.refactorKindBeginsWith(e,n.kind)})))?void 0:e.getAvailableActions(n)})))},t.getEditsForRefactor=function(e,t,n){var i=r.get(t);return i&&i.getEditsForAction(e,n)}}(c||(c={})),function(e){!function(t){var r="addConvertToUnknownForNonOverlappingTypes",n=[e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];function i(t,r,n){var i=e.isAsExpression(n)?e.factory.createAsExpression(n.expression,e.factory.createKeywordTypeNode(155)):e.factory.createTypeAssertion(e.factory.createKeywordTypeNode(155),n.expression);t.replaceNode(r,n.expression,i)}function a(t,r){if(!e.isInJSFile(t))return e.findAncestor(e.getTokenAtPosition(t,r),(function(t){return e.isAsExpression(t)||e.isTypeAssertionExpression(t)}))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(void 0!==o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return[t.createCodeFixAction(r,s,e.Diagnostics.Add_unknown_conversion_for_non_overlapping_types,r,e.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(r){var n=r.sourceFile,i=e.textChanges.ChangeTracker.with(r,(function(t){var r=e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([]),void 0);t.insertNodeAtEndOfScope(n,n,r)}));return[t.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",i,e.Diagnostics.Add_export_to_make_this_file_into_a_module)]}})}(c||(c={})),function(e){!function(t){var r="addMissingAsync",n=[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_comparable_to_type_1.code];function i(n,i,a,o){var s=a((function(t){return function(t,r,n,i){if(i&&i.has(e.getNodeId(n)))return;null==i||i.add(e.getNodeId(n));var a=e.factory.updateModifiers(e.getSynthesizedDeepClone(n,!0),e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(256|e.getSyntacticModifierFlags(n))));t.replaceNode(r,n,a)}(t,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)}function a(t,r){if(r){var n=e.getTokenAtPosition(t,r.start),i=e.findAncestor(n,(function(n){return n.getStart(t)e.textSpanEnd(r)?"quit":(e.isArrowFunction(n)||e.isMethodDeclaration(n)||e.isFunctionExpression(n)||e.isFunctionDeclaration(n))&&e.textSpansEqual(r,e.createTextSpanFromNode(n,t))}));return i}}t.registerCodeFix({fixIds:[r],errorCodes:n,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,o=t.cancellationToken,s=t.program,c=t.span,l=e.find(s.getTypeChecker().getDiagnostics(r,o),function(t,r){return function(n){var i=n.start,a=n.length,o=n.relatedInformation,s=n.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},t)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code}))}}(c,n)),u=l&&l.relatedInformation&&e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),d=a(r,u);if(d){return[i(t,d,(function(r){return e.textChanges.ChangeTracker.with(t,r)}))]}},getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Set;return t.codeFixAll(r,n,(function(t,n){var c=n.relatedInformation&&e.find(n.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),l=a(o,c);if(l){return i(r,l,(function(e){return e(t),[]}),s)}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="addMissingAwait",i=e.Diagnostics.Property_0_does_not_exist_on_type_1.code,a=[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],o=r([e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,e.Diagnostics.Type_0_is_not_an_array_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,i],a,!0);function s(t,r,n,i,a){var o=e.getFixableErrorSpanExpression(t,n);return o&&function(t,r,n,i,a){var o=a.getTypeChecker().getDiagnostics(t,i);return e.some(o,(function(t){var i=t.start,a=t.length,o=t.relatedInformation,s=t.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},n)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_forget_to_use_await.code}))}))}(t,r,n,i,a)&&u(o)?o:void 0}function c(r,n,i,a,s,c){var l=r.sourceFile,_=r.program,p=r.cancellationToken,f=function(t,r,n,i,a){var s=function(t,r){if(e.isPropertyAccessExpression(t.parent)&&e.isIdentifier(t.parent.expression))return{identifiers:[t.parent.expression],isCompleteFix:!0};if(e.isIdentifier(t))return{identifiers:[t],isCompleteFix:!0};if(e.isBinaryExpression(t)){for(var n=void 0,i=!0,a=0,o=[t.left,t.right];a0)return[t.createCodeFixAction(r,a,e.Diagnostics.Add_const_to_unresolved_variable,r,e.Diagnostics.Add_const_to_all_unresolved_variables)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,r.program,a)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addMissingDeclareProperty",n=[e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isIdentifier(a)){var o=a.parent;167!==o.kind||i&&!e.tryAddToSet(i,o)||t.insertModifierBefore(r,135,o)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));if(a.length>0)return[t.createCodeFixAction(r,a,e.Diagnostics.Prefix_with_declare,r,e.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,a)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addMissingInvocationForDecorator",n=[e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.findAncestor(i,e.isDecorator);e.Debug.assert(!!a,"Expected position to be owned by a decorator.");var o=e.factory.createCallExpression(a.expression,void 0,void 0);t.replaceNode(r,a.expression,o)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return[t.createCodeFixAction(r,a,e.Diagnostics.Call_decorator_expression,r,e.Diagnostics.Add_to_all_uncalled_decorators)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addNameToNamelessParameter",n=[e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=i.parent;if(!e.isParameter(a))return e.Debug.fail("Tried to add a parameter name to a non-parameter: "+e.Debug.formatSyntaxKind(i.kind));var o=a.parent.parameters.indexOf(a);e.Debug.assert(!a.type,"Tried to add a parameter name to a parameter that already had one."),e.Debug.assert(o>-1,"Parameter not found in parent parameter list.");var s=e.factory.createTypeReferenceNode(a.name,void 0),c=e.factory.createParameterDeclaration(void 0,a.modifiers,a.dotDotDotToken,"arg"+o,a.questionToken,a.dotDotDotToken?e.factory.createArrayTypeNode(s):s,a.initializer);t.replaceNode(r,a,c)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return[t.createCodeFixAction(r,a,e.Diagnostics.Add_parameter_name,r,e.Diagnostics.Add_names_to_all_parameters_without_names)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="addOptionalPropertyUndefined",i=[e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];function a(t,r){var n;if(t){if(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind)return{source:t.parent.right,target:t.parent.left};if(e.isVariableDeclaration(t.parent)&&t.parent.initializer)return{source:t.parent.initializer,target:t.parent.name};if(e.isCallExpression(t.parent)){var i=r.getSymbolAtLocation(t.parent.expression);if(!(null==i?void 0:i.valueDeclaration)||!e.isFunctionLikeKind(i.valueDeclaration.kind))return;if(!e.isExpression(t))return;var o=t.parent.arguments.indexOf(t);if(-1===o)return;var s=i.valueDeclaration.parameters[o].name;if(e.isIdentifier(s))return{source:t,target:s}}else if(e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)||e.isShorthandPropertyAssignment(t.parent)){var c=a(t.parent.parent,r);if(!c)return;var l=r.getPropertyOfType(r.getTypeAtLocation(c.target),t.parent.name.text),u=null===(n=null==l?void 0:l.declarations)||void 0===n?void 0:n[0];if(!u)return;return{source:e.isPropertyAssignment(t.parent)?t.parent.initializer:t.parent.name,target:u}}}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.program.getTypeChecker(),s=function(t,r,n){var i,o,s=a(e.getFixableErrorSpanExpression(t,r),n);if(!s)return e.emptyArray;var c=s.source,l=s.target,u=function(t,r,n){return e.isPropertyAccessExpression(r)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(r.expression)).length&&n.getTypeAtLocation(t)===n.getUndefinedType()}(c,l,n)?n.getTypeAtLocation(l.expression):n.getTypeAtLocation(l);if(null===(o=null===(i=u.symbol)||void 0===i?void 0:i.declarations)||void 0===o?void 0:o.some((function(t){return e.getSourceFileOfNode(t).fileName.match(/\.d\.ts$/)})))return e.emptyArray;return n.getExactOptionalProperties(u)}(i.sourceFile,i.span,o);if(s.length){var c=e.textChanges.ChangeTracker.with(i,(function(t){return function(t,n){for(var i=0,a=n;i1?(t.delete(r,u),t.insertNodeAfter(r,_,d)):t.replaceNode(r,_,d)}}function p(n){var i=[];return n.exports&&n.exports.forEach((function(t){if("prototype"===t.name&&t.declarations){var r=t.declarations[0];if(1===t.declarations.length&&e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind&&e.isObjectLiteralExpression(r.parent.right))l(r.parent.right.symbol,void 0,i)}else l(t,[e.factory.createToken(124)],i)})),n.members&&n.members.forEach((function(a,s){var c,u,d,_;if("constructor"===s&&a.valueDeclaration){var p=null===(_=null===(d=null===(u=null===(c=n.exports)||void 0===c?void 0:c.get("prototype"))||void 0===u?void 0:u.declarations)||void 0===d?void 0:d[0])||void 0===_?void 0:_.parent;p&&e.isBinaryExpression(p)&&e.isObjectLiteralExpression(p.right)&&e.some(p.right.properties,o)||t.delete(r,a.valueDeclaration.parent)}else l(a,void 0,i)})),i;function l(n,i,l){if(8192&n.flags||4096&n.flags){var u,d,_=n.valueDeclaration,p=_.parent,f=p.right;if(u=_,d=f,e.isAccessExpression(u)?e.isPropertyAccessExpression(u)&&o(u)||e.isFunctionLike(d):e.every(u.properties,(function(t){return!!(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)||e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&t.name||o(t))})))if(!e.some(l,(function(t){var r=e.getNameOfDeclaration(t);return!(!r||!e.isIdentifier(r)||e.idText(r)!==e.symbolName(n))}))){var m=p.parent&&238===p.parent.kind?p.parent:p;if(t.delete(r,m),f){if(e.isAccessExpression(_)&&(e.isFunctionExpression(f)||e.isArrowFunction(f))){var g=e.getQuotePreference(r,s),y=function(t,r,n){if(e.isPropertyAccessExpression(t))return t.name;var i=t.argumentExpression;if(e.isNumericLiteral(i))return i;if(e.isStringLiteralLike(i))return e.isIdentifierText(i.text,e.getEmitScriptTarget(r))?e.factory.createIdentifier(i.text):e.isNoSubstitutionTemplateLiteral(i)?e.factory.createStringLiteral(i.text,0===n):i;return}(_,c,g);y&&v(l,f,y)}else if(e.isObjectLiteralExpression(f))e.forEach(f.properties,(function(t){(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t))&&l.push(t),e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&v(l,t.initializer,t.name),o(t)}));else if(!e.isSourceFileJS(r)&&e.isPropertyAccessExpression(_)){var h=e.factory.createPropertyDeclaration(void 0,i,_.name,void 0,void 0,f);return e.copyLeadingComments(p.parent,h,r),void l.push(h)}}else l.push(e.factory.createPropertyDeclaration([],i,n.name,void 0,void 0,void 0))}}function v(t,n,o){return e.isFunctionExpression(n)?function(t,n,o){var s=e.concatenate(i,a(n,131)),c=e.factory.createMethodDeclaration(void 0,s,void 0,o,void 0,void 0,n.parameters,void 0,n.body);return e.copyLeadingComments(p,c,r),void t.push(c)}(t,n,o):function(t,n,o){var s,c=n.body;s=235===c.kind?c:e.factory.createBlock([e.factory.createReturnStatement(c)]);var l=e.concatenate(i,a(n,131)),u=e.factory.createMethodDeclaration(void 0,l,void 0,o,void 0,void 0,n.parameters,void 0,s);e.copyLeadingComments(p,u,r),t.push(u)}(t,n,o)}}}}function a(t,r){return e.filter(t.modifiers,(function(e){return e.kind===r}))}function o(t){return!!t.name&&!(!e.isIdentifier(t.name)||"constructor"!==t.name.text)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program.getTypeChecker(),n.preferences,n.program.getCompilerOptions())}));return[t.createCodeFixAction(r,a,e.Diagnostics.Convert_function_to_an_ES2015_class,r,e.Diagnostics.Convert_all_constructor_functions_to_classes)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n,i="convertToAsyncFunction",a=[e.Diagnostics.This_may_be_converted_to_an_async_function.code],o=!0;function s(t,r,n,i){var a,o=e.getTokenAtPosition(r,n);if(a=e.isIdentifier(o)&&e.isVariableDeclaration(o.parent)&&o.parent.initializer&&e.isFunctionLikeDeclaration(o.parent.initializer)?o.parent.initializer:e.tryCast(e.getContainingFunction(e.getTokenAtPosition(r,n)),e.canBeConvertedToAsync)){var s=new e.Map,l=e.isInJSFile(a),u=function(t,r){if(!t.body)return new e.Set;var n=new e.Set;return e.forEachChild(t.body,(function t(i){c(i,r,"then")?(n.add(e.getNodeId(i)),e.forEach(i.arguments,t)):c(i,r,"catch")||c(i,r,"finally")?(n.add(e.getNodeId(i)),e.forEachChild(i,t)):d(i,r)?n.add(e.getNodeId(i)):e.forEachChild(i,t)})),n}(a,i),f=function(t,r,n){var i=new e.Map,a=e.createMultiMap();return e.forEachChild(t,(function t(o){if(e.isIdentifier(o)){var s=r.getSymbolAtLocation(o);if(s){var c=C(r.getTypeAtLocation(o),r),l=e.getSymbolId(s).toString();if(!c||e.isParameter(o.parent)||e.isFunctionLikeDeclaration(o.parent)||n.has(l)){if(o.parent&&(e.isParameter(o.parent)||e.isVariableDeclaration(o.parent)||e.isBindingElement(o.parent))){var u=o.text,d=a.get(u);if(d&&d.some((function(e){return e!==s}))){var p=_(o,a);i.set(l,p.identifier),n.set(l,p),a.add(u,s)}else{var f=e.getSynthesizedDeepClone(o);n.set(l,A(f)),a.add(u,s)}}}else{var m=e.firstOrUndefined(c.parameters),g=(null==m?void 0:m.valueDeclaration)&&e.isParameter(m.valueDeclaration)&&e.tryCast(m.valueDeclaration.name,e.isIdentifier)||e.factory.createUniqueName("result",16),y=_(g,a);n.set(l,y),a.add(g.text,s)}}}else e.forEachChild(o,t)})),e.getSynthesizedDeepCloneWithReplacements(t,!0,(function(t){if(e.isBindingElement(t)&&e.isIdentifier(t.name)&&e.isObjectBindingPattern(t.parent)){if((a=(n=r.getSymbolAtLocation(t.name))&&i.get(String(e.getSymbolId(n))))&&a.text!==(t.name||t.propertyName).getText())return e.factory.createBindingElement(t.dotDotDotToken,t.propertyName||t.name,a,t.initializer)}else if(e.isIdentifier(t)){var n,a;if(a=(n=r.getSymbolAtLocation(t))&&i.get(String(e.getSymbolId(n))))return e.factory.createIdentifier(a.text)}}))}(a,i,s);if(e.returnsPromise(f,i)){var g=f.body&&e.isBlock(f.body)?function(t,r){var n=[];return e.forEachReturnStatement(t,(function(t){e.isReturnStatementWithFixablePromiseHandler(t,r)&&n.push(t)})),n}(f.body,i):e.emptyArray,y={checker:i,synthNamesMap:s,setOfExpressionsToReturn:u,isInJSFile:l};if(g.length){var h=a.modifiers?a.modifiers.end:a.decorators?e.skipTrivia(r.text,a.decorators.end):a.getStart(r),v=a.modifiers?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,h,131,v);for(var b=function(n){if(e.forEachChild(n,(function i(a){if(e.isCallExpression(a)){var o=m(a,a,y,!1);if(p())return!0;t.replaceNodeWithNodes(r,n,o)}else if(!e.isFunctionLike(a)&&(e.forEachChild(a,i),p()))return!0})),p())return{value:void 0}},x=0,S=g;x0)return F;if(y){A=D(o.checker,y,g);if(O(a,o))return x(A,u(a,t,o.checker));var P=b(n,A,void 0);return n&&n.types.push(o.checker.getAwaitedType(y)||y),P}return f();default:return f()}return e.emptyArray}function D(t,r,n){var i=e.getSynthesizedDeepClone(n);return t.getPromisedTypeOfPromise(r)?e.factory.createAwaitExpression(i):i}function C(t,r){var n=r.getSignaturesOfType(t,0);return e.lastOrUndefined(n)}function T(t,r,n,i){var a=[];return e.forEachChild(r,(function r(o){if(e.isCallExpression(o)){var s=m(o,o,t,n,i);if((a=a.concat(s)).length>0)return}else e.isFunctionLike(o)||e.forEachChild(o,r)})),a}function E(t,r){var n,i=[];e.isFunctionLikeDeclaration(t)?t.parameters.length>0&&(n=function t(r){if(e.isIdentifier(r))return a(r);var n=e.flatMap(r.elements,(function(r){return e.isOmittedExpression(r)?[]:[t(r.name)]}));return function(t,r,n){void 0===r&&(r=e.emptyArray);void 0===n&&(n=[]);return{kind:1,bindingPattern:t,elements:r,types:n}}(r,n)}(t.parameters[0].name)):e.isIdentifier(t)?n=a(t):e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&(n=a(t.name));if(n&&(!("identifier"in n)||"undefined"!==n.identifier.text))return n;function a(t){var n=function(e){return e.original?e.original:e}(t),a=function(e){return e.symbol?e.symbol:r.checker.getSymbolAtLocation(e)}(n);return a&&r.synthNamesMap.get(e.getSymbolId(a).toString())||A(t,i)}}function k(t){return!t||(I(t)?!t.identifier.text:e.every(t.elements,k))}function A(e,t){return void 0===t&&(t=[]),{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function N(e){return e.hasBeenReferenced=!0,e.identifier}function w(e){return I(e)?P(e):F(e)}function F(e){for(var t=0,r=e.elements;t1?[[o(n),s(n)],!0]:[[s(n)],!0]:[[o(n)],!1]}(d.arguments[0],r):void 0;return p?(i.replaceNodeWithNodes(t,n.parent,p[0]),p[1]):(i.replaceRangeWithText(t,e.createRange(u.getStart(t),d.pos),"export default"),!0)}i.delete(t,n.parent)}else e.isExportsOrModuleExportsOrAlias(t,u.expression)&&function(t,r,n,i){var a=r.left.name.text,o=i.get(a);if(void 0!==o){var s=[m(void 0,o,r.right),g([e.factory.createExportSpecifier(!1,o,a)])];n.replaceNodeWithNodes(t,r.parent,s)}else!function(t,r,n){var i=t.left,a=t.right,o=t.parent,s=i.name.text;if(!(e.isFunctionExpression(a)||e.isArrowFunction(a)||e.isClassExpression(a))||a.name&&a.name.text!==s)n.replaceNodeRangeWithNodes(r,i.expression,e.findChildOfKind(i,24,r),[e.factory.createToken(93),e.factory.createToken(85)],{joiner:" ",suffix:" "});else{n.replaceRange(r,{pos:i.getStart(r),end:a.getStart(r)},e.factory.createToken(93),{suffix:" "}),a.name||n.insertName(r,a,s);var c=e.findChildOfKind(o,26,r);c&&n.delete(r,c)}}(r,t,n)}(t,n,i,a);return!1}(t,n,y,i,d,p)}default:return!1}}function a(r,n,i,a,o,s,c){var u,d=n.declarationList,_=!1,g=e.map(d.declarations,(function(n){var i=n.name,u=n.initializer;if(u){if(e.isExportsOrModuleExportsOrAlias(r,u))return _=!0,y([]);if(e.isRequireCall(u,!0))return _=!0,function(r,n,i,a,o,s){switch(r.kind){case 201:var c=e.mapAllOrFail(r.elements,(function(t){return t.dotDotDotToken||t.initializer||t.propertyName&&!e.isIdentifier(t.propertyName)||!e.isIdentifier(t.name)?void 0:f(t.propertyName&&t.propertyName.text,t.name.text)}));if(c)return y([e.makeImport(void 0,c,n,s)]);case 202:var u=l(t.moduleSpecifierToValidIdentifier(n.text,o),a);return y([e.makeImport(e.factory.createIdentifier(u),void 0,n,s),m(void 0,e.getSynthesizedDeepClone(r),e.factory.createIdentifier(u))]);case 79:return function(t,r,n,i,a){for(var o,s=n.getSymbolAtLocation(t),c=new e.Map,u=!1,d=0,_=i.original.get(t.text);d<_.length;d++){var p=_[d];if(n.getSymbolAtLocation(p)===s&&p!==t){var f=p.parent;if(e.isPropertyAccessExpression(f)){var m=f.name.text;if("default"===m){u=!0;var g=p.getText();(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(g))}else{e.Debug.assert(f.expression===p,"Didn't expect expression === use");var h=c.get(m);void 0===h&&(h=l(m,i),c.set(m,h)),(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(h))}}else u=!0}}var v=0===c.size?void 0:e.arrayFrom(e.mapIterator(c.entries(),(function(t){var r=t[0],n=t[1];return e.factory.createImportSpecifier(!1,r===n?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(n))})));v||(u=!0);return y([e.makeImport(u?e.getSynthesizedDeepClone(t):void 0,v,r,a)],o)}(r,n,i,a,s);default:return e.Debug.assertNever(r,"Convert to ES module got invalid name kind ".concat(r.kind))}}(i,u.arguments[0],a,o,s,c);if(e.isPropertyAccessExpression(u)&&e.isRequireCall(u.expression,!0))return _=!0,function(t,r,n,i,a){switch(t.kind){case 201:case 202:var o=l(r,i);return y([p(o,r,n,a),m(void 0,t,e.factory.createIdentifier(o))]);case 79:return y([p(t.text,r,n,a)]);default:return e.Debug.assertNever(t,"Convert to ES module got invalid syntax form ".concat(t.kind))}}(i,u.name.text,u.expression.arguments[0],o,c)}return y([e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([n],d.flags))])}));if(_)return i.replaceNodeWithNodes(r,n,e.flatMap(g,(function(e){return e.newImports}))),e.forEach(g,(function(t){t.useSitesToUnqualify&&e.copyEntries(t.useSitesToUnqualify,null!=u?u:u=new e.Map)})),u}function o(e){return g(void 0,e)}function s(t){return g([e.factory.createExportSpecifier(!1,void 0,"default")],t)}function c(t,r){return r&&e.some(e.arrayFrom(r.keys()),(function(r){return e.rangeContainsRange(t,r)}))?e.isArray(t)?e.getSynthesizedDeepClonesWithReplacements(t,!0,n):e.getSynthesizedDeepCloneWithReplacements(t,!0,n):t;function n(e){if(206===e.kind){var t=r.get(e);return r.delete(e),t}}}function l(e,t){for(;t.original.has(e)||t.additional.has(e);)e="_".concat(e);return t.additional.add(e),e}function u(t){var r=e.createMultiMap();return d(t,(function(e){return r.add(e.text,e)})),r}function d(t,r){e.isIdentifier(t)&&function(e){var t=e.parent;switch(t.kind){case 206:return t.name!==e;case 203:case 270:return t.propertyName!==e;default:return!0}}(t)&&r(t),t.forEachChild((function(e){return d(e,r)}))}function _(t,r,n,i){return e.factory.createFunctionDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),e.getSynthesizedDeepClone(n.asteriskToken),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.parameters),e.getSynthesizedDeepClone(n.type),e.factory.converters.convertToFunctionBlock(c(n.body,i)))}function p(t,r,n,i){return"default"===r?e.makeImport(e.factory.createIdentifier(t),void 0,n,i):e.makeImport(void 0,[f(r,t)],n,i)}function f(t,r){return e.factory.createImportSpecifier(!1,void 0!==t&&t!==r?e.factory.createIdentifier(t):void 0,e.factory.createIdentifier(r))}function m(t,r,n){return e.factory.createVariableStatement(t,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(r,void 0,void 0,n)],2))}function g(t,r){return e.factory.createExportDeclaration(void 0,void 0,!1,t&&e.factory.createNamedExports(t),void 0===r?void 0:e.factory.createStringLiteral(r))}function y(e,t){return{newImports:e,useSitesToUnqualify:t}}t.registerCodeFix({errorCodes:[e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions:function(o){var s=o.sourceFile,c=o.program,d=o.preferences,_=e.textChanges.ChangeTracker.with(o,(function(t){var o=function(t,r,o,s,c){var d={original:u(t),additional:new e.Set},_=function(t,r,i){var a=new e.Map;return n(t,(function(t){var n=t.name,o=n.text,s=n.originalKeywordKind;!a.has(o)&&(void 0!==s&&e.isNonContextualKeyword(s)||r.resolveName(o,t,111551,!0))&&a.set(o,l("_".concat(o),i))})),a}(t,r,d);!function(t,r,i){n(t,(function(n,a){if(!a){var o=n.name.text;i.replaceNode(t,n,e.factory.createIdentifier(r.get(o)||o))}}))}(t,_,o);for(var p,f=!1,m=0,g=e.filter(t.statements,e.isVariableStatement);m0||c.length>0||u.size>0||d.size>0}};function p(t){var r,n,i=t.fixes,a=t.symbolName,o=e.first(i);switch(o.kind){case 0:s.push(o);break;case 1:c.push(o);break;case 2:var l=o.importClauseOrBindingPattern,_=o.importKind,p=o.addAsTypeOnly,f=String(e.getNodeId(l));if((h=u.get(f))||u.set(f,h={importClauseOrBindingPattern:l,defaultImport:void 0,namedImports:new e.Map}),0===_){var m=null==h?void 0:h.namedImports.get(a);h.namedImports.set(a,v(m,p))}else e.Debug.assert(void 0===h.defaultImport||h.defaultImport.name===a,"(Add to Existing) Default import should be missing or match symbolName"),h.defaultImport={name:a,addAsTypeOnly:v(null===(r=h.defaultImport)||void 0===r?void 0:r.addAsTypeOnly,p)};break;case 3:var g=o.moduleSpecifier,y=(_=o.importKind,o.useRequire),h=function(e,t,r,n){var i=b(e,!0),a=b(e,!1),o=d.get(i),s=d.get(a),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:r};if(1===t&&2===n)return o||(d.set(i,c),c);if(1===n&&(o||s))return o||s;if(s)return s;return d.set(a,c),c}(g,_,y,p=o.addAsTypeOnly);switch(e.Debug.assert(h.useRequire===y,"(Add new) Tried to add an `import` and a `require` for the same module"),_){case 1:e.Debug.assert(void 0===h.defaultImport||h.defaultImport.name===a,"(Add new) Default import should be missing or match symbolName"),h.defaultImport={name:a,addAsTypeOnly:v(null===(n=h.defaultImport)||void 0===n?void 0:n.addAsTypeOnly,p)};break;case 0:m=(h.namedImports||(h.namedImports=new e.Map)).get(a);h.namedImports.set(a,v(m,p));break;case 3:case 2:e.Debug.assert(void 0===h.namespaceLikeImport||h.namespaceLikeImport.name===a,"Namespacelike import shoudl be missing or match symbolName"),h.namespaceLikeImport={importKind:_,name:a,addAsTypeOnly:p}}break;case 4:break;default:e.Debug.assertNever(o,"fix wasn't never - got kind ".concat(o.kind))}function v(e,t){return Math.max(null!=e?e:0,t)}function b(e,t){return"".concat(t?1:0,"|").concat(e)}}}function l(t,r,n,i,a,o,s,c,l){e.Debug.assert(r.some((function(e){return e.moduleSymbol===n||e.symbol.parent===n})),"Some exportInfo should match the specified moduleSymbol");var u=e.createPackageJsonImportFilter(t,l,c);return h(p(r,a,o,s,i,t,c,l).fixes,t,i,u,c)}function u(e){return{description:e.description,changes:e.changes,commands:e.commands}}function d(t,r,n,i){var a,o,s=n.getCompilerOptions(),c=u(n.getTypeChecker(),!1);if(c)return c;var l=null===(o=null===(a=i.getPackageJsonAutoImportProvider)||void 0===a?void 0:a.call(i))||void 0===o?void 0:o.getTypeChecker();return e.Debug.checkDefined(l&&u(l,!0),"Could not find symbol in specified module for code actions");function u(n,i){var a=e.getDefaultLikeExportInfo(r,n,s);if(a&&e.skipAlias(a.symbol,n)===t)return{symbol:a.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:a.exportKind,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i};var o=n.tryGetMemberInModuleExportsAndProperties(t.name,r);return o&&e.skipAlias(o,n)===t?{symbol:o,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i}:void 0}}function _(t,r,n,i,a,o,s,c,l){var u=[],d=s.getCompilerOptions(),_=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?o.getPackageJsonAutoImportProvider():s,o)}));return e.forEachExternalModuleToImportFrom(s,o,l,(function(o,s,c,l){var _=c.getTypeChecker();if(!s||o===n||!e.startsWith(t.fileName,e.getDirectoryPath(s.fileName))){var f=e.getDefaultLikeExportInfo(o,_,d);f&&(f.name===i||M(o,e.getEmitScriptTarget(d),a)===i)&&e.skipAlias(f.symbol,_)===r&&p(c,s,l)&&u.push({symbol:f.symbol,moduleSymbol:o,moduleFileName:null==s?void 0:s.fileName,exportKind:f.exportKind,targetFlags:e.skipAlias(f.symbol,_).flags,isFromPackageJson:l});for(var m=0,g=_.getExportsAndPropertiesOfModule(o);m0}:{kind:3,moduleSpecifier:i,importKind:x(r,t.exportKind,d),useRequire:a,addAsTypeOnly:v,exportInfo:t,isReExport:o>0}}))}));return{computedWithoutCacheCount:y,fixes:h}}(n,i,a,o,s,t,c,l,u)}(t,_,o,s,null==n?void 0:n.position,i,a,c,l,u),y=g.fixes,h=g.computedWithoutCacheCount;return{computedWithoutCacheCount:void 0===h?0:h,fixes:r(r([],p?[p]:e.emptyArray,!0),y,!0)}}function f(e,t,r,n,i,a){return e?t&&2===a.importsNotUsedAsValues?2:!a.isolatedModules||!a.preserveValueImports||111551&n&&!i.getTypeOnlyAliasDeclaration(r)?1:2:4}function m(t,r){if(!e.isSourceFileJS(t))return!1;if(t.commonJsModuleIndicator&&!t.externalModuleIndicator)return!0;if(t.externalModuleIndicator&&!t.commonJsModuleIndicator)return!1;var n=r.getCompilerOptions();if(n.configFile)return e.getEmitModuleKind(n)=e.ModuleKind.ES2015)return i?1:2;if(a)return e.isExternalModule(t)||n?i?1:2:3;for(var o=0,s=t.statements;o1&&e.OrganizeImports.importSpecifiersAreSorted(r.parent.elements)){t.delete(i,r);var o=e.factory.updateImportSpecifier(r,!1,r.propertyName,r.name),s=e.OrganizeImports.getImportSpecifierInsertionIndex(r.parent.elements,o);t.insertImportSpecifierAtIndex(i,o,r.parent,s)}else t.deleteRange(i,r.getFirstToken());return r}return e.Debug.assert(r.parent.parent.isTypeOnly),c(r.parent.parent),r.parent.parent;case 267:return c(r),r;case 268:return c(r.parent),r.parent;case 265:return t.deleteRange(i,r.getChildAt(1)),r;default:e.Debug.failBadSyntaxKind(r)}function c(n){if(t.delete(i,e.getTypeKeywordOfTypeOnlyImport(n,i)),a){var o=e.tryCast(n.namedBindings,e.isNamedImports);if(o&&o.elements.length>1){e.OrganizeImports.importSpecifiersAreSorted(o.elements)&&270===r.kind&&0!==o.elements.indexOf(r)&&(t.delete(i,r),t.insertImportSpecifierAtIndex(i,r,o,0));for(var s=0,c=o.elements;s"),[e.Diagnostics.Convert_function_expression_0_to_arrow_function,c?c.text:e.ANONYMOUS]}return t.replaceNode(r,s,e.factory.createToken(85)),t.insertText(r,c.end," = "),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_declaration_0_to_arrow_function,c.text]}}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a,o=n.sourceFile,s=n.program,c=n.span,l=e.textChanges.ChangeTracker.with(n,(function(e){a=i(e,o,c.start,s.getTypeChecker())}));return a?[t.createCodeFixAction(r,l,a,r,e.Diagnostics.Fix_all_implicit_this_errors)]:e.emptyArray},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){i(t,r.file,r.start,e.program.getTypeChecker())}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixIncorrectNamedTupleSyntax",n=[e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=function(t,r){var n=e.getTokenAtPosition(t,r);return e.findAncestor(n,(function(e){return 197===e.kind}))}(i,a.start),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){if(n){for(var i=n.type,a=!1,o=!1;185===i.kind||186===i.kind||191===i.kind;)185===i.kind?a=!0:186===i.kind&&(o=!0),i=i.type;var s=e.factory.updateNamedTupleMember(n,n.dotDotDotToken||(o?e.factory.createToken(25):void 0),n.name,n.questionToken||(a?e.factory.createToken(57):void 0),i);s!==n&&t.replaceNode(r,n,s)}}(t,i,o)}));return[t.createCodeFixAction(r,s,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels,r,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="fixSpelling",n=[e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.No_overload_matches_this_call.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code];function i(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=a.parent;if(i!==e.Diagnostics.No_overload_matches_this_call.code&&i!==e.Diagnostics.Type_0_is_not_assignable_to_type_1.code||e.isJsxAttribute(o)){var s,c=n.program.getTypeChecker();if(e.isPropertyAccessExpression(o)&&o.name===a){e.Debug.assert(e.isMemberName(a),"Expected an identifier for spelling (property access)");var l=c.getTypeAtLocation(o.expression);32&o.flags&&(l=c.getNonNullableType(l)),s=c.getSuggestedSymbolForNonexistentProperty(a,l)}else if(e.isBinaryExpression(o)&&101===o.operatorToken.kind&&o.left===a&&e.isPrivateIdentifier(a)){var u=c.getTypeAtLocation(o.right);s=c.getSuggestedSymbolForNonexistentProperty(a,u)}else if(e.isQualifiedName(o)&&o.right===a){var d=c.getSymbolAtLocation(o.left);d&&1536&d.flags&&(s=c.getSuggestedSymbolForNonexistentModule(o.right,d))}else if(e.isImportSpecifier(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for spelling (import)");var _=function(t,r,n){if(!n||!e.isStringLiteralLike(n.moduleSpecifier))return;var i=e.getResolvedModule(t,n.moduleSpecifier.text,e.getModeForUsageLocation(t,n.moduleSpecifier));return i?r.program.getSourceFile(i.resolvedFileName):void 0}(t,n,e.findAncestor(a,e.isImportDeclaration));_&&_.symbol&&(s=c.getSuggestedSymbolForNonexistentModule(a,_.symbol))}else if(e.isJsxAttribute(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for JSX attribute");var p=e.findAncestor(a,e.isJsxOpeningLikeElement),f=c.getContextualTypeForArgumentAtIndex(p,0);s=c.getSuggestedSymbolForNonexistentJSXAttribute(a,f)}else if(e.hasSyntacticModifier(o,16384)&&e.isClassElement(o)&&o.name===a){var m=e.findAncestor(a,e.isClassLike),g=m?e.getEffectiveBaseTypeNode(m):void 0,y=g?c.getTypeAtLocation(g):void 0;y&&(s=c.getSuggestedSymbolForNonexistentClassMember(e.getTextOfNode(a),y))}else{var h=e.getMeaningFromLocation(a),v=e.getTextOfNode(a);e.Debug.assert(void 0!==v,"name should be defined"),s=c.getSuggestedSymbolForNonexistentSymbol(a,v,function(e){var t=0;4&e&&(t|=1920);2&e&&(t|=788968);1&e&&(t|=111551);return t}(h))}return void 0===s?void 0:{node:a,suggestedSymbol:s}}}function a(t,r,n,i,a){var o=e.symbolName(i);if(!e.isIdentifierText(o,a)&&e.isPropertyAccessExpression(n.parent)){var s=i.valueDeclaration;s&&e.isNamedDeclaration(s)&&e.isPrivateIdentifier(s.name)?t.replaceNode(r,n,e.factory.createIdentifier(o)):t.replaceNode(r,n.parent,e.factory.createElementAccessExpression(n.parent.expression,e.factory.createStringLiteral(o)))}else t.replaceNode(r,n,e.factory.createIdentifier(o))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.errorCode,c=i(o,n.span.start,n,s);if(c){var l=c.node,u=c.suggestedSymbol,d=e.getEmitScriptTarget(n.host.getCompilationSettings()),_=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l,u,d)}));return[t.createCodeFixAction("spelling",_,[e.Diagnostics.Change_spelling_to_0,e.symbolName(u)],r,e.Diagnostics.Fix_all_detected_spelling_errors)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(n.file,n.start,r,n.code),s=e.getEmitScriptTarget(r.host.getCompilationSettings());o&&a(t,r.sourceFile,o.node,o.suggestedSymbol,s)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r,n="returnValueCorrect",i="fixAddReturnStatement",a="fixRemoveBracesFromArrowFunctionBody",o="fixWrapTheBlockWithParen",s=[e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function c(t,r,n){var i=t.createSymbol(4,r.escapedText);i.type=t.getTypeAtLocation(n);var a=e.createSymbolTable([i]);return t.createAnonymousType(void 0,a,[],[],[])}function l(t,n,i,a){if(n.body&&e.isBlock(n.body)&&1===e.length(n.body.statements)){var o=e.first(n.body.statements);if(e.isExpressionStatement(o)&&u(t,n,t.getTypeAtLocation(o.expression),i,a))return{declaration:n,kind:r.MissingReturnStatement,expression:o.expression,statement:o,commentSource:o.expression};if(e.isLabeledStatement(o)&&e.isExpressionStatement(o.statement)){var s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(o.label,o.statement.expression)]);if(u(t,n,c(t,o.label,o.statement.expression),i,a))return e.isArrowFunction(n)?{declaration:n,kind:r.MissingParentheses,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:o.statement.expression}}else if(e.isBlock(o)&&1===e.length(o.statements)){var l=e.first(o.statements);if(e.isLabeledStatement(l)&&e.isExpressionStatement(l.statement)){s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(l.label,l.statement.expression)]);if(u(t,n,c(t,l.label,l.statement.expression),i,a))return{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:l}}}}}function u(t,r,n,i,a){if(a){var o=t.getSignatureFromDeclaration(r);if(o){e.hasSyntacticModifier(r,256)&&(n=t.createPromiseType(n));var s=t.createSignature(r,o.typeParameters,o.thisParameter,o.parameters,n,void 0,o.minArgumentCount,o.flags);n=t.createAnonymousType(void 0,e.createSymbolTable(),[s],[],[])}else n=t.getAnyType()}return t.isTypeAssignableTo(n,i)}function d(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(a.parent){var o=e.findAncestor(a.parent,e.isFunctionLikeDeclaration);switch(i){case e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&e.rangeContainsRange(o.type,a)))return;return l(t,o,t.getTypeFromTypeNode(o.type),!1);case e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!e.isCallExpression(o.parent)||!o.body)return;var s=o.parent.arguments.indexOf(o),c=t.getContextualTypeForArgumentAtIndex(o.parent,s);if(!c)return;return l(t,o,c,!0);case e.Diagnostics.Type_0_is_not_assignable_to_type_1.code:if(!e.isDeclarationName(a)||!e.isVariableLike(a.parent)&&!e.isJsxAttribute(a.parent))return;var u=function(t){switch(t.kind){case 254:case 164:case 203:case 167:case 296:return t.initializer;case 285:return t.initializer&&(e.isJsxExpression(t.initializer)?t.initializer.expression:void 0);case 297:case 166:case 299:case 347:case 340:return}}(a.parent);if(!u||!e.isFunctionLikeDeclaration(u)||!u.body)return;return l(t,u,t.getTypeAtLocation(a.parent),!0)}}}function _(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.probablyUsesSemicolons(r);t.replaceNode(r,i,e.factory.createReturnStatement(n),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,suffix:a?";":void 0})}function p(t,r,n,i,a,o){var s=o||e.needsParentheses(i)?e.factory.createParenthesizedExpression(i):i;e.suppressLeadingAndTrailingTrivia(a),e.copyComments(a,s),t.replaceNode(r,n.body,s)}function f(t,r,n,i){t.replaceNode(r,n.body,e.factory.createParenthesizedExpression(i))}function m(r,a,o){var s=e.textChanges.ChangeTracker.with(r,(function(e){return _(e,r.sourceFile,a,o)}));return t.createCodeFixAction(n,s,e.Diagnostics.Add_a_return_statement,i,e.Diagnostics.Add_all_missing_return_statement)}function g(r,i,a){var s=e.textChanges.ChangeTracker.with(r,(function(e){return f(e,r.sourceFile,i,a)}));return t.createCodeFixAction(n,s,e.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,o,e.Diagnostics.Wrap_all_object_literal_with_parentheses)}!function(e){e[e.MissingReturnStatement=0]="MissingReturnStatement",e[e.MissingParentheses=1]="MissingParentheses"}(r||(r={})),t.registerCodeFix({errorCodes:s,fixIds:[i,a,o],getCodeActions:function(i){var o=i.program,s=i.sourceFile,c=i.span.start,l=i.errorCode,u=d(o.getTypeChecker(),s,c,l);if(u)return u.kind===r.MissingReturnStatement?e.append([m(i,u.expression,u.statement)],e.isArrowFunction(u.declaration)?function(r,i,o,s){var c=e.textChanges.ChangeTracker.with(r,(function(e){return p(e,r.sourceFile,i,o,s,!1)}));return t.createCodeFixAction(n,c,e.Diagnostics.Remove_braces_from_arrow_function_body,a,e.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(i,u.declaration,u.expression,u.commentSource):void 0):[g(i,u.declaration,u.expression)]},getAllCodeActions:function(r){return t.codeFixAll(r,s,(function(t,n){var s=d(r.program.getTypeChecker(),n.file,n.start,n.code);if(s)switch(r.fixId){case i:_(t,n.file,s.expression,s.statement);break;case a:if(!e.isArrowFunction(s.declaration))return;p(t,n.file,s.declaration,s.expression,s.commentSource,!1);break;case o:if(!e.isArrowFunction(s.declaration))return;f(t,n.file,s.declaration,s.expression);break;default:e.Debug.fail(JSON.stringify(r.fixId))}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n,i="fixMissingMember",a="fixMissingProperties",o="fixMissingAttributes",s="fixMissingFunctionDeclaration",c=[e.Diagnostics.Property_0_does_not_exist_on_type_1.code,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Cannot_find_name_0.code];function l(t,r,n,i,a){var o=e.getTokenAtPosition(t,r),s=o.parent;if(n===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(18!==o.kind||!e.isObjectLiteralExpression(s)||!e.isCallExpression(s.parent))return;var c=e.findIndex(s.parent.arguments,(function(e){return e===s}));if(c<0)return;var l=e.singleOrUndefined(i.getSignaturesOfType(i.getTypeAtLocation(s.parent.expression),0));if(!(l&&l.declaration&&l.parameters[c]))return;var d=l.parameters[c].valueDeclaration;if(!(d&&e.isParameter(d)&&e.isIdentifier(d.name)))return;var _=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s),i.getParameterType(l,c),!1,!1));if(!e.length(_))return;return{kind:3,token:d.name,properties:_,parentDeclaration:s}}if(e.isMemberName(o)){if(e.isIdentifier(o)&&e.hasInitializer(s)&&s.initializer&&e.isObjectLiteralExpression(s.initializer)){_=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s.initializer),i.getTypeAtLocation(o),!1,!1));if(!e.length(_))return;return{kind:3,token:o,properties:_,parentDeclaration:s.initializer}}if(e.isIdentifier(o)&&e.isJsxOpeningLikeElement(o.parent)){var p=function(t,r,n){var i=t.getContextualType(n.attributes);if(void 0===i)return e.emptyArray;var a=i.getProperties();if(!e.length(a))return e.emptyArray;for(var o=new e.Set,s=0,c=n.attributes.properties;s=e.ModuleKind.ES2015&&o99)&&(s=e.textChanges.ChangeTracker.with(r,(function(r){if(e.getTsConfigObjectLiteralExpression(i)){var n=[["target",e.factory.createStringLiteral("es2017")]];o===e.ModuleKind.CommonJS&&n.push(["module",e.factory.createStringLiteral("commonjs")]),t.setJsonCompilerOptionValues(r,i,n)}})),a.push(t.createCodeFixActionWithoutFixAll("fixTargetOption",s,[e.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))),a.length?a:void 0}}})}(c||(c={})),function(e){!function(t){var r="fixPropertyAssignment",n=[e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];function i(t,r,n){t.replaceNode(r,n,e.factory.createPropertyAssignment(n.name,n.objectAssignmentInitializer))}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isShorthandPropertyAssignment)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start),s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return[t.createCodeFixAction(r,s,[e.Diagnostics.Change_0_to_1,"=",":"],r,[e.Diagnostics.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,a(t.file,t.start))}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="extendsInterfaceBecomesImplements",n=[e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingClass(n).heritageClauses,a=i[0].getFirstToken();return 94===a.kind?{extendsToken:a,heritageClauses:i}:void 0}function a(t,r,n,i){if(t.replaceNode(r,n,e.factory.createToken(117)),2===i.length&&94===i[0].token&&117===i[1].token){var a=i[1].getFirstToken(),o=a.getFullStart();t.replaceRange(r,{pos:o,end:o},e.factory.createToken(27));for(var s=r.text,c=a.end;c":">","}":"}"};function o(t,r,n,i,o){var s=n.getText()[i];if(function(t){return e.hasProperty(a,t)}(s)){var c=o?a[s]:"{".concat(e.quote(n,r,s),"}");t.replaceRangeWithText(n,{pos:i,end:i+1},c)}}}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="deleteUnmatchedParameter",n="renameUnmatchedParameter",i=[e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];function a(t,r){var n=e.getTokenAtPosition(t,r);if(n.parent&&e.isJSDocParameterTag(n.parent)&&e.isIdentifier(n.parent.name)){var i=n.parent,a=e.getHostSignatureFromJSDoc(i);if(a)return{signature:a,name:n.parent.name,jsDocParameterTag:i}}}t.registerCodeFix({fixIds:[r,n],errorCodes:i,getCodeActions:function(i){var o=[],s=a(i.sourceFile,i.span.start);if(s)return e.append(o,function(n,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag,c=e.textChanges.ChangeTracker.with(n,(function(e){return e.filterJSDocTags(n.sourceFile,o,(function(e){return e!==s}))}));return t.createCodeFixAction(r,c,[e.Diagnostics.Delete_unused_param_tag_0,a.getText(n.sourceFile)],r,e.Diagnostics.Delete_all_unused_param_tags)}(i,s)),e.append(o,function(r,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag;if(!e.length(o.parameters))return;for(var c=r.sourceFile,l=e.getJSDocTags(o),u=new e.Set,d=0,_=l;d<_.length;d++){var p=_[d];e.isJSDocParameterTag(p)&&e.isIdentifier(p.name)&&u.add(p.name.escapedText)}var f=e.firstDefined(o.parameters,(function(t){return e.isIdentifier(t.name)&&!u.has(t.name.escapedText)?t.name.getText(c):void 0}));if(void 0===f)return;var m=e.factory.updateJSDocParameterTag(s,s.tagName,e.factory.createIdentifier(f),s.isBracketed,s.typeExpression,s.isNameFirst,s.comment),g=e.textChanges.ChangeTracker.with(r,(function(t){return t.replaceJSDocComment(c,o,e.map(l,(function(e){return e===s?m:e})))}));return t.createCodeFixActionWithoutFixAll(n,g,[e.Diagnostics.Rename_param_tag_name_0_to_1,a.getText(c),f])}(i,s)),o},getAllCodeActions:function(n){var o=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(n,(function(s){t.eachDiagnostic(n,i,(function(t){var r=a(t.file,t.start);r&&o.set(r.signature,e.append(o.get(r.signature),r.jsDocParameterTag))})),o.forEach((function(t,i){if(n.fixId===r){var a=new e.Set(t);s.filterJSDocTags(i.getSourceFile(),i,(function(e){return!a.has(e)}))}}))})))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixUnreferenceableDecoratorMetadata",n=[e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=function(t,r,n){var i=e.tryCast(e.getTokenAtPosition(t,n),e.isIdentifier);if(i&&178===i.parent.kind){var a=r.getTypeChecker().getSymbolAtLocation(i);return e.find((null==a?void 0:a.declarations)||e.emptyArray,e.or(e.isImportClause,e.isImportSpecifier,e.isImportEqualsDeclaration))}}(n.sourceFile,n.program,n.span.start);if(i){var a,o=e.textChanges.ChangeTracker.with(n,(function(t){return 270===i.kind&&function(t,r,n,i){e.refactor.doChangeNamedToNamespaceOrDefault(r,i,t,n.parent)}(t,n.sourceFile,i,n.program)})),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n,i){if(265!==n.kind){var a=267===n.kind?n:n.parent.parent;if(!a.name||!a.namedBindings){var o=i.getTypeChecker();e.forEachImportClauseDeclaration(a,(function(t){if(111551&e.skipAlias(t.symbol,o).flags)return!0}))||t.insertModifierBefore(r,152,a)}}else t.insertModifierBefore(r,152,n.name)}(t,n.sourceFile,i,n.program)}));return o.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Convert_named_imports_to_namespace_import))),s.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,s,e.Diagnostics.Convert_to_type_only_import))),a}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="unusedIdentifier",n="unusedIdentifier_prefix",i="unusedIdentifier_delete",a="unusedIdentifier_deleteImports",o="unusedIdentifier_infer",s=[e.Diagnostics._0_is_declared_but_its_value_is_never_read.code,e.Diagnostics._0_is_declared_but_never_used.code,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,e.Diagnostics.All_imports_in_import_declaration_are_unused.code,e.Diagnostics.All_destructured_elements_are_unused.code,e.Diagnostics.All_variables_are_unused.code,e.Diagnostics.All_type_parameters_are_unused.code];function c(t,r,n){t.replaceNode(r,n.parent,e.factory.createKeywordTypeNode(155))}function l(n,a){return t.createCodeFixAction(r,n,a,i,e.Diagnostics.Delete_all_unused_declarations)}function u(t,r,n){t.delete(r,e.Debug.checkDefined(e.cast(n.parent,e.isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"))}function d(e){return 100===e.kind||79===e.kind&&(270===e.parent.kind||267===e.parent.kind)}function _(t){return 100===t.kind?e.tryCast(t.parent,e.isImportDeclaration):void 0}function p(t,r){return e.isVariableDeclarationList(r.parent)&&e.first(r.parent.getChildren(t))===r}function f(e,t,r){e.delete(t,237===r.parent.kind?r.parent:r)}function m(t,r,n,i){r!==e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code&&(137===i.kind&&(i=e.cast(i.parent,e.isInferTypeNode).typeParameter.name),e.isIdentifier(i)&&function(e){switch(e.parent.kind){case 164:case 163:return!0;case 254:switch(e.parent.parent.parent.kind){case 244:case 243:return!0}}return!1}(i)&&(t.replaceNode(n,i,e.factory.createIdentifier("_".concat(i.text))),e.isParameter(i.parent)&&e.getJSDocParameterTags(i.parent).forEach((function(r){e.isIdentifier(r.name)&&t.replaceNode(n,r.name,e.factory.createIdentifier("_".concat(r.name.text)))}))))}function g(t,r,n,i,a,o,s,c){!function(t,r,n,i,a,o,s,c){var l=t.parent;if(e.isParameter(l))!function(t,r,n,i,a,o,s,c){void 0===c&&(c=!1);(function(t,r,n,i,a,o,s){var c=n.parent;switch(c.kind){case 169:case 171:var l=c.parameters.indexOf(n),u=e.isMethodDeclaration(c)?c.name:c,d=e.FindAllReferences.Core.getReferencedSymbolsForNode(c.pos,u,a,i,o);if(d)for(var _=0,p=d;_l,v=e.isPropertyAccessExpression(g.node.parent)&&e.isSuperKeyword(g.node.parent.expression)&&e.isCallExpression(g.node.parent.parent)&&g.node.parent.parent.arguments.length>l,b=(e.isMethodDeclaration(g.node.parent)||e.isMethodSignature(g.node.parent))&&g.node.parent!==n.parent&&g.node.parent.parameters.length>l;if(y||v||b)return!1}}return!0;case 256:return!c.name||!function(t,r,n){return!!e.FindAllReferences.Core.eachSymbolReferenceInFile(n,t,r,(function(t){return e.isIdentifier(t)&&e.isCallExpression(t.parent)&&t.parent.arguments.indexOf(t)>=0}))}(t,r,c.name)||h(c,n,s);case 213:case 214:return h(c,n,s);case 173:return!1;case 172:return!0;default:return e.Debug.failBadSyntaxKind(c)}})(i,r,n,a,o,s,c)&&(n.modifiers&&n.modifiers.length>0&&(!e.isIdentifier(n.name)||e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,i,r))?n.modifiers.forEach((function(e){return t.deleteModifier(r,e)})):!n.initializer&&y(n,i,a)&&t.delete(r,n))}(r,n,l,i,a,o,s,c);else if(!(c&&e.isIdentifier(t)&&e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,n))){var u=e.isImportClause(l)?t:e.isComputedPropertyName(l)?l.parent:l;e.Debug.assert(u!==n,"should not delete whole source file"),r.delete(n,u)}}(r,n,t,i,a,o,s,c),e.isIdentifier(r)&&e.FindAllReferences.Core.eachSymbolReferenceInFile(r,i,t,(function(r){e.isPropertyAccessExpression(r.parent)&&r.parent.name===r&&(r=r.parent),!c&&function(t){return(e.isBinaryExpression(t.parent)&&t.parent.left===t||(e.isPostfixUnaryExpression(t.parent)||e.isPrefixUnaryExpression(t.parent))&&t.parent.operand===t)&&e.isExpressionStatement(t.parent.parent)}(r)&&n.delete(t,r.parent.parent)}))}function y(t,r,n){var i=t.parent.parameters.indexOf(t);return!e.FindAllReferences.Core.someSignatureUsage(t.parent,n,r,(function(e,t){return!t||t.arguments.length>i}))}function h(t,r,n){var i=t.parameters,a=i.indexOf(r);return e.Debug.assert(-1!==a,"The parameter should already be in the list"),n?i.slice(a+1).every((function(t){return e.isIdentifier(t.name)&&!t.symbol.isReferenced})):a===i.length-1}t.registerCodeFix({errorCodes:s,getCodeActions:function(i){var s=i.errorCode,y=i.sourceFile,h=i.program,v=i.cancellationToken,b=h.getTypeChecker(),x=h.getSourceFiles(),S=e.getTokenAtPosition(y,i.span.start);if(e.isJSDocTemplateTag(S))return[l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S)})),e.Diagnostics.Remove_template_tag)];if(29===S.kind)return[l(C=e.textChanges.ChangeTracker.with(i,(function(e){return u(e,y,S)})),e.Diagnostics.Remove_type_parameters)];var D=_(S);if(D){var C=e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D)}));return[t.createCodeFixAction(r,C,[e.Diagnostics.Remove_import_from_0,e.showModuleSpecifier(D)],a,e.Diagnostics.Delete_all_unused_imports)]}if(d(S)&&(N=e.textChanges.ChangeTracker.with(i,(function(e){return g(y,S,e,b,x,h,v,!1)}))).length)return[t.createCodeFixAction(r,N,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,S.getText(y)],a,e.Diagnostics.Delete_all_unused_imports)];if(e.isObjectBindingPattern(S.parent)||e.isArrayBindingPattern(S.parent)){if(e.isParameter(S.parent.parent)){var T=S.parent.elements,E=[T.length>1?e.Diagnostics.Remove_unused_declarations_for_Colon_0:e.Diagnostics.Remove_unused_declaration_for_Colon_0,e.map(T,(function(e){return e.getText(y)})).join(", ")];return[l(e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r,n){e.forEach(n.elements,(function(e){return t.delete(r,e)}))}(t,y,S.parent)})),E)]}return[l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S.parent.parent)})),e.Diagnostics.Remove_unused_destructuring_declaration)]}if(p(y,S))return[l(e.textChanges.ChangeTracker.with(i,(function(e){return f(e,y,S.parent)})),e.Diagnostics.Remove_variable_statement)];var k=[];if(137===S.kind){C=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,y,S)}));var A=e.cast(S.parent,e.isInferTypeNode).typeParameter.name.text;k.push(t.createCodeFixAction(r,C,[e.Diagnostics.Replace_infer_0_with_unknown,A],o,e.Diagnostics.Replace_all_unused_infer_with_unknown))}else{var N;if((N=e.textChanges.ChangeTracker.with(i,(function(e){return g(y,S,e,b,x,h,v,!1)}))).length){A=e.isComputedPropertyName(S.parent)?S.parent:S;k.push(l(N,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,A.getText(y)]))}}var w=e.textChanges.ChangeTracker.with(i,(function(e){return m(e,s,y,S)}));return w.length&&k.push(t.createCodeFixAction(r,w,[e.Diagnostics.Prefix_0_with_an_underscore,S.getText(y)],n,e.Diagnostics.Prefix_all_unused_declarations_with_where_possible)),k},fixIds:[n,i,a,o],getAllCodeActions:function(r){var l=r.sourceFile,h=r.program,v=r.cancellationToken,b=h.getTypeChecker(),x=h.getSourceFiles();return t.codeFixAll(r,s,(function(t,s){var S=e.getTokenAtPosition(l,s.start);switch(r.fixId){case n:m(t,s.code,l,S);break;case a:var D=_(S);D?t.delete(l,D):d(S)&&g(l,S,t,b,x,h,v,!0);break;case i:if(137===S.kind||d(S))break;if(e.isJSDocTemplateTag(S))t.delete(l,S);else if(29===S.kind)u(t,l,S);else if(e.isObjectBindingPattern(S.parent)){if(S.parent.parent.initializer)break;e.isParameter(S.parent.parent)&&!y(S.parent.parent,b,x)||t.delete(l,S.parent.parent)}else{if(e.isArrayBindingPattern(S.parent.parent)&&S.parent.parent.parent.initializer)break;p(l,S)?f(t,l,S.parent):g(l,S,t,b,x,h,v,!0)}break;case o:137===S.kind&&c(t,l,S);break;default:e.Debug.fail(JSON.stringify(r.fixId))}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="fixUnreachableCode",n=[e.Diagnostics.Unreachable_code_detected.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n),s=e.findAncestor(o,e.isStatement);if(s.getStart(r)!==o.getStart(r)){var c=JSON.stringify({statementKind:e.Debug.formatSyntaxKind(s.kind),tokenKind:e.Debug.formatSyntaxKind(o.kind),errorCode:a,start:n,length:i});e.Debug.fail("Token and statement should start at the same point. "+c)}var l=(e.isBlock(s.parent)?s.parent:s).parent;if(!e.isBlock(s.parent)||s===e.first(s.parent.statements))switch(l.kind){case 239:if(l.elseStatement){if(e.isBlock(s.parent))break;return void t.replaceNode(r,s,e.factory.createBlock(e.emptyArray))}case 241:case 242:return void t.delete(r,l)}if(e.isBlock(s.parent)){var u=n+i,d=e.Debug.checkDefined(function(e,t){for(var r,n=0,i=e;nJ.length)V(k,h.getSignatureFromDeclaration(y[y.length-1]),D,x,_||c(k));else e.Debug.assert(y.length===J.length,"Declarations and signatures should match count"),d(function(t,n,i,a,o,l,u,d,_){for(var p=a[0],f=a[0].minArgumentCount,m=!1,g=0,y=a;g=p.parameters.length&&(!e.signatureHasRestParameter(h)||e.signatureHasRestParameter(p))&&(p=h)}var v=p.parameters.length-(e.signatureHasRestParameter(p)?1:0),b=p.parameters.map((function(e){return e.name})),x=s(v,b,void 0,f,!1);if(m){var S=e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),b[v]||"rest",v>=f?e.factory.createToken(57):void 0,e.factory.createArrayTypeNode(e.factory.createKeywordTypeNode(155)),void 0);x.push(S)}return function(t,r,n,i,a,o,s,l){return e.factory.createMethodDeclaration(void 0,t,void 0,r,n?e.factory.createToken(57):void 0,i,a,o,l||c(s))}(u,o,l,void 0,x,function(t,n,i,a){if(e.length(t)){var o=n.getUnionType(e.map(t,n.getReturnTypeOfSignature));return n.typeToTypeNode(o,a,void 0,r(i))}}(a,t,n,i),d,_)}(h,o,n,J,x,T&&!!(1&f),D,k,_))}}function V(e,t,r,i,s){var c=a(169,o,e,t,s,i,r,T&&!!(1&f),n,u);c&&d(c)}}function a(t,n,i,a,o,s,c,l,u,d){var _=n.program,f=_.getTypeChecker(),g=e.getEmitScriptTarget(_.getCompilerOptions()),y=524545|(0===i?268435456:0),h=f.signatureToSignatureDeclaration(a,t,u,y,r(n));if(h){var v=h.typeParameters,b=h.parameters,x=h.type;if(d){if(v){var S=e.sameMap(v,(function(t){var r,n=t.constraint,i=t.default;n&&((r=p(n,g))&&(n=r.typeNode,m(d,r.symbols)));i&&((r=p(i,g))&&(i=r.typeNode,m(d,r.symbols)));return e.factory.updateTypeParameterDeclaration(t,t.modifiers,t.name,n,i)}));v!==S&&(v=e.setTextRange(e.factory.createNodeArray(S,v.hasTrailingComma),v))}var D=e.sameMap(b,(function(t){var r=p(t.type,g),n=t.type;return r&&(n=r.typeNode,m(d,r.symbols)),e.factory.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,n,t.initializer)}));if(b!==D&&(b=e.setTextRange(e.factory.createNodeArray(D,b.hasTrailingComma),b)),x){var C=p(x,g);C&&(x=C.typeNode,m(d,C.symbols))}}var T=l?e.factory.createToken(57):void 0,E=h.asteriskToken;return e.isFunctionExpression(h)?e.factory.updateFunctionExpression(h,c,h.asteriskToken,e.tryCast(s,e.isIdentifier),v,b,x,null!=o?o:h.body):e.isArrowFunction(h)?e.factory.updateArrowFunction(h,c,v,b,x,h.equalsGreaterThanToken,null!=o?o:h.body):e.isMethodDeclaration(h)?e.factory.updateMethodDeclaration(h,void 0,c,E,null!=s?s:e.factory.createIdentifier(""),T,v,b,x,o):void 0}}function o(t,r,n,i,a,o,s){var c=t.typeToTypeNode(n,i,o,s);if(c&&e.isImportTypeNode(c)){var l=p(c,a);l&&(m(r,l.symbols),c=l.typeNode)}return e.getSynthesizedDeepClone(c)}function s(t,r,n,i,a){for(var o=[],s=0;s=i?e.factory.createToken(57):void 0,a?void 0:n&&n[s]||e.factory.createKeywordTypeNode(155),void 0);o.push(c)}return o}function c(t){return l(e.Diagnostics.Method_not_implemented.message,t)}function l(t,r){return e.factory.createBlock([e.factory.createThrowStatement(e.factory.createNewExpression(e.factory.createIdentifier("Error"),void 0,[e.factory.createStringLiteral(t,0===r)]))],!0)}function u(t,r,n){var i=e.getTsConfigObjectLiteralExpression(r);if(i){var a=_(i,"compilerOptions");if(void 0!==a){var o=a.initializer;if(e.isObjectLiteralExpression(o))for(var s=0,c=n;s0)return[t.createCodeFixAction(r,a,e.Diagnostics.Convert_to_a_bigint_numeric_literal,r,e.Diagnostics.Convert_all_to_bigint_numeric_literals)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="fixAddModuleReferTypeMissingTypeof",n=[e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(100===n.kind,"This token should be an ImportKeyword"),e.Debug.assert(200===n.parent.kind,"Token parent should be an ImportType"),n.parent}function a(t,r,n){var i=e.factory.updateImportTypeNode(n,n.argument,n.qualifier,n.typeArguments,!0);t.replaceNode(r,n,i)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return[t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_typeof,r,e.Diagnostics.Add_missing_typeof)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="wrapJsxInFragment",n=[e.Diagnostics.JSX_expressions_must_have_one_parent_element.code];function i(t,r){var n=e.getTokenAtPosition(t,r).parent.parent;if((e.isBinaryExpression(n)||(n=n.parent,e.isBinaryExpression(n)))&&e.nodeIsMissing(n.operatorToken))return n}function a(t,r,n){var i=function(t){var r=[],n=t;for(;;){if(e.isBinaryExpression(n)&&e.nodeIsMissing(n.operatorToken)&&27===n.operatorToken.kind){if(r.push(n.left),e.isJsxChild(n.right))return r.push(n.right),r;if(e.isBinaryExpression(n.right)){n=n.right;continue}return}return}}(n);i&&t.replaceNode(r,n,e.factory.createJsxFragment(e.factory.createJsxOpeningFragment(),i,e.factory.createJsxJsxClosingFragment()))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return[t.createCodeFixAction(r,l,e.Diagnostics.Wrap_in_JSX_fragment,r,e.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(e.sourceFile,r.start);n&&a(t,e.sourceFile,n)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="fixConvertToMappedObjectType",i=[e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function a(t,r){var n=e.getTokenAtPosition(t,r),i=e.tryCast(n.parent.parent,e.isIndexSignatureDeclaration);if(i){var a=e.isInterfaceDeclaration(i.parent)?i.parent:e.tryCast(i.parent.parent,e.isTypeAliasDeclaration);if(a)return{indexSignature:i,container:a}}}function o(t,n,i){var a,o,s=i.indexSignature,c=i.container,l=(e.isInterfaceDeclaration(c)?c.members:c.type.members).filter((function(t){return!e.isIndexSignatureDeclaration(t)})),u=e.first(s.parameters),d=e.factory.createTypeParameterDeclaration(void 0,e.cast(u.name,e.isIdentifier),u.type),_=e.factory.createMappedTypeNode(e.hasEffectiveReadonlyModifier(s)?e.factory.createModifier(145):void 0,d,void 0,s.questionToken,s.type,void 0),p=e.factory.createIntersectionTypeNode(r(r(r([],e.getAllSuperTypeNodes(c),!0),[_],!1),l.length?[e.factory.createTypeLiteralNode(l)]:e.emptyArray,!0));t.replaceNode(n,c,(a=c,o=p,e.factory.createTypeAliasDeclaration(a.decorators,a.modifiers,a.name,a.typeParameters,o)))}t.registerCodeFix({errorCodes:i,getCodeActions:function(r){var i=r.sourceFile,s=r.span,c=a(i,s.start);if(c){var l=e.textChanges.ChangeTracker.with(r,(function(e){return o(e,i,c)})),u=e.idText(c.container.name);return[t.createCodeFixAction(n,l,[e.Diagnostics.Convert_0_to_mapped_object_type,u],n,[e.Diagnostics.Convert_0_to_mapped_object_type,u])]}},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(e,t){var r=a(t.file,t.start);r&&o(e,t.file,r)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="removeAccidentalCallParentheses",n=[e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=e.findAncestor(e.getTokenAtPosition(n.sourceFile,n.span.start),e.isCallExpression);if(i){var a=e.textChanges.ChangeTracker.with(n,(function(e){e.deleteRange(n.sourceFile,{pos:i.expression.end,end:i.end})}));return[t.createCodeFixActionWithoutFixAll(r,a,e.Diagnostics.Remove_parentheses)]}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="removeUnnecessaryAwait",n=[e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),(function(e){return 132===e.kind})),a=i&&e.tryCast(i.parent,e.isAwaitExpression);if(a){var o=a;if(e.isParenthesizedExpression(a.parent)){var s=e.getLeftmostExpression(a.expression,!1);if(e.isIdentifier(s)){var c=e.findPrecedingToken(a.parent.pos,r);c&&103!==c.kind&&(o=a.parent)}}t.replaceNode(r,o,a.expression)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return[t.createCodeFixAction(r,a,e.Diagnostics.Remove_unnecessary_await,r,e.Diagnostics.Remove_all_unnecessary_uses_of_await)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r=[e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],n="splitTypeOnlyImport";function i(t,r){return e.findAncestor(e.getTokenAtPosition(t,r.start),e.isImportDeclaration)}function a(t,r,n){if(r){var i=e.Debug.checkDefined(r.importClause);t.replaceNode(n.sourceFile,r,e.factory.updateImportDeclaration(r,r.decorators,r.modifiers,e.factory.updateImportClause(i,i.isTypeOnly,i.name,void 0),r.moduleSpecifier,r.assertClause)),t.insertNodeAfter(n.sourceFile,r,e.factory.createImportDeclaration(void 0,void 0,e.factory.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),r.moduleSpecifier,r.assertClause))}}t.registerCodeFix({errorCodes:r,fixIds:[n],getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.sourceFile,r.span),r)}));if(o.length)return[t.createCodeFixAction(n,o,e.Diagnostics.Split_into_two_separate_import_declarations,n,e.Diagnostics.Split_all_invalid_type_only_imports)]},getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(e.sourceFile,r),e)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixConvertConstToLet",n=[e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=n.program,s=function(t,r,n){var i,a=n.getTypeChecker().getSymbolAtLocation(e.getTokenAtPosition(t,r)),o=e.tryCast(null===(i=null==a?void 0:a.valueDeclaration)||void 0===i?void 0:i.parent,e.isVariableDeclarationList);if(void 0!==o){var s=e.findChildOfKind(o,85,t);if(void 0!==s)return e.createRange(s.pos,s.end)}}(i,a.start,o);if(void 0!==s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return function(e,t,r){e.replaceRangeWithText(t,r,"let")}(e,i,s)}));return[t.createCodeFixAction(r,c,e.Diagnostics.Convert_const_to_let,r,e.Diagnostics.Convert_const_to_let)]}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="fixExpectedComma",n=[e.Diagnostics._0_expected.code];function i(t,r,n){var i=e.getTokenAtPosition(t,r);return 26===i.kind&&i.parent&&(e.isObjectLiteralExpression(i.parent)||e.isArrayLiteralExpression(i.parent))?{node:i}:void 0}function a(t,r,n){var i=n.node,a=e.factory.createToken(27);t.replaceNode(r,i,a)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start,n.errorCode);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,s)}));return[t.createCodeFixAction(r,c,[e.Diagnostics.Change_0_to_1,";",","],r,[e.Diagnostics.Change_0_to_1,";",","])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start,r.code);n&&a(t,e.sourceFile,n)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addVoidToPromise",n=[e.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n.start);if(e.isIdentifier(o)&&e.isCallExpression(o.parent)&&o.parent.expression===o&&0===o.parent.arguments.length){var s=i.getTypeChecker(),c=s.getSymbolAtLocation(o),l=null==c?void 0:c.valueDeclaration;if(l&&e.isParameter(l)&&e.isNewExpression(l.parent.parent)&&!(null==a?void 0:a.has(l))){null==a||a.add(l);var u=function(t){var r;if(!e.isInJSFile(t))return t.typeArguments;if(e.isParenthesizedExpression(t.parent)){var n=null===(r=e.getJSDocTypeTag(t.parent))||void 0===r?void 0:r.typeExpression.type;if(n&&e.isTypeReferenceNode(n)&&e.isIdentifier(n.typeName)&&"Promise"===e.idText(n.typeName))return n.typeArguments}}(l.parent.parent);if(e.some(u)){var d=u[0],_=!e.isUnionTypeNode(d)&&!e.isParenthesizedTypeNode(d)&&e.isParenthesizedTypeNode(e.factory.createUnionTypeNode([d,e.factory.createKeywordTypeNode(114)]).types[0]);_&&t.insertText(r,d.pos,"("),t.insertText(r,d.end,_?") | void":" | void")}else{var p=s.getResolvedSignature(o.parent),f=null==p?void 0:p.parameters[0],m=f&&s.getTypeOfSymbolAtLocation(f,l.parent.parent);e.isInJSFile(l)?(!m||3&m.flags)&&(t.insertText(r,l.parent.parent.end,")"),t.insertText(r,e.skipTrivia(r.text,l.parent.parent.pos),"/** @type {Promise} */(")):(!m||2&m.flags)&&t.insertText(r,l.parent.parent.expression.end,"")}}}}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span,n.program)}));if(a.length>0)return[t.createCodeFixAction("addVoidToPromise",a,e.Diagnostics.Add_void_to_Promise_resolved_without_a_value,r,e.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){return i(t,n.file,n,r.program,new e.Set)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="Convert export",i={name:"Convert default export to named export",description:e.Diagnostics.Convert_default_export_to_named_export.message,kind:"refactor.rewrite.export.named"},a={name:"Convert named export to default export",description:e.Diagnostics.Convert_named_export_to_default_export.message,kind:"refactor.rewrite.export.default"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=e.getTokenAtPosition(n,a.start),s=o.parent&&1&e.getSyntacticModifierFlags(o.parent)&&r?o.parent:e.getParentNodeInSpan(o,n,a);if(!(s&&(e.isSourceFile(s.parent)||e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent))))return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_export_statement)};var c=e.isSourceFile(s.parent)?s.parent.symbol:s.parent.parent.symbol,l=e.getSyntacticModifierFlags(s)||(e.isExportAssignment(s)&&!s.isExportEquals?513:0),u=!!(512&l);if(!(1&l)||!u&&c.exports.has("default"))return{error:e.getLocaleSpecificMessage(e.Diagnostics.This_file_already_has_a_default_export)};var d=i.getTypeChecker(),_=function(t){return e.isIdentifier(t)&&d.getSymbolAtLocation(t)?void 0:{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_named_export)}};switch(s.kind){case 256:case 257:case 258:case 260:case 259:case 261:if(!(m=s).name)return;return _(m.name)||{exportNode:m,exportName:m.name,wasDefault:u,exportingModuleSymbol:c};case 237:var p=s;if(!(2&p.declarationList.flags)||1!==p.declarationList.declarations.length)return;var f=e.first(p.declarationList.declarations);if(!f.initializer)return;return e.Debug.assert(!u,"Can't have a default flag here"),_(f.name)||{exportNode:p,exportName:f.name,wasDefault:u,exportingModuleSymbol:c};case 271:var m;if((m=s).isExportEquals)return;return _(m.expression)||{exportNode:m,exportName:m.expression,wasDefault:u,exportingModuleSymbol:c};default:return}}function s(t,r){return e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}function c(t,r){return e.factory.createExportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}t.registerRefactor(r,{kinds:[i.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=c.wasDefault?i:a;return[{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.Diagnostics.Convert_default_export_to_named_export.message,actions:[n(n({},i),{notApplicableReason:c.error}),n(n({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,n){e.Debug.assert(n===i.name||n===a.name,"Unexpected action name");var l=o(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u=e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){(function(t,r,n,i){var a=r.wasDefault,o=r.exportNode,s=r.exportName;if(a)if(e.isExportAssignment(o)&&!o.isExportEquals){var l=o.expression,u=c(l.text,l.text);n.replaceNode(t,o,e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([u])))}else n.delete(t,e.Debug.checkDefined(e.findModifier(o,88),"Should find a default keyword in modifier list"));else{var d=e.Debug.checkDefined(e.findModifier(o,93),"Should find an export keyword in modifier list");switch(o.kind){case 256:case 257:case 258:n.insertNodeAfter(t,d,e.factory.createToken(88));break;case 237:var _=e.first(o.declarationList.declarations);if(!e.FindAllReferences.Core.isSymbolReferencedInFile(s,i,t)&&!_.type){n.replaceNode(t,o,e.factory.createExportDefault(e.Debug.checkDefined(_.initializer,"Initializer was previously known to be present")));break}case 260:case 259:case 261:n.deleteModifier(t,d),n.insertNodeAfter(t,o,e.factory.createExportDefault(e.factory.createIdentifier(s.text)));break;default:e.Debug.fail("Unexpected exportNode kind ".concat(o.kind))}}})(t,n,i,r.getTypeChecker()),function(t,r,n,i){var a=r.wasDefault,o=r.exportName,l=r.exportingModuleSymbol,u=t.getTypeChecker(),d=e.Debug.checkDefined(u.getSymbolAtLocation(o),"Export name should resolve to a symbol");e.FindAllReferences.Core.eachExportReference(t.getSourceFiles(),u,i,d,l,o.text,a,(function(t){var r=t.getSourceFile();a?function(t,r,n,i){var a=r.parent;switch(a.kind){case 206:n.replaceNode(t,r,e.factory.createIdentifier(i));break;case 270:case 275:var o=a;n.replaceNode(t,o,s(i,o.name.text));break;case 267:var c=a;e.Debug.assert(c.name===r,"Import clause name should match provided ref");o=s(i,r.text);var l=c.namedBindings;if(l)if(268===l.kind){n.deleteRange(t,{pos:r.getStart(t),end:l.getStart(t)});var u=e.isStringLiteral(c.parent.moduleSpecifier)?e.quotePreferenceFromString(c.parent.moduleSpecifier,t):1,d=e.makeImport(void 0,[s(i,r.text)],c.parent.moduleSpecifier,u);n.insertNodeAfter(t,c.parent,d)}else n.delete(t,r),n.insertNodeAtEndOfList(t,l.elements,o);else n.replaceNode(t,r,e.factory.createNamedImports([o]));break;case 200:var _=a;n.replaceNode(t,a,e.factory.createImportTypeNode(_.argument,e.factory.createIdentifier(i),_.typeArguments,_.isTypeOf));break;default:e.Debug.failBadSyntaxKind(a)}}(r,t,n,o.text):function(t,r,n){var i=r.parent;switch(i.kind){case 206:n.replaceNode(t,r,e.factory.createIdentifier("default"));break;case 270:var a=e.factory.createIdentifier(i.name.text);1===i.parent.elements.length?n.replaceNode(t,i.parent,a):(n.delete(t,i),n.insertNodeBefore(t,i.parent,a));break;case 275:n.replaceNode(t,i,c("default",i.name.text));break;default:e.Debug.assertNever(i,"Unexpected parent kind ".concat(i.kind))}}(r,t,n)}))}(r,n,i,a)}(r.file,r.program,l,t,r.cancellationToken)}));return{edits:u,renameFilename:void 0,renameLocation:void 0}}})}(e.refactor||(e.refactor={}))}(c||(c={})),function(e){!function(t){var r,i="Convert import",a=((r={})[0]={name:"Convert namespace import to named imports",description:e.Diagnostics.Convert_namespace_import_to_named_imports.message,kind:"refactor.rewrite.import.named"},r[2]={name:"Convert named imports to namespace import",description:e.Diagnostics.Convert_named_imports_to_namespace_import.message,kind:"refactor.rewrite.import.namespace"},r[1]={name:"Convert named imports to default import",description:e.Diagnostics.Convert_named_imports_to_default_import.message,kind:"refactor.rewrite.import.default"},r);function o(t,r){void 0===r&&(r=!0);var n=t.file,i=e.getRefactorContextSpan(t),a=e.getTokenAtPosition(n,i.start),o=r?e.findAncestor(a,e.isImportDeclaration):e.getParentNodeInSpan(a,n,i);if(!o||!e.isImportDeclaration(o))return{error:"Selection is not an import declaration."};var c=i.start+i.length,l=e.findNextToken(o,o.parent,n);if(!(l&&c>l.getStart())){var u=o.importClause;return u?u.namedBindings?268===u.namedBindings.kind?{convertTo:0,import:u.namedBindings}:s(t.program,u)?{convertTo:1,import:u.namedBindings}:{convertTo:2,import:u.namedBindings}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_namespace_import_or_named_imports)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_import_clause)}}}function s(t,r){return e.getAllowSyntheticDefaultImports(t.getCompilerOptions())&&function(e,t){var r=t.resolveExternalModuleName(e);if(!r)return!1;var n=t.resolveExternalModuleSymbol(r);return r!==n}(r.parent.moduleSpecifier,t.getTypeChecker())}function c(t){return e.isPropertyAccessExpression(t)?t.name:t.right}function l(t,r,n,i,a){void 0===a&&(a=s(r,i.parent));var o=r.getTypeChecker(),c=i.parent.parent,l=c.moduleSpecifier,d=new e.Set;i.elements.forEach((function(e){var t=o.getSymbolAtLocation(e.name);t&&d.add(t)}));var _=l&&e.isStringLiteral(l)?e.codefix.moduleSpecifierToValidIdentifier(l.text,99):"module";for(var p=i.elements.some((function(r){return!!e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(t){var r=o.resolveName(_,t,67108863,!0);return!!r&&(!d.has(r)||e.isExportSpecifier(t.parent))}))}))?e.getUniqueName(_,t):_,f=new e.Set,m=function(r){var i=(r.propertyName||r.name).text;e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(a){var o=e.factory.createPropertyAccessExpression(e.factory.createIdentifier(p),i);e.isShorthandPropertyAssignment(a.parent)?n.replaceNode(t,a.parent,e.factory.createPropertyAssignment(a.text,o)):e.isExportSpecifier(a.parent)?f.add(r):n.replaceNode(t,a,o)}))},g=0,y=i.elements;g=l.pos?_.getEnd():l.getEnd()),m=o?function(e){for(;e.parent;){if(c(e)&&!c(e.parent))return e;e=e.parent}}(l):function(e,t){for(;e.parent;){if(c(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent}}(l,f),g=m&&c(m)?function(t){if(s(t))return t;if(e.isVariableStatement(t)){var r=e.getSingleVariableOfVariableStatement(t),n=null==r?void 0:r.initializer;return n&&s(n)?n:void 0}return t.expression&&s(t.expression)?t.expression:void 0}(m):void 0;if(!g)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var y=i.getTypeChecker();return e.isConditionalExpression(g)?function(t,r){var n=t.condition,i=p(t.whenTrue);if(!i||r.isNullableType(r.getTypeAtLocation(i)))return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};if((e.isPropertyAccessExpression(n)||e.isIdentifier(n))&&d(n,i.expression))return{finalExpression:i,occurrences:[n],expression:t};if(e.isBinaryExpression(n)){var a=u(i.expression,n);return a?{finalExpression:i,occurrences:a,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}}(g,y):function(t){if(55!==t.operatorToken.kind)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_logical_AND_access_chains)};var r=p(t.right);if(!r)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var n=u(r.expression,t.left);return n?{finalExpression:r,occurrences:n,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}(g)}}function u(t,r){for(var n=[];e.isBinaryExpression(r)&&55===r.operatorToken.kind;){var i=d(e.skipParentheses(t),e.skipParentheses(r.right));if(!i)break;n.push(i),t=i,r=r.left}var a=d(t,r);return a&&n.push(a),n.length>0?n:void 0}function d(t,r){if(e.isIdentifier(r)||e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r))return function(t,r){for(;(e.isCallExpression(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&_(t)!==_(r);)t=t.expression;for(;e.isPropertyAccessExpression(t)&&e.isPropertyAccessExpression(r)||e.isElementAccessExpression(t)&&e.isElementAccessExpression(r);){if(_(t)!==_(r))return!1;t=t.expression,r=r.expression}return e.isIdentifier(t)&&e.isIdentifier(r)&&t.getText()===r.getText()}(t,r)?r:void 0}function _(t){return e.isIdentifier(t)||e.isStringOrNumericLiteralLike(t)?t.getText():e.isPropertyAccessExpression(t)?_(t.name):e.isElementAccessExpression(t)?_(t.argumentExpression):void 0}function p(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)?p(t.left):(e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)||e.isCallExpression(t))&&!e.isOptionalChain(t)?t:void 0}function f(t,r,n){if(e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r)||e.isCallExpression(r)){var i=f(t,r.expression,n),a=n.length>0?n[n.length-1]:void 0,o=(null==a?void 0:a.getText())===r.expression.getText();if(o&&n.pop(),e.isCallExpression(r))return o?e.factory.createCallChain(i,e.factory.createToken(28),r.typeArguments,r.arguments):e.factory.createCallChain(i,r.questionDotToken,r.typeArguments,r.arguments);if(e.isPropertyAccessExpression(r))return o?e.factory.createPropertyAccessChain(i,e.factory.createToken(28),r.name):e.factory.createPropertyAccessChain(i,r.questionDotToken,r.name);if(e.isElementAccessExpression(r))return o?e.factory.createElementAccessChain(i,e.factory.createToken(28),r.argumentExpression):e.factory.createElementAccessChain(i,r.questionDotToken,r.argumentExpression)}return r}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(r,n){var i=l(r);return e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){var o=i.finalExpression,s=i.occurrences,c=i.expression,l=s[s.length-1],u=f(r,o,s);u&&(e.isPropertyAccessExpression(u)||e.isElementAccessExpression(u)||e.isCallExpression(u))&&(e.isBinaryExpression(c)?n.replaceNodeRange(t,l,o,u):e.isConditionalExpression(c)&&n.replaceNode(t,c,e.factory.createBinaryExpression(u,e.factory.createToken(60),c.whenFalse)))}(r.file,r.program.getTypeChecker(),t,i)})),renameFilename:void 0,renameLocation:void 0}},getAvailableActions:function(r){var s=l(r,"invoked"===r.triggerReason);return s?t.isRefactorErrorInfo(s)?r.preferences.provideRefactorNotApplicableReason?[{name:i,description:a,actions:[n(n({},o),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:i,description:a,actions:[o]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).convertToOptionalChainExpression||(t.convertToOptionalChainExpression={}))}(c||(c={})),function(e){var t;(function(r){var n="Convert overload list to single signature",i=e.Diagnostics.Convert_overload_list_to_single_signature.message,a={name:n,description:i,kind:"refactor.rewrite.function.overloadList"};function o(e){switch(e.kind){case 168:case 169:case 174:case 171:case 175:case 256:return!0}return!1}function s(t,r,n){var i=e.getTokenAtPosition(t,r),a=e.findAncestor(i,o);if(a){var s=n.getTypeChecker(),c=a.symbol;if(c){var l=c.declarations;if(!(e.length(l)<=1)&&e.every(l,(function(r){return e.getSourceFileOfNode(r)===t}))&&o(l[0])){var u=l[0].kind;if(e.every(l,(function(e){return e.kind===u}))){var d=l;if(!e.some(d,(function(t){return!!t.typeParameters||e.some(t.parameters,(function(t){return!!t.decorators||!!t.modifiers||!e.isIdentifier(t.name)}))}))){var _=e.mapDefined(d,(function(e){return s.getSignatureFromDeclaration(e)}));if(e.length(_)===e.length(l)){var p=s.getReturnTypeOfSignature(_[0]);if(e.every(_,(function(e){return s.getReturnTypeOfSignature(e)===p})))return d}}}}}}}t.registerRefactor(n,{kinds:[a.kind],getEditsForAction:function(t){var r=t.file,n=t.startPosition,i=t.program,a=s(r,n,i);if(a){var o=i.getTypeChecker(),c=a[a.length-1],l=c;switch(c.kind){case 168:l=e.factory.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,d(a),c.type);break;case 169:l=e.factory.updateMethodDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,d(a),c.type,c.body);break;case 174:l=e.factory.updateCallSignature(c,c.typeParameters,d(a),c.type);break;case 171:l=e.factory.updateConstructorDeclaration(c,c.decorators,c.modifiers,d(a),c.body);break;case 175:l=e.factory.updateConstructSignature(c,c.typeParameters,d(a),c.type);break;case 256:l=e.factory.updateFunctionDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.typeParameters,d(a),c.type,c.body);break;default:return e.Debug.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(l!==c){var u=e.textChanges.ChangeTracker.with(t,(function(e){e.replaceNodeRange(r,a[0],a[a.length-1],l)}));return{renameFilename:void 0,renameLocation:void 0,edits:u}}}function d(t){var r=t[t.length-1];return e.isFunctionLikeDeclaration(r)&&r.body&&(t=t.slice(0,t.length-1)),e.factory.createNodeArray([e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),"args",void 0,e.factory.createUnionTypeNode(e.map(t,_)))])}function _(t){var r=e.map(t.parameters,p);return e.setEmitFlags(e.factory.createTupleTypeNode(r),e.some(r,(function(t){return!!e.length(e.getSyntheticLeadingComments(t))}))?0:1)}function p(t){e.Debug.assert(e.isIdentifier(t.name));var r=e.setTextRange(e.factory.createNamedTupleMember(t.dotDotDotToken,t.name,t.questionToken,t.type||e.factory.createKeywordTypeNode(130)),t),n=t.symbol&&t.symbol.getDocumentationComment(o);if(n){var i=e.displayPartsToString(n);i.length&&e.setSyntheticLeadingComments(r,[{text:"*\n".concat(i.split("\n").map((function(e){return" * ".concat(e)})).join("\n"),"\n "),kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}])}return r}},getAvailableActions:function(t){var r=t.file,o=t.startPosition,c=t.program;return s(r,o,c)?[{name:n,description:i,actions:[a]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}))}(c||(c={})),function(e){var t;(function(r){var i,a,o,s,c="Extract Symbol",l={name:"Extract Constant",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),kind:"refactor.extract.constant"},u={name:"Extract Function",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),kind:"refactor.extract.function"};function d(r){var i=r.kind,a=p(r.file,e.getRefactorContextSpan(r),"invoked"===r.triggerReason),o=a.targetRange;if(void 0===o){if(!a.errors||0===a.errors.length||!r.preferences.provideRefactorNotApplicableReason)return e.emptyArray;var s=[];return t.refactorKindBeginsWith(u.kind,i)&&s.push({name:c,description:u.description,actions:[n(n({},u),{notApplicableReason:N(a.errors)})]}),t.refactorKindBeginsWith(l.kind,i)&&s.push({name:c,description:l.description,actions:[n(n({},l),{notApplicableReason:N(a.errors)})]}),s}var d=function(t,r){var n=g(t,r),i=n.scopes,a=n.readsAndWrites,o=a.functionErrorsPerScope,s=a.constantErrorsPerScope,c=i.map((function(t,r){var n,i,a=function(t){return e.isFunctionLikeDeclaration(t)?"inner function":e.isClassLike(t)?"method":"function"}(t),c=function(t){return e.isClassLike(t)?"readonly field":"constant"}(t),l=e.isFunctionLikeDeclaration(t)?function(t){switch(t.kind){case 171:return"constructor";case 213:case 256:return t.name?"function '".concat(t.name.text,"'"):e.ANONYMOUS;case 214:return"arrow function";case 169:return"method '".concat(t.name.getText(),"'");case 172:return"'get ".concat(t.name.getText(),"'");case 173:return"'set ".concat(t.name.getText(),"'");default:throw e.Debug.assertNever(t,"Unexpected scope kind ".concat(t.kind))}}(t):e.isClassLike(t)?function(e){return 257===e.kind?e.name?"class '".concat(e.name.text,"'"):"anonymous class declaration":e.name?"class expression '".concat(e.name.text,"'"):"anonymous class expression"}(t):function(e){return 262===e.kind?"namespace '".concat(e.parent.name.getText(),"'"):e.externalModuleIndicator?0:1}(t);return 1===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"global"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"global"])):0===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"module"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"module"])):(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[a,l]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[c,l])),0!==r||e.isClassLike(t)||(i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_enclosing_scope),[c])),{functionExtraction:{description:n,errors:o[r]},constantExtraction:{description:i,errors:s[r]}}}));return c}(o,r);if(void 0===d)return e.emptyArray;for(var _,f,m=[],y=new e.Map,h=[],v=new e.Map,b=0,x=0,S=d;x0;if(e.isBlock(t)&&!s&&0===i.size)return{body:e.factory.createBlock(t.statements,!0),returnValueProperty:void 0};var c=!1,l=e.factory.createNodeArray(e.isBlock(t)?t.statements.slice(0):[e.isStatement(t)?t:e.factory.createReturnStatement(e.skipParentheses(t))]);if(s||i.size){var u=e.visitNodes(l,_).slice();if(s&&!a&&e.isStatement(t)){var d=v(r,n);1===d.length?u.push(e.factory.createReturnStatement(d[0].name)):u.push(e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(d)))}return{body:e.factory.createBlock(u,!0),returnValueProperty:o}}return{body:e.factory.createBlock(l,!0),returnValueProperty:void 0};function _(t){if(!c&&e.isReturnStatement(t)&&s){var a=v(r,n);return t.expression&&(o||(o="__return"),a.unshift(e.factory.createPropertyAssignment(o,e.visitNode(t.expression,_)))),1===a.length?e.factory.createReturnStatement(a[0].name):e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(a))}var l=c;c=c||e.isFunctionLikeDeclaration(t)||e.isClassLike(t);var u=i.get(e.getNodeId(t).toString()),d=u?e.getSynthesizedDeepClone(u):e.visitEachChild(t,_,e.nullTransformationContext);return c=l,d}}(t,i,l,_,!!(o.facts&a.HasReturn)),I=P.body,O=P.returnValueProperty;e.suppressLeadingAndTrailingTrivia(I);var M=!!(o.facts&a.UsesThisInFunction);if(e.isClassLike(r)){var L=S?[]:[e.factory.createModifier(121)];o.facts&a.InStaticRegion&&L.push(e.factory.createModifier(124)),o.facts&a.IsAsyncFunction&&L.push(e.factory.createModifier(131)),F=e.factory.createMethodDeclaration(void 0,L.length?L:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,C,void 0,A,T,c,I)}else M&&T.unshift(e.factory.createParameterDeclaration(void 0,void 0,void 0,"this",void 0,p.typeToTypeNode(p.getTypeAtLocation(o.thisNode),r,1),void 0)),F=e.factory.createFunctionDeclaration(void 0,o.facts&a.IsAsyncFunction?[e.factory.createToken(131)]:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,C,A,T,c,I);var R=e.textChanges.ChangeTracker.fromContext(s),B=function(t,r){return e.find(function(t){if(e.isFunctionLikeDeclaration(t)){var r=t.body;if(e.isBlock(r))return r.statements}else{if(e.isModuleBlock(t)||e.isSourceFile(t))return t.statements;if(e.isClassLike(t))return t.members;e.assertType(t)}return e.emptyArray}(r),(function(r){return r.pos>=t&&e.isFunctionLikeDeclaration(r)&&!e.isConstructorDeclaration(r)}))}((b(o.range)?e.last(o.range):o.range).end,r);B?R.insertNodeBefore(s.file,B,F,!0):R.insertNodeAtEndOfScope(s.file,r,F),m.writeFixes(R);var J=[],j=function(t,r,n){var i=e.factory.createIdentifier(n);if(e.isClassLike(t)){var o=r.facts&a.InStaticRegion?e.factory.createIdentifier(t.name.text):e.factory.createThis();return e.factory.createPropertyAccessExpression(o,i)}return i}(r,o,x);M&&E.unshift(e.factory.createIdentifier("this"));var U=e.factory.createCallExpression(M?e.factory.createPropertyAccessExpression(j,"call"):j,N,E);if(o.facts&a.IsGenerator&&(U=e.factory.createYieldExpression(e.factory.createToken(41),U)),o.facts&a.IsAsyncFunction&&(U=e.factory.createAwaitExpression(U)),D(t)&&(U=e.factory.createJsxExpression(void 0,U)),i.length&&!l)if(e.Debug.assert(!O,"Expected no returnValueProperty"),e.Debug.assert(!(o.facts&a.HasReturn),"Expected RangeFacts.HasReturn flag to be unset"),1===i.length){var V=i[0];J.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(V.name),void 0,e.getSynthesizedDeepClone(V.type),U)],V.parent.flags)))}else{for(var K=[],z=[],G=i[0].parent.flags,q=!1,W=0,H=i;W0,"Found no members");for(var a=!0,o=0,s=i;ot)return n||i[0];if(a&&!e.isPropertyDeclaration(c)){if(void 0!==n)return c;a=!1}n=c}return void 0===n?e.Debug.fail():n}(t.pos,r);g.insertNodeBefore(o.file,b,h,!0),g.replaceNode(o.file,t,v)}else{var x=e.factory.createVariableDeclaration(d,void 0,p,f),C=function(t,r){for(var n;void 0!==t&&t!==r;){if(e.isVariableDeclaration(t)&&t.initializer===n&&e.isVariableDeclarationList(t.parent)&&t.parent.declarations.length>1)return t;n=t,t=t.parent}}(t,r);if(C)g.insertNodeBefore(o.file,C,x),v=e.factory.createIdentifier(d),g.replaceNode(o.file,t,v);else if(238===t.parent.kind&&r===e.findAncestor(t,m)){var T=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2));g.replaceNode(o.file,t.parent,T)}else T=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2)),b=function(t,r){var n;e.Debug.assert(!e.isClassLike(r));for(var i=t;i!==r;i=i.parent)m(i)&&(n=i);for(i=(n||t).parent;;i=i.parent){if(S(i)){for(var a=void 0,o=0,s=i.statements;ot.pos)break;a=c}return!a&&e.isCaseClause(i)?(e.Debug.assert(e.isSwitchStatement(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):e.Debug.checkDefined(a,"prevStatement failed to get set")}e.Debug.assert(i!==r,"Didn't encounter a block-like before encountering scope")}}(t,r),0===b.pos?g.insertNodeAtTopOfFile(o.file,T,!1):g.insertNodeBefore(o.file,b,T,!1),238===t.parent.kind?g.delete(o.file,t.parent):(v=e.factory.createIdentifier(d),D(t)&&(v=e.factory.createJsxExpression(void 0,v)),g.replaceNode(o.file,t,v))}var E=g.getChanges(),k=t.getSourceFile().fileName,A=e.getRenameLocation(E,k,d,!0);return{renameFilename:k,renameLocation:A,edits:E};function N(n,i){if(void 0===n)return{variableType:n,initializer:i};if(!e.isFunctionExpression(i)&&!e.isArrowFunction(i)||i.typeParameters)return{variableType:n,initializer:i};var a=l.getTypeAtLocation(t),o=e.singleOrUndefined(l.getSignaturesOfType(a,0));if(!o)return{variableType:n,initializer:i};if(o.getTypeParameters())return{variableType:n,initializer:i};for(var s=[],c=!1,u=0,d=i.parameters;u=r.start+r.length)return(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractSuper)),!0}else g|=a.UsesThis,s=n;break;case 214:e.forEachChild(n,(function t(r){if(e.isThis(r))g|=a.UsesThis,s=n;else{if(e.isClassLike(r)||e.isFunctionLike(r)&&!e.isArrowFunction(r))return!1;e.forEachChild(r,t)}}));case 257:case 256:e.isSourceFile(n.parent)&&void 0===n.parent.externalModuleIndicator&&(o||(o=[])).push(e.createDiagnosticForNode(n,i.functionWillNotBeVisibleInTheNewScope));case 226:case 213:case 169:case 171:case 172:case 173:return!1}var _=u;switch(n.kind){case 239:case 252:u=0;break;case 235:n.parent&&252===n.parent.kind&&n.parent.finallyBlock===n&&(u=4);break;case 290:case 289:u|=1;break;default:e.isIterationStatement(n,!1)&&(u|=3)}switch(n.kind){case 192:case 108:g|=a.UsesThis,s=n;break;case 250:var p=n.label;(l||(l=[])).push(p.escapedText),e.forEachChild(n,t),l.pop();break;case 246:case 245:(p=n.label)?e.contains(l,p.escapedText)||(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):u&(246===n.kind?1:2)||(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break;case 218:g|=a.IsAsyncFunction;break;case 224:g|=a.IsGenerator;break;case 247:4&u?g|=a.HasReturn:(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingConditionalReturnStatement));break;default:e.forEachChild(n,t)}u=_}(t),g&a.UsesThis){var d=e.getThisContainer(t,!1);(256===d.kind||169===d.kind&&205===d.parent.kind||213===d.kind)&&(g|=a.UsesThisInFunction)}return o}}function f(t){return e.isStatement(t)?[t]:e.isExpressionNode(t)?e.isExpressionStatement(t.parent)?[t.parent]:t:C(t)?t:void 0}function m(t){return e.isArrowFunction(t)?e.isFunctionBody(t.body):e.isFunctionLikeDeclaration(t)||e.isSourceFile(t)||e.isModuleBlock(t)||e.isClassLike(t)}function g(t,r){var n=r.file,o=function(t){var r=b(t.range)?e.first(t.range):t.range;if(t.facts&a.UsesThis&&!(t.facts&a.UsesThisInFunction)){var n=e.getContainingClass(r);if(n){var i=e.findAncestor(r,e.isFunctionLikeDeclaration);return i?[i,n]:[n]}}for(var o=[];;)if(164===(r=r.parent).kind&&(r=e.findAncestor(r,(function(t){return e.isFunctionLikeDeclaration(t)})).parent),m(r)&&(o.push(r),305===r.kind))return o}(t),s=function(t,r){return b(t.range)?{pos:e.first(t.range).getStart(r),end:e.last(t.range).getEnd()}:t.range}(t,n),c=function(t,r,n,o,s,c){var l,u,d=new e.Map,_=[],p=[],f=[],m=[],g=[],y=new e.Map,h=[],v=b(t.range)?1===t.range.length&&e.isExpressionStatement(t.range[0])?t.range[0].expression:void 0:t.range;if(void 0===v){var x=t.range,S=e.first(x).getStart(),D=e.last(x).end;u=e.createFileDiagnostic(o,S,D-S,i.expressionExpected)}else 147456&s.getTypeAtLocation(v).flags&&(u=e.createDiagnosticForNode(v,i.uselessConstantType));for(var C=0,T=r;C0){for(var P=new e.Map,I=0,O=w;void 0!==O&&I0&&(o.usages.size>0||o.typeParameterUsages.size>0)){var s=b(t.range)?t.range[0]:t.range;m[n].push(e.createDiagnosticForNode(s,i.cannotAccessVariablesFromNestedScopes))}t.facts&a.UsesThisInFunction&&e.isClassLike(r[n])&&f[n].push(e.createDiagnosticForNode(t.thisNode,i.cannotExtractFunctionsContainingThisToMethod));var c,u=!1;if(_[n].usages.forEach((function(t){2===t.usage&&(u=!0,106500&t.symbol.flags&&t.symbol.valueDeclaration&&e.hasEffectiveModifier(t.symbol.valueDeclaration,64)&&(c=t.symbol.valueDeclaration))})),e.Debug.assert(b(t.range)||0===h.length,"No variable declarations expected if something was extracted"),u&&!b(t.range)){var d=e.createDiagnosticForNode(t.range,i.cannotWriteInExpression);f[n].push(d),m[n].push(d)}else c&&n>0?(d=e.createDiagnosticForNode(c,i.cannotExtractReadonlyPropertyInitializerOutsideConstructor),f[n].push(d),m[n].push(d)):l&&(d=e.createDiagnosticForNode(l,i.cannotExtractExportedEntity),f[n].push(d),m[n].push(d))},U=0;U=l)return g;if(A.set(g,l),y){for(var h=0,v=_;h=0)){var n=e.isIdentifier(r)?H(r):s.getSymbolAtLocation(r);if(n){var i=e.find(g,(function(e){return e.symbol===n}));if(i)if(e.isVariableDeclaration(i)){var a=i.symbol.id.toString();y.has(a)||(h.push(i),y.set(a,!0))}else l=l||i}e.forEachChild(r,W)}}function H(t){return t.parent&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?s.getShorthandAssignmentValueSymbol(t.parent):s.getSymbolAtLocation(t)}function Q(t,r,n){if(t){var i=t.getDeclarations();if(i&&i.some((function(e){return e.parent===r})))return e.factory.createIdentifier(t.name);var a=Q(t.parent,r,n);if(void 0!==a)return n?e.factory.createQualifiedName(a,e.factory.createIdentifier(t.name)):e.factory.createPropertyAccessExpression(a,t.name)}}}(t,o,s,n,r.program.getTypeChecker(),r.cancellationToken);return{scopes:o,readsAndWrites:c}}function y(e){var t,r=e.symbol;if(r&&r.declarations)for(var n=0,i=r.declarations;nn.pos}));if(-1!==a){var o=i[a];if(e.isNamedDeclaration(o)&&o.name&&e.rangeContainsRange(o.name,n))return{toMove:[i[a]],afterLast:i[a+1]};if(!(n.pos>o.getStart(r))){var s=e.findIndex(i,(function(e){return e.end>n.end}),a);if(-1===s||!(0===s||i[s].getStart(r)=1&&e.every(t,(function(t){return function(t,r){if(e.isRestParameter(t)){var n=r.getTypeAtLocation(t);if(!r.isArrayType(n)&&!r.isTupleType(n))return!1}return!t.modifiers&&!t.decorators&&e.isIdentifier(t.name)}(t,r)}))}(t.parameters,r))return!1;switch(t.kind){case 256:return g(t)&&m(t,r);case 169:if(e.isObjectLiteralExpression(t.parent)){var i=s(t.name,r);return 1===(null===(n=null==i?void 0:i.declarations)||void 0===n?void 0:n.length)&&m(t,r)}return m(t,r);case 171:return e.isClassDeclaration(t.parent)?g(t.parent)&&m(t,r):y(t.parent.parent)&&m(t,r);case 213:case 214:return y(t.parent)}return!1}(a,n)&&e.rangeContainsRange(a,i))||a.body&&e.rangeContainsRange(a.body,i)?void 0:a}function f(t){return e.isMethodSignature(t)&&(e.isInterfaceDeclaration(t.parent)||e.isTypeLiteralNode(t.parent))}function m(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function g(t){return!!t.name||!!e.findModifier(t,88)}function y(t){return e.isVariableDeclaration(t)&&e.isVarConst(t)&&e.isIdentifier(t.name)&&!t.type}function h(t){return t.length>0&&e.isThis(t[0].name)}function v(t){return h(t)&&(t=e.factory.createNodeArray(t.slice(1),t.hasTrailingComma)),t}function b(t,r){var n=v(t.parameters),i=e.isRestParameter(e.last(n)),a=i?r.slice(0,n.length-1):r,o=e.map(a,(function(t,r){var i=function(t,r){return e.isIdentifier(r)&&e.getTextOfIdentifierOrLiteral(r)===t?e.factory.createShorthandPropertyAssignment(t):e.factory.createPropertyAssignment(t,r)}(S(n[r]),t);return e.suppressLeadingAndTrailingTrivia(i.name),e.isPropertyAssignment(i)&&e.suppressLeadingAndTrailingTrivia(i.initializer),e.copyComments(t,i),i}));if(i&&r.length>=n.length){var s=r.slice(n.length-1),c=e.factory.createPropertyAssignment(S(e.last(n)),e.factory.createArrayLiteralExpression(s));o.push(c)}return e.factory.createObjectLiteralExpression(o,!1)}function x(t,r,n){var i,a,o,s=r.getTypeChecker(),c=v(t.parameters),l=e.map(c,(function(t){var r=e.factory.createBindingElement(void 0,void 0,S(t),e.isRestParameter(t)&&g(t)?e.factory.createArrayLiteralExpression():t.initializer);return e.suppressLeadingAndTrailingTrivia(r),t.initializer&&r.initializer&&e.copyComments(t.initializer,r.initializer),r})),u=e.factory.createObjectBindingPattern(l),d=(i=c,a=e.map(i,m),e.addEmitFlags(e.factory.createTypeLiteralNode(a),1));e.every(c,g)&&(o=e.factory.createObjectLiteralExpression());var _=e.factory.createParameterDeclaration(void 0,void 0,void 0,u,void 0,d,o);if(h(t.parameters)){var p=t.parameters[0],f=e.factory.createParameterDeclaration(void 0,void 0,void 0,p.name,void 0,p.type);return e.suppressLeadingAndTrailingTrivia(f.name),e.copyComments(p.name,f.name),p.type&&(e.suppressLeadingAndTrailingTrivia(f.type),e.copyComments(p.type,f.type)),e.factory.createNodeArray([f,_])}return e.factory.createNodeArray([_]);function m(t){var i=t.type;i||!t.initializer&&!e.isRestParameter(t)||(i=function(t){var i=s.getTypeAtLocation(t);return e.getTypeNodeIfAccessible(i,t,r,n)}(t));var a=e.factory.createPropertySignature(void 0,S(t),g(t)?e.factory.createToken(57):t.questionToken,i);return e.suppressLeadingAndTrailingTrivia(a),e.copyComments(t.name,a.name),t.type&&a.type&&e.copyComments(t.type,a.type),a}function g(t){if(e.isRestParameter(t)){var r=s.getTypeAtLocation(t);return!s.isTupleType(r)}return s.isOptionalParameter(t)}}function S(t){return e.getTextOfIdentifierOrLiteral(t.name)}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(t,n){e.Debug.assert(n===i,"Unexpected action name");var a=t.file,o=t.startPosition,m=t.program,g=t.cancellationToken,y=t.host,h=p(a,o,m.getTypeChecker());if(h&&g){var v=function(t,n,i){var a=function(t){switch(t.kind){case 256:return t.name?[t.name]:[e.Debug.checkDefined(e.findModifier(t,88),"Nameless function declaration should be a default export")];case 169:return[t.name];case 171:var r=e.Debug.checkDefined(e.findChildOfKind(t,134,t.getSourceFile()),"Constructor declaration should have constructor keyword");return 226===t.parent.kind?[t.parent.parent.name,r]:[r];case 214:return[t.parent.name];case 213:return t.name?[t.name,t.parent.name]:[t.parent.name];default:return e.Debug.assertNever(t,"Unexpected function declaration kind ".concat(t.kind))}}(t),o=e.isConstructorDeclaration(t)?function(t){switch(t.parent.kind){case 257:var r=t.parent;return r.name?[r.name]:[e.Debug.checkDefined(e.findModifier(r,88),"Nameless class declaration should be a default export")];case 226:var n=t.parent,i=t.parent.parent,a=n.name;return a?[a,i.name]:[i.name]}}(t):[],p=e.deduplicate(r(r([],a,!0),o,!0),e.equateValues),m=n.getTypeChecker(),g=e.flatMap(p,(function(t){return e.FindAllReferences.getReferenceEntriesForNode(-1,t,n,n.getSourceFiles(),i)})),y=h(g);return e.every(y.declarations,(function(t){return e.contains(p,t)}))||(y.valid=!1),y;function h(r){for(var n={accessExpressions:[],typeUsages:[]},i={functionCalls:[],declarations:[],classReferences:n,valid:!0},p=e.map(a,v),g=e.map(o,v),y=e.isConstructorDeclaration(t),h=e.map(a,(function(e){return s(e,m)})),b=0,x=r;b0;){var o=i.shift();e.copyTrailingComments(t[o],a,r,3,!1),n(o,a)}}}(n,r,a),s=p(0,n),c=s[0],l=s[1],u=s[2],d=s[3];if(c===n.length){var m=e.factory.createNoSubstitutionTemplateLiteral(l,u);return o(d,m),m}var g=[],y=e.factory.createTemplateHead(l,u);o(d,y);for(var h,v=function(t){var r=function(t){return e.isParenthesizedExpression(t)&&(f(t),t=t.expression),t}(n[t]);a(t,r);var i=p(t+1,n),s=i[0],c=i[1],l=i[2],u=i[3],d=(t=s-1)==n.length-1;if(e.isTemplateExpression(r)){var m=e.map(r.templateSpans,(function(t,n){f(t);var i=n===r.templateSpans.length-1,a=t.literal.text+(i?c:""),o=_(t.literal)+(i?l:"");return e.factory.createTemplateSpan(t.expression,d&&i?e.factory.createTemplateTail(a,o):e.factory.createTemplateMiddle(a,o))}));g.push.apply(g,m)}else{var y=d?e.factory.createTemplateTail(c,l):e.factory.createTemplateMiddle(c,l);o(u,y),g.push(e.factory.createTemplateSpan(r,y))}h=t},b=c;b1)return t.getUnionType(e.mapDefined(n,(function(e){return e.getReturnType()})))}var i=t.getSignatureFromDeclaration(r);if(i)return t.getReturnTypeOfSignature(i)}(a,i);if(!s)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_determine_function_return_type)};var c=a.typeToTypeNode(s,i,1);return c?{declaration:i,returnTypeNode:c}:void 0}}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(r){var n=s(r);if(n&&!t.isRefactorErrorInfo(n))return{renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(t){return i=r.file,a=t,o=n.declaration,s=n.returnTypeNode,c=e.findChildOfKind(o,21,i),l=e.isArrowFunction(o)&&void 0===c,void((u=l?e.first(o.parameters):c)&&(l&&(a.insertNodeBefore(i,u,e.factory.createToken(20)),a.insertNodeAfter(i,u,e.factory.createToken(21))),a.insertNodeAt(i,u.end,s,{prefix:": "})));var i,a,o,s,c,l,u}))}},getAvailableActions:function(r){var c=s(r);return c?t.isRefactorErrorInfo(c)?r.preferences.provideRefactorNotApplicableReason?[{name:i,description:a,actions:[n(n({},o),{notApplicableReason:c.error})]}]:e.emptyArray:[{name:i,description:a,actions:[o]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).inferFunctionReturnType||(t.inferFunctionReturnType={}))}(c||(c={})),function(e){function t(t,r,n,a){var o=e.isNodeKind(t)?new i(t,r,n):79===t?new u(79,r,n):80===t?new d(80,r,n):new l(t,r,n);return o.parent=a,o.flags=50720768&a.flags,o}e.servicesVersion="0.8";var i=function(){function r(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e}return r.prototype.assertHasRealPosition=function(t){e.Debug.assert(!e.positionIsSynthesized(this.pos)&&!e.positionIsSynthesized(this.end),t||"Node must have a real position for this operation")},r.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},r.prototype.getStart=function(t,r){return this.assertHasRealPosition(),e.getTokenPosOfNode(this,t,r)},r.prototype.getFullStart=function(){return this.assertHasRealPosition(),this.pos},r.prototype.getEnd=function(){return this.assertHasRealPosition(),this.end},r.prototype.getWidth=function(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)},r.prototype.getFullWidth=function(){return this.assertHasRealPosition(),this.end-this.pos},r.prototype.getLeadingTriviaWidth=function(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos},r.prototype.getFullText=function(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)},r.prototype.getText=function(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},r.prototype.getChildCount=function(e){return this.getChildren(e).length},r.prototype.getChildAt=function(e,t){return this.getChildren(t)[e]},r.prototype.getChildren=function(r){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=function(r,n){if(!e.isNodeKind(r.kind))return e.emptyArray;var i=[];if(e.isJSDocCommentContainingNode(r))return r.forEachChild((function(e){i.push(e)})),i;e.scanner.setText((n||r.getSourceFile()).text);var o=r.pos,s=function(e){a(i,o,e.pos,r),i.push(e),o=e.end},c=function(e){a(i,o,e.pos,r),i.push(function(e,r){var n=t(348,e.pos,e.end,r);n._children=[];for(var i=e.pos,o=0,s=e;o347}));return n.kind<161?n:n.getFirstToken(t)}},r.prototype.getLastToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t),n=e.lastOrUndefined(r);if(n)return n.kind<161?n:n.getLastToken(t)},r.prototype.forEachChild=function(t,r){return e.forEachChild(this,t,r)},r}();function a(r,n,i,a){for(e.scanner.setTextPos(n);n=n.length&&(t=this.getEnd()),t||(t=n[r+1]-1);var i=this.getFullText();return"\n"===i[t]&&"\r"===i[t-1]?t-1:t},r.prototype.getNamedDeclarations=function(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations},r.prototype.computeNamedDeclarations=function(){var t=e.createMultiMap();return this.forEachChild((function i(a){switch(a.kind){case 256:case 213:case 169:case 168:var o=a,s=n(o);if(s){var c=function(e){var r=t.get(e);r||t.set(e,r=[]);return r}(s),l=e.lastOrUndefined(c);l&&o.parent===l.parent&&o.symbol===l.symbol?o.body&&!l.body&&(c[c.length-1]=o):c.push(o)}e.forEachChild(a,i);break;case 257:case 226:case 258:case 259:case 260:case 261:case 265:case 275:case 270:case 267:case 268:case 172:case 173:case 182:r(a),e.forEachChild(a,i);break;case 164:if(!e.hasSyntacticModifier(a,16476))break;case 254:case 203:var u=a;if(e.isBindingPattern(u.name)){e.forEachChild(u.name,i);break}u.initializer&&i(u.initializer);case 299:case 167:case 166:r(a);break;case 272:var d=a;d.exportClause&&(e.isNamedExports(d.exportClause)?e.forEach(d.exportClause.elements,i):i(d.exportClause.name));break;case 266:var _=a.importClause;_&&(_.name&&r(_.name),_.namedBindings&&(268===_.namedBindings.kind?r(_.namedBindings):e.forEach(_.namedBindings.elements,i)));break;case 221:0!==e.getAssignmentDeclarationKind(a)&&r(a);default:e.forEachChild(a,i)}})),t;function r(e){var r=n(e);r&&t.add(r,e)}function n(t){var r=e.getNonAssignedNameOfDeclaration(t);return r&&(e.isComputedPropertyName(r)&&e.isPropertyAccessExpression(r.expression)?r.expression.name.text:e.isPropertyName(r)?e.getNameFromPropertyName(r):void 0)}},r}(i),v=function(){function t(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r}return t.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},t}();function b(t){var r=!0;for(var n in t)if(e.hasProperty(t,n)&&!x(n)){r=!1;break}if(r)return t;var i={};for(var n in t){if(e.hasProperty(t,n))i[x(n)?n:n.charAt(0).toLowerCase()+n.substr(1)]=t[n]}return i}function x(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function S(){return{target:1,jsx:1}}e.toEditorSettings=b,e.displayPartsToString=function(t){return t?e.map(t,(function(e){return e.text})).join(""):""},e.getDefaultCompilerOptions=S,e.getSupportedCodeFixes=function(){return e.codefix.getSupportedErrorCodes()};var D=function(){function t(t,r){this.host=t,this.currentDirectory=t.getCurrentDirectory(),this.fileNameToEntry=new e.Map;var n=t.getScriptFileNames();null===e.tracing||void 0===e.tracing||e.tracing.push("session","initializeHostCache",{count:n.length});for(var i=0,a=n;i=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=t,this.hostCancellationToken.isCancellationRequested())},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"ThrottledCancellationToken"}),new e.OperationCanceledException},t}();e.ThrottledCancellationToken=w;var F=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints"],P=r(r([],F,!0),["getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getOccurrencesAtPosition","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],!1);function I(t){var r=function(t){switch(t.kind){case 10:case 14:case 8:if(162===t.parent.kind)return e.isObjectLiteralElement(t.parent.parent)?t.parent.parent:void 0;case 79:return!e.isObjectLiteralElement(t.parent)||205!==t.parent.parent.kind&&286!==t.parent.parent.kind||t.parent.name!==t?void 0:t.parent}return}(t);return r&&(e.isObjectLiteralExpression(r.parent)||e.isJsxAttributes(r.parent))?r:void 0}function O(t,r,n,i){var a=e.getNameFromPropertyName(t.name);if(!a)return e.emptyArray;if(!n.isUnion())return(o=n.getProperty(a))?[o]:e.emptyArray;var o,s=e.mapDefined(n.types,(function(n){return(e.isObjectLiteralExpression(t.parent)||e.isJsxAttributes(t.parent))&&r.isTypeInvalidDueToUnionDiscriminant(n,t.parent)?void 0:n.getProperty(a)}));if(i&&(0===s.length||s.length===n.types.length)&&(o=n.getProperty(a)))return[o];return 0===s.length?e.mapDefined(n.types,(function(e){return e.getProperty(a)})):s}e.createLanguageService=function(t,i,a){var o,s,c;void 0===i&&(i=e.createDocumentRegistry(t.useCaseSensitiveFileNames&&t.useCaseSensitiveFileNames(),t.getCurrentDirectory())),c=void 0===a?e.LanguageServiceMode.Semantic:"boolean"==typeof a?a?e.LanguageServiceMode.Syntactic:e.LanguageServiceMode.Semantic:a;var l,u,d=new C(t),_=0,p=t.getCancellationToken?new N(t.getCancellationToken()):A,f=t.getCurrentDirectory();function m(e){t.log&&t.log(e)}e.maybeSetLocalizedDiagnosticMessages(null===(s=t.getLocalizedDiagnosticMessages)||void 0===s?void 0:s.bind(t));var g=e.hostUsesCaseSensitiveFileNames(t),y=e.createGetCanonicalFileName(g),h=e.getSourceMapper({useCaseSensitiveFileNames:function(){return g},getCurrentDirectory:function(){return f},getProgram:S,fileExists:e.maybeBind(t,t.fileExists),readFile:e.maybeBind(t,t.readFile),getDocumentPositionMapper:e.maybeBind(t,t.getDocumentPositionMapper),getSourceFileLike:e.maybeBind(t,t.getSourceFileLike),log:m});function v(e){var t=l.getSourceFile(e);if(!t){var r=new Error("Could not find source file: '".concat(e,"'."));throw r.ProgramFiles=l.getSourceFiles().map((function(e){return e.fileName})),r}return t}function x(){var r,n,a;if(e.Debug.assert(c!==e.LanguageServiceMode.Syntactic),t.getProjectVersion){var o=t.getProjectVersion();if(o){if(u===o&&!(null===(r=t.hasChangedAutomaticTypeDirectiveNames)||void 0===r?void 0:r.call(t)))return;u=o}}var s=t.getTypeRootsVersion?t.getTypeRootsVersion():0;_!==s&&(m("TypeRoots version has changed; provide new program"),l=void 0,_=s);var d,v=new D(t,y),b=v.getRootFileNames(),x=t.getCompilationSettings()||{target:1,jsx:1},S=t.hasInvalidatedResolution||e.returnFalse,C=e.maybeBind(t,t.hasChangedAutomaticTypeDirectiveNames),T=null===(n=t.getProjectReferences)||void 0===n?void 0:n.call(t),E={useCaseSensitiveFileNames:g,fileExists:F,readFile:P,readDirectory:I,trace:e.maybeBind(t,t.trace),getCurrentDirectory:function(){return f},onUnRecoverableConfigFileDiagnostic:e.noop};if(!e.isProgramUptoDate(l,b,x,(function(e,r){return t.getScriptVersion(r)}),F,S,C,w,T)){var k={getSourceFile:M,getSourceFileByPath:L,getCancellationToken:function(){return p},getCanonicalFileName:y,useCaseSensitiveFileNames:function(){return g},getNewLine:function(){return e.getNewLineCharacter(x,(function(){return e.getNewLineOrDefaultFromHost(t)}))},getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:e.noop,getCurrentDirectory:function(){return f},fileExists:F,readFile:P,getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),realpath:e.maybeBind(t,t.realpath),directoryExists:function(r){return e.directoryProbablyExists(r,t)},getDirectories:function(e){return t.getDirectories?t.getDirectories(e):[]},readDirectory:I,onReleaseOldSourceFile:O,onReleaseParsedCommandLine:function(e,r,n){var i;t.getParsedCommandLine?null===(i=t.onReleaseParsedCommandLine)||void 0===i||i.call(t,e,r,n):r&&O(r.sourceFile,n)},hasInvalidatedResolution:S,hasChangedAutomaticTypeDirectiveNames:C,trace:E.trace,resolveModuleNames:e.maybeBind(t,t.resolveModuleNames),getModuleResolutionCache:e.maybeBind(t,t.getModuleResolutionCache),resolveTypeReferenceDirectives:e.maybeBind(t,t.resolveTypeReferenceDirectives),useSourceOfProjectReferenceRedirect:e.maybeBind(t,t.useSourceOfProjectReferenceRedirect),getParsedCommandLine:w};null===(a=t.setCompilerHost)||void 0===a||a.call(t,k);var A=i.getKeyForCompilationSettings(x),N={rootNames:b,options:x,host:k,oldProgram:l,projectReferences:T};return l=e.createProgram(N),v=void 0,d=void 0,h.clearCache(),void l.getTypeChecker()}function w(r){var n=e.toPath(r,f,y),i=null==d?void 0:d.get(n);if(void 0!==i)return i||void 0;var a=t.getParsedCommandLine?t.getParsedCommandLine(r):function(t){var r=M(t,100);return r?(r.path=e.toPath(t,f,y),r.resolvedPath=r.path,r.originalFileName=r.fileName,e.parseJsonSourceFileConfigFileContent(r,E,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),f),void 0,e.getNormalizedAbsolutePath(t,f))):void 0}(r);return(d||(d=new e.Map)).set(n,a||!1),a}function F(r){var n=e.toPath(r,f,y),i=v&&v.getEntryByPath(n);return i?!e.isString(i):!!t.fileExists&&t.fileExists(r)}function P(r){var n=e.toPath(r,f,y),i=v&&v.getEntryByPath(n);return i?e.isString(i)?void 0:e.getSnapshotText(i.scriptSnapshot):t.readFile&&t.readFile(r)}function I(r,n,i,a,o){return e.Debug.checkDefined(t.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,n,i,a,o)}function O(e,t){var r=i.getKeyForCompilationSettings(t);i.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind)}function M(t,r,n,i){return L(t,e.toPath(t,f,y),r,n,i)}function L(r,n,a,o,s){e.Debug.assert(void 0!==v,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");var c=v&&v.getOrCreateEntryByPath(r,n);if(c){if(!s){var u=l&&l.getSourceFileByPath(n);if(u){if(c.scriptKind===u.scriptKind)return i.updateDocumentWithKey(r,n,t,A,c.scriptSnapshot,c.version,c.scriptKind);i.releaseDocumentWithKey(u.resolvedPath,i.getKeyForCompilationSettings(l.getCompilerOptions()),u.scriptKind)}}return i.acquireDocumentWithKey(r,n,t,A,c.scriptSnapshot,c.version,c.scriptKind)}}}function S(){if(c!==e.LanguageServiceMode.Syntactic)return x(),l;e.Debug.assert(void 0===l)}function T(t,r,n){var i=e.normalizePath(t);e.Debug.assert(n.some((function(t){return e.normalizePath(t)===i}))),x();var a=e.mapDefined(n,(function(e){return l.getSourceFile(e)})),o=v(t);return e.DocumentHighlights.getDocumentHighlights(l,p,o,r,a)}function E(t,r,n,i){x();var a=n&&2===n.use?l.getSourceFiles().filter((function(e){return!l.isSourceFileDefaultLibrary(e)})):l.getSourceFiles();return e.FindAllReferences.findReferenceOrRenameEntries(l,p,a,t,r,n,i)}var k=new e.Map(e.getEntries(((o={})[18]=19,o[20]=21,o[22]=23,o[31]=29,o)));function w(r){var n;return e.Debug.assertEqual(r.type,"install package"),t.installPackage?t.installPackage({fileName:(n=r.file,e.toPath(n,f,y)),packageName:r.packageName}):Promise.reject("Host does not implement `installPackage`")}function M(e,t){return{lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function L(t,r,n){for(var i=d.getCurrentSourceFile(t),a=[],o=M(i,r),s=o.lineStarts,c=o.firstLine,l=o.lastLine,u=n||!1,_=Number.MAX_VALUE,p=new e.Map,f=new RegExp(/\S/),m=e.isInsideJsxElement(i,s[c]),g=m?"{/*":"//",y=c;y<=l;y++){var h=i.text.substring(s[y],i.getLineEndOfPosition(s[y])),v=f.exec(h);v&&(_=Math.min(_,v.index),p.set(y.toString(),v.index),h.substr(v.index,g.length)!==g&&(u=void 0===n||n))}for(y=c;y<=l;y++)if(c===l||s[y]!==r.end){var b=p.get(y.toString());void 0!==b&&(m?a.push.apply(a,R(t,{pos:s[y]+_,end:i.getLineEndOfPosition(s[y])},u,m)):u?a.push({newText:g,span:{length:0,start:s[y]+_}}):i.text.substr(s[y]+b,g.length)===g&&a.push({newText:"",span:{length:g.length,start:s[y]+b}}))}return a}function R(t,r,n,i){for(var a,o=d.getCurrentSourceFile(t),s=[],c=o.text,l=!1,u=n||!1,_=[],p=r.pos,f=void 0!==i?i:e.isInsideJsxElement(o,p),m=f?"{/*":"/*",g=f?"*/}":"*/",y=f?"\\{\\/\\*":"\\/\\*",h=f?"\\*\\/\\}":"\\*\\/";p<=r.end;){var v=c.substr(p,m.length)===m?m.length:0,b=e.isInComment(o,p+v);if(b)f&&(b.pos--,b.end++),_.push(b.pos),3===b.kind&&_.push(b.end),l=!0,p=b.end+1;else{var x=c.substring(p,r.end).search("(".concat(y,")|(").concat(h,")"));u=void 0!==n?n:u||!e.isTextWhiteSpaceLike(c,p,-1===x?r.end:p+x),p=-1===x?r.end+1:p+x+g.length}}if(u||!l){2!==(null===(a=e.isInComment(o,r.pos))||void 0===a?void 0:a.kind)&&e.insertSorted(_,r.pos,e.compareValues),e.insertSorted(_,r.end,e.compareValues);var S=_[0];c.substr(S,m.length)!==m&&s.push({newText:m,span:{length:0,start:S}});for(var D=1;D<_.length-1;D++)c.substr(_[D]-g.length,g.length)!==g&&s.push({newText:g,span:{length:0,start:_[D]}}),c.substr(_[D],m.length)!==m&&s.push({newText:m,span:{length:0,start:_[D]}});s.length%2!=0&&s.push({newText:g,span:{length:0,start:_[_.length-1]}})}else for(var C=0,T=_;C0?E-g.length:0;v=c.substr(k,g.length)===g?g.length:0;s.push({newText:"",span:{length:m.length,start:E-v}})}return s}function B(t){var r=t.openingElement,n=t.closingElement,i=t.parent;return!e.tagNamesAreEquivalent(r.tagName,n.tagName)||e.isJsxElement(i)&&e.tagNamesAreEquivalent(r.tagName,i.openingElement.tagName)&&B(i)}function J(t){var r=t.closingFragment,n=t.parent;return!!(131072&r.flags)||e.isJsxFragment(n)&&J(n)}function j(r,n,i,a,o,s){var c="number"==typeof n?[n,void 0]:[n.pos,n.end];return{file:r,startPosition:c[0],endPosition:c[1],program:S(),host:t,formatContext:e.formatting.getFormatContext(a,t),cancellationToken:p,preferences:i,triggerReason:o,kind:s}}k.forEach((function(e,t){return k.set(e.toString(),Number(t))}));var U={dispose:function(){if(l){var r=i.getKeyForCompilationSettings(l.getCompilerOptions());e.forEach(l.getSourceFiles(),(function(e){return i.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind)})),l=void 0}t=void 0},cleanupSemanticCache:function(){l=void 0},getSyntacticDiagnostics:function(e){return x(),l.getSyntacticDiagnostics(v(e),p).slice()},getSemanticDiagnostics:function(t){x();var n=v(t),i=l.getSemanticDiagnostics(n,p);if(!e.getEmitDeclarations(l.getCompilerOptions()))return i.slice();var a=l.getDeclarationDiagnostics(n,p);return r(r([],i,!0),a,!0)},getSuggestionDiagnostics:function(t){return x(),e.computeSuggestionDiagnostics(v(t),l,p)},getCompilerOptionsDiagnostics:function(){return x(),r(r([],l.getOptionsDiagnostics(p),!0),l.getGlobalDiagnostics(p),!0)},getSyntacticClassifications:function(t,r){return e.getSyntacticClassifications(p,d.getCurrentSourceFile(t),r)},getSemanticClassifications:function(t,r,n){return x(),"2020"===(n||"original")?e.classifier.v2020.getSemanticClassifications(l,p,v(t),r):e.getSemanticClassifications(l.getTypeChecker(),p,v(t),l.getClassifiableNames(),r)},getEncodedSyntacticClassifications:function(t,r){return e.getEncodedSyntacticClassifications(p,d.getCurrentSourceFile(t),r)},getEncodedSemanticClassifications:function(t,r,n){return x(),"original"===(n||"original")?e.getEncodedSemanticClassifications(l.getTypeChecker(),p,v(t),l.getClassifiableNames(),r):e.classifier.v2020.getEncodedSemanticClassifications(l,p,v(t),r)},getCompletionsAtPosition:function(r,i,a,o){void 0===a&&(a=e.emptyOptions);var s=n(n({},e.identity(a)),{includeCompletionsForModuleExports:a.includeCompletionsForModuleExports||a.includeExternalModuleExports,includeCompletionsWithInsertText:a.includeCompletionsWithInsertText||a.includeInsertTextCompletions});return x(),e.Completions.getCompletionsAtPosition(t,l,m,v(r),i,s,a.triggerCharacter,a.triggerKind,p,o&&e.formatting.getFormatContext(o,t))},getCompletionEntryDetails:function(r,n,i,a,o,s,c){return void 0===s&&(s=e.emptyOptions),x(),e.Completions.getCompletionEntryDetails(l,m,v(r),n,{name:i,source:o,data:c},t,a&&e.formatting.getFormatContext(a,t),s,p)},getCompletionEntrySymbol:function(r,n,i,a,o){return void 0===o&&(o=e.emptyOptions),x(),e.Completions.getCompletionEntrySymbol(l,m,v(r),n,{name:i,source:a},t,o)},getSignatureHelpItems:function(t,r,n){var i=(void 0===n?e.emptyOptions:n).triggerReason;x();var a=v(t);return e.SignatureHelp.getSignatureHelpItems(l,a,r,i,p)},getQuickInfoAtPosition:function(t,r){x();var n=v(t),i=e.getTouchingPropertyName(n,r);if(i!==n){var a=l.getTypeChecker(),o=function(t){if(e.isNewExpression(t.parent)&&t.pos===t.parent.pos)return t.parent.expression;if(e.isNamedTupleMember(t.parent)&&t.pos===t.parent.pos)return t.parent;if(e.isImportMeta(t.parent)&&t.parent.name===t)return t.parent;return t}(i),s=function(t,r){var n=I(t);if(n){var i=r.getContextualType(n.parent),a=i&&O(n,r,i,!1);if(a&&1===a.length)return e.first(a)}return r.getSymbolAtLocation(t)}(o,a);if(!s||a.isUnknownSymbol(s)){var c=function(t,r,n){switch(r.kind){case 79:return!e.isLabelName(r)&&!e.isTagName(r)&&!e.isConstTypeReference(r.parent);case 206:case 161:return!e.isInComment(t,n);case 108:case 192:case 106:case 197:return!0;case 231:return e.isImportMeta(r);default:return!1}}(n,o,r)?a.getTypeAtLocation(o):void 0;return c&&{kind:"",kindModifiers:"",textSpan:e.createTextSpanFromNode(o,n),displayParts:a.runWithCancellationToken(p,(function(t){return e.typeToDisplayParts(t,c,e.getContainerNode(o))})),documentation:c.symbol?c.symbol.getDocumentationComment(a):void 0,tags:c.symbol?c.symbol.getJsDocTags(a):void 0}}var u=a.runWithCancellationToken(p,(function(t){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(t,s,n,e.getContainerNode(o),o)})),d=u.symbolKind,_=u.displayParts,f=u.documentation,m=u.tags;return{kind:d,kindModifiers:e.SymbolDisplay.getSymbolModifiers(a,s),textSpan:e.createTextSpanFromNode(o,n),displayParts:_,documentation:f,tags:m}}},getDefinitionAtPosition:function(t,r,n,i){return x(),e.GoToDefinition.getDefinitionAtPosition(l,v(t),r,n,i)},getDefinitionAndBoundSpan:function(t,r){return x(),e.GoToDefinition.getDefinitionAndBoundSpan(l,v(t),r)},getImplementationAtPosition:function(t,r){return x(),e.FindAllReferences.getImplementationsAtPosition(l,p,l.getSourceFiles(),v(t),r)},getTypeDefinitionAtPosition:function(t,r){return x(),e.GoToDefinition.getTypeDefinitionAtPosition(l.getTypeChecker(),v(t),r)},getReferencesAtPosition:function(t,r){return x(),E(e.getTouchingPropertyName(v(t),r),r,{use:1},e.FindAllReferences.toReferenceEntry)},findReferences:function(t,r){return x(),e.FindAllReferences.findReferencedSymbols(l,p,l.getSourceFiles(),v(t),r)},getFileReferences:function(t){return x(),e.FindAllReferences.Core.getReferencesForFileName(t,l,l.getSourceFiles()).map(e.FindAllReferences.toReferenceEntry)},getOccurrencesAtPosition:function(t,r){return e.flatMap(T(t,r,[t]),(function(e){return e.highlightSpans.map((function(t){return n(n({fileName:e.fileName,textSpan:t.textSpan,isWriteAccess:"writtenReference"===t.kind},t.isInString&&{isInString:!0}),t.contextSpan&&{contextSpan:t.contextSpan})}))}))},getDocumentHighlights:T,getNameOrDottedNameSpan:function(t,r,n){var i=d.getCurrentSourceFile(t),a=e.getTouchingPropertyName(i,r);if(a!==i){switch(a.kind){case 206:case 161:case 10:case 95:case 110:case 104:case 106:case 108:case 192:case 79:break;default:return}for(var o=a;;)if(e.isRightSideOfPropertyAccess(o)||e.isRightSideOfQualifiedName(o))o=o.parent;else{if(!e.isNameOfModuleDeclaration(o))break;if(261!==o.parent.parent.kind||o.parent.parent.body!==o.parent)break;o=o.parent.parent.name}return e.createTextSpanFromBounds(o.getStart(),a.getEnd())}},getBreakpointStatementAtPosition:function(t,r){var n=d.getCurrentSourceFile(t);return e.BreakpointResolver.spanInSourceFileAtLocation(n,r)},getNavigateToItems:function(t,r,n,i){void 0===i&&(i=!1),x();var a=n?[v(n)]:l.getSourceFiles();return e.NavigateTo.getNavigateToItems(a,l.getTypeChecker(),p,t,r,i)},getRenameInfo:function(t,r,n){return x(),e.Rename.getRenameInfo(l,v(t),r,n)},getSmartSelectionRange:function(t,r){return e.SmartSelectionRange.getSmartSelectionRange(r,d.getCurrentSourceFile(t))},findRenameLocations:function(t,r,i,a,o){x();var s=v(t),c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(s,r));if(e.Rename.nodeIsEligibleForRename(c)){if(e.isIdentifier(c)&&(e.isJsxOpeningElement(c.parent)||e.isJsxClosingElement(c.parent))&&e.isIntrinsicJsxName(c.escapedText)){var l=c.parent.parent;return[l.openingElement,l.closingElement].map((function(t){var r=e.createTextSpanFromNode(t.tagName,s);return n({fileName:s.fileName,textSpan:r},e.FindAllReferences.toContextSpan(r,s,t.parent))}))}return E(c,r,{findInStrings:i,findInComments:a,providePrefixAndSuffixTextForRename:o,use:2},(function(t,r,n){return e.FindAllReferences.toRenameLocation(t,r,n,o||!1)}))}},getNavigationBarItems:function(t){return e.NavigationBar.getNavigationBarItems(d.getCurrentSourceFile(t),p)},getNavigationTree:function(t){return e.NavigationBar.getNavigationTree(d.getCurrentSourceFile(t),p)},getOutliningSpans:function(t){var r=d.getCurrentSourceFile(t);return e.OutliningElementsCollector.collectElements(r,p)},getTodoComments:function(t,r){x();var n=v(t);p.throwIfCancellationRequested();var i,a,o=n.text,s=[];if(r.length>0&&(a=n.fileName,!e.stringContains(a,"/node_modules/")))for(var c=function(){var t="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/\/+\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+e.map(r,(function(e){return"("+function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}(e.text)+")"})).join("|")+")";return new RegExp(t+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}(),l=void 0;l=c.exec(o);){p.throwIfCancellationRequested();e.Debug.assert(l.length===r.length+3);var u=l[1],d=l.index+u.length;if(e.isInComment(n,d)){for(var _=void 0,f=0;f=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)){var m=l[2];s.push({descriptor:_,message:m,position:d})}}}return s},getBraceMatchingAtPosition:function(t,r){var n=d.getCurrentSourceFile(t),i=e.getTouchingToken(n,r),a=i.getStart(n)===r?k.get(i.kind.toString()):void 0,o=a&&e.findChildOfKind(i.parent,a,n);return o?[e.createTextSpanFromNode(i,n),e.createTextSpanFromNode(o,n)].sort((function(e,t){return e.start-t.start})):e.emptyArray},getIndentationAtPosition:function(t,r,n){var i=e.timestamp(),a=b(n),o=d.getCurrentSourceFile(t);m("getIndentationAtPosition: getCurrentSourceFile: "+(e.timestamp()-i)),i=e.timestamp();var s=e.formatting.SmartIndenter.getIndentation(r,o,a);return m("getIndentationAtPosition: computeIndentation : "+(e.timestamp()-i)),s},getFormattingEditsForRange:function(r,n,i,a){var o=d.getCurrentSourceFile(r);return e.formatting.formatSelection(n,i,o,e.formatting.getFormatContext(b(a),t))},getFormattingEditsForDocument:function(r,n){return e.formatting.formatDocument(d.getCurrentSourceFile(r),e.formatting.getFormatContext(b(n),t))},getFormattingEditsAfterKeystroke:function(r,n,i,a){var o=d.getCurrentSourceFile(r),s=e.formatting.getFormatContext(b(a),t);if(!e.isInComment(o,n))switch(i){case"{":return e.formatting.formatOnOpeningCurly(n,o,s);case"}":return e.formatting.formatOnClosingCurly(n,o,s);case";":return e.formatting.formatOnSemicolon(n,o,s);case"\n":return e.formatting.formatOnEnter(n,o,s)}return[]},getDocCommentTemplateAtPosition:function(r,n,i){return e.JsDoc.getDocCommentTemplateAtPosition(e.getNewLineOrDefaultFromHost(t),d.getCurrentSourceFile(r),n,i)},isValidBraceCompletionAtPosition:function(t,r,n){if(60===n)return!1;var i=d.getCurrentSourceFile(t);if(e.isInString(i,r))return!1;if(e.isInsideJsxElementOrAttribute(i,r))return 123===n;if(e.isInTemplateString(i,r))return!1;switch(n){case 39:case 34:case 96:return!e.isInComment(i,r)}return!0},getJsxClosingTagAtPosition:function(t,r){var n=d.getCurrentSourceFile(t),i=e.findPrecedingToken(r,n);if(i){var a=31===i.kind&&e.isJsxOpeningElement(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxElement(i.parent)?i.parent:void 0;if(a&&B(a))return{newText:"")};var o=31===i.kind&&e.isJsxOpeningFragment(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxFragment(i.parent)?i.parent:void 0;return o&&J(o)?{newText:""}:void 0}},getSpanOfEnclosingComment:function(t,r,n){var i=d.getCurrentSourceFile(t),a=e.formatting.getRangeOfEnclosingComment(i,r);return!a||n&&3!==a.kind?void 0:e.createTextSpanFromRange(a)},getCodeFixesAtPosition:function(r,n,i,a,o,s){void 0===s&&(s=e.emptyOptions),x();var c=v(r),u=e.createTextSpanFromBounds(n,i),d=e.formatting.getFormatContext(o,t);return e.flatMap(e.deduplicate(a,e.equateValues,e.compareValues),(function(r){return p.throwIfCancellationRequested(),e.codefix.getFixes({errorCode:r,sourceFile:c,span:u,program:l,host:t,cancellationToken:p,formatContext:d,preferences:s})}))},getCombinedCodeFix:function(r,n,i,a){void 0===a&&(a=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var o=v(r.fileName),s=e.formatting.getFormatContext(i,t);return e.codefix.getAllFixes({fixId:n,sourceFile:o,program:l,host:t,cancellationToken:p,formatContext:s,preferences:a})},applyCodeActionCommand:function(t,r){var n="string"==typeof t?r:t;return e.isArray(n)?Promise.all(n.map((function(e){return w(e)}))):w(n)},organizeImports:function(r,n,i){void 0===i&&(i=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var a=v(r.fileName),o=e.formatting.getFormatContext(n,t);return e.OrganizeImports.organizeImports(a,o,t,l,i,r.skipDestructiveCodeActions)},getEditsForFileRename:function(r,n,i,a){return void 0===a&&(a=e.emptyOptions),e.getEditsForFileRename(S(),r,n,t,e.formatting.getFormatContext(i,t),a,h)},getEmitOutput:function(r,n,i){x();var a=v(r),o=t.getCustomTransformers&&t.getCustomTransformers();return e.getFileEmitOutput(l,a,!!n,p,o,i)},getNonBoundSourceFile:function(e){return d.getCurrentSourceFile(e)},getProgram:S,getAutoImportProvider:function(){var e;return null===(e=t.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(t)},getApplicableRefactors:function(t,r,n,i,a){void 0===n&&(n=e.emptyOptions),x();var o=v(t);return e.refactor.getApplicableRefactors(j(o,r,n,e.emptyOptions,i,a))},getEditsForRefactor:function(t,r,n,i,a,o){void 0===o&&(o=e.emptyOptions),x();var s=v(t);return e.refactor.getEditsForRefactor(j(s,n,o,r),i,a)},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:h.toLineColumnOffset(e,t)},getSourceMapper:function(){return h},clearSourceMapperCache:function(){return h.clearCache()},prepareCallHierarchy:function(t,r){x();var n=e.CallHierarchy.resolveCallHierarchyDeclaration(l,e.getTouchingPropertyName(v(t),r));return n&&e.mapOneOrMany(n,(function(t){return e.CallHierarchy.createCallHierarchyItem(l,t)}))},provideCallHierarchyIncomingCalls:function(t,r){x();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getIncomingCalls(l,i,p):[]},provideCallHierarchyOutgoingCalls:function(t,r){x();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getOutgoingCalls(l,i):[]},toggleLineComment:L,toggleMultilineComment:R,commentSelection:function(e,t){var r=M(d.getCurrentSourceFile(e),t);return r.firstLine===r.lastLine&&t.pos!==t.end?R(e,t,!0):L(e,t,!0)},uncommentSelection:function(t,r){var n=d.getCurrentSourceFile(t),i=[],a=r.pos,o=r.end;a===o&&(o+=e.isInsideJsxElement(n,a)?2:1);for(var s=a;s<=o;s++){var c=e.isInComment(n,s);if(c){switch(c.kind){case 2:i.push.apply(i,L(t,{end:c.end,pos:c.pos+1},!1));break;case 3:i.push.apply(i,R(t,{end:c.end,pos:c.pos+1},!1))}s=c.end+1}}return i},provideInlayHints:function(r,n,i){void 0===i&&(i=e.emptyOptions),x();var a=v(r);return e.InlayHints.provideInlayHints(function(e,r,n){return{file:e,program:S(),host:t,span:r,preferences:n,cancellationToken:p}}(a,n,i))}};switch(c){case e.LanguageServiceMode.Semantic:break;case e.LanguageServiceMode.PartialSemantic:F.forEach((function(e){return U[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.PartialSemantic"))}}));break;case e.LanguageServiceMode.Syntactic:P.forEach((function(e){return U[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.Syntactic"))}}));break;default:e.Debug.assertNever(c)}return U},e.getNameTable=function(t){return t.nameTable||function(t){var r=t.nameTable=new e.Map;t.forEachChild((function t(n){if(e.isIdentifier(n)&&!e.isTagName(n)&&n.escapedText||e.isStringOrNumericLiteralLike(n)&&function(t){return e.isDeclarationName(t)||277===t.parent.kind||function(e){return e&&e.parent&&207===e.parent.kind&&e.parent.argumentExpression===e}(t)||e.isLiteralComputedPropertyDeclarationName(t)}(n)){var i=e.getEscapedTextOfIdentifierOrLiteral(n);r.set(i,void 0===r.get(i)?n.pos:-1)}else if(e.isPrivateIdentifier(n)){i=n.escapedText;r.set(i,void 0===r.get(i)?n.pos:-1)}if(e.forEachChild(n,t),e.hasJSDocNodes(n))for(var a=0,o=n.jsDoc;ai){var a=e.findPrecedingToken(n.pos,t);if(!a||t.getLineAndCharacterOfPosition(a.getEnd()).line!==i)return;n=a}if(!(16777216&n.flags))return d(n)}function o(r,n){var i=r.decorators?e.skipTrivia(t.text,r.decorators.end):r.getStart(t);return e.createTextSpanFromBounds(i,(n||r).getEnd())}function s(r,n){return o(r,e.findNextToken(n,n.parent,t))}function c(e,r){return e&&i===t.getLineAndCharacterOfPosition(e.getStart(t)).line?d(e):d(r)}function l(r){return d(e.findPrecedingToken(r.pos,t))}function u(r){return d(e.findNextToken(r,r.parent,t))}function d(r){if(r){var n=r.parent;switch(r.kind){case 237:return x(r.declarationList.declarations[0]);case 254:case 167:case 166:return x(r);case 164:return function t(r){if(e.isBindingPattern(r.name))return T(r.name);if(function(t){return!!t.initializer||void 0!==t.dotDotDotToken||e.hasSyntacticModifier(t,12)}(r))return o(r);var n=r.parent,i=n.parameters.indexOf(r);return e.Debug.assert(-1!==i),0!==i?t(n.parameters[i-1]):d(n.body)}(r);case 256:case 169:case 168:case 172:case 173:case 171:case 213:case 214:return function(e){if(e.body)return S(e)?o(e):d(e.body)}(r);case 235:if(e.isFunctionBlock(r))return h=(y=r).statements.length?y.statements[0]:y.getLastToken(),S(y.parent)?c(y.parent,h):d(h);case 262:return D(r);case 292:return D(r.block);case 238:return o(r.expression);case 247:return o(r.getChildAt(0),r.expression);case 241:return s(r,r.expression);case 240:return d(r.statement);case 253:return o(r.getChildAt(0));case 239:return s(r,r.expression);case 250:return d(r.statement);case 246:case 245:return o(r.getChildAt(0),r.label);case 242:return(g=r).initializer?C(g):g.condition?o(g.condition):g.incrementor?o(g.incrementor):void 0;case 243:return s(r,r.expression);case 244:return C(r);case 249:return s(r,r.expression);case 289:case 290:return d(r.statements[0]);case 252:return D(r.tryBlock);case 251:case 271:return o(r,r.expression);case 265:return o(r,r.moduleReference);case 266:case 272:return o(r,r.moduleSpecifier);case 261:if(1!==e.getModuleInstanceState(r))return;case 257:case 260:case 299:case 203:return o(r);case 248:return d(r.statement);case 165:return v=n.decorators,e.createTextSpanFromBounds(e.skipTrivia(t.text,v.pos),v.end);case 201:case 202:return T(r);case 258:case 259:return;case 26:case 1:return c(e.findPrecedingToken(r.pos,t));case 27:return l(r);case 18:return function(r){switch(r.parent.kind){case 260:var n=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),n.members.length?n.members[0]:n.getLastToken(t));case 257:var i=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),i.members.length?i.members[0]:i.getLastToken(t));case 263:return c(r.parent.parent,r.parent.clauses[0])}return d(r.parent)}(r);case 19:return function(t){switch(t.parent.kind){case 262:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 260:case 257:return o(t);case 235:if(e.isFunctionBlock(t.parent))return o(t);case 292:return d(e.lastOrUndefined(t.parent.statements));case 263:var r=t.parent,n=e.lastOrUndefined(r.clauses);return n?d(e.lastOrUndefined(n.statements)):void 0;case 201:var i=t.parent;return d(e.lastOrUndefined(i.elements)||i);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var a=t.parent;return o(e.lastOrUndefined(a.properties)||a)}return d(t.parent)}}(r);case 23:return function(t){if(202===t.parent.kind){var r=t.parent;return o(e.lastOrUndefined(r.elements)||r)}if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var n=t.parent;return o(e.lastOrUndefined(n.elements)||n)}return d(t.parent)}(r);case 20:return function(e){return 240===e.parent.kind||208===e.parent.kind||209===e.parent.kind?l(e):212===e.parent.kind?u(e):d(e.parent)}(r);case 21:return function(e){switch(e.parent.kind){case 213:case 256:case 214:case 169:case 168:case 172:case 173:case 171:case 241:case 240:case 242:case 244:case 208:case 209:case 212:return l(e);default:return d(e.parent)}}(r);case 58:return function(t){return e.isFunctionLike(t.parent)||296===t.parent.kind||164===t.parent.kind?l(t):d(t.parent)}(r);case 31:case 29:return function(e){return 211===e.parent.kind?u(e):d(e.parent)}(r);case 115:return function(e){return 240===e.parent.kind?s(e,e.parent.expression):d(e.parent)}(r);case 91:case 83:case 96:return u(r);case 160:return function(e){return 244===e.parent.kind?u(e):d(e.parent)}(r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(r))return E(r);if((79===r.kind||225===r.kind||296===r.kind||297===r.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return o(r);if(221===r.kind){var i=r,a=i.left,_=i.operatorToken;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(a))return E(a);if(63===_.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent))return o(r);if(27===_.kind)return d(a)}if(e.isExpressionNode(r))switch(n.kind){case 240:return l(r);case 165:return d(r.parent);case 242:case 244:return o(r);case 221:if(27===r.parent.operatorToken.kind)return o(r);break;case 214:if(r.parent.body===r)return o(r)}switch(r.parent.kind){case 296:if(r.parent.name===r&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent.parent))return d(r.parent.initializer);break;case 211:if(r.parent.type===r)return u(r.parent.type);break;case 254:case 164:var p=r.parent,f=p.initializer,m=p.type;if(f===r||m===r||e.isAssignmentOperator(r.kind))return l(r);break;case 221:if(a=r.parent.left,e.isArrayLiteralOrObjectLiteralDestructuringPattern(a)&&r!==a)return l(r);break;default:if(e.isFunctionLike(r.parent)&&r.parent.type===r)return l(r)}return d(r.parent)}}var g,y,h,v;function b(r){return e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]===r?o(e.findPrecedingToken(r.pos,t,r.parent),r):o(r)}function x(r){if(243===r.parent.parent.kind)return d(r.parent.parent);var n=r.parent;return e.isBindingPattern(r.name)?T(r.name):r.initializer||e.hasSyntacticModifier(r,1)||244===n.parent.kind?b(r):e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]!==r?d(e.findPrecedingToken(r.pos,t,r.parent)):void 0}function S(t){return e.hasSyntacticModifier(t,1)||257===t.parent.kind&&171!==t.kind}function D(r){switch(r.parent.kind){case 261:if(1!==e.getModuleInstanceState(r.parent))return;case 241:case 239:case 243:return c(r.parent,r.statements[0]);case 242:case 244:return c(e.findPrecedingToken(r.pos,t,r.parent),r.statements[0])}return d(r.statements[0])}function C(e){if(255!==e.initializer.kind)return d(e.initializer);var t=e.initializer;return t.declarations.length>0?d(t.declarations[0]):void 0}function T(t){var r=e.forEach(t.elements,(function(e){return 227!==e.kind?e:void 0}));return r?d(r):203===t.parent.kind?o(t.parent):b(t.parent)}function E(t){e.Debug.assert(202!==t.kind&&201!==t.kind);var r=204===t.kind?t.elements:t.properties,n=e.forEach(r,(function(e){return 227!==e.kind?e:void 0}));return n?d(n):o(221===t.parent.kind?t.parent:t)}}}}(c||(c={})),function(e){e.transform=function(t,r,n){var i=[];n=e.fixupCompilerOptions(n,i);var a=e.isArray(t)?t:[t],o=e.transformNodes(void 0,void 0,e.factory,n,a,r,!0);return o.diagnostics=e.concatenate(o.diagnostics,i),o}}(c||(c={}));var c,l=function(){return this}();!function(e){function t(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message)}var i=function(){function t(e){this.scriptSnapshotShim=e}return t.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},t.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},t.prototype.getChangeRange=function(t){var r=t,n=this.scriptSnapshotShim.getChangeRange(r.scriptSnapshotShim);if(null===n)return null;var i=JSON.parse(n);return e.createTextChangeRange(e.createTextSpan(i.span.start,i.span.length),i.newLength)},t.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose()},t}(),a=function(){function t(t){var r=this;this.shimHost=t,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(t,n){var i=JSON.parse(r.shimHost.getModuleResolutionsForFile(n));return e.map(t,(function(t){var r=e.getProperty(i,t);return r?{resolvedFileName:r,extension:e.extensionFromPath(r),isExternalLibraryImport:!1}:void 0}))}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return r.shimHost.directoryExists(e)}),"getTypeReferenceDirectiveResolutionsForFile"in this.shimHost&&(this.resolveTypeReferenceDirectives=function(t,n){var i=JSON.parse(r.shimHost.getTypeReferenceDirectiveResolutionsForFile(n));return e.map(t,(function(t){return e.getProperty(i,e.isString(t)?t:t.fileName.toLowerCase())}))})}return t.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e)},t.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e)},t.prototype.error=function(e){this.shimHost.error(e)},t.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},t.prototype.getTypeRootsVersion=function(){return this.shimHost.getTypeRootsVersion?this.shimHost.getTypeRootsVersion():0},t.prototype.useCaseSensitiveFileNames=function(){return!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},t.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null===e||""===e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");var t=JSON.parse(e);return t.allowNonTsExtensions=!0,t},t.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return JSON.parse(e)},t.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new i(t)},t.prototype.getScriptKind=function(e){return"getScriptKind"in this.shimHost?this.shimHost.getScriptKind(e):0},t.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},t.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null===e||""===e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},t.prototype.getCancellationToken=function(){var t=this.shimHost.getCancellationToken();return new e.ThrottledCancellationToken(t)},t.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.readFile=function(e,t){return this.shimHost.readFile(e,t)},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t}();e.LanguageServiceShimHostAdapter=a;var c=function(){function t(e){var t=this;this.shimHost=e,this.useCaseSensitiveFileNames=!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames(),"directoryExists"in this.shimHost?this.directoryExists=function(e){return t.shimHost.directoryExists(e)}:this.directoryExists=void 0,"realpath"in this.shimHost?this.realpath=function(e){return t.shimHost.realpath(e)}:this.realpath=void 0}return t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t.prototype.readFile=function(e){return this.shimHost.readFile(e)},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t}();function u(e,t,r,n){return d(e,t,!0,r,n)}function d(r,n,i,a,o){try{var s=function(t,r,n,i){var a;i&&(t.log(r),a=e.timestamp());var o=n();if(i){var s=e.timestamp();if(t.log("".concat(r," completed in ").concat(s-a," msec")),e.isString(o)){var c=o;c.length>128&&(c=c.substring(0,128)+"..."),t.log(" result.length=".concat(c.length,", result='").concat(JSON.stringify(c),"'"))}}return o}(r,n,a,o);return i?JSON.stringify({result:s}):s}catch(i){return i instanceof e.OperationCanceledException?JSON.stringify({canceled:!0}):(t(r,i),i.description=n,JSON.stringify({error:i}))}}e.CoreServicesShimHostAdapter=c;var _=function(){function e(e){this.factory=e,e.registerShim(this)}return e.prototype.dispose=function(e){this.factory.unregisterShim(this)},e}();function p(t,r){return t.map((function(t){return function(t,r){return{message:e.flattenDiagnosticMessageText(t.messageText,r),start:t.start,length:t.length,category:e.diagnosticCategoryName(t),code:t.code,reportsUnnecessary:t.reportsUnnecessary,reportsDeprecated:t.reportsDeprecated}}(t,r)}))}e.realizeDiagnostics=p;var f=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.host=r,i.languageService=n,i.logPerformance=!1,i.logger=i.host,i}return s(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.dispose=function(e){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,l&&l.CollectGarbage&&(l.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,t.prototype.dispose.call(this,e)},r.prototype.refresh=function(e){this.forwardJSONCall("refresh(".concat(e,")"),(function(){return null}))},r.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",(function(){return e.languageService.cleanupSemanticCache(),null}))},r.prototype.realizeDiagnostics=function(t){return p(t,e.getNewLineOrDefaultFromHost(this.host))},r.prototype.getSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSyntacticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSemanticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getEncodedSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return m(i.languageService.getEncodedSyntacticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getEncodedSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return m(i.languageService.getEncodedSemanticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSuggestionDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSuggestionDiagnostics('".concat(e,"')"),(function(){return t.realizeDiagnostics(t.languageService.getSuggestionDiagnostics(e))}))},r.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",(function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)}))},r.prototype.getQuickInfoAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getQuickInfoAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getQuickInfoAtPosition(e,t)}))},r.prototype.getNameOrDottedNameSpan=function(e,t,r){var n=this;return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNameOrDottedNameSpan(e,t,r)}))},r.prototype.getBreakpointStatementAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBreakpointStatementAtPosition(e,t)}))},r.prototype.getSignatureHelpItems=function(e,t,r){var n=this;return this.forwardJSONCall("getSignatureHelpItems('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSignatureHelpItems(e,t,r)}))},r.prototype.getDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAtPosition(e,t)}))},r.prototype.getDefinitionAndBoundSpan=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAndBoundSpan(e,t)}))},r.prototype.getTypeDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getTypeDefinitionAtPosition(e,t)}))},r.prototype.getImplementationAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getImplementationAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getImplementationAtPosition(e,t)}))},r.prototype.getRenameInfo=function(e,t,r){var n=this;return this.forwardJSONCall("getRenameInfo('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getRenameInfo(e,t,r)}))},r.prototype.getSmartSelectionRange=function(e,t){var r=this;return this.forwardJSONCall("getSmartSelectionRange('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getSmartSelectionRange(e,t)}))},r.prototype.findRenameLocations=function(e,t,r,n,i){var a=this;return this.forwardJSONCall("findRenameLocations('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,", ").concat(i,")"),(function(){return a.languageService.findRenameLocations(e,t,r,n,i)}))},r.prototype.getBraceMatchingAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBraceMatchingAtPosition(e,t)}))},r.prototype.isValidBraceCompletionAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.isValidBraceCompletionAtPosition(e,t,r)}))},r.prototype.getSpanOfEnclosingComment=function(e,t,r){var n=this;return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSpanOfEnclosingComment(e,t,r)}))},r.prototype.getIndentationAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getIndentationAtPosition('".concat(e,"', ").concat(t,")"),(function(){var i=JSON.parse(r);return n.languageService.getIndentationAtPosition(e,t,i)}))},r.prototype.getReferencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getReferencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getReferencesAtPosition(e,t)}))},r.prototype.findReferences=function(e,t){var r=this;return this.forwardJSONCall("findReferences('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.findReferences(e,t)}))},r.prototype.getFileReferences=function(e){var t=this;return this.forwardJSONCall("getFileReferences('".concat(e,")"),(function(){return t.languageService.getFileReferences(e)}))},r.prototype.getOccurrencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getOccurrencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getOccurrencesAtPosition(e,t)}))},r.prototype.getDocumentHighlights=function(t,r,n){var i=this;return this.forwardJSONCall("getDocumentHighlights('".concat(t,"', ").concat(r,")"),(function(){var a=i.languageService.getDocumentHighlights(t,r,JSON.parse(n)),o=e.toFileNameLowerCase(e.normalizeSlashes(t));return e.filter(a,(function(t){return e.toFileNameLowerCase(e.normalizeSlashes(t.fileName))===o}))}))},r.prototype.getCompletionsAtPosition=function(e,t,r,n){var i=this;return this.forwardJSONCall("getCompletionsAtPosition('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getCompletionsAtPosition(e,t,r,n)}))},r.prototype.getCompletionEntryDetails=function(e,t,r,n,i,a,o){var s=this;return this.forwardJSONCall("getCompletionEntryDetails('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var c=void 0===n?void 0:JSON.parse(n);return s.languageService.getCompletionEntryDetails(e,t,r,c,i,a,o)}))},r.prototype.getFormattingEditsForRange=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsForRange(e,t,r,a)}))},r.prototype.getFormattingEditsForDocument=function(e,t){var r=this;return this.forwardJSONCall("getFormattingEditsForDocument('".concat(e,"')"),(function(){var n=JSON.parse(t);return r.languageService.getFormattingEditsForDocument(e,n)}))},r.prototype.getFormattingEditsAfterKeystroke=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsAfterKeystroke(e,t,r,a)}))},r.prototype.getDocCommentTemplateAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getDocCommentTemplateAtPosition(e,t,r)}))},r.prototype.getNavigateToItems=function(e,t,r){var n=this;return this.forwardJSONCall("getNavigateToItems('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNavigateToItems(e,t,r)}))},r.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('".concat(e,"')"),(function(){return t.languageService.getNavigationBarItems(e)}))},r.prototype.getNavigationTree=function(e){var t=this;return this.forwardJSONCall("getNavigationTree('".concat(e,"')"),(function(){return t.languageService.getNavigationTree(e)}))},r.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('".concat(e,"')"),(function(){return t.languageService.getOutliningSpans(e)}))},r.prototype.getTodoComments=function(e,t){var r=this;return this.forwardJSONCall("getTodoComments('".concat(e,"')"),(function(){return r.languageService.getTodoComments(e,JSON.parse(t))}))},r.prototype.prepareCallHierarchy=function(e,t){var r=this;return this.forwardJSONCall("prepareCallHierarchy('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.prepareCallHierarchy(e,t)}))},r.prototype.provideCallHierarchyIncomingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyIncomingCalls(e,t)}))},r.prototype.provideCallHierarchyOutgoingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyOutgoingCalls(e,t)}))},r.prototype.provideInlayHints=function(e,t,r){var n=this;return this.forwardJSONCall("provideInlayHints('".concat(e,"', '").concat(JSON.stringify(t),"', ").concat(JSON.stringify(r),")"),(function(){return n.languageService.provideInlayHints(e,t,r)}))},r.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('".concat(e,"')"),(function(){var r=t.languageService.getEmitOutput(e),i=r.diagnostics,a=o(r,["diagnostics"]);return n(n({},a),{diagnostics:t.realizeDiagnostics(i)})}))},r.prototype.getEmitOutputObject=function(e){var t=this;return d(this.logger,"getEmitOutput('".concat(e,"')"),!1,(function(){return t.languageService.getEmitOutput(e)}),this.logPerformance)},r.prototype.toggleLineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleLineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleLineComment(e,t)}))},r.prototype.toggleMultilineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleMultilineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleMultilineComment(e,t)}))},r.prototype.commentSelection=function(e,t){var r=this;return this.forwardJSONCall("commentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.commentSelection(e,t)}))},r.prototype.uncommentSelection=function(e,t){var r=this;return this.forwardJSONCall("uncommentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.uncommentSelection(e,t)}))},r}(_);function m(e){return{spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var g=function(t){function r(r,n){var i=t.call(this,r)||this;return i.logger=n,i.logPerformance=!1,i.classifier=e.createClassifier(),i}return s(r,t),r.prototype.getEncodedLexicalClassifications=function(e,t,r){var n=this;return void 0===r&&(r=!1),u(this.logger,"getEncodedLexicalClassifications",(function(){return m(n.classifier.getEncodedLexicalClassifications(e,t,r))}),this.logPerformance)},r.prototype.getClassificationsForLine=function(e,t,r){void 0===r&&(r=!1);for(var n=this.classifier.getClassificationsForLine(e,t,r),i="",a=0,o=n.entries;a=1&&arguments.length<=3?e.factory.createVariableDeclaration(t,void 0,r,n):e.Debug.fail("Argument count mismatch")}),t),e.updateVariableDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.updateVariableDeclaration(t,r,n,i,a):4===arguments.length?e.factory.updateVariableDeclaration(t,r,t.exclamationToken,n,i):e.Debug.fail("Argument count mismatch")}),t),e.createImportClause=e.Debug.deprecate((function(t,r,n){return void 0===n&&(n=!1),e.factory.createImportClause(n,t,r)}),t),e.updateImportClause=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateImportClause(t,i,r,n)}),t),e.createExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return void 0===a&&(a=!1),e.factory.createExportDeclaration(t,r,a,n,i)}),t),e.updateExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateExportDeclaration(t,r,n,o,i,a,t.assertClause)}),t),e.createJSDocParamTag=e.Debug.deprecate((function(t,r,n,i){return e.factory.createJSDocParameterTag(void 0,t,r,n,!1,i?e.factory.createNodeArray([e.factory.createJSDocText(i)]):void 0)}),t),e.createComma=e.Debug.deprecate((function(t,r){return e.factory.createComma(t,r)}),t),e.createLessThan=e.Debug.deprecate((function(t,r){return e.factory.createLessThan(t,r)}),t),e.createAssignment=e.Debug.deprecate((function(t,r){return e.factory.createAssignment(t,r)}),t),e.createStrictEquality=e.Debug.deprecate((function(t,r){return e.factory.createStrictEquality(t,r)}),t),e.createStrictInequality=e.Debug.deprecate((function(t,r){return e.factory.createStrictInequality(t,r)}),t),e.createAdd=e.Debug.deprecate((function(t,r){return e.factory.createAdd(t,r)}),t),e.createSubtract=e.Debug.deprecate((function(t,r){return e.factory.createSubtract(t,r)}),t),e.createLogicalAnd=e.Debug.deprecate((function(t,r){return e.factory.createLogicalAnd(t,r)}),t),e.createLogicalOr=e.Debug.deprecate((function(t,r){return e.factory.createLogicalOr(t,r)}),t),e.createPostfixIncrement=e.Debug.deprecate((function(t){return e.factory.createPostfixIncrement(t)}),t),e.createLogicalNot=e.Debug.deprecate((function(t){return e.factory.createLogicalNot(t)}),t),e.createNode=e.Debug.deprecate((function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),e.setTextRangePosEnd(305===t?e.parseBaseNodeFactory.createBaseSourceFileNode(t):79===t?e.parseBaseNodeFactory.createBaseIdentifierNode(t):80===t?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(t):e.isNodeKind(t)?e.parseBaseNodeFactory.createBaseNode(t):e.parseBaseNodeFactory.createBaseTokenNode(t),r,n)}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate((function(t){var r=e.factory.cloneNode(t);return e.setTextRange(r,t),e.setParent(r,t.parent),r}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."}),e.isTypeAssertion=e.Debug.deprecate((function(e){return 211===e.kind}),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."}),e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate((function(t){return e.isMemberName(t)}),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."})}(c||(c={}))}(ce);class de{constructor(e,t){this.name=e,this.code=t}static getLibraryFuncs(){let e={polarDecompose2D:"(A: ti.types.matrix) => {\n let x = A[0][0] + A[1][1];\n let y = A[1][0] - A[0][1];\n let scale = 1.0 / Math.sqrt(x * x + y * y);\n let c = x * scale;\n let s = y * scale;\n let r = [\n [c, -s],\n [s, c],\n ];\n return {\n U: r,\n P: ti.matmul(ti.transpose(r), A),\n };\n}",svd2D:"(A: ti.types.matrix) => {\n let RS = ti.polarDecompose2D(A);\n let R = RS.U;\n let S = RS.P;\n let c = 0.0;\n let s = 0.0;\n let s1 = 0.0;\n let s2 = 0.0;\n if (Math.abs(S[0][1]) < 1e-5) {\n c = 1.0;\n s = 0.0;\n s1 = S[0][0];\n s2 = S[1][1];\n } else {\n let tao = 0.5 * (S[0][0] - S[1][1]);\n let w = Math.sqrt(tao * tao + S[0][1] * S[0][1]);\n let t = 0.0;\n if (tao > 0) {\n t = S[0][1] / (tao + w);\n } else {\n t = S[0][1] / (tao - w);\n }\n c = 1 / Math.sqrt(t * t + 1);\n s = -t * c;\n s1 = c ** 2 * S[0][0] - 2 * c * s * S[0][1] + s ** 2 * S[1][1];\n s2 = s ** 2 * S[0][0] + 2 * c * s * S[0][1] + c ** 2 * S[1][1];\n }\n let zeros = [\n [0.0, 0.0],\n [0.0, 0.0],\n ];\n let result = {\n U: zeros,\n E: zeros,\n V: zeros,\n };\n if (s1 < s2) {\n let tmp = s1;\n s1 = s2;\n s2 = tmp;\n result.V = [\n [-s, c],\n [-c, -s],\n ];\n } else {\n result.V = [\n [c, s],\n [-s, c],\n ];\n }\n result.U = ti.matmul(R, result.V);\n result.E = [\n [s1, 0.0],\n [0.0, s2],\n ];\n return result;\n}",svd3D:"(A: ti.types.matrix) => {\n let a00 = A[0][0];\n let a01 = A[0][1];\n let a02 = A[0][2];\n let a10 = A[1][0];\n let a11 = A[1][1];\n let a12 = A[1][2];\n let a20 = A[2][0];\n let a21 = A[2][1];\n let a22 = A[2][2];\n\n let xffffffff = -1;\n\n //@ts-ignore\n let Ti = (x: any) => ti.i32(x);\n //@ts-ignore\n let int32 = (x: any) => ti.i32(x);\n let expr_select = (c: any, x: any, y: any) => {\n let result = x;\n if (!c) {\n result = y;\n }\n return result;\n };\n let svd_bitwise_or = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) | ti.bitcast_i32(f2));\n };\n let svd_bitwise_xor = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) ^ ti.bitcast_i32(f2));\n };\n let svd_bitwise_and = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) & ti.bitcast_i32(f2));\n };\n\n let Four_Gamma_Squared = 5.82842712474619;\n let Sine_Pi_Over_Eight = 0.3826834323650897;\n let Cosine_Pi_Over_Eight = 0.9238795325112867;\n\n let Sfour_gamma_squared = 0.0;\n let Ssine_pi_over_eight = 0.0;\n let Scosine_pi_over_eight = 0.0;\n let Sone_half = 0.0;\n let Sone = 0.0;\n let Stiny_number = 0.0;\n let Ssmall_number = 0.0;\n let Sa11 = 0.0;\n let Sa21 = 0.0;\n let Sa31 = 0.0;\n let Sa12 = 0.0;\n let Sa22 = 0.0;\n let Sa32 = 0.0;\n let Sa13 = 0.0;\n let Sa23 = 0.0;\n let Sa33 = 0.0;\n let Sv11 = 0.0;\n let Sv21 = 0.0;\n let Sv31 = 0.0;\n let Sv12 = 0.0;\n let Sv22 = 0.0;\n let Sv32 = 0.0;\n let Sv13 = 0.0;\n let Sv23 = 0.0;\n let Sv33 = 0.0;\n let Su11 = 0.0;\n let Su21 = 0.0;\n let Su31 = 0.0;\n let Su12 = 0.0;\n let Su22 = 0.0;\n let Su32 = 0.0;\n let Su13 = 0.0;\n let Su23 = 0.0;\n let Su33 = 0.0;\n let Sc = 0.0;\n let Ss = 0.0;\n let Sch = 0.0;\n let Ssh = 0.0;\n let Stmp1 = 0.0;\n let Stmp2 = 0.0;\n let Stmp3 = 0.0;\n let Stmp4 = 0.0;\n let Stmp5 = 0.0;\n let Sqvs = 0.0;\n let Sqvvx = 0.0;\n let Sqvvy = 0.0;\n let Sqvvz = 0.0;\n let Ss11 = 0.0;\n let Ss21 = 0.0;\n let Ss31 = 0.0;\n let Ss22 = 0.0;\n let Ss32 = 0.0;\n let Ss33 = 0.0;\n Sfour_gamma_squared = Four_Gamma_Squared;\n Ssine_pi_over_eight = Sine_Pi_Over_Eight;\n Scosine_pi_over_eight = Cosine_Pi_Over_Eight;\n Sone_half = 0.5;\n Sone = 1.0;\n Stiny_number = 1e-20;\n Ssmall_number = 1e-12;\n Sa11 = a00;\n Sa21 = a10;\n Sa31 = a20;\n Sa12 = a01;\n Sa22 = a11;\n Sa32 = a21;\n Sa13 = a02;\n Sa23 = a12;\n Sa33 = a22;\n Sqvs = 1.0;\n Sqvvx = 0.0;\n Sqvvy = 0.0;\n Sqvvz = 0.0;\n Ss11 = Sa11 * Sa11;\n Stmp1 = Sa21 * Sa21;\n Ss11 = Stmp1 + Ss11;\n Stmp1 = Sa31 * Sa31;\n Ss11 = Stmp1 + Ss11;\n Ss21 = Sa12 * Sa11;\n Stmp1 = Sa22 * Sa21;\n Ss21 = Stmp1 + Ss21;\n Stmp1 = Sa32 * Sa31;\n Ss21 = Stmp1 + Ss21;\n Ss31 = Sa13 * Sa11;\n Stmp1 = Sa23 * Sa21;\n Ss31 = Stmp1 + Ss31;\n Stmp1 = Sa33 * Sa31;\n Ss31 = Stmp1 + Ss31;\n Ss22 = Sa12 * Sa12;\n Stmp1 = Sa22 * Sa22;\n Ss22 = Stmp1 + Ss22;\n Stmp1 = Sa32 * Sa32;\n Ss22 = Stmp1 + Ss22;\n Ss32 = Sa13 * Sa12;\n Stmp1 = Sa23 * Sa22;\n Ss32 = Stmp1 + Ss32;\n Stmp1 = Sa33 * Sa32;\n Ss32 = Stmp1 + Ss32;\n Ss33 = Sa13 * Sa13;\n Stmp1 = Sa23 * Sa23;\n Ss33 = Stmp1 + Ss33;\n Stmp1 = Sa33 * Sa33;\n Ss33 = Stmp1 + Ss33;\n for (let iter of ti.range(5)) {\n Ssh = Ss21 * Sone_half;\n Stmp5 = Ss11 - Ss22;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(ti.not(ti.bitcast_i32(Stmp1)), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss33 = Ss33 * Stmp3;\n Ss31 = Ss31 * Stmp3;\n Ss32 = Ss32 * Stmp3;\n Ss33 = Ss33 * Stmp3;\n Stmp1 = Ss * Ss31;\n Stmp2 = Ss * Ss32;\n Ss31 = Sc * Ss31;\n Ss32 = Sc * Ss32;\n Ss31 = Stmp2 + Ss31;\n Ss32 = Ss32 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss22 * Stmp2;\n Stmp3 = Ss11 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss11 = Ss11 * Stmp4;\n Ss22 = Ss22 * Stmp4;\n Ss11 = Ss11 + Stmp1;\n Ss22 = Ss22 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss21 + Ss21;\n Ss21 = Ss21 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss11 = Ss11 + Stmp2;\n Ss21 = Ss21 - Stmp5;\n Ss22 = Ss22 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvz = Sqvvz + Ssh;\n Sqvs = Sqvs - Stmp3;\n Sqvvx = Sqvvx + Stmp2;\n Sqvvy = Sqvvy - Stmp1;\n Ssh = Ss32 * Sone_half;\n Stmp5 = Ss22 - Ss33;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss11 = Ss11 * Stmp3;\n Ss21 = Ss21 * Stmp3;\n Ss31 = Ss31 * Stmp3;\n Ss11 = Ss11 * Stmp3;\n Stmp1 = Ss * Ss21;\n Stmp2 = Ss * Ss31;\n Ss21 = Sc * Ss21;\n Ss31 = Sc * Ss31;\n Ss21 = Stmp2 + Ss21;\n Ss31 = Ss31 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss33 * Stmp2;\n Stmp3 = Ss22 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss22 = Ss22 * Stmp4;\n Ss33 = Ss33 * Stmp4;\n Ss22 = Ss22 + Stmp1;\n Ss33 = Ss33 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss32 + Ss32;\n Ss32 = Ss32 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss22 = Ss22 + Stmp2;\n Ss32 = Ss32 - Stmp5;\n Ss33 = Ss33 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvx = Sqvvx + Ssh;\n Sqvs = Sqvs - Stmp1;\n Sqvvy = Sqvvy + Stmp3;\n Sqvvz = Sqvvz - Stmp2;\n Ssh = Ss31 * Sone_half;\n Stmp5 = Ss33 - Ss11;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss22 = Ss22 * Stmp3;\n Ss32 = Ss32 * Stmp3;\n Ss21 = Ss21 * Stmp3;\n Ss22 = Ss22 * Stmp3;\n Stmp1 = Ss * Ss32;\n Stmp2 = Ss * Ss21;\n Ss32 = Sc * Ss32;\n Ss21 = Sc * Ss21;\n Ss32 = Stmp2 + Ss32;\n Ss21 = Ss21 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss11 * Stmp2;\n Stmp3 = Ss33 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss33 = Ss33 * Stmp4;\n Ss11 = Ss11 * Stmp4;\n Ss33 = Ss33 + Stmp1;\n Ss11 = Ss11 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss31 + Ss31;\n Ss31 = Ss31 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss33 = Ss33 + Stmp2;\n Ss31 = Ss31 - Stmp5;\n Ss11 = Ss11 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvy = Sqvvy + Ssh;\n Sqvs = Sqvs - Stmp2;\n Sqvvz = Sqvvz + Stmp1;\n Sqvvx = Sqvvx - Stmp3;\n }\n Stmp2 = Sqvs * Sqvs;\n Stmp1 = Sqvvx * Sqvvx;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = Sqvvy * Sqvvy;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = Sqvvz * Sqvvz;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sqvs = Sqvs * Stmp1;\n Sqvvx = Sqvvx * Stmp1;\n Sqvvy = Sqvvy * Stmp1;\n Sqvvz = Sqvvz * Stmp1;\n Stmp1 = Sqvvx * Sqvvx;\n Stmp2 = Sqvvy * Sqvvy;\n Stmp3 = Sqvvz * Sqvvz;\n Sv11 = Sqvs * Sqvs;\n Sv22 = Sv11 - Stmp1;\n Sv33 = Sv22 - Stmp2;\n Sv33 = Sv33 + Stmp3;\n Sv22 = Sv22 + Stmp2;\n Sv22 = Sv22 - Stmp3;\n Sv11 = Sv11 + Stmp1;\n Sv11 = Sv11 - Stmp2;\n Sv11 = Sv11 - Stmp3;\n Stmp1 = Sqvvx + Sqvvx;\n Stmp2 = Sqvvy + Sqvvy;\n Stmp3 = Sqvvz + Sqvvz;\n Sv32 = Sqvs * Stmp1;\n Sv13 = Sqvs * Stmp2;\n Sv21 = Sqvs * Stmp3;\n Stmp1 = Sqvvy * Stmp1;\n Stmp2 = Sqvvz * Stmp2;\n Stmp3 = Sqvvx * Stmp3;\n Sv12 = Stmp1 - Sv21;\n Sv23 = Stmp2 - Sv32;\n Sv31 = Stmp3 - Sv13;\n Sv21 = Stmp1 + Sv21;\n Sv32 = Stmp2 + Sv32;\n Sv13 = Stmp3 + Sv13;\n Stmp2 = Sa12;\n Stmp3 = Sa13;\n Sa12 = Sv12 * Sa11;\n Sa13 = Sv13 * Sa11;\n Sa11 = Sv11 * Sa11;\n Stmp1 = Sv21 * Stmp2;\n Sa11 = Sa11 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa11 = Sa11 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa12 = Sa12 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa12 = Sa12 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa13 = Sa13 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa13 = Sa13 + Stmp1;\n Stmp2 = Sa22;\n Stmp3 = Sa23;\n Sa22 = Sv12 * Sa21;\n Sa23 = Sv13 * Sa21;\n Sa21 = Sv11 * Sa21;\n Stmp1 = Sv21 * Stmp2;\n Sa21 = Sa21 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa21 = Sa21 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa22 = Sa22 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa22 = Sa22 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa23 = Sa23 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa23 = Sa23 + Stmp1;\n Stmp2 = Sa32;\n Stmp3 = Sa33;\n Sa32 = Sv12 * Sa31;\n Sa33 = Sv13 * Sa31;\n Sa31 = Sv11 * Sa31;\n Stmp1 = Sv21 * Stmp2;\n Sa31 = Sa31 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa31 = Sa31 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa32 = Sa32 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa32 = Sa32 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa33 = Sa33 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa33 = Sa33 + Stmp1;\n Stmp1 = Sa11 * Sa11;\n Stmp4 = Sa21 * Sa21;\n Stmp1 = Stmp1 + Stmp4;\n Stmp4 = Sa31 * Sa31;\n Stmp1 = Stmp1 + Stmp4;\n Stmp2 = Sa12 * Sa12;\n Stmp4 = Sa22 * Sa22;\n Stmp2 = Stmp2 + Stmp4;\n Stmp4 = Sa32 * Sa32;\n Stmp2 = Stmp2 + Stmp4;\n Stmp3 = Sa13 * Sa13;\n Stmp4 = Sa23 * Sa23;\n Stmp3 = Stmp3 + Stmp4;\n Stmp4 = Sa33 * Sa33;\n Stmp3 = Stmp3 + Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp1 < Stmp2, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa11, Sa12);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa11 = svd_bitwise_xor(Sa11, Stmp5);\n Sa12 = svd_bitwise_xor(Sa12, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa21, Sa22);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa21 = svd_bitwise_xor(Sa21, Stmp5);\n Sa22 = svd_bitwise_xor(Sa22, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa31, Sa32);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa31 = svd_bitwise_xor(Sa31, Stmp5);\n Sa32 = svd_bitwise_xor(Sa32, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv11, Sv12);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv11 = svd_bitwise_xor(Sv11, Stmp5);\n Sv12 = svd_bitwise_xor(Sv12, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv21, Sv22);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv21 = svd_bitwise_xor(Sv21, Stmp5);\n Sv22 = svd_bitwise_xor(Sv22, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv31, Sv32);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv31 = svd_bitwise_xor(Sv31, Stmp5);\n Sv32 = svd_bitwise_xor(Sv32, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp1, Stmp2);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp1 = svd_bitwise_xor(Stmp1, Stmp5);\n Stmp2 = svd_bitwise_xor(Stmp2, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa12 = Sa12 * Stmp4;\n Sa22 = Sa22 * Stmp4;\n Sa32 = Sa32 * Stmp4;\n Sv12 = Sv12 * Stmp4;\n Sv22 = Sv22 * Stmp4;\n Sv32 = Sv32 * Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp1 < Stmp3, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa11, Sa13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa11 = svd_bitwise_xor(Sa11, Stmp5);\n Sa13 = svd_bitwise_xor(Sa13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa21, Sa23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa21 = svd_bitwise_xor(Sa21, Stmp5);\n Sa23 = svd_bitwise_xor(Sa23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa31, Sa33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa31 = svd_bitwise_xor(Sa31, Stmp5);\n Sa33 = svd_bitwise_xor(Sa33, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv11, Sv13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv11 = svd_bitwise_xor(Sv11, Stmp5);\n Sv13 = svd_bitwise_xor(Sv13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv21, Sv23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv21 = svd_bitwise_xor(Sv21, Stmp5);\n Sv23 = svd_bitwise_xor(Sv23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv31, Sv33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv31 = svd_bitwise_xor(Sv31, Stmp5);\n Sv33 = svd_bitwise_xor(Sv33, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp1, Stmp3);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp1 = svd_bitwise_xor(Stmp1, Stmp5);\n Stmp3 = svd_bitwise_xor(Stmp3, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa11 = Sa11 * Stmp4;\n Sa21 = Sa21 * Stmp4;\n Sa31 = Sa31 * Stmp4;\n Sv11 = Sv11 * Stmp4;\n Sv21 = Sv21 * Stmp4;\n Sv31 = Sv31 * Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp2 < Stmp3, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa12, Sa13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa12 = svd_bitwise_xor(Sa12, Stmp5);\n Sa13 = svd_bitwise_xor(Sa13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa22, Sa23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa22 = svd_bitwise_xor(Sa22, Stmp5);\n Sa23 = svd_bitwise_xor(Sa23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa32, Sa33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa32 = svd_bitwise_xor(Sa32, Stmp5);\n Sa33 = svd_bitwise_xor(Sa33, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv12, Sv13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv12 = svd_bitwise_xor(Sv12, Stmp5);\n Sv13 = svd_bitwise_xor(Sv13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv22, Sv23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv22 = svd_bitwise_xor(Sv22, Stmp5);\n Sv23 = svd_bitwise_xor(Sv23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv32, Sv33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv32 = svd_bitwise_xor(Sv32, Stmp5);\n Sv33 = svd_bitwise_xor(Sv33, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp2, Stmp3);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp2 = svd_bitwise_xor(Stmp2, Stmp5);\n Stmp3 = svd_bitwise_xor(Stmp3, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa13 = Sa13 * Stmp4;\n Sa23 = Sa23 * Stmp4;\n Sa33 = Sa33 * Stmp4;\n Sv13 = Sv13 * Stmp4;\n Sv23 = Sv23 * Stmp4;\n Sv33 = Sv33 * Stmp4;\n Su11 = 1.0;\n Su21 = 0.0;\n Su31 = 0.0;\n Su12 = 0.0;\n Su22 = 1.0;\n Su32 = 0.0;\n Su13 = 0.0;\n Su23 = 0.0;\n Su33 = 1.0;\n Ssh = Sa21 * Sa21;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa21);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa11;\n Sch = Math.max(Sch, Sa11);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa11 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa11;\n Stmp2 = Ss * Sa21;\n Sa11 = Sc * Sa11;\n Sa21 = Sc * Sa21;\n Sa11 = Sa11 + Stmp2;\n Sa21 = Sa21 - Stmp1;\n Stmp1 = Ss * Sa12;\n Stmp2 = Ss * Sa22;\n Sa12 = Sc * Sa12;\n Sa22 = Sc * Sa22;\n Sa12 = Sa12 + Stmp2;\n Sa22 = Sa22 - Stmp1;\n Stmp1 = Ss * Sa13;\n Stmp2 = Ss * Sa23;\n Sa13 = Sc * Sa13;\n Sa23 = Sc * Sa23;\n Sa13 = Sa13 + Stmp2;\n Sa23 = Sa23 - Stmp1;\n Stmp1 = Ss * Su11;\n Stmp2 = Ss * Su12;\n Su11 = Sc * Su11;\n Su12 = Sc * Su12;\n Su11 = Su11 + Stmp2;\n Su12 = Su12 - Stmp1;\n Stmp1 = Ss * Su21;\n Stmp2 = Ss * Su22;\n Su21 = Sc * Su21;\n Su22 = Sc * Su22;\n Su21 = Su21 + Stmp2;\n Su22 = Su22 - Stmp1;\n Stmp1 = Ss * Su31;\n Stmp2 = Ss * Su32;\n Su31 = Sc * Su31;\n Su32 = Sc * Su32;\n Su31 = Su31 + Stmp2;\n Su32 = Su32 - Stmp1;\n Ssh = Sa31 * Sa31;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa31);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa11;\n Sch = Math.max(Sch, Sa11);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa11 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa11;\n Stmp2 = Ss * Sa31;\n Sa11 = Sc * Sa11;\n Sa31 = Sc * Sa31;\n Sa11 = Sa11 + Stmp2;\n Sa31 = Sa31 - Stmp1;\n Stmp1 = Ss * Sa12;\n Stmp2 = Ss * Sa32;\n Sa12 = Sc * Sa12;\n Sa32 = Sc * Sa32;\n Sa12 = Sa12 + Stmp2;\n Sa32 = Sa32 - Stmp1;\n Stmp1 = Ss * Sa13;\n Stmp2 = Ss * Sa33;\n Sa13 = Sc * Sa13;\n Sa33 = Sc * Sa33;\n Sa13 = Sa13 + Stmp2;\n Sa33 = Sa33 - Stmp1;\n Stmp1 = Ss * Su11;\n Stmp2 = Ss * Su13;\n Su11 = Sc * Su11;\n Su13 = Sc * Su13;\n Su11 = Su11 + Stmp2;\n Su13 = Su13 - Stmp1;\n Stmp1 = Ss * Su21;\n Stmp2 = Ss * Su23;\n Su21 = Sc * Su21;\n Su23 = Sc * Su23;\n Su21 = Su21 + Stmp2;\n Su23 = Su23 - Stmp1;\n Stmp1 = Ss * Su31;\n Stmp2 = Ss * Su33;\n Su31 = Sc * Su31;\n Su33 = Sc * Su33;\n Su31 = Su31 + Stmp2;\n Su33 = Su33 - Stmp1;\n Ssh = Sa32 * Sa32;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa32);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa22;\n Sch = Math.max(Sch, Sa22);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa22 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa21;\n Stmp2 = Ss * Sa31;\n Sa21 = Sc * Sa21;\n Sa31 = Sc * Sa31;\n Sa21 = Sa21 + Stmp2;\n Sa31 = Sa31 - Stmp1;\n Stmp1 = Ss * Sa22;\n Stmp2 = Ss * Sa32;\n Sa22 = Sc * Sa22;\n Sa32 = Sc * Sa32;\n Sa22 = Sa22 + Stmp2;\n Sa32 = Sa32 - Stmp1;\n Stmp1 = Ss * Sa23;\n Stmp2 = Ss * Sa33;\n Sa23 = Sc * Sa23;\n Sa33 = Sc * Sa33;\n Sa23 = Sa23 + Stmp2;\n Sa33 = Sa33 - Stmp1;\n Stmp1 = Ss * Su12;\n Stmp2 = Ss * Su13;\n Su12 = Sc * Su12;\n Su13 = Sc * Su13;\n Su12 = Su12 + Stmp2;\n Su13 = Su13 - Stmp1;\n Stmp1 = Ss * Su22;\n Stmp2 = Ss * Su23;\n Su22 = Sc * Su22;\n Su23 = Sc * Su23;\n Su22 = Su22 + Stmp2;\n Su23 = Su23 - Stmp1;\n Stmp1 = Ss * Su32;\n Stmp2 = Ss * Su33;\n Su32 = Sc * Su32;\n Su33 = Sc * Su33;\n Su32 = Su32 + Stmp2;\n Su33 = Su33 - Stmp1;\n\n return {\n U: [\n [Su11, Su12, Su13],\n [Su21, Su22, Su23],\n [Su31, Su32, Su33],\n ],\n V: [\n [Sv11, Sv12, Sv13],\n [Sv21, Sv22, Sv23],\n [Sv31, Sv32, Sv33],\n ],\n E: [\n [Sa11, 0.0, 0.0],\n [0.0, Sa22, 0.0],\n [0.0, 0.0, Sa33],\n ],\n };\n}",lookAt:"(eye: ti.types.vector, center: ti.types.vector, up: ti.types.vector) => {\n let z = ti.normalized(eye - center);\n let x = ti.normalized(ti.cross(up, z));\n let y = ti.normalized(ti.cross(z, x));\n let result = [x.concat([-ti.dot(x, eye)]), y.concat([-ti.dot(y, eye)]), z.concat([-ti.dot(z, eye)]), [0, 0, 0, 1]];\n return result;\n}",perspective:"(fovy: number, aspect: number, zNear: number, zFar: number) => {\n let rad = (fovy * Math.PI) / 180.0;\n let tanHalfFovy = Math.tan(rad / 2.0);\n\n let zero4 = [0.0, 0.0, 0.0, 0.0];\n let result = [zero4, zero4, zero4, zero4];\n\n result[0][0] = 1.0 / (aspect * tanHalfFovy);\n result[1][1] = 1.0 / tanHalfFovy;\n result[2][2] = zFar / (zNear - zFar);\n result[3][2] = -1.0;\n result[2][3] = (zFar * zNear) / (zNear - zFar);\n return result;\n}",ortho:"(left: number, right: number, bottom: number, top: number, zNear: number, zFar: number) => {\n let zero4 = [0.0, 0.0, 0.0, 0.0];\n let result = [zero4, zero4, zero4, zero4];\n result[0][0] = 2.0 / (right - left);\n result[1][1] = 2.0 / (top - bottom);\n result[2][2] = -1.0 / (zFar - zNear);\n result[0][3] = -(right + left) / (right - left);\n result[1][3] = -(top + bottom) / (top - bottom);\n result[2][3] = (-zNear * 2.0) / (zFar - zNear);\n result[3][3] = 1.0;\n return result;\n}",inverse:"(m: ti.types.matrix) => {\n let det =\n m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) -\n m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +\n m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\n\n let invdet = 1 / det;\n\n let minv = [\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n ];\n minv[0][0] = (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * invdet;\n minv[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) * invdet;\n minv[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) * invdet;\n minv[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) * invdet;\n minv[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) * invdet;\n minv[1][2] = (m[1][0] * m[0][2] - m[0][0] * m[1][2]) * invdet;\n minv[2][0] = (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * invdet;\n minv[2][1] = (m[2][0] * m[0][1] - m[0][0] * m[2][1]) * invdet;\n minv[2][2] = (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * invdet;\n return minv;\n}",rotateAxisAngle:"(axis: ti.types.vector, angle: number) => {\n let a = angle;\n let c = Math.cos(a);\n let s = Math.sin(a);\n let temp: ti.types.vector = (1.0 - c) * axis;\n\n let m = [\n [1.0, 0.0, 0.0, 0.0],\n [0.0, 1.0, 0.0, 0.0],\n [0.0, 0.0, 1.0, 0.0],\n [0.0, 0.0, 0.0, 1.0],\n ];\n m[0][0] = c + temp[0] * axis[0];\n m[1][0] = temp[0] * axis[1] + s * axis[2];\n m[2][0] = temp[0] * axis[2] - s * axis[1];\n\n m[0][1] = temp[1] * axis[0] - s * axis[2];\n m[1][1] = c + temp[1] * axis[1];\n m[2][1] = temp[1] * axis[2] + s * axis[0];\n\n m[0][2] = temp[2] * axis[0] + s * axis[1];\n m[1][2] = temp[2] * axis[1] - s * axis[0];\n m[2][2] = c + temp[2] * axis[2];\n return m;\n}",translate:"(t: ti.types.vector) => {\n return [\n [1.0, 0.0, 0.0, t[0]],\n [0.0, 1.0, 0.0, t[1]],\n [0.0, 0.0, 1.0, t[2]],\n [0.0, 0.0, 0.0, 1.0],\n ];\n}",scale:"(t: ti.types.vector) => {\n return [\n [t[0], 0.0, 0.0, 0.0],\n [0.0, t[1], 0.0, 0.0],\n [0.0, 0.0, t[2], 0.0],\n [0.0, 0.0, 0.0, 1.0],\n ];\n}"},t=new Map;for(let r in e)t.set(r,new de(r,e[r].toString()));return t}}class _e{constructor(e,t=[],r=[]){this.stmts=t,this.compileTimeConstants=r,this.hostSideValue=void 0,this.type_=e}getType(){return this.type_}isCompileTimeConstant(){return null!==this.compileTimeConstants&&this.compileTimeConstants.length===this.stmts.length}}class pe{static makeScalar(e,t){return new _e(new u(t),[e],[])}static makeConstantScalar(e,t,r){return new _e(new u(r),[t],[e])}static getVectorComponents(e){let r,n;if(c(h.isValueOrPointerOfCategory(e.getType(),t.Vector)),e.getType().getCategory()===t.Pointer){let t=e.getType();r=h.getPrimitiveType(t.getValueType()),n=new u(r),n=new p(n,t.getIsGlobal())}else r=h.getPrimitiveType(e.getType()),n=new u(r);let i=[];for(let t=0;t0);for(let r of e)c(h.isValueOrPointerOfCategory(r.getType(),t.Scalar));if(e[0].getType().getCategory()===t.Pointer){let t=e[0].getType(),i=h.getPrimitiveType(t.getValueType());for(let t of e){let e=t.getType();c(h.getPrimitiveType(e.getValueType())===i)}r=new d(i,n),r=new p(r,t.getIsGlobal())}else{let t=h.getPrimitiveType(e[0].getType());for(let r of e)c(h.getPrimitiveType(r.getType())===t);r=new d(t,n)}let i=new _e(r,[],[]),a=!0;for(let t of e)a&&(a=t.isCompileTimeConstant());for(let t of e)i.stmts.push(t.stmts[0]),a&&i.compileTimeConstants.push(t.compileTimeConstants[0]);return i}static makeMatrixFromVectorsAsRows(e){let r,n=e.length;c(n>0);for(let r of e)c(h.isValueOrPointerOfCategory(r.getType(),t.Vector));if(e[0].getType().getCategory()===t.Pointer){let t=e[0].getType(),i=h.getPrimitiveType(t.getValueType());for(let t of e){let e=t.getType();c(h.getPrimitiveType(e.getValueType())===i)}let a=t.getValueType().getNumRows();for(let t of e){c(t.getType().getValueType().getNumRows()===a)}r=new _(i,n,a),r=new p(r,t.getIsGlobal())}else{let t=h.getPrimitiveType(e[0].getType());for(let r of e)c(h.getPrimitiveType(r.getType())===t);let i=e[0].getType().getNumRows();for(let t of e)c(t.getType().getNumRows()===i);r=new _(t,n,i)}let i=new _e(r,[],[]),a=!0;for(let t of e)a&&(a=t.isCompileTimeConstant());for(let t of e)for(let e=0;ee+t)),new mt("add",r,!0,!0,me.add,((e,t)=>e+t)),new mt("-",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("sub",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("*",r,!0,!0,me.mul,((e,t)=>e-t)),new mt("mul",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("**",r,!0,!0,me.pow,((e,t)=>Math.pow(e,t))),new mt("%",r,!0,!0,me.mod,((e,t)=>e%t)),new mt("<",r,!0,!0,me.cmp_lt,((e,t)=>Number(e",r,!0,!0,me.cmp_gt,((e,t)=>Number(e>t))),new mt(">=",r,!0,!0,me.cmp_ge,((e,t)=>Number(e>=t))),new mt("==",r,!0,!0,me.cmp_eq,((e,t)=>Number(e===t))),new mt("!=",r,!0,!0,me.cmp_ne,((e,t)=>Number(e!==t))),new mt("===",r,!0,!0,me.cmp_eq,((e,t)=>Number(e===t))),new mt("!==",r,!0,!0,me.cmp_ne,((e,t)=>Number(e!==t))),new mt("&",r,!0,!0,me.bit_and,((e,t)=>e&t)),new mt("&&",r,!1,!1,me.bit_and,((e,t)=>e&t)),new mt("|",r,!0,!0,me.bit_or,((e,t)=>e&t)),new mt("||",r,!1,!1,me.bit_or,((e,t)=>e&t)),new mt("^",r,!0,!0,me.bit_xor,((e,t)=>e&t)),new mt("/",r,!0,!0,me.truediv,((e,t)=>e/t)),new mt("div",r,!0,!0,me.truediv,((e,t)=>e/t)),new mt("<<",r,!1,!1,me.bit_shl),new mt(">>>",r,!1,!1,me.bit_shr),new mt("max",r,!0,!0,me.max,((e,t)=>Math.max(e,t))),new mt("min",r,!0,!0,me.min,((e,t)=>Math.min(e,t))),new mt("pow",r,!0,!0,me.pow,((e,t)=>Math.pow(e,t))),new mt("atan2",r,!0,!0,me.atan2,((e,t)=>Math.atan2(e,t))),new ft("sin",r,ge.sin),new ft("cos",r,ge.cos),new ft("asin",r,ge.asin),new ft("acos",r,ge.acos),new ft("tan",r,ge.tan),new ft("tanh",r,ge.tanh),new ft("exp",r,ge.exp),new ft("log",r,ge.log),new ft("neg",r,ge.neg,(e=>-e)),new ft("not",r,ge.bit_not),new ft("logical_not",r,ge.logic_not),new ft("abs",r,ge.abs),new ft("floor",r,ge.floor),new ft("sgn",r,ge.sgn),new ft("sqrt",r,ge.sqrt),new ft("rsqrt",r,ge.rsqrt),new ft("i32",r,ge.cast_i32_value,(e=>Math.floor(e))),new ft("f32",r,ge.cast_f32_value,(e=>e)),new ft("bitcast_f32",r,ge.cast_f32_bits,(e=>e)),new ft("bitcast_i32",r,ge.cast_i32_bits,(e=>e)),new pt("random",new u(e.f32),(()=>new _e(new u(e.f32),[r.create_rand(e.f32)],[])))];for(let e of i)n.set(e.name,e);let a=new gt("=",2,(r=>{if(2!==r.length)return v.createError("what??");if(r[0].getType().getCategory()!==t.Pointer)return v.createError("expecting left hand side of assignment to be an lvalue");let n=r[0].getType(),i=r[1].getType();if(h.isTensorType(n.getValueType())&&h.isTensorType(i)){let r=h.getPrimitiveType(n.getValueType()),a=h.getPrimitiveType(i);return r===e.i32&&a===e.f32?v.createError("storing f32 into a i32 local variable."):h.tensorTypeShapeMatch(n.getValueType(),i)||i.getCategory()===t.Scalar?v.createNoError():v.createError("Shape mismatch in assignment")}return n.getValueType().getCategory()===t.Struct&&i.getCategory()===t.Struct?(n.getValueType().equals(i)||v.createError("struct type mismatch"),v.createNoError()):v.createError("invalid assignment")}),(i=>{let a=i[0].getType(),o=i[1].getType(),l=(e,t)=>{switch(e.getKind()){case fe.GlobalPtrStmt:return r.create_global_store(e,t);case fe.GlobalTemporaryStmt:return r.create_global_temporary_store(e,t);case fe.AllocaStmt:return r.create_local_store(e,t);default:s("assignment failed: not a pointer",i)}};if(h.isTensorType(a.getValueType())&&h.isTensorType(i[1].getType())){let r=h.getPrimitiveType(a.getValueType()),u=h.getPrimitiveType(o);if(r===e.f32&&u===e.i32&&(i[1]=n.get("f32").apply([i[1]])),h.tensorTypeShapeMatch(a.getValueType(),o)){c(i[0].stmts.length===i[1].stmts.length,"[Compiler bug]","Expecting stmts.length to match");for(let e=0;e1===e.length&&e[0].getType().getCategory()===t.Pointer?v.createNoError():v.createError("expecting pointer type")),(e=>{let t=e[0].getType().getValueType(),n=new _e(t,[]);for(let t=0;t{if(2!==e.length)return v.createError("expecting 2 values being");let r=e[0],n=e[1],i=r.getType(),a=n.getType();if(!h.isTensorType(i)||!h.isTensorType(a))return v.createError("Only scalar/vector/matrix types can be grouped together");let o=i.getCategory(),s=a.getCategory();if(o===t.Scalar&&s===t.Scalar)return v.createNoError();if(o===t.Vector&&s===t.Scalar)return v.createNoError();if(o===t.Vector&&s===t.Vector){let e=a;return i.getNumRows()!==e.getNumRows()?v.createError("vectors with different number of rows cannot be grouped together"):v.createNoError()}if(o===t.Matrix&&s===t.Vector){let e=a;return i.getNumCols()!==e.getNumRows()?v.createError("cannot append to a matrix a vector whose number of rows don't match"):v.createNoError()}return v.createError("invalid grouping")}),(r=>{let i=r[0],a=r[1],o=i.getType(),s=a.getType(),c=h.getPrimitiveType(o),l=h.getPrimitiveType(s);(c===e.f32||l===e.f32)&&(i=n.get("f32").apply([i]),a=n.get("f32").apply([a]));let u=o.getCategory(),d=s.getCategory();return u===t.Scalar&&d===t.Scalar?pe.makeVectorFromScalars([i,a]):u===t.Vector&&d===t.Scalar?pe.addScalarToVector(i,a):u===t.Vector&&d===t.Vector?pe.makeMatrixFromVectorsAsRows([i,a]):u===t.Matrix&&d===t.Vector?pe.addRowVectorToMatrix(i,a):i})),d=new gt("concat",2,(e=>{if(2!==e.length)return v.createError("can only concat among two values");let r=e[0],n=e[1],i=r.getType(),a=n.getType(),o=i.getCategory(),s=a.getCategory();if(o===t.Vector&&s===t.Vector)return v.createNoError();if(o===t.Matrix&&s===t.Matrix){let e=a;return i.getNumCols()!==e.getNumCols()?v.createError("cannot concat matrices with different amount of columns"):v.createNoError()}return v.createError("cannot only concat two vectors or two matrices")}),(r=>{let i=r[0],a=r[1],o=i.getType(),s=a.getType(),c=o.getCategory(),l=s.getCategory(),u=h.getPrimitiveType(o),d=h.getPrimitiveType(s);return(u===e.f32||d===e.f32)&&(i=n.get("f32").apply([i]),a=n.get("f32").apply([a])),c===t.Vector&&l===t.Vector?pe.concatVectors(i,a):c===t.Matrix&&l===t.Matrix?pe.concatMatrices(i,a):i})),_=new gt("len",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(t=>{let n=t[0].getType().getNumRows();return pe.makeConstantScalar(n,r.get_int32(n),e.i32)})),p=new gt("length",1,(e=>_.checkType(e)),(e=>_.apply(e))),f=new gt("sum",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(t=>{let i=pe.makeConstantScalar(0,r.get_float32(0),e.f32),a=pe.getVectorComponents(t[0]);for(let e of a)i=n.get("+").apply([i,e]);return i})),g=new gt("normSqr",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=n.get("*").apply([e[0],e[0]]);return f.apply([t])})),y=new gt("norm",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=g.apply(e);return n.get("sqrt").apply([t])})),b=new gt("normalized",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=y.apply(e);return n.get("/").apply([e[0],t])})),x=new gt("dot",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector&&e[0].getType().getNumRows()===e[1].getType().getNumRows()?v.createNoError():v.createError("expecting vectors of the same size ")),(e=>{let t=n.get("*").apply([e[0],e[1]]);return f.apply([t])})),S=new gt("cross",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector&&3===e[0].getType().getNumRows()&&3===e[1].getType().getNumRows()?v.createNoError():v.createError("expecting 3D vectors")),(e=>{let t=pe.getVectorComponents(e[0]),r=pe.getVectorComponents(e[1]),i=n.get("-").apply([n.get("*").apply([t[1],r[2]]),n.get("*").apply([t[2],r[1]])]),a=n.get("-").apply([n.get("*").apply([t[2],r[0]]),n.get("*").apply([t[0],r[2]])]),o=n.get("-").apply([n.get("*").apply([t[0],r[1]]),n.get("*").apply([t[1],r[0]])]);return pe.makeVectorFromScalars([i,a,o])})),D=new gt("outerProduct",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vectors")),(e=>{let t=pe.getVectorComponents(e[0]),r=pe.getVectorComponents(e[1]),i=t.length,a=r.length,o=[];for(let e=0;e{let r=e[0].getType(),n=e[1].getType();if(r.getCategory()!==t.Matrix)return v.createError("LHS of the matrix multiplication must be a matrix");let i=r;if(n.getCategory()===t.Matrix){let e=n;return i.getNumCols()===e.getNumRows()?v.createNoError():v.createError(`size mismatch during matrix-matrix multiplication: LHS num cols = ${i.getNumCols()}, but RHS num rows = ${e.getNumRows()}`)}if(n.getCategory()===t.Vector){let e=n;return i.getNumCols()===e.getNumRows()?v.createNoError():v.createError(`size mismatch during matrix-vector multiplication: LHS num cols = ${i.getNumCols()}, but RHS num rows = ${e.getNumRows()}`)}return v.createError("RHS of the matrix multiplication must be a matrix or a vector")}),(e=>{let r=e[0].getType(),n=e[1].getType(),i=r,a=pe.getMatrixRowVectors(e[0]);if(n.getCategory()===t.Matrix){let t=n,r=i.getNumRows(),o=t.getNumCols(),s=[],c=pe.getMatrixColVectors(e[1]);for(let e=0;e1===e.length&&e[0].getType().getCategory()===t.Matrix?v.createNoError():v.createError("expecting matrix")),(e=>pe.transposeMatrix(e[0]))),E=new gt("static",1,(e=>1!==e.length?v.createError("static(...) requires exactly 1 argument"):e[0].isCompileTimeConstant()?v.createNoError():v.createError("static(...) requires a compile-time constant argument")),(e=>e[0].getType().getCategory()===t.HostObjectReference?pe.makeHostObjectReference(e[0].hostSideValue,!0):e[0])),k=new gt("Static",1,(e=>E.checkType(e)),(e=>E.apply(e))),A=new gt("mergeStructs",2,(e=>{if(2!==e.length)return v.createError("ti.mergeStructs(...) requires 2 structs to be merged");if(e[0].getType().getCategory()!==t.Struct||e[1].getType().getCategory()!==t.Struct)return v.createError("arguments to ti.mergeStructs(...) must be structs");let r=e[0].getType(),n=e[1].getType();for(let e of r.getPropertyNames())for(let t of n.getPropertyNames())if(e===t)return v.createError("structs to be named cannot have overlapping property names");return v.createNoError()}),(e=>{let t=e[0].getType(),r=e[1].getType(),n=t.getPropertyNames(),i=r.getPropertyNames(),a=n.concat(i),o=pe.getStructMembers(e[0]),s=pe.getStructMembers(e[1]),c=new Map;for(let e of n)c.set(e,o.get(e));for(let e of i)c.set(e,s.get(e));return pe.makeStruct(a,c)})),N=new gt("slice",3,(e=>{if(e.length<2||e.length>3)return v.createError("unsupported overload of slice()");let r=e[0].getType();for(let t=1;t{let r=e[0],n=r.getType();if(n.getCategory()===t.Vector){let t=e[1].compileTimeConstants[0],n=r.stmts.length;3===e.length&&(n=e[2].compileTimeConstants[0]);let i=pe.getVectorComponents(r);return i=i.slice(t,n),pe.makeVectorFromScalars(i)}{let t=n,i=e[1].compileTimeConstants,a=[t.getNumRows(),t.getNumCols()];3===e.length&&(a=e[2].compileTimeConstants),1===i.length&&i.push(t.getNumCols()),1===a.length&&a.push(t.getNumCols());let o=a[0]-i[0];a[1],i[1];let s=pe.getMatrixComponents(r);s=s.slice(i[0],a[0]);for(let e=0;et.startsWith(e))),t=t.map((t=>t.substr(e.length+1).split("/")[0])),t}}class bt{constructor(){this.fs=new vt}getSourceFile(e,t,r){let n=null;if(this.fs.fileExists(e)&&(n=this.fs.readFile(e)),null!=n)return ce.exports.createSourceFile(e,this.fs.readFile(e),t)}getDefaultLibFileName(e){return"typescript.js"}writeFile(e,t){this.fs.writeFile(e,t,!0)}getCurrentDirectory(){return"."}getDirectories(e){throw new Error("Method not implemented.")}getCanonicalFileName(e){return e}useCaseSensitiveFileNames(){return!0}getNewLine(){return"\n"}fileExists(e){return o(`fileExists(${e})`),this.fs.fileExists(e)}readFile(e){return o(`readFile(${e})`),this.fs.readFile(e)}}class xt{constructor(){this.typeChecker=null,this.tsProgram=null,this.functionNode=null,this.parent=null,this.argNames=[],this.argNodes=[]}static makeFromCode(e){let t=new xt,r=new bt,n="temp.ts";r.writeFile(n,e);let i={allowNonTsExtensions:!0,target:ce.exports.ScriptTarget.Latest,allowJs:!0,strict:!1,noImplicitUseStrict:!0,alwaysStrict:!1,strictFunctionTypes:!1,checkJs:!0};t.tsProgram=ce.exports.createProgram([n],i,r),t.errorTsDiagnostics(t.tsProgram.getSyntacticDiagnostics()),t.typeChecker=t.tsProgram.getTypeChecker();let a=t.tsProgram.getSourceFiles();t.assertNode(a[0],1===a.length,"Expecting exactly 1 source file, got ",a.length);let o=a[0].statements;return t.assertNode(a[0],1===o.length,"Expecting exactly 1 statement in ti.kernel (A single function or arrow function)"),t.registerFunctionNode(o[0]),t}static makeFromParsedNode(e,t){let r=new xt;return t.parent=t,r.typeChecker=t.typeChecker,r.tsProgram=t.tsProgram,r.registerFunctionNode(e),r}registerFunctionNode(e){if(e.kind===ce.exports.SyntaxKind.FunctionDeclaration){let t=e;t.name&&-1!==t.name.getText().indexOf("$")&&this.errorNode(e,"function name cannot have $ in it"),this.functionNode=e,this.registerArguments(e.parameters)}else if(e.kind===ce.exports.SyntaxKind.ExpressionStatement&&e.expression.kind===ce.exports.SyntaxKind.ArrowFunction){let t=e.expression;this.functionNode=t,this.registerArguments(t.parameters)}else e.kind===ce.exports.SyntaxKind.ArrowFunction?(this.functionNode=e,this.registerArguments(e.parameters)):this.errorNode(e,"Expecting a function or an arrow function in kernel/function")}registerArguments(e){for(let t of e)this.argNames.push(t.name.getText()),this.argNodes.push(t)}hasNodeSymbol(e){return void 0!==this.typeChecker.getSymbolAtLocation(e)}getNodeSymbol(e){return this.assertNode(e,this.hasNodeSymbol(e),"symbol not found for "+e.getText()),this.typeChecker.getSymbolAtLocation(e)}getSourceCodeAt(e,t){let r=this.tsProgram.getSourceFiles()[0],n=r.getLineAndCharacterOfPosition(e).line,i=r.getLineAndCharacterOfPosition(t).line,a=r.getLineStarts()[n],o=r.getLineStarts()[i+1];return r.getText().slice(a,o)}errorTsDiagnostics(e){let t="";for(let r of e)if(r.category===ce.exports.DiagnosticCategory.Error){let e=r.start,n=r.start+r.length,i=this.getSourceCodeAt(e,n);t+=`\n Syntax Error: ${r.messageText} \n at: \n ${i}\n `}""!==t&&s("Kernel/function code cannot be parsed as Javascript: \n"+t)}getNodeSourceCode(e){let t=e.getStart(),r=e.getEnd();return this.getSourceCodeAt(t,r)}errorNode(e,...t){let r=this.getNodeSourceCode(e),n="Error: ";for(let e of t)n+=String(e);n+=`\nat:\n ${r} `,s(n)}assertNode(e,t,...r){t||this.errorNode(e,...r)}}class St{static createField(e,t,r=!1){r&&ne.getCurrentProgram().materializeCurrentTree();let n=ne.getCurrentProgram().partialTree.addNaiveDenseField(e,t);return r&&(n.snodeTree.fragmentShaderWritable=!0,ne.getCurrentProgram().materializeCurrentTree()),n}}class Dt{constructor(){this.module=new dt,this.guards=[new Ct(this,this.module.block)]}get_int32(t){return this.pushNewStmt(new Te(t,e.i32,this.getNewId()))}get_float32(t){return this.pushNewStmt(new Te(t,e.f32,this.getNewId()))}create_range_for(e,t){return this.pushNewStmt(new Ee(e,t,new ut,this.getNewId()))}get_loop_index(e){return this.pushNewStmt(new ke(e,this.getNewId()))}create_global_ptr(e,t,r){return this.pushNewStmt(new Fe(e,t,r,this.getNewId()))}create_global_load(e){return this.pushNewStmt(new Pe(e,this.getNewId()))}create_global_store(e,t){return this.pushNewStmt(new Ie(e,t,this.getNewId()))}create_global_temporary(e,t){return this.pushNewStmt(new Oe(e,t,this.getNewId()))}create_global_temporary_load(e){return this.pushNewStmt(new Me(e,this.getNewId()))}create_global_temporary_store(e,t){return this.pushNewStmt(new Le(e,t,this.getNewId()))}create_local_var(e){return this.pushNewStmt(new Ae(e,this.getNewId()))}create_local_load(e){return this.pushNewStmt(new Ne(e,this.getNewId()))}create_local_store(e,t){return this.pushNewStmt(new we(e,t,this.getNewId()))}create_binary_op(e,t,r){return this.pushNewStmt(new Je(e,t,r,this.getNewId()))}create_unary_op(e,t){return this.pushNewStmt(new Ue(e,t,this.getNewId()))}create_atomic_op(e,t,r){return this.pushNewStmt(new Qe(e,t,r,this.getNewId()))}create_atomic_load(e){return this.pushNewStmt(new Xe(e,this.getNewId()))}create_atomic_store(e,t){return this.pushNewStmt(new $e(e,t,this.getNewId()))}create_while_true(){return this.pushNewStmt(new Ve(new ut,this.getNewId()))}create_if(e){return this.pushNewStmt(new Ke(e,new ut,new ut,this.getNewId()))}create_break(){return this.pushNewStmt(new ze(this.getNewId()))}create_continue(){return this.pushNewStmt(new Ge(this.getNewId()))}create_arg_load(e,t){return this.pushNewStmt(new qe(e,t,this.getNewId()))}create_rand(e){return this.pushNewStmt(new We(e,this.getNewId()))}create_return(e){return this.pushNewStmt(new He([e],this.getNewId()))}create_return_vec(e){return this.pushNewStmt(new He(e,this.getNewId()))}create_vertex_input(e,t){return this.pushNewStmt(new et(t,e,this.getNewId()))}create_vertex_output(e,t){return this.pushNewStmt(new tt(t,e,this.getNewId()))}create_position_output(e){return this.pushNewStmt(new nt(e,he.Position,void 0,this.getNewId()))}create_fragment_input(e,t){return this.pushNewStmt(new rt(t,e,this.getNewId()))}create_color_output(e,t){return this.pushNewStmt(new nt(t,he.Color,e,this.getNewId()))}create_vertex_for(){return this.pushNewStmt(new Ye(new ut,this.getNewId()))}create_fragment_for(){return this.pushNewStmt(new Ze(new ut,this.getNewId()))}create_discard(){return this.pushNewStmt(new st(this.getNewId()))}create_depth_output(e){return this.pushNewStmt(new nt([e],he.FragDepth,void 0,this.getNewId()))}create_texture_sample(e,t){return this.pushNewStmt(new ct(e,xe.Sample,t,[],this.getNewId()))}create_texture_sample_lod(e,t,r){return this.pushNewStmt(new ct(e,xe.SampleLod,t,[r],this.getNewId()))}create_texture_sample_compare(e,t,r){return this.pushNewStmt(new ct(e,xe.SampleCompare,t,[r],this.getNewId()))}create_texture_load(e,t){return this.pushNewStmt(new ct(e,xe.Load,t,[],this.getNewId()))}create_texture_store(e,t,r){return this.pushNewStmt(new ct(e,xe.Store,t,r,this.getNewId()))}create_composite_extract(e,t){return this.pushNewStmt(new lt(e,t,this.getNewId()))}create_vertex_index_input(){return this.pushNewStmt(new at(ve.VertexIndex,this.getNewId()))}create_instance_index_input(){return this.pushNewStmt(new at(ve.InstanceIndex,this.getNewId()))}create_frag_coord_input(){return this.pushNewStmt(new at(ve.FragCoord,this.getNewId()))}create_dpdx(e){return this.pushNewStmt(new ot(be.x,e,this.getNewId()))}create_dpdy(e){return this.pushNewStmt(new ot(be.y,e,this.getNewId()))}get_range_loop_guard(e){return this.addGuard(e.body)}get_while_loop_guard(e){return this.addGuard(e.body)}get_vertex_loop_guard(e){return this.addGuard(e.body)}get_fragment_loop_guard(e){return this.addGuard(e.body)}get_if_guard(e,t){return t?this.addGuard(e.trueBranch):this.addGuard(e.falseBranch)}getNewId(){return this.module.getNewId()}pushNewStmt(e){return this.guards.at(-1).block.stmts.push(e),e}addGuard(e){let t=new Ct(this,e);return this.guards.push(t),t}}class Ct{constructor(e,t){this.parent=e,this.block=t}delete(){this.parent.guards.pop()}}class Tt{visitModule(e){this.visitBlock(e.block)}visitBlock(e){for(let t of e.stmts)this.visit(t)}visit(e){switch(e.getKind()){case fe.ConstStmt:this.visitConstStmt(e);break;case fe.RangeForStmt:this.visitRangeForStmt(e);break;case fe.LoopIndexStmt:this.visitLoopIndexStmt(e);break;case fe.AllocaStmt:this.visitAllocaStmt(e);break;case fe.LocalLoadStmt:this.visitLocalLoadStmt(e);break;case fe.LocalStoreStmt:this.visitLocalStoreStmt(e);break;case fe.GlobalPtrStmt:this.visitGlobalPtrStmt(e);break;case fe.GlobalLoadStmt:this.visitGlobalLoadStmt(e);break;case fe.GlobalStoreStmt:this.visitGlobalStoreStmt(e);break;case fe.GlobalTemporaryStmt:this.visitGlobalTemporaryStmt(e);break;case fe.GlobalTemporaryLoadStmt:this.visitGlobalTemporaryLoadStmt(e);break;case fe.GlobalTemporaryStoreStmt:this.visitGlobalTemporaryStoreStmt(e);break;case fe.BinaryOpStmt:this.visitBinaryOpStmt(e);break;case fe.UnaryOpStmt:this.visitUnaryOpStmt(e);break;case fe.WhileStmt:this.visitWhileStmt(e);break;case fe.IfStmt:this.visitIfStmt(e);break;case fe.WhileControlStmt:this.visitWhileControlStmt(e);break;case fe.ContinueStmt:this.visitContinueStmt(e);break;case fe.ArgLoadStmt:this.visitArgLoadStmt(e);break;case fe.RandStmt:this.visitRandStmt(e);break;case fe.ReturnStmt:this.visitReturnStmt(e);break;case fe.AtomicOpStmt:this.visitAtomicOpStmt(e);break;case fe.AtomicLoadStmt:this.visitAtomicLoadStmt(e);break;case fe.AtomicStoreStmt:this.visitAtomicStoreStmt(e);break;case fe.VertexForStmt:this.visitVertexForStmt(e);break;case fe.FragmentForStmt:this.visitFragmentForStmt(e);break;case fe.VertexInputStmt:this.visitVertexInputStmt(e);break;case fe.VertexOutputStmt:this.visitVertexOutputStmt(e);break;case fe.FragmentInputStmt:this.visitFragmentInputStmt(e);break;case fe.BuiltInOutputStmt:this.visitBuiltInOutputStmt(e);break;case fe.BuiltInInputStmt:this.visitBuiltInInputStmt(e);break;case fe.FragmentDerivativeStmt:this.visitFragmentDerivativeStmt(e);break;case fe.DiscardStmt:this.visitDiscardStmt(e);break;case fe.TextureFunctionStmt:this.visitTextureFunctionStmt(e);break;case fe.CompositeExtractStmt:this.visitCompositeExtractStmt(e);break;default:s("unrecognized stmt: ",e)}}visitConstStmt(e){}visitRangeForStmt(e){this.visitBlock(e.body)}visitLoopIndexStmt(e){}visitAllocaStmt(e){}visitLocalLoadStmt(e){}visitLocalStoreStmt(e){}visitGlobalPtrStmt(e){}visitGlobalLoadStmt(e){}visitGlobalStoreStmt(e){}visitGlobalTemporaryStmt(e){}visitGlobalTemporaryLoadStmt(e){}visitGlobalTemporaryStoreStmt(e){}visitBinaryOpStmt(e){}visitUnaryOpStmt(e){}visitWhileStmt(e){this.visitBlock(e.body)}visitIfStmt(e){this.visitBlock(e.trueBranch),this.visitBlock(e.falseBranch)}visitWhileControlStmt(e){}visitContinueStmt(e){}visitArgLoadStmt(e){}visitRandStmt(e){}visitReturnStmt(e){}visitAtomicOpStmt(e){}visitAtomicLoadStmt(e){}visitAtomicStoreStmt(e){}visitVertexForStmt(e){this.visitBlock(e.body)}visitFragmentForStmt(e){this.visitBlock(e.body)}visitVertexInputStmt(e){}visitVertexOutputStmt(e){}visitFragmentInputStmt(e){}visitBuiltInOutputStmt(e){}visitBuiltInInputStmt(e){}visitFragmentDerivativeStmt(e){}visitDiscardStmt(e){}visitTextureFunctionStmt(e){}visitCompositeExtractStmt(e){}}class Et extends Tt{visitModule(e){for(let t of e.block.stmts)this.visit(t)}visitBlock(e){}visitRangeForStmt(e){e.isParallelFor=!e.strictlySerialize}}class kt extends Tt{constructor(){super(...arguments),this.guards=[],this.module=new dt}transform(e){this.module=e,this.visitBlock(e.block)}pushNewStmt(e){return this.guards.at(-1).block.stmts.push(e),e}addGuard(e){let t=new Ct(this,e);return this.guards.push(t),t}visitBlock(e){let t=new ut,r=this.addGuard(t);for(let t of e.stmts)this.visit(t);r.delete(),e.stmts=t.stmts}visitConstStmt(e){this.pushNewStmt(e)}visitRangeForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitLoopIndexStmt(e){this.pushNewStmt(e)}visitAllocaStmt(e){this.pushNewStmt(e)}visitLocalLoadStmt(e){this.pushNewStmt(e)}visitLocalStoreStmt(e){this.pushNewStmt(e)}visitGlobalPtrStmt(e){this.pushNewStmt(e)}visitGlobalLoadStmt(e){this.pushNewStmt(e)}visitGlobalStoreStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryLoadStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryStoreStmt(e){this.pushNewStmt(e)}visitBinaryOpStmt(e){this.pushNewStmt(e)}visitUnaryOpStmt(e){this.pushNewStmt(e)}visitWhileStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitIfStmt(e){this.pushNewStmt(e),this.visitBlock(e.trueBranch),this.visitBlock(e.falseBranch)}visitWhileControlStmt(e){this.pushNewStmt(e)}visitContinueStmt(e){this.pushNewStmt(e)}visitArgLoadStmt(e){this.pushNewStmt(e)}visitRandStmt(e){this.pushNewStmt(e)}visitReturnStmt(e){this.pushNewStmt(e)}visitAtomicOpStmt(e){this.pushNewStmt(e)}visitAtomicLoadStmt(e){this.pushNewStmt(e)}visitAtomicStoreStmt(e){this.pushNewStmt(e)}visitVertexForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitFragmentForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitVertexInputStmt(e){this.pushNewStmt(e)}visitVertexOutputStmt(e){this.pushNewStmt(e)}visitFragmentInputStmt(e){this.pushNewStmt(e)}visitBuiltInOutputStmt(e){this.pushNewStmt(e)}visitBuiltInInputStmt(e){this.pushNewStmt(e)}visitFragmentDerivativeStmt(e){this.pushNewStmt(e)}visitDiscardStmt(e){this.pushNewStmt(e)}visitTextureFunctionStmt(e){this.pushNewStmt(e)}visitCompositeExtractStmt(e){this.pushNewStmt(e)}}class At extends kt{constructor(){super(...arguments),this.replaceMap=new Map}markReplace(e,t){this.replaceMap.set(e,t)}pushNewStmt(e){for(let t=0;t{switch(e){case ye.add:return me.add;case ye.sub:return me.sub;case ye.max:return me.max;case ye.min:return me.min;case ye.bit_and:return me.bit_and;case ye.bit_or:return me.bit_or;case ye.bit_xor:return me.bit_xor}})(e.op),a=this.pushNewStmt(new Je(r,n,i,this.module.getNewId()));this.replacer.markReplace(e,a),this.pushNewStmt(new we(t,a,this.module.getNewId()))}visitAtomicLoadStmt(e){if(e.getPointer().getKind()!==fe.AllocaStmt)return void this.pushNewStmt(e);let t=e.getPointer(),r=this.pushNewStmt(new Ne(t,this.module.getNewId()));this.replacer.markReplace(e,r)}visitAtomicStoreStmt(e){if(e.getPointer().getKind()!==fe.AllocaStmt)return void this.pushNewStmt(e);let t=e.getPointer(),r=e.getValue();this.pushNewStmt(new $e(t,r,this.module.getNewId()))}transform(e){super.transform(e),this.replacer.transform(e)}}!function(e){e[e.Serial=0]="Serial",e[e.Compute=1]="Compute",e[e.Vertex=2]="Vertex",e[e.Fragment=3]="Fragment"}(Se||(Se={}));class Mt extends dt{constructor(e){super(),this.type=e}}class Lt extends Mt{constructor(){super(Se.Serial)}}class Rt extends Mt{constructor(e,t){super(Se.Compute),this.rangeArg=e,this.hasConstRange=t}}class Bt extends Mt{constructor(){super(Se.Vertex)}}class Jt extends Mt{constructor(){super(Se.Fragment)}}class jt extends kt{constructor(){super(...arguments),this.offloadedModules=[],this.currentOffloadType=Se.Serial}transform(e){this.resetTransformerState(new Lt);for(let t of e.block.stmts)this.visit(t)}resetTransformerState(e){this.guards=[],this.module=e,this.addGuard(e.block),this.offloadedModules.push(e),this.currentOffloadType=e.type}visitRangeForStmt(e){if(e.isParallelFor){let t=0,r=!1,n=e.getRange();n.getKind()===fe.ConstStmt?(r=!0,t=n.val):n.getKind()===fe.GlobalTemporaryLoadStmt?(r=!1,t=n.getPointer().offset):s("InternalError: range of be const or global temp load");let i=new Rt(t,r);this.resetTransformerState(i);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}else super.visitRangeForStmt(e)}visitVertexForStmt(e){let t=new Bt;this.resetTransformerState(t);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}visitFragmentForStmt(e){let t=new Jt;this.resetTransformerState(t);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}}class Ut extends Tt{constructor(){super(),this.isTrivial=!0}visitGlobalTemporaryStoreStmt(e){this.isTrivial=!1}visitGlobalStoreStmt(e){this.isTrivial=!1}visitAtomicOpStmt(e){this.isTrivial=!1}visitAtomicStoreStmt(e){this.isTrivial=!1}visitReturnStmt(e){this.isTrivial=!1}}class Vt{constructor(){this.parts=[]}write(...e){for(let t of e)this.parts.push(t.toString())}getString(){return this.parts.join("")}empty(){return 0===this.parts.length}}class Kt{constructor(){this.bindings=[]}has(e){for(let t of this.bindings)if(t.info.equals(e))return!0;return!1}add(e,t){let r=new A(e,t);this.bindings.push(r)}get(e){for(let t of this.bindings)if(t.info.equals(e))return t.binding}size(){return this.bindings.length}}class zt extends Tt{constructor(e,t,r,n,i){super(),this.runtime=e,this.offload=t,this.argBytes=r,this.retBytes=n,this.previousStageBindings=i,this.globalDecls=new Vt,this.stageInStructBegin=new Vt,this.stageInStructBody=new Vt,this.stageInStructEnd=new Vt,this.stageOutStructBegin=new Vt,this.stageOutStructBody=new Vt,this.stageOutStructEnd=new Vt,this.funtionSignature=new Vt,this.functionBodyPrologue=new Vt,this.body=new Vt,this.functionBodyEpilogue=new Vt,this.functionEnd=new Vt,this.stageInMembers=new Set,this.stageOutMembers=new Set,this.stageOutBuiltinMembers=new Set,this.bodyIndentCount=1,this.nextInternalTemp=0,this.resourceBindings=new Kt,this.randInitiated=!1}visitConstStmt(t){let r=t.getReturnType(),n=t.val;switch(this.emitLet(t.getName(),this.getPrimitiveTypeName(r)),r){case e.f32:{let e=n.toPrecision(8);e.includes(".")||e.includes("e")||e.includes("E")||(e+=".f"),this.body.write(e);break}case e.i32:c(Number.isInteger(n),"expecting integer"),this.body.write(n.toString());break;default:s("unrecognized return type ",t)}this.body.write(";\n")}visitRandStmt(t){switch(this.initRand(),this.emitLet(t.getName(),this.getPrimitiveTypeName(t.getReturnType())),t.getReturnType()){case e.i32:this.body.write("rand_i32(gid3.x);\n");break;case e.f32:this.body.write("rand_f32(gid3.x);\n");break;default:s("unrecognized primitive type")}}visitUnaryOpStmt(t){let r=t.getOperand().getName(),n=t.getOperand().getReturnType(),i=t.getReturnType(),a=this.getPrimitiveTypeName(i),o=(t=>{switch(t){case ge.neg:return`(-(${r}))`;case ge.sqrt:return`sqrt(f32(${r}))`;case ge.round:return`round(f32(${r}))`;case ge.floor:return`floor(f32(${r}))`;case ge.ceil:return`ceil(f32(${r}))`;case ge.cast_i32_value:return`i32(${r})`;case ge.cast_f32_value:return`f32(${r})`;case ge.cast_i32_bits:return`bitcast(${r})`;case ge.cast_f32_bits:return`bitcast(${r})`;case ge.abs:return`abs(${r})`;case ge.sgn:return`sign(${r})`;case ge.sin:return`sin(f32(${r}))`;case ge.asin:return`asin(f32(${r}))`;case ge.cos:return`cos(f32(${r}))`;case ge.acos:return`acos(f32(${r}))`;case ge.tan:return`tan(f32(${r}))`;case ge.tanh:return`tanh(f32(${r}))`;case ge.inv:case ge.rcp:return`1.f / f32(${r})`;case ge.exp:return`exp(f32(${r}))`;case ge.log:return`log(f32(${r}))`;case ge.rsqrt:return`inverseSqrt(f32(${r}))`;case ge.logic_not:{let t="0";switch(n){case e.f32:t="0.f";break;case e.i32:t="0";break;default:s("unexpected prim type")}return`i32(${r} == ${t})`}case ge.bit_not:return`(~(${r}))`;default:return s("unhandled unary op ",t),"error"}})(t.op);this.emitLet(t.getName(),a),this.body.write(`${i}(${o});\n`)}visitBinaryOpStmt(t){let r=t.getLeft().getName(),n=t.getRight().getName(),i=t.op,a=t.getReturnType(),o=(()=>{switch(i){case me.mul:return`(${r} * ${n})`;case me.add:return`(${r} + ${n})`;case me.sub:return`(${r} - ${n})`;case me.truediv:return`(f32(${r}) / f32(${n}))`;case me.floordiv:return`i32(${r} / ${n})`;case me.mod:return`(${r} % ${n})`;case me.max:return`max(${r}, ${n})`;case me.min:return`min(${r}, ${n})`;case me.bit_and:return`(${r} & ${n})`;case me.bit_or:return`(${r} | ${n})`;case me.bit_xor:return`(${r} ^ ${n})`;case me.bit_shl:return`(${r} << u32(${n}))`;case me.bit_shr:return`(u32(${r}) >> u32(${n}))`;case me.bit_sar:return`(${r} >> u32(${n}))`;case me.cmp_lt:return`(${r} < ${n})`;case me.cmp_le:return`(${r} <= ${n})`;case me.cmp_gt:return`(${r} > ${n})`;case me.cmp_ge:return`(${r} >= ${n})`;case me.cmp_eq:return`(${r} == ${n})`;case me.cmp_ne:return`(${r} != ${n})`;case me.atan2:return`atan2(f32(${r}), f32(${n}))`;case me.logical_or:return`(${r} | ${n})`;case me.logical_and:return`(${r} & ${n})`;case me.pow:switch(a){case e.i32:return`round(pow(f32(${r}), f32(${n})))`;case e.f32:return`pow(f32(${r}), f32(${n}))`;default:return s("unrecgnized prim type"),"error"}}})(),c=this.getPrimitiveTypeName(a);this.emitLet(t.getName(),c),this.body.write(`${c}(${o});\n`)}visitRangeForStmt(e){this.emitVar(e.getName(),"i32"),this.body.write("0;\n"),this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.body.write(this.getIndentation(),`if (${e.getName()} >= ${e.getRange().getName()}) { break; }\n`),this.visitBlock(e.body),this.body.write(this.getIndentation(),`continuing { ${e.getName()} = ${e.getName()} + 1; }\n`),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitIfStmt(e){this.body.write(this.getIndentation(),`if (bool(${e.getCondition().getName()})) {\n`),this.indent(),this.visitBlock(e.trueBranch),this.dedent(),this.body.write(this.getIndentation(),"}\n"),this.body.write(this.getIndentation(),"else {\n"),this.indent(),this.visitBlock(e.falseBranch),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitWhileControlStmt(e){this.body.write(this.getIndentation(),"break;\n")}visitContinueStmt(e){this.body.write(this.getIndentation(),"continue;\n")}visitWhileStmt(e){this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.visitBlock(e.body),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitVertexInputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getReturnType()),i=`in_${r}_${n}`;this.ensureStageInStruct();let a=t.getReturnType()==e.i32;this.addStageInMember(i,n,r,a),this.emitLet(t.getName(),n),this.body.write(`stage_input.${i};\n`)}visitFragmentInputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getReturnType()),i=`in_${r}_${n}`;this.ensureStageInStruct();let a=t.getReturnType()==e.i32;this.addStageInMember(i,n,r,a),this.emitLet(t.getName(),n),this.body.write(`stage_input.${i};\n`)}visitVertexOutputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getValue().getReturnType()),i=`out_${r}_${n}`;this.ensureStageOutStruct();let a=t.getValue().getReturnType()==e.i32;this.addStageOutMember(i,n,r,a),this.body.write(this.getIndentation(),`stage_output.${i} = ${t.getValue().getName()};\n`)}visitBuiltInOutputStmt(e){this.ensureStageOutStruct();let t=e.getValues().length,r=e.getValues()[0].getReturnType(),n=this.getScalarOrVectorTypeName(r,t),i=this.getScalarOrVectorExpr(e.getValues(),n),a="";switch(e.builtinKind){case he.Color:{let t=e.location;a=`color_${t}`,this.addStageOutMember(a,n,t,!1);break}case he.Position:a="position",this.addStageOutBuiltinMember(a,n,"position");break;case he.FragDepth:a="frag_depth",this.addStageOutBuiltinMember(a,n,"frag_depth");break;default:s("unrecognized builtin kind")}this.body.write(this.getIndentation(),`stage_output.${a} = ${i};\n`)}visitBuiltInInputStmt(e){let t=it(e.builtinKind),r=function(e){switch(e){case ve.VertexIndex:case ve.InstanceIndex:return 1;case ve.FragCoord:return 4}}(e.builtinKind),n=this.getScalarOrVectorTypeName(t,r);switch(this.emitLet(e.getName(),n),this.body.write(`${n}(`),e.builtinKind){case ve.VertexIndex:this.body.write("vertex_index");break;case ve.InstanceIndex:this.body.write("instance_index");break;case ve.FragCoord:this.body.write("frag_coord");break;default:s("unrecognized builtin kind")}this.body.write(");\n")}visitFragmentDerivativeStmt(e){let t=this.getPrimitiveTypeName(e.getReturnType());switch(this.emitLet(e.getName(),t),e.direction){case be.x:this.body.write("dpdxFine");break;case be.y:this.body.write("dpdyFine");break;default:s("unrecognized direction")}this.body.write(`(${e.getValue().getName()});\n`)}visitDiscardStmt(e){this.body.write(this.getIndentation(),"discard;\n")}visitTextureFunctionStmt(t){let r=t.texture,n=r instanceof C,a=new k(i.Texture,r.textureId),o=!1,l=n?1:4;switch(t.func){case xe.Sample:case xe.SampleLod:o=!0;break;case xe.SampleCompare:o=!0,l=1;break;case xe.Load:o=!1;break;case xe.Store:o=!1,a.resourceType=i.StorageTexture;break;default:s("unrecognized texture func")}let u=this.getTextureName(a),d=this.getScalarOrVectorTypeName(e.f32,l),_="";if(o){let e=new k(i.Sampler,r.textureId);_=this.getSamplerName(e)}let p=b(r.getTextureDimensionality());c(p===t.getCoordinates().length,"component count mismatch",t);let f=t.getCoordinates()[0].getReturnType(),m=this.getScalarOrVectorTypeName(f,p),g=this.getScalarOrVectorExpr(t.getCoordinates(),m);switch(t.func){case xe.Sample:this.emitLet(t.getName(),d),this.body.write(`textureSample(${u}, ${_}, ${g});\n`);break;case xe.SampleLod:c(1===t.getAdditionalOperands().length,"expecting 1 lod value"),this.emitLet(t.getName(),d),this.body.write(`textureSampleLevel(${u}, ${_}, ${g}, ${t.getAdditionalOperands()[0].getName()});\n`);break;case xe.SampleCompare:c(1===t.getAdditionalOperands().length,"expecting 1 depth ref value"),this.emitLet(t.getName(),d),this.body.write(`textureSampleCompare(${u}, ${_}, ${g}, ${t.getAdditionalOperands()[0].getName()});\n`);break;case xe.Load:this.emitLet(t.getName(),d),this.body.write(`textureLoad(${u}, ${g}, 0);\n`);break;case xe.Store:{let e=t.getAdditionalOperands()[0].getReturnType(),r=this.getScalarOrVectorTypeName(e,t.getAdditionalOperands().length),n=this.getScalarOrVectorExpr(t.getAdditionalOperands(),r);this.body.write(this.getIndentation(),`textureStore(${u}, ${g}, ${n});\n`);break}default:s("unrecognized texture func")}}visitCompositeExtractStmt(e){let t=this.getPrimitiveTypeName(e.getReturnType());switch(this.emitLet(e.getName(),t),this.body.write(e.getComposite().getName()),e.elementIndex){case 0:this.body.write(".x");break;case 1:this.body.write(".y");break;case 2:this.body.write(".z");break;case 3:this.body.write(".w");break;default:s("unsupported composite extract index: ",e.elementIndex)}this.body.write(";\n")}visitArgLoadStmt(e){let t=e.argId,r=e.getReturnType(),n=this.getPrimitiveTypeName(r),a=this.getBufferMemberName(new k(i.Args));this.emitLet(e.getName(),n),this.body.write(`bitcast<${n}>(${a}[${t}]);\n`)}visitReturnStmt(t){(this.isVertexFor()||this.isFragmentFor())&&s("Return cannot be used in a vertex-for or a fragment-for");let r=t.getValues();for(let t=0;t(${r[t].getName()});\n`);break;case e.i32:this.body.write(`${r[t].getName()};\n`);break;default:s("unrecognized prim type")}}}visitAllocaStmt(e){let t=e.allocatedType;this.body.write(this.getIndentation(),`var ${e.getName()} : ${this.getPrimitiveTypeName(t)};\n`)}visitLocalLoadStmt(e){let t=e.getReturnType();this.emitLet(e.getName(),t),this.body.write(e.getPointer().getName(),";\n")}visitLocalStoreStmt(e){this.body.write(this.getIndentation(),`${e.getPointer().getName()} = ${e.getValue().getName()};\n`)}visitGlobalPtrStmt(e){let t=e.field,r=e.getIndices();c(r.length===t.dimensions.length,"global ptr dimension mismatch");let n="",i=1;for(let e=t.dimensions.length-1;e>=0;--e)n+=`${i} * ${r[e].getName()}`,e>0&&(n+=" + "),i*=t.dimensions[e];let a=`${t.offsetBytes/4} + ${t.elementType.getPrimitivesList().length} * (${n}) + ${e.offsetInElement}`;this.emitLet(e.getName(),this.getPointerIntTypeName()),this.body.write(a,";\n")}visitGlobalTemporaryStmt(e){this.emitLet(e.getName(),this.getPointerIntTypeName()),this.body.write(e.offset,";\n")}emitGlobalLoadExpr(e,t=!1){let r,n=e.getPointer();if(n.getKind()===fe.GlobalPtrStmt){n=n;let e=t?i.RootAtomic:i.Root;r=new k(e,n.field.snodeTree.treeId),this.runtime.materializedTrees[n.field.snodeTree.treeId].fragmentShaderWritable&&s("A vertex shader cannot read from a field marked as `fragmentShaderWritable`")}else{let e=t?i.GlobalTmpsAtomic:i.GlobalTmps;r=new k(e)}let a=this.getBufferMemberName(r),o=e.getReturnType(),c=this.getPrimitiveTypeName(o);this.emitLet(e.getName(),o),t?this.body.write(`bitcast<${c}>(atomicLoad(&(${a}[${n.getName()}])));\n`):this.body.write(`bitcast<${c}>(${a}[${n.getName()}]);\n`)}emitGlobalStore(e,t=!1){let r,n=e.getPointer();if(n.getKind()===fe.GlobalPtrStmt){n=n;let e=t?i.RootAtomic:i.Root;r=new k(e,n.field.snodeTree.treeId)}else{let e=t?i.GlobalTmpsAtomic:i.GlobalTmps;r=new k(e)}let a=this.getBufferMemberName(r);this.assertBufferWritable(r);let o=`bitcast<${this.getRawDataTypeName()}>(${e.getValue().getName()})`;t?this.body.write(this.getIndentation(),`atomicStore(&(${a}[${n.getName()}]), ${o});\n`):this.body.write(this.getIndentation(),`${a}[${n.getName()}] = ${o};\n`)}visitGlobalLoadStmt(e){this.emitGlobalLoadExpr(e,!1)}visitGlobalStoreStmt(e){this.emitGlobalStore(e,!1)}visitGlobalTemporaryLoadStmt(e){this.emitGlobalLoadExpr(e,!1)}visitGlobalTemporaryStoreStmt(e){this.emitGlobalStore(e,!1)}visitAtomicOpStmt(t){let r,n=Re(t.getDestination()),a=this.getPrimitiveTypeName(n),o=t.getDestination();o.getKind()===fe.GlobalPtrStmt?(o=o,r=new k(i.RootAtomic,o.field.snodeTree.treeId)):r=new k(i.GlobalTmpsAtomic),this.assertBufferWritable(r);let c=this.getBufferMemberName(r),l=this.getTemp("atomic_op_result");this.body.write(this.getIndentation(),`var ${l} : ${a};\n`);let u=`&(${c}[${t.getDestination().getName()}])`;switch(n){case e.i32:{let e="";switch(t.op){case ye.add:e="atomicAdd";break;case ye.sub:e="atomicSub";break;case ye.max:e="atomicMax";break;case ye.min:e="atomicMin";break;case ye.bit_and:e="atomicAnd";break;case ye.bit_or:e="atomicOr";break;case ye.bit_xor:e="atomicXor";break;default:s("atomic op not supported")}this.body.write(`${l} = ${e}(${u}, ${t.getOperand().getName()});\n`);break}case e.f32:{this.body.write(this.getIndentation(),"loop { \n"),this.indent();let e=this.getTemp("old_val");this.emitLet(e,"f32"),this.body.write(`bitcast(atomicLoad(${u}));\n`);let r="";switch(t.op){case ye.add:r=`${e} + ${t.getOperand().getName()}`;break;case ye.sub:r=`${e} - ${t.getOperand().getName()}`;break;case ye.max:r=`max(${e}, ${t.getOperand().getName()})`;break;case ye.min:r=`min(${e}, ${t.getOperand().getName()})`;break;default:s("atomic op not supported for f32")}let n=this.getTemp("new_val");this.emitLet(n,"f32"),this.body.write(`${r};\n`),this.body.write(this.getIndentation(),`if(atomicCompareExchangeWeak(${u}, bitcast(${e}), bitcast(${n})).exchanged){\n`),this.indent(),this.body.write(this.getIndentation(),`${l} = ${e};\n`),this.body.write(this.getIndentation(),"break;\n"),this.dedent(),this.body.write(this.getIndentation(),"}\n"),this.dedent(),this.body.write(this.getIndentation(),"}\n");break}default:s("unrecognized prim type")}this.emitLet(t.getName(),a),this.body.write(`${l};\n`)}visitAtomicLoadStmt(e){this.emitGlobalLoadExpr(e,!0)}visitAtomicStoreStmt(e){this.emitGlobalStore(e,!0)}visitLoopIndexStmt(e){e.getLoop().isParallelFor?(this.emitLet(e.getName(),"i32"),this.body.write("ii;\n")):(this.emitLet(e.getName(),"i32"),this.body.write(`${e.getLoop().getName()};\n`))}visitFragmentForStmt(e){s("FragmentForStmt should have been offloaded")}visitVertexForStmt(e){s("VertexForStmt should have been offloaded")}generateSerialKernel(){return this.startComputeFunction(1),this.visitBlock(this.offload.block),new N(this.assembleShader(),1,1,this.resourceBindings.bindings)}generateRangeForKernel(){let e=128,t=512,r=this.offload,n="";if(r.hasConstRange)n=`${r.rangeArg}`,t=B(r.rangeArg,e);else{let e=new k(i.GlobalTmps);n=`${this.getBufferMemberName(e)}[${r.rangeArg}]`}this.startComputeFunction(e);let a=this.getTemp("end");this.emitLet(a,"i32"),this.body.write(`${n};\n`);let o=this.getTemp("total_invocs");return this.emitLet(o,"i32"),this.body.write("128 * i32(n_workgroups.x);\n"),this.emitVar("ii","i32"),this.body.write("i32(gid3.x);\n"),this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.body.write(this.getIndentation(),`if(ii >= ${a}) { break; }\n`),this.visitBlock(this.offload.block),this.body.write(this.getIndentation(),`continuing { ii = ii + ${o}; }\n`),this.dedent(),this.body.write(this.getIndentation(),"}\n"),new N(this.assembleShader(),e,t,this.resourceBindings.bindings)}generateVertexForKernel(){return this.visitBlock(this.offload.block),this.startGraphicsFunction(),new w(this.assembleShader(),this.resourceBindings.bindings)}generateFragmentForKernel(){return this.visitBlock(this.offload.block),this.startGraphicsFunction(),new F(this.assembleShader(),this.resourceBindings.bindings)}generate(){switch(this.offload.type){case Se.Serial:return this.generateSerialKernel();case Se.Compute:return this.generateRangeForKernel();case Se.Vertex:return this.generateVertexForKernel();case Se.Fragment:return this.generateFragmentForKernel()}}emitLet(e,t){this.body.write(this.getIndentation(),`let ${e} : ${t} = `)}emitVar(e,t){this.body.write(this.getIndentation(),`var ${e} : ${t} = `)}getPointerIntTypeName(){return"i32"}getPrimitiveTypeName(t){switch(t){case e.f32:return"f32";case e.i32:return"i32";default:return s("unsupported primitive type ",t),"error"}}getScalarOrVectorTypeName(e,t){let r=this.getPrimitiveTypeName(e),n=r;return t>1&&(n=`vec${t}<${r}>`),n}getScalarOrVectorExpr(e,t){let r=e[0].getName();if(e.length>1){r=`${t}(${e[0].getName()}`;for(let t=1;t, \n @builtin(num_workgroups) n_workgroups : vec3) \n{ \n`;this.funtionSignature.write(t),this.functionEnd.write("}\n")}startGraphicsFunction(){c(this.funtionSignature.empty(),"already has a signature");let e="",t="",r="",n="";this.isVertexFor()?(e="vertex",t="@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) instance_index : u32"):this.isFragmentFor()?(e="fragment",t="@builtin(position) frag_coord : vec4"):s("emit_graphics_function called, but we're not in vert/frag for"),this.stageInStructBegin.empty()||(r=", stage_input: StageInput"),this.stageOutStructBegin.empty()||(n="-> StageOutput");let i=`\n@${e}\nfn main(${t} ${r}) ${n}\n{\n`;this.funtionSignature.write(i),this.functionEnd.write("\n}\n")}ensureStageInStruct(){this.stageInStructBegin.parts.length>0||(this.stageInStructBegin.write("struct StageInput {\n"),this.stageInStructEnd.write("};\n"))}ensureStageOutStruct(){this.stageOutStructBegin.parts.length>0||(this.stageOutStructBegin.write("struct StageOutput {\n"),this.stageOutStructEnd.write("};\n"),this.functionBodyPrologue.write(" var stage_output: StageOutput;\n"),this.functionBodyEpilogue.write(" return stage_output;\n"))}addStageInMember(e,t,r,n){this.stageInMembers.has(e)||(this.stageInStructBody.write(` @location(${r}) `),n&&this.stageInStructBody.write("@interpolate(flat) "),this.stageInStructBody.write(`${e} : ${t},\n`),this.stageInMembers.add(e))}addStageOutMember(e,t,r,n){this.stageOutMembers.has(e)||(this.stageOutStructBody.write(` @location(${r}) `),n&&this.stageOutStructBody.write("@interpolate(flat) "),this.stageOutStructBody.write(`${e} : ${t},\n`),this.stageOutMembers.add(e))}addStageOutBuiltinMember(e,t,r){this.stageOutBuiltinMembers.has(e)||(this.stageOutStructBody.write(` @builtin(${r}) ${e} : ${t},\n`),this.stageOutMembers.add(e))}indent(){this.bodyIndentCount++}dedent(){this.bodyIndentCount--}getIndentation(){return" ".repeat(this.bodyIndentCount)}getTemp(e=""){return`_internal_temp_${this.nextInternalTemp++}_${e}`}isVertexFor(){return this.offload.type===Se.Vertex}isFragmentFor(){return this.offload.type===Se.Fragment}getRawDataTypeName(){return"i32"}getAtomicRawDataTypeName(){return`atomic<${this.getRawDataTypeName()}>`}getRawDataTypeSize(){return 4}getElementCount(e){switch(e.resourceType){case i.Root:return B(this.runtime.materializedTrees[e.resourceID].size,this.getRawDataTypeSize());case i.RootAtomic:return B(this.runtime.materializedTrees[e.resourceID].size,4);case i.GlobalTmps:case i.GlobalTmpsAtomic:return B(65536,this.getRawDataTypeSize());case i.RandStates:return 65536;case i.Args:return B(this.argBytes,this.getRawDataTypeSize());case i.Rets:return B(this.retBytes,this.getRawDataTypeSize());default:return s("not a buffer"),-1}}getBufferName(e){let t,r="";t=this.resourceBindings.has(e)?this.resourceBindings.get(e):this.previousStageBindings.length+this.resourceBindings.size();let n=this.getRawDataTypeName();switch(e.resourceType){case i.Root:r=`root_buffer_binding_${t}`;break;case i.RootAtomic:r=`root_buffer_atomic_binding_${t}`,n=this.getAtomicRawDataTypeName();break;case i.GlobalTmps:r="global_tmps_";break;case i.GlobalTmpsAtomic:r="global_tmps_atomic_",n=this.getAtomicRawDataTypeName();break;case i.RandStates:r="rand_states_",n="RandState";break;case i.Args:r="args_";break;case i.Rets:r="rets_";break;default:s("not a buffer")}if(!this.resourceBindings.has(e)){this.resourceBindings.add(e,t);let i=this.getElementCount(e);this.declareNewBuffer(e,r,t,n,i)}return r}isBufferWritable(e){if(this.isVertexFor())return!1;if(this.isFragmentFor()){for(let t of this.previousStageBindings)if(t.info.equals(e))return!1;if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){if(!this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable)return!1}}return!0}assertBufferWritable(e){if(this.isVertexFor()&&(e.resourceType===i.GlobalTmps||e.resourceType===i.GlobalTmpsAtomic?s("a vertex shader is not allowed to write to global temporary variables"):e.resourceType===i.Root||e.resourceType===i.RootAtomic?s("a vertex shader is not allowed to write to fields"):s("[Internal Error] Unexpected resource type")),this.isFragmentFor()){for(let t of this.previousStageBindings)if(t.info.equals(e))if(e.resourceType===i.GlobalTmps||e.resourceType===i.GlobalTmpsAtomic)s("a fragment shader is not allowed to write to global temporary variables, if the corresponding vertex shader reads any global temporary variable");else if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable?s("[Internal Error] the vertex shader shouldn't have been able to read from the field which is marked as `fragmentShaderWritable`"):s("[Internal Error] a fragment shader can only write to a field if it is marked as `fragmentShaderWritable`")}else s("[Internal Error] Unexpected resource type");if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable||s("[Internal Error] a fragment shader can only write to a field if it is marked as `fragmentShaderWritable`")}}}declareNewBuffer(e,t,r,n,i){let a="storage, read_write";this.isBufferWritable(e)||(a="storage, read");let o=`\nstruct ${t}_type {\n member: array<${n}, ${i}>,\n};\n@group(0) @binding(${r})\nvar<${a}> ${t}: ${t}_type; \n`;this.globalDecls.write(o)}getBufferMemberName(e){return this.getBufferName(e)+".member"}getTextureName(t){let n;t.resourceType!==i.Texture&&t.resourceType!==i.StorageTexture&&s("not a texture"),n=this.resourceBindings.has(t)?this.resourceBindings.get(t):this.previousStageBindings.length+this.resourceBindings.size();let a,o=t.resourceType===i.StorageTexture,l=this.runtime.textures[t.resourceID];a=o?`texture_binding_${n}`:`storage_texture_binding_${n}`;let u=this.getPrimitiveTypeName(e.f32),d="",_=l instanceof C;switch(c(!(_&&o),"cannot have depth storeage texture"),l.getTextureDimensionality()){case r.Dim2d:d=_?1===l.sampleCount?"texture_depth_2d":"texture_depth_multisampled_2d":o?"texture_storage_2d":"texture_2d";break;case r.Dim3d:_?s("depth 3d texture not supported"):d=o?"texture_storage_3d":"texture_3d";break;case r.DimCube:_?s("depth cube texture not supported"):o?s("storage cube texture not supported"):d="texture_3d";break;default:s("unrecognized dimensionality")}if(!this.resourceBindings.has(t)){this.resourceBindings.add(t,n);let e="";e=o?`<${l.getGPUTextureFormat()}, write>`:_?"":`<${u}>`,this.declareNewTexture(t,a,d,e,n)}return a}declareNewTexture(e,t,r,n,i){let a=`\n@group(0) @binding(${i})\nvar ${t}: ${r}${n};\n `;this.globalDecls.write(a)}getSamplerName(e){let t;e.resourceType!==i.Sampler&&s("not a sampler"),t=this.resourceBindings.has(e)?this.resourceBindings.get(e):this.previousStageBindings.length+this.resourceBindings.size();let r=`sampler_binding_${t}`,n="sampler";return this.runtime.textures[e.resourceID]instanceof C&&(n="sampler_comparison"),this.resourceBindings.has(e)||(this.resourceBindings.add(e,t),this.declareNewSampler(e,r,n,t)),r}declareNewSampler(e,t,r,n){let i=`\n@group(0) @binding(${n})\nvar ${t}: ${r};\n `;this.globalDecls.write(i)}initRand(){if(this.randInitiated)return;this.globalDecls.write("\nstruct RandState{\n x: u32,\n y: u32,\n z: u32,\n w: u32,\n};\n");let e=this.getBufferMemberName(new k(i.RandStates)),t=`\nfn rand_u32(id: u32) -> u32 {\n var state : RandState = ${e}[id];\n if(state.x == 0u && state.y == 0u && state.z == 0u && state.w == 0u){\n state.x = 123456789u * id * 1000000007u;\n state.y = 362436069u;\n state.z = 521288629u;\n state.w = 88675123u;\n }\n let t : u32 = state.x ^ (state.x << 11u);\n state.x = state.y;\n state.y = state.z;\n state.z = state.w;\n state.w = (state.w ^ (state.w >> 19u)) ^ (t ^ (t >> 8u)); \n let result : u32 = state.w * 1000000007u;\n ${e}[id] = state;\n return result;\n}\n\nfn rand_f32(id:u32) -> f32 {\n let u32_res : u32 = rand_u32(id);\n return f32(u32_res) * (1.0f / 4294967296.0f);\n}\n\nfn rand_i32(id:u32) -> i32 {\n let u32_res : u32 = rand_u32(id);\n return i32(u32_res);\n}\n`;this.globalDecls.write(t),this.randInitiated=!0}}function Gt(e){return`%${e.id}`}function qt(t){switch(t){case e.i32:return"i32";case e.f32:return"f32";default:return s("unrecognized type"),"error-type"}}class Wt extends Tt{constructor(){super(...arguments),this.sb=new Vt,this.indentation=0}visitConstStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = const ${e.val}`)}visitRangeForStmt(e){this.write(`${Gt(e)} = for range(${Gt(e)}) {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitLoopIndexStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = loop index of ${Gt(e.getLoop())}`)}visitAllocaStmt(e){this.write(`${Gt(e)} = alloca ${qt(e.allocatedType)}`)}visitLocalLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = local load ${Gt(e.getPointer())}`)}visitLocalStoreStmt(e){this.write(`local store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitGlobalPtrStmt(e){let t="["+e.getIndices().map(Gt).join(", ")+"]";this.write(`${Gt(e)} = global pointer, indices ${t}`)}visitGlobalLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = global load ${Gt(e.getPointer())}`)}visitGlobalStoreStmt(e){this.write(`global store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitGlobalTemporaryStmt(e){this.write(`${Gt(e)} = gtemp ${e.offset} : ${qt(e.type)}`)}visitGlobalTemporaryLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = gtemp load ${Gt(e.getPointer())}`)}visitGlobalTemporaryStoreStmt(e){this.write(`gtemp store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitBinaryOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = binary op ${(()=>{switch(e.op){case me.mul:return"mul";case me.add:return"add";case me.sub:return"sub";case me.truediv:return"truediv";case me.floordiv:return"floordiv";case me.mod:return"mod";case me.max:return"max";case me.min:return"min";case me.bit_and:return"bit_and";case me.bit_or:return"bit_or";case me.bit_xor:return"bit_xor";case me.bit_shl:return"bit_shl";case me.bit_shr:return"bit_shr";case me.bit_sar:return"bit_sar";case me.cmp_lt:return"cmp_lt";case me.cmp_le:return"cmp_le";case me.cmp_gt:return"cmp_gt";case me.cmp_ge:return"cmp_ge";case me.cmp_eq:return"cmp_eq";case me.cmp_ne:return"cmp_ne";case me.atan2:return"atan2";case me.pow:return"pow";case me.logical_or:return"logical_or";case me.logical_and:return"logical_and"}})()} ${Gt(e.getLeft())} ${Gt(e.getRight())}`)}visitUnaryOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = unary op ${(()=>{switch(e.op){case ge.neg:return"neg";case ge.sqrt:return"sqrt";case ge.round:return"round";case ge.floor:return"floor";case ge.ceil:return"ceil";case ge.cast_i32_value:return"cast_i32_value";case ge.cast_f32_value:return"cast_f32_value";case ge.cast_i32_bits:return"cast_i32_bits";case ge.cast_f32_bits:return"cast_f32_bits";case ge.abs:return"abs";case ge.sgn:return"sgn";case ge.sin:return"sin";case ge.asin:return"asin";case ge.cos:return"cos";case ge.acos:return"acos";case ge.tan:return"tan";case ge.tanh:return"tanh";case ge.inv:return"inv";case ge.rcp:return"rcp";case ge.exp:return"exp";case ge.log:return"log";case ge.rsqrt:return"rsqrt";case ge.bit_not:return"bit_not";case ge.logic_not:return"logic_not"}})()} ${Gt(e.getOperand())}`)}visitWhileStmt(e){this.write(`${Gt(e)} = while true {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitIfStmt(e){this.write(`${Gt(e)} = if(${Gt(e.getCondition())}){`),this.indent(),this.visitBlock(e.trueBranch),this.dedent(),this.write("}"),this.write("else {"),this.indent(),this.visitBlock(e.falseBranch),this.dedent(),this.write("}")}visitWhileControlStmt(e){this.write("break;")}visitContinueStmt(e){this.write("continue;")}visitArgLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = arg load ${e.argId}`)}visitRandStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = random`)}visitReturnStmt(e){let t="["+e.getValues().map(Gt).join(", ")+"]";this.write(`return ${t}`)}visitAtomicOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic op ${(()=>{switch(e.op){case ye.add:return"add";case ye.sub:return"sub";case ye.max:return"max";case ye.min:return"min";case ye.bit_and:return"bit_and";case ye.bit_or:return"bit_or";case ye.bit_xor:return"bit_xor"}})()}, dest ${Gt(e.getDestination())}, operand ${Gt(e.getOperand())}`)}visitAtomicLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic load, ptr ${Gt(e.getPointer())}`)}visitAtomicStoreStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic store, ptr ${Gt(e.getPointer())}, val ${Gt(e.getValue())}`)}visitVertexForStmt(e){this.write(`${Gt(e)} = vertex for {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitFragmentForStmt(e){this.write(`${Gt(e)} = fragment for {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitVertexInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = vertex input ${e.location}`)}visitVertexOutputStmt(e){this.write(`vertex output location=${e.location} ${e.getValue()}`)}visitFragmentInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = fragment input ${e.location}`)}visitBuiltInOutputStmt(e){let t="["+e.getValues().map(Gt).join(", ")+"]";this.write(`built-in output ${(()=>{switch(e.builtinKind){case he.Color:return"color";case he.FragDepth:return"FragDepth";case he.Position:return"position"}})()} location=${e.location} ${t}`)}visitBuiltInInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = built-in input ${(()=>{switch(e.builtinKind){case ve.InstanceIndex:return"instance index";case ve.VertexIndex:return"vert index"}})()}`)}visitFragmentDerivativeStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = d(${e.getValue()})d${(()=>{switch(e.direction){case be.x:return"x";case be.y:return"y"}})()}`)}visitDiscardStmt(e){this.write("discard;")}visitTextureFunctionStmt(e){let t="["+e.getCoordinates().map(Gt).join(", ")+"]",r="["+e.getAdditionalOperands().map(Gt).join(", ")+"]";this.write(`${Gt(e)} = texture ${(()=>{switch(e.func){case xe.Load:return"load";case xe.Store:return"store";case xe.Sample:return"sample";case xe.SampleLod:return"sample-lod"}})()} ${t} ${r}`)}visitCompositeExtractStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = composite extract ${e.elementIndex} ${e.getComposite()}`)}indent(){this.indentation+=1}dedent(){this.indentation-=1}write(...e){this.sb.write(" ".repeat(this.indentation),...e,"\n")}}function Ht(e){let t=new Wt;return t.visitModule(e),t.sb.getString()}class Qt extends kt{visitBinaryOpStmt(t){let r=t.getLeft(),n=t.getRight();r.getReturnType()!==n.getReturnType()?(r.getReturnType()===e.i32?(r=this.pushNewStmt(new Ue(r,ge.cast_f32_value,this.module.getNewId())),t.setLeft(r)):n.getReturnType()===e.i32&&(n=this.pushNewStmt(new Ue(n,ge.cast_f32_value,this.module.getNewId())),t.setRight(n)),this.pushNewStmt(t)):super.visitBinaryOpStmt(t)}}class Xt extends kt{constructor(){super(...arguments),this.idBound=0}transform(e){super.transform(e),e.idBound=this.idBound}pushNewStmt(e){return e.id=this.getNewId(),super.pushNewStmt(e)}getNewId(){return this.idBound++}}function $t(e){(new Xt).transform(e)}class Yt extends Tt{constructor(){super(),this.usefulInstructions=new Set}visit(e){let t=e.getKind();[fe.GlobalStoreStmt,fe.LocalStoreStmt,fe.GlobalTemporaryStoreStmt,fe.ReturnStmt,fe.AtomicOpStmt,fe.AtomicLoadStmt,fe.AtomicStoreStmt,fe.IfStmt,fe.WhileStmt,fe.RangeForStmt,fe.FragmentForStmt,fe.VertexForStmt,fe.WhileControlStmt,fe.ContinueStmt,fe.DiscardStmt,fe.VertexOutputStmt,fe.BuiltInOutputStmt,fe.TextureFunctionStmt].includes(t)&&this.usefulInstructions.add(e),super.visit(e)}visitModule(e){super.visitModule(e);let t=this.usefulInstructions;this.usefulInstructions=new Set,t.forEach((e=>{this.recursiveMarkUseful(e)}))}recursiveMarkUseful(e){if(!this.usefulInstructions.has(e)){this.usefulInstructions.add(e);for(let t of e.operands)this.recursiveMarkUseful(t)}}}class Zt extends kt{constructor(e){super(),this.usefulInstructions=e}visit(e){this.usefulInstructions.has(e)&&super.visit(e)}}class er extends Tt{constructor(){super(),this.atomicTrees=new Set,this.atomicGtemps=!1}maybeMarkAtomics(e){if(e.getKind()==fe.GlobalPtrStmt){let t=e.field.snodeTree.treeId;this.atomicTrees.add(t)}else e.getKind()==fe.GlobalTemporaryStmt&&(this.atomicGtemps=!0)}visitAtomicOpStmt(e){let t=e.getDestination();this.maybeMarkAtomics(t)}visitAtomicLoadStmt(e){let t=e.getPointer();this.maybeMarkAtomics(t)}visitAtomicStoreStmt(e){let t=e.getPointer();this.maybeMarkAtomics(t)}}class tr extends kt{constructor(e,t){super(),this.replacer=new At,this.atomicTrees=e,this.atomicGtemps=t}visitGlobalLoadStmt(e){let t=e.getPointer();if(this.atomicTrees.has(t.field.snodeTree.treeId)){let r=this.pushNewStmt(new Xe(t,this.module.getNewId()));this.replacer.markReplace(e,r)}else this.pushNewStmt(e)}visitGlobalStoreStmt(e){let t=e.getPointer();this.atomicTrees.has(t.field.snodeTree.treeId)?this.pushNewStmt(new $e(t,e.getValue(),this.module.getNewId())):this.pushNewStmt(e)}visitGlobalTemporaryLoadStmt(e){let t=e.getPointer();if(this.atomicGtemps){let r=this.pushNewStmt(new Xe(t,this.module.getNewId()));this.replacer.markReplace(e,r)}else this.pushNewStmt(e)}visitGlobalTemporaryStoreStmt(e){let t=e.getPointer();this.atomicGtemps?this.pushNewStmt(new $e(t,e.getValue(),this.module.getNewId())):this.pushNewStmt(e)}transform(e){super.transform(e),this.replacer.transform(e)}}!function(e){e[e.For=0]="For",e[e.While=1]="While",e[e.VertexFor=2]="VertexFor",e[e.FragmentFor=3]="FragmentFor"}(De||(De={}));class rr extends class{extractVisitorResult(e){return c(void 0!==e,"Result is undefined"),e}dispatchVisit(e){switch(e.kind){case ce.exports.SyntaxKind.VariableDeclaration:return this.visitVariableDeclaration(e);case ce.exports.SyntaxKind.VariableDeclarationList:return this.visitVariableDeclarationList(e);case ce.exports.SyntaxKind.FunctionDeclaration:return this.visitFunctionDeclaration(e);case ce.exports.SyntaxKind.ArrowFunction:return this.visitArrowFunction(e);case ce.exports.SyntaxKind.VariableStatement:return this.visitVariableStatement(e);case ce.exports.SyntaxKind.Identifier:return this.visitIdentifier(e);case ce.exports.SyntaxKind.ForOfStatement:case ce.exports.SyntaxKind.ForStatement:return this.visitForOfStatement(e);case ce.exports.SyntaxKind.ForInStatement:return this.visitForInStatement(e);case ce.exports.SyntaxKind.IfStatement:return this.visitIfStatement(e);case ce.exports.SyntaxKind.WhileStatement:return this.visitWhileStatement(e);case ce.exports.SyntaxKind.BreakStatement:return this.visitBreakStatement(e);case ce.exports.SyntaxKind.ContinueStatement:return this.visitContinueStatement(e);case ce.exports.SyntaxKind.ReturnStatement:return this.visitReturnStatement(e);case ce.exports.SyntaxKind.Block:return this.visitBlock(e);case ce.exports.SyntaxKind.NumericLiteral:return this.visitNumericLiteral(e);case ce.exports.SyntaxKind.ExpressionStatement:return this.visitExpressionStatement(e);case ce.exports.SyntaxKind.BinaryExpression:return this.visitBinaryExpression(e);case ce.exports.SyntaxKind.PrefixUnaryExpression:return this.visitPrefixUnaryExpression(e);case ce.exports.SyntaxKind.CallExpression:return this.visitCallExpression(e);case ce.exports.SyntaxKind.PropertyAccessExpression:return this.visitPropertyAccessExpression(e);case ce.exports.SyntaxKind.ElementAccessExpression:return this.visitElementAccessExpression(e);case ce.exports.SyntaxKind.ParenthesizedExpression:return this.visitParenthesizedExpression(e);case ce.exports.SyntaxKind.ArrayLiteralExpression:return this.visitArrayLiteralExpression(e);case ce.exports.SyntaxKind.ObjectLiteralExpression:return this.visitObjectLiteralExpression(e);case ce.exports.SyntaxKind.NonNullExpression:return this.visitNonNullExpression(e);case ce.exports.SyntaxKind.AsExpression:return this.visitAsExpression(e);case ce.exports.SyntaxKind.ThisKeyword:return this.visitThisKeyword();case ce.exports.SyntaxKind.TrueKeyword:return this.visitTrueKeyword();case ce.exports.SyntaxKind.FalseKeyword:return this.visitFalseKeyword();default:return this.visitUnknown(e)}}visitEachChild(e,t=null){let r=[];if(e.forEachChild((e=>{let t=this.dispatchVisit(e);r.push(t)})),t)return t(r)}visitUnknown(e){return this.visitEachChild(e)}visitNumericLiteral(e){return this.visitEachChild(e)}visitIdentifier(e){return this.visitEachChild(e)}visitVariableDeclaration(e){return this.visitEachChild(e)}visitVariableStatement(e){return this.visitEachChild(e)}visitFunctionDeclaration(e){return this.visitEachChild(e)}visitArrowFunction(e){return this.visitEachChild(e)}visitVariableDeclarationList(e){return this.visitEachChild(e)}visitForOfStatement(e){return this.visitEachChild(e)}visitForInStatement(e){return this.visitEachChild(e)}visitForStatement(e){return this.visitEachChild(e)}visitIfStatement(e){return this.visitEachChild(e)}visitWhileStatement(e){return this.visitEachChild(e)}visitBreakStatement(e){return this.visitEachChild(e)}visitContinueStatement(e){return this.visitEachChild(e)}visitReturnStatement(e){return this.visitEachChild(e)}visitBlock(e){return this.visitEachChild(e)}visitExpressionStatement(e){return this.visitEachChild(e)}visitBinaryExpression(e){return this.visitEachChild(e)}visitPrefixUnaryExpression(e){return this.visitEachChild(e)}visitCallExpression(e){return this.visitEachChild(e)}visitPropertyAccessExpression(e){return this.visitEachChild(e)}visitElementAccessExpression(e){return this.visitEachChild(e)}visitParenthesizedExpression(e){return this.visitEachChild(e)}visitArrayLiteralExpression(e){return this.visitEachChild(e)}visitObjectLiteralExpression(e){return this.visitEachChild(e)}visitNonNullExpression(e){return this.visitEachChild(e)}visitAsExpression(e){return this.visitEachChild(e)}visitThisKeyword(){}visitTrueKeyword(){}visitFalseKeyword(){}}{constructor(e,t,r){super(),this.irBuilder=e,this.builtinOps=t,this.atomicOps=r,this.kernelScope=new re,this.templatedValues=new re,this.symbolTable=new Map,this.parsedFunction=null,this.returnValue=null,this.loopStack=[],this.branchDepth=0,this.lastVisitedNode=null,this.startedVertex=!1,this.finishedVertex=!1,this.startedFragment=!1,this.renderPipelineParams=[],this.currentRenderPipelineParams=null,this.renderPassParams=null}buildIR(e,t,r){this.kernelScope=t,this.templatedValues=r,this.parsedFunction=e;let n=this.parsedFunction.functionNode;if(n.kind===ce.exports.SyntaxKind.FunctionDeclaration){let e=n;this.registerArguments(e.parameters),this.visitInputFunctionBody(e.body)}else if(n.kind===ce.exports.SyntaxKind.ArrowFunction){let e=n;this.registerArguments(e.parameters);let t=e.body;if(t.kind===ce.exports.SyntaxKind.Block)this.visitInputFunctionBody(t);else{let t=ce.exports.factory.createReturnStatement(e.body);this.visitReturnStatement(t)}}}visitInputFunctionBody(e){this.visitEachChild(e)}dispatchVisit(e){return this.returnValue&&this.errorNode(e,"If there is a `return`, it must be the final statement of the function"),this.finishedVertex&&!this.startedFragment&&(this.isFragmentFor(e)||this.errorNode(e,"No statements allowed between the vertex shader and the fragment shader")),this.lastVisitedNode=e,super.dispatchVisit(e)}extractVisitorResult(e){return this.assertNode(null,void 0!==e,"VistorResult is undefined"),super.extractVisitorResult(e)}extractValueOrError(e,t,...r){return e.isError&&this.errorNode(t,e.errorMessage,...r),e.result}registerArguments(e){this.errorNode(e[0],"[Compiler bug] should call overriden function")}hasNodeSymbol(e){return this.parsedFunction.hasNodeSymbol(e)}getNodeSymbol(e){return this.parsedFunction.getNodeSymbol(e)}getNodeBaseSymbol(e){for(;;){if(this.hasNodeSymbol(e)){if(e.kind===ce.exports.SyntaxKind.ThisKeyword)return;return this.getNodeSymbol(e)}if(e.kind===ce.exports.SyntaxKind.PropertyAccessExpression){e=e.expression}else if(e.kind===ce.exports.SyntaxKind.ElementAccessExpression){e=e.expression}else{if(e.kind!==ce.exports.SyntaxKind.CallExpression)return;e=e.expression}}}tryEvalInKernelScopeOrTemplateArgs(e){let t=e.getText(),r=this.getNodeBaseSymbol(e);if(void 0!==r){let e=!1;for(let t of this.parsedFunction.argNodes)if(this.getNodeSymbol(t.name)===r){e=!0;break}if(!e)return;if(!this.templatedValues.canEvaluate(t))return;return this.templatedValues.tryEvaluate(t)}return this.kernelScope.tryEvaluate(t)}canEvalInKernelScopeOrTemplateArgs(e){return void 0!==this.tryEvalInKernelScopeOrTemplateArgs(e)}errorNode(e,...t){null!==e?this.parsedFunction.errorNode(e,...t):null!==this.lastVisitedNode?this.errorNode(this.lastVisitedNode,...t):s(...t)}assertNode(e,t,...r){t||this.errorNode(e,...r)}derefIfPointer(e){return e.getType().getCategory()!==t.Pointer?e:this.builtinOps.get("load").apply([e])}createLocalVarCopy(e){let t=e.getType(),r=t.getPrimitivesList(),n=new _e(new p(t,!1));for(let t=0;t2**32-1&&this.errorNode(t,`${t.getText()} cannot be expressed as a 32-bit integer`),r>2**31-1&&(r-=2**32),pe.makeConstantScalar(r,this.irBuilder.get_int32(r),e.i32))}visitPrefixUnaryExpression(e){let t=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.operand))),r=null;switch(e.operator){case ce.exports.SyntaxKind.PlusToken:return t;case ce.exports.SyntaxKind.MinusToken:r=this.builtinOps.get("neg");break;case ce.exports.SyntaxKind.ExclamationToken:r=this.builtinOps.get("logical_not");break;case ce.exports.SyntaxKind.TildeToken:r=this.builtinOps.get("not");break;default:this.errorNode(e,"unsupported prefix unary operator:"+e.getText())}let n=r.checkType([t]);return n.hasError&&this.errorNode(e,"type error in unary operator:"+e.getText()+" "+n.msg),r.apply([t])}visitBinaryExpression(e){let r=this.extractVisitorResult(this.dispatchVisit(e.left)),n=this.extractVisitorResult(this.dispatchVisit(e.right)),i=r.getType(),a=this.derefIfPointer(n),o=e.operatorToken,s=o.getText();if(o.kind===ce.exports.SyntaxKind.EqualsToken){i.getCategory()!=t.Pointer&&this.errorNode(e,"Left hand side of assignment must be an l-value. ",i.getCategory());let n=i;this.isInVertexFor()&&n.getIsGlobal()&&this.errorNode(e,"vertex shaders are not allowed to write to global temporary variables or global fields.");let o=this.builtinOps.get("="),s=o.checkType([r,a]);return s.hasError&&this.errorNode(e,"Assignment type error: "+s.msg),void o.apply([r,a])}let c=new Map;if(c.set(ce.exports.SyntaxKind.PlusEqualsToken,this.atomicOps.get("atomicAdd")),c.set(ce.exports.SyntaxKind.MinusEqualsToken,this.atomicOps.get("atomicSub")),c.set(ce.exports.SyntaxKind.AmpersandEqualsToken,this.atomicOps.get("atomicAnd")),c.set(ce.exports.SyntaxKind.BarEqualsToken,this.atomicOps.get("atomicOr")),c.set(ce.exports.SyntaxKind.CaretEqualsToken,this.atomicOps.get("atomicXor")),c.has(o.kind)){let t=c.get(o.kind),n=t.checkType([r,a]);return n.hasError&&this.errorNode(e,"Atomic type error: "+n.msg),t.apply([r,a])}let l=this.derefIfPointer(r),u=new Map;if(u.set(ce.exports.SyntaxKind.AsteriskEqualsToken,this.builtinOps.get("*")),u.set(ce.exports.SyntaxKind.SlashEqualsToken,this.builtinOps.get("/")),u.has(o.kind)){let t=u.get(o.kind),n=t.checkType([l,a]);n.hasError&&this.errorNode(e,"self assignment type error: "+n.msg);let i=t.apply([l,a]),s=this.builtinOps.get("=");return n=s.checkType([r,i]),n.hasError&&this.errorNode(e,"self assignment type error: "+n.msg),s.apply([r,i]),i}if(l.getType().getCategory()===t.HostObjectReference&&a.getType().getCategory()===t.HostObjectReference)try{let e=Function("x","y",`return x ${s} y;`)(l.hostSideValue,a.hostSideValue);return this.getValueFromAnyHostValue(e)}catch(t){this.errorNode(e,"can not evaluate "+e.getText())}let d=this.builtinOps;if(d.has(s)){let t=d.get(s),r=t.checkType([l,a]);return r.hasError&&this.errorNode(e,`Binary op ${s} type error: `+r.msg),t.apply([l,a])}if(o.kind===ce.exports.SyntaxKind.CommaToken)return this.comma(l,a);this.errorNode(e,"unsupported binary operator:"+s)}visitArrayLiteralExpression(e){let r=e.elements;this.assertNode(e,r.length>0,"cannot have empty arrays");let n=[];for(let e of r)n.push(this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e))));if(1===n.length){let r=n[0].getType().getCategory();if(r===t.Scalar)return pe.makeVectorFromScalars(n);if(r===t.Vector)return pe.makeMatrixFromVectorsAsRows(n);this.errorNode(e,"array expression can only be used to represent vectors and matrices")}let i=n[0];for(let e=1;e{this.assertNode(e,e.arguments.length===t,r+" requires "+t.toString()+" args")},i=[];for(let t of e.arguments){let e=this.extractVisitorResult(this.dispatchVisit(t));i.push(e)}let a=null,o=()=>{if(null!==a)return a;a=[];for(let e of i)if(e.getType().getCategory()===t.Pointer)a.push(e);else if(e.getType().getCategory()===t.Function||e.getType().getCategory()===t.HostObjectReference)a.push(e);else{let t=this.createLocalVarCopy(e);a.push(t)}return a},s=null,c=()=>{if(null!==s)return s;s=[];for(let r=0;r1){let r=!0,n=[];for(let t of i){if(!e.has(t)){r=!1;break}n.push(e.get(t))}if(r){let e=[];for(let r of n)e.push(t[r]);return pe.makeVectorFromScalars(e)}}}else if(h.isValueOrPointerOfCategory(a.getType(),t.Struct)){let e=pe.getStructMembers(a);if(e.has(i))return e.get(i)}else if(a.getType().getCategory()===t.HostObjectReference){let e=a.hostSideValue;if("object"==typeof e&&e&&i in e)return this.getValueFromAnyHostValue(e[i])}this.errorNode(r,`invalid property access: ${r.getText()}`)}getValueFromAnyHostValue(r){let n=(r,i)=>{if(i>1024)return"The object is too big to be evaluated in kernel scope (or it might has a circular reference structure).";if("number"==typeof r)return r%1==0?pe.makeConstantScalar(r,this.irBuilder.get_int32(r),e.i32):pe.makeConstantScalar(r,this.irBuilder.get_float32(r),e.f32);if("boolean"==typeof r)return r?pe.makeConstantScalar(1,this.irBuilder.get_int32(1),e.i32):pe.makeConstantScalar(0,this.irBuilder.get_int32(0),e.i32);if("function"==typeof r){if(0!==i)return"calling member functions are not supported";let e=xt.makeFromCode(r.toString()),t=new _e(new g);return t.hostSideValue=e,t}if("string"==typeof r){if(0!==i)return" member functions / strings are not supported";let e=xt.makeFromCode(r),t=new _e(new g);return t.hostSideValue=e,t}if(G(r)){let e=n(r[0],i+1);if("string"==typeof e)return e;if(1===r.length)return e.getType().getCategory()===t.Scalar?pe.makeVectorFromScalars([e]):e.getType().getCategory()===t.Vector?pe.makeMatrixFromVectorsAsRows([e]):"can only use arrays of scalars or vectors";for(let t=1;t0&&this.loopStack[this.loopStack.length-1]===De.While,"break can only be used in a while loop"),this.irBuilder.create_break()}visitContinueStatement(e){this.assertNode(e,this.loopStack.length>0&&(this.loopStack[this.loopStack.length-1]===De.For||this.loopStack[this.loopStack.length-1]===De.While),"continue must be used inside a non-static loop"),this.loopStack[this.loopStack.length-1]!==De.VertexFor&&this.loopStack[this.loopStack.length-1]!==De.FragmentFor||this.errorNode(e,"continue cannot be used for Vertex-For or Fragment-For"),this.irBuilder.create_continue()}visitWhileStatement(e){let r=this.irBuilder.create_while_true(),n=this.irBuilder.get_while_loop_guard(r),i=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression)));this.assertNode(e,i.getType().getCategory()===t.Scalar,"condition of while statement must be scalar");let a=this.irBuilder.create_unary_op(i.stmts[0],ge.logic_not),o=this.irBuilder.create_if(a),s=this.irBuilder.get_if_guard(o,!0);this.irBuilder.create_break(),s.delete(),this.loopStack.push(De.While),this.dispatchVisit(e.statement),this.loopStack.pop(),n.delete()}shouldStrictlySerialize(){return!1}visitRangeFor(r,n,i,a){this.assertNode(null,1===n.length,"Expecting exactly 1 argument in range()"),this.assertNode(null,1===r.length,"Expecting exactly 1 loop index in range()");let o=n[0],s=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(o)));if(s=this.castTo(s,e.i32),this.assertNode(null,s.getType().getCategory()===t.Scalar,"range must be scalar"),a){this.assertNode(null,s.isCompileTimeConstant(),"for static range loops, the range must be a compile time constant");let t=s.compileTimeConstants[0];for(let n=0;n0,"ndrange() arg list cannot be empty");let s=[];for(let r of n){let n=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(r)));n=this.castTo(n,e.i32),this.assertNode(null,n.getType().getCategory()===t.Scalar,"each arg to ndrange() must be a scalar"),s.push(n)}if(a){let t=1;for(let e of s)this.assertNode(null,e.isCompileTimeConstant(),"for static ndrange loops, each range must be a compile time constant"),t*=e.compileTimeConstants[0];for(let n=0;n=0;--e){let t=s[e].compileTimeConstants[0],r=c%t,n=this.irBuilder.get_int32(r);a.stmts.push(n),a.compileTimeConstants.push(r),c=(c-r)/t}this.symbolTable.set(r[0],a),this.dispatchVisit(i)}}else{let t=s[0].stmts[0];for(let e=1;e=0;--e){let t=s[e].stmts[0],r=this.irBuilder.create_binary_op(_,t,me.mod);u.stmts=[r].concat(u.stmts),_=this.irBuilder.create_binary_op(_,t,me.floordiv)}this.symbolTable.set(r[0],u),this.loopStack.push(De.For),this.dispatchVisit(i),this.loopStack.pop(),a.delete()}}isAtTopLevel(){return 0===this.loopStack.length&&0===this.branchDepth}isInVertexFor(){return this.startedVertex&&!this.finishedVertex}isInFragmentFor(){return this.startedFragment}isInVertexOrFragmentFor(){return this.isInVertexFor()||this.isInFragmentFor()}isFragmentFor(e){if(e.kind!==ce.exports.SyntaxKind.ForOfStatement)return!1;let t=e;if(t.expression.kind!==ce.exports.SyntaxKind.CallExpression)return!1;let r=t.expression.expression.getText();return this.isBuiltinFunctionWithName(r,"inputFragments")}visitVertexFor(r,n,i){this.isAtTopLevel()||this.errorNode(null,"Vertex-For must be top-level"),this.finishedVertex&&this.errorNode(null,"cannot start a new render pipeline when the previous one hasn't been finioshed"),this.assertNode(null,1===r.length,"Expecting exactly 1 vertex declaration"),this.assertNode(null,null===this.currentRenderPipelineParams,"[Compiler bug]"),this.currentRenderPipelineParams=new P(new w,new F),this.ensureRenderPassParams(),0===n.length&&this.errorNode(null,"Expecting vertex buffer and optionally index buffer");let a=n.map((e=>this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e)))));if(a.length>=1){this.assertNode(null,a[0].getType().getCategory()===t.HostObjectReference&&a[0].hostSideValue instanceof W,`the vertex buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let e=a[0].hostSideValue;this.assertNode(null,1===e.dimensions.length,"the vertex buffer must be a 1D field "),this.currentRenderPipelineParams.vertexBuffer=e}if(a.length>=2){this.assertNode(null,a[1].getType().getCategory()===t.HostObjectReference&&a[1].hostSideValue instanceof W,`the index buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let r=a[1].hostSideValue;this.assertNode(null,1===r.dimensions.length,"the index buffer must be a 1D field"),this.assertNode(null,h.getPrimitiveType(r.elementType)===e.i32&&(r.elementType.getCategory()===t.Scalar||r.elementType.getCategory()===t.Vector&&3==r.elementType.getNumRows()),"the index buffer must container i32 scalars or 3D i32 vectors"),this.currentRenderPipelineParams.indexBuffer=r}if(n.length>=3){this.assertNode(null,a[2].getType().getCategory()===t.HostObjectReference&&a[2].hostSideValue instanceof W,`the indirect buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let e=a[2].getType(),r=a[2].hostSideValue;this.assertNode(null,1===r.dimensions.length,"the indirect buffer must be a 1D field "),e.markedAsStatic?this.currentRenderPipelineParams.indirectBuffer=r.toInt32Array():this.currentRenderPipelineParams.indirectBuffer=r}if(n.length>=4)if(this.assertNode(null,a[3].getType().getCategory()===t.Scalar&&h.getPrimitiveType(a[3].getType())==e.i32,"the indirect count must be a i32 scalar"),a[3].isCompileTimeConstant())this.currentRenderPipelineParams.indirectCount=a[3].compileTimeConstants[0];else{this.currentRenderPipelineParams.indirectCount=St.createField(new u(e.i32),[1]),ne.getCurrentProgram().materializeCurrentTree();let t=this.irBuilder.create_global_ptr(this.currentRenderPipelineParams.indirectCount,[this.irBuilder.get_int32(0)],0);this.irBuilder.create_global_store(t,a[3].stmts[0])}n.length>=5&&this.errorNode(null,"Expecting up to 4 arguments (vertex buffer, index buffer, indirect buffer, indirect count) in inputVertices");let o=this.irBuilder.create_vertex_for(),s=this.irBuilder.get_vertex_loop_guard(o);this.loopStack.push(De.VertexFor);let c=this.currentRenderPipelineParams.vertexBuffer.elementType,l=new _e(c,[]),d=c.getPrimitivesList();for(let e=0;e0||this.loopStack.length>0)&&this.errorNode(e,"return cannot be used inside a loop/branch"),e.expression?this.returnValue=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression))):this.returnValue=new _e(new m)}visitVertexFor(e,t,r){this.errorNode(null,"Vertex-For not allowed in non-kernel functions")}visitFragmentFor(e,t,r){this.errorNode(null,"Fragment-For not allowed in non-kernel functions")}shouldStrictlySerialize(){return!0}}class ir extends rr{constructor(){let e=new Dt;super(e,ht.getBuiltinOps(e),ht.getAtomicOps(e)),this.kernelArgTypes=[],this.argTypesMap=new Map,this.templateArgumentValues=null}compileKernel(e,t,r,n=null){this.argTypesMap=r,this.templateArgumentValues=n;let i=new re;if(null!==n)for(let e of n.keys())i.addStored(e,n.get(e));this.buildIR(e,t,i);let a=ne.getCurrentProgram().options.printIR,o=this.irBuilder.module;a&&console.log("initial IR\n",Ht(o)),function(e){let t=new Qt;t.transform(e)}(o),a&&console.log("fixed op types \n",Ht(o)),function(e){(new Et).visitModule(e)}(o),a&&console.log("identified parallel loops\n",Ht(o)),function(e){let t=new Yt;t.visitModule(e);let r=t.usefulInstructions;new Zt(r).transform(e)}(o),a&&console.log("DIEed\n",Ht(o)),function(e){let t=0,r=new Nt(t);r.visitModule(e);let n=r.gtempsAllocation;new wt(n).transform(e),t+=n.size;let i=new Ft(t);i.visitModule(e),n=i.gtempsAllocation,new Pt(n).transform(e),t+=n.size,new It(t).transform(e)}(o),a&&console.log("global temps\n",Ht(o)),function(e){(new Ot).transform(e)}(o),a&&console.log("demoted atomics\n",Ht(o)),function(e){let t=new er;t.visitModule(e),new tr(t.atomicTrees,t.atomicGtemps).transform(e)}(o),a&&console.log("promoted load stores to atomics\n",Ht(o));let c=function(e){let t=new jt;t.transform(e);let r=t.offloadedModules,n=[];for(let e of r){if(e.type!==Se.Serial){n.push(e);continue}let t=new Ut;t.visitModule(e),t.isTrivial||n.push(e)}return n}(o);a&&console.log("offloaded\n");for(let e of c)$t(e),a&&console.log(Ht(e));let l=0;for(let e of this.kernelArgTypes)l+=4*e.getPrimitivesList().length;let u=0,d=new m;null!==this.returnValue&&(d=this.returnValue.getType(),u=4*d.getPrimitivesList().length);let _=[],p=0;for(let e=0;e0||this.loopStack.length>0)&&this.errorNode(e,"return cannot be used inside a loop/branch"),e.expression?(this.returnValue=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression))),this.irBuilder.create_return_vec(this.returnValue.stmts.slice())):(this.returnValue=new _e(new m),this.irBuilder.create_return_vec(this.returnValue.stmts))}checkGraphicsShaderBindings(e){for(let t of e)t.info.resourceType===i.RandStates?s("vertex and fragment shaders are not allowed to use randoms"):t.info.resourceType===i.Rets&&s("[Compiler Bug] vertex and fragment shaders are not allowed to have return values")}}class ar{}class or{constructor(){this.instances=[]}findInstance(e){for(let t of this.instances){let r=!0,n=t[0];for(let t of n.keys())e.has(t)&&e.get(t)===n.get(t)||(r=!1);if(r)return t[1]}return null}}class sr{static kernel(t,r,n){let i={};n=n.toString(),r&&(i=r);let a=new Map,o=new Set;for(let t in i){let r=i[t];r===e.f32||r===e.i32?(r=new u(r),a.set(t,r)):r instanceof l?a.set(t,r):r instanceof ar?o.add(t):s("Invalid argument type annotations")}let d=n.toString(),_=ne.getCurrentProgram(),p=xt.makeFromCode(d),f=p.argNames;sr.templateKernelCache.has(d)||sr.templateKernelCache.set(d,new or);let m=sr.templateKernelCache.get(d);if(0===o.size){_.materializeCurrentTree();let e=(new ir).compileKernel(p,t,a),r=_.runtime.createKernel(e);return async(...e)=>await _.runtime.launchKernel(r,...e)}{let e=async(...e)=>{c(e.length===f.length,`Kernel requires ${f.length} arguments, but ${e.length} is provided`);let r=new Map,n=[];for(let t=0;tyr(new d(t,e),r,n)},vr={field:(e,t,r,n,i=!1)=>yr(new _(r,e,t),n,i)},br={field:(e,t,r=!1)=>yr(new f(e),t,r)};function xr(){ne.getCurrentProgram().materializeCurrentTree()}let Sr=(e,t,r=1,n={})=>new S(e,t,r,n),Dr=(e,t=1)=>new D(e,t),Cr=(e,t=1)=>new C(e,t);class Tr{constructor(e){this.htmlCanvas=e,this.VBO=hr.field(2,gr,[4]),this.IBO=yr(mr,[6]),this.renderTarget=Dr(e),this.VBO.fromArray([[-1,-1],[1,-1],[-1,1],[1,1]]),this.IBO.fromArray([0,1,2,1,3,2]),this.renderFieldKernel=_r(this,{image:ur()},"(image: any) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n //@ts-ignore\n let texelIndex = ti.i32(coord * (image.dimensions - 1));\n let color = image[texelIndex].rgb;\n ti.outputColor(this.renderTarget, color.concat([1.0]));\n }\n }"),this.renderTextureKernel=_r(this,{image:ur()},"(image: TextureBase) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n let color = ti.textureSample(image, coord);\n color[3] = 1.0;\n ti.outputColor(this.renderTarget, color);\n }\n }"),this.renderDepthTextureKernel=_r(this,{image:ur()},"(image: DepthTexture) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n //@ts-ignore\n let texelIndex = ti.i32(coord * (image.dimensions - 1));\n let depth = ti.textureLoad(image, texelIndex);\n let color = [depth, depth, depth, 1.0];\n ti.outputColor(this.renderTarget, color);\n }\n }")}async render(e){e instanceof W?await this.renderFieldKernel(e):e instanceof C?await this.renderDepthTextureKernel(e):await this.renderTextureKernel(e)}}class Er{constructor(e){this.htmlCanvas=e,this.setImageObj=new Tr(e)}async setImage(e){await this.setImageObj.render(e)}}class kr{constructor(){this.begin=Date.now()}time(){return Date.now()-this.begin}static getDefaultTimer(){return this.defaultTimer}}kr.defaultTimer=new kr;let Ar=()=>{s("This function is only implemented in taichi kernel scope!")};function Nr(e){let t=[];for(let r=0;rr(e,t)));if("number"==typeof e&&Array.isArray(t))return t.map((t=>r(e,t)));if(Array.isArray(e)&&Array.isArray(t)){c(e.length===t.length,"vector size mismatch");let n=[];for(let i=0;i-e))}function Mr(e,t){return Ir(e,t,((e,t)=>e+t))}function Lr(e,t){return Ir(e,t,((e,t)=>e-t))}function Rr(e,t){return Ir(e,t,((e,t)=>e*t))}function Br(e,t){return Ir(e,t,((e,t)=>e/t))}function Jr(e){let t=0;for(let r of e)t+=r*r;return t}function jr(e){return Math.sqrt(Jr(e))}function Ur(e){return Br(e,jr(e))}function Vr(e,t){c(e.length===t.length,"vector size mismatch");let r=0;for(let n=0;n{this.ensureAttrib(e)}))}setAttribValue(e,t){switch(e){case En.Position:this.position=t;break;case En.Normal:this.normal=t;break;case En.Tangent:this.tangent=t;break;case En.TexCoords0:this.texCoords0=t;break;case En.TexCoords1:this.texCoords1=t;break;case En.Color:this.color=t;break;case En.Joints:this.joints=t;break;case En.Weights:this.weights=t;break;default:s("setAttribValue called on None or All")}}ensureAttrib(e){let t=Nn(e),r=Array(t).fill(0);this.setAttribValue(e,r)}ensureAttribs(e){e.foreach((e=>this.ensureAttrib(e)))}}class Fn{constructor(e){this.matrix=[],this.reset(),e&&(this.matrix=e)}reset(){this.matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]}mul(e){let t=new Fn;return t.matrix=zr(this.matrix,e.matrix),t}static getKernelType(){return Bc({matrix:Rc(gr,4,4)})}}class Pn{constructor(){this.parent=-1,this.children=[],this.localTransform=new Fn,this.globalTransform=new Fn,this.mesh=-1}static getKernelType(){return Bc({globalTransform:Fn.getKernelType()})}}!function(e){e[e.Point=1]="Point",e[e.Spot=2]="Spot",e[e.Directional=3]="Directional"}(kn||(kn={}));class In{constructor(e,t,r,n,i=[0,0,0],a=[0,0,0],o=0,s=Math.PI/4,c=!1,l){this.type=e,this.brightness=t,this.color=r,this.influenceRadius=n,this.position=i,this.direction=a,this.innerConeAngle=o,this.outerConeAngle=s,this.castsShadow=c,this.shadow=l}static getKernelType(){return Bc({type:mr,brightness:gr,color:Lc(gr,3),influenceRadius:gr,position:Lc(gr,3),direction:Lc(gr,3),innerConeAngle:gr,outerConeAngle:gr,castsShadow:mr})}}function On(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const Mn=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Ln="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ln&&parseFloat(Ln[1]);function Rn(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const Bn={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Jn=Bn.global||Bn.self||Bn.window||{},jn="object"!=typeof process||"[object process]"!==String(process)||process.browser,Un="function"==typeof importScripts,Vn="undefined"!=typeof window&&void 0!==window.orientation,Kn="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Kn&&parseFloat(Kn[1]);class Gn{constructor(e,t){zn(this,"name",void 0),zn(this,"workerThread",void 0),zn(this,"isRunning",void 0),zn(this,"result",void 0),zn(this,"_resolve",void 0),zn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Rn(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Rn(this.isRunning),this.isRunning=!1,this._reject(e)}}const qn=new Map;function Wn(e){Rn(e.source&&!e.url||!e.source&&e.url);let t=qn.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Hn((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),qn.set(e.url,t)),e.source&&(t=Hn(e.source),qn.set(e.source,t))),Rn(t),t}function Hn(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Qn(e,t=!0,r){const n=r||new Set;if(e){if(Xn(e))n.add(e);else if(Xn(e.buffer))n.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"==typeof e)for(const r in e)Qn(e[r],t,n)}else;return void 0===r?Array.from(n):[]}function Xn(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const $n=()=>{};class Yn{static isSupported(){return"undefined"!=typeof Worker}constructor(e){zn(this,"name",void 0),zn(this,"source",void 0),zn(this,"url",void 0),zn(this,"terminated",!1),zn(this,"worker",void 0),zn(this,"onMessage",void 0),zn(this,"onError",void 0),zn(this,"_loadableURL","");const{name:t,source:r,url:n}=e;Rn(r||n),this.name=t,this.source=r,this.url=n,this.onMessage=$n,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=$n,this.onError=$n,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Qn(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=Wn({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class Zn{constructor(e){zn(this,"name","unnamed"),zn(this,"source",void 0),zn(this,"url",void 0),zn(this,"maxConcurrency",1),zn(this,"maxMobileConcurrency",1),zn(this,"onDebug",(()=>{})),zn(this,"reuseWorkers",!0),zn(this,"props",{}),zn(this,"jobQueue",[]),zn(this,"idleQueue",[]),zn(this,"count",0),zn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach((e=>e.destroy())),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,r)=>e.done(r)),r=((e,t)=>e.error(t))){const n=new Promise((n=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new Gn(t.name,e);e.onMessage=e=>t.onMessage(r,e.type,e.payload),e.onError=e=>t.onError(r,e),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ri{static isSupported(){return Yn.isSupported()}static getWorkerFarm(e={}){return ri._workerFarm=ri._workerFarm||new ri({}),ri._workerFarm.setProps(e),ri._workerFarm}constructor(e){zn(this,"props",void 0),zn(this,"workerPools",new Map),this.props={...ei},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:n}=e;let i=this.workerPools.get(t);return i||(i=new Zn({name:t,source:r,url:n}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}zn(ri,"_workerFarm",void 0);const ni={};async function ii(e,t=null,r={}){return t&&(e=function(e,t,r){if(e.startsWith("http"))return e;const n=r.modules||{};if(n[e])return n[e];if(!jn)return"modules/".concat(t,"/dist/libs/").concat(e);if(r.CDN)return Rn(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.1.8","/dist/libs/").concat(e);if(Un)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,r)),ni[e]=ni[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!jn)try{return le&&void 0}catch{return null}if(Un)return importScripts(e);const t=await fetch(e);return function(e,t){if(!jn)return;if(Un)return eval.call(Jn,e),null;const r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}(await t.text(),e)}(e),await ni[e]}async function ai(e,t,r,n,i){const a=e.id,o=function(e,t={}){const r=t[e.id]||{},n="".concat(e.id,"-worker.js");let i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){let t=e.version;"latest"===t&&(t="latest");const r=t?"@".concat(t):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r,"/dist/").concat(n)}return Rn(i),i}(e,r),s=ri.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r));const c=await s.startJob("process-on-worker",oi.bind(null,i));c.postMessage("process",{input:t,options:r});const l=await c.result;return await l.result}async function oi(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:i,input:a,options:o}=n;try{const r=await e(a,o);t.postMessage("done",{id:i,result:r})}catch(e){const r=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:r})}break;default:console.warn("parse-with-worker unknown message ".concat(r))}}function si(e,t,r){if(e.byteLength<=t+r)return"";const n=new DataView(e);let i="";for(let e=0;e=0),On(t>0),e+(t-1)&~(t-1)}function pi(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,r=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,r)}return t.set(n,r),r+_i(n.byteLength,4)}async function fi(e){const t=[];for await(const r of e)t.push(r);return function(...e){const t=e.map((e=>e instanceof ArrayBuffer?new Uint8Array(e):e)),r=t.reduce(((e,t)=>e+t.byteLength),0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}(...t)}const mi={};const gi=e=>"function"==typeof e,yi=e=>null!==e&&"object"==typeof e,hi=e=>yi(e)&&e.constructor==={}.constructor,vi=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,bi=e=>"undefined"!=typeof Blob&&e instanceof Blob,xi=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||yi(e)&&gi(e.tee)&&gi(e.cancel)&&gi(e.getReader))(e)||(e=>yi(e)&&gi(e.read)&&gi(e.pipe)&&(e=>"boolean"==typeof e)(e.readable))(e),Si=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Di=/^([-\w.]+\/[-\w.+]+)/;function Ci(e){const t=Di.exec(e);return t?t[1]:e}function Ti(e){const t=Si.exec(e);return t?t[1]:""}const Ei=/\?.*/;function ki(e){if(vi(e)){const t=Ai(e.url||"");return{url:t,type:Ci(e.headers.get("content-type")||"")||Ti(t)}}return bi(e)?{url:Ai(e.name||""),type:e.type||""}:"string"==typeof e?{url:Ai(e),type:Ti(e)}:{url:"",type:""}}function Ai(e){return e.replace(Ei,"")}async function Ni(e){if(vi(e))return e;const t={},r=function(e){return vi(e)?e.headers["content-length"]||-1:bi(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);r>=0&&(t["content-length"]=String(r));const{url:n,type:i}=ki(e);i&&(t["content-type"]=i);const a=await async function(e){const t=5;if("string"==typeof e)return"data:,".concat(e.slice(0,t));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise((e=>{const r=new FileReader;r.onload=t=>{var r;return e(null==t||null===(r=t.target)||void 0===r?void 0:r.result)},r.readAsDataURL(t)}))}if(e instanceof ArrayBuffer){const r=function(e){let t="";const r=new Uint8Array(e);for(let e=0;e=0)}()}const Pi={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Ii=Pi.window||Pi.self||Pi.global,Oi=Pi.process||{},Mi="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Fi();class Li{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";zn(this,"storage",void 0),zn(this,"id",void 0),zn(this,"config",{}),this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Ri(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}let Bi;function Ji(e){return"string"==typeof e?Bi[e.toUpperCase()]||Bi.WHITE:e}function ji(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ui(){let e;var t,r;if(Fi&&"performance"in Ii)e=null==Ii||null===(t=Ii.performance)||void 0===t||null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in Oi){var n;const t=null==Oi||null===(n=Oi.hrtime)||void 0===n?void 0:n.call(Oi);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Bi||(Bi={}));const Vi={debug:Fi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ki={enabled:!0,level:0};function zi(){}const Gi={},qi={once:!0};class Wi{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};zn(this,"id",void 0),zn(this,"VERSION",Mi),zn(this,"_startTs",Ui()),zn(this,"_deltaTs",Ui()),zn(this,"_storage",void 0),zn(this,"userData",{}),zn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new Li("__probe-".concat(this.id,"__"),Ki),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find((e=>r===e))||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ui()-this._startTs).toPrecision(10))}getDelta(){return Number((Ui()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){ji(e,t)}warn(e){return this._getLogFunction(0,e,Vi.warn,arguments,qi)}error(e){return this._getLogFunction(0,e,Vi.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,Vi.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Vi.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i{const t=Ri(e,r,n);console.log(...t)},e.src=t,zi}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...Ri(t,r,n)),zi;if("canvas"===i.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Ri(e,r,n)),e.src=t.toDataURL(),zi}return zi}({image:n,message:i,scale:a}):function(e){let{image:t,message:r="",scale:n=1}=e,i=null;try{i=module.require("asciify-image")}catch(e){}if(i)return()=>i(t,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then((e=>console.log(e)));return zi}({image:n,message:i,scale:a}):zi}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||zi)}group(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=Qi({logLevel:e,message:t,opts:r}),{collapsed:i}=r;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zi)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Hi(e)}_getLogFunction(e,t,r,n,i){if(this._shouldLog(e)){i=Qi({logLevel:e,message:t,args:n,opts:i}),ji(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ui();const a=i.tag||i.message;if(i.once){if(Gi[a])return zi;Gi[a]=Ui()}return t=function(e,t,r){if("string"==typeof t){const o=r.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,a=r.background,Fi||"string"!=typeof n||(i&&(i=Ji(i),n="[".concat(i,"m").concat(n,"")),a&&(i=Ji(a),n="[".concat(a+10,"m").concat(n,""))),t=n}var n,i,a;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return zi}}function Hi(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ji(Number.isFinite(t)&&t>=0),t}function Qi(e){const{logLevel:t,message:r}=e;e.logLevel=Hi(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return ji("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function Xi(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}zn(Wi,"VERSION",Mi);const $i=new Wi({id:"loaders.gl"});class Yi{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const Zi={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){zn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ea={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ta(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const ra=()=>{const e=ta();return e.globalOptions=e.globalOptions||{...Zi},e.globalOptions};function na(e,t,r,n){return r=r||[],function(e,t){aa(e,null,Zi,ea,t);for(const r of t){const n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};aa(n,r.id,i,a,t)}}(e,r=Array.isArray(r)?r:[r]),function(e,t,r){const n={...e.options||{}};(function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)})(n,r),null===n.log&&(n.log=new Yi);return sa(n,ra()),sa(n,t),n}(t,e,n)}function ia(e,t){const r=ra(),n=e||r;return"function"==typeof n.fetch?n.fetch:yi(n.fetch)?e=>wi(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:wi}function aa(e,t,r,n,i){const a=t||"Top level",o=t?"".concat(t,"."):"";for(const s in e){const c=!t&&yi(e[s]),l="baseUri"===s&&!t,u="workerUrl"===s&&t;if(!(s in r)&&!l&&!u)if(s in n)$i.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!c){const e=oa(s,i);$i.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(e))()}}}function oa(e,t){const r=e.toLowerCase();let n="";for(const i of t)for(const t in i.options){if(e===t)return"Did you mean '".concat(i.id,".").concat(t,"'?");const a=t.toLowerCase();(r.startsWith(a)||a.startsWith(r))&&(n=n||"Did you mean '".concat(i.id,".").concat(t,"'?"))}return n}function sa(e,t){for(const r in t)if(r in t){const n=t[r];hi(n)&&hi(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function ca(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function la(e){var t,r;let n;return On(e,"null loader"),On(ca(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}function ua(){return(()=>{const e=ta();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry})()}const da=new Wi({id:"loaders.gl"}),_a=/\.([^.]+)$/;function pa(e,t=[],r,n){if(!fa(e))return null;if(t&&!Array.isArray(t))return la(t);let i=[];t&&(i=i.concat(t)),null!=r&&r.ignoreRegisteredLoaders||i.push(...ua()),function(e){for(const t of e)la(t)}(i);const a=function(e,t,r,n){const{url:i,type:a}=ki(e),o=i||(null==n?void 0:n.url);let s=null,c="";null!=r&&r.mimeType&&(s=ga(t,null==r?void 0:r.mimeType),c="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType));var l;s=s||function(e,t){const r=t&&_a.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();for(const r of e)for(const e of r.extensions)if(e.toLowerCase()===t)return r;return null}(e,n):null}(t,o),c=c||(s?"matched url ".concat(o):""),s=s||ga(t,a),c=c||(s?"matched MIME type ".concat(a):""),s=s||function(e,t){if(!t)return null;for(const r of e)if("string"==typeof t){if(ya(t,r))return r}else if(ArrayBuffer.isView(t)){if(ha(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(ha(t,0,r))return r}return null}(t,e),c=c||(s?"matched initial data ".concat(va(e)):""),s=s||ga(t,null==r?void 0:r.fallbackMimeType),c=c||(s?"matched fallback MIME type ".concat(a):""),c&&da.log(1,"selectLoader selected ".concat(null===(l=s)||void 0===l?void 0:l.name,": ").concat(c,"."));return s}(e,i,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(ma(e));return a}function fa(e){return!(e instanceof Response&&204===e.status)}function ma(e){const{url:t,type:r}=ki(e);let n="No valid loader found (";n+=t?"".concat(function(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}(t),", "):"no url provided, ",n+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");const i=e?va(e):"";return n+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",n+=")",n}function ga(e,t){for(const r of e){if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}return null}function ya(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some((t=>e.startsWith(t)))}function ha(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((n=>function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}(r),t.binary?await r.arrayBuffer():await r.text()}if(xi(e)&&(e=Da(e,r)),(i=e)&&"function"==typeof i[Symbol.iterator]||(e=>e&&"function"==typeof e[Symbol.asyncIterator])(e))return fi(e);var i;throw new Error(Ca)}async function Ea(e,t,r,n){Rn(!n||"object"==typeof n),!t||Array.isArray(t)||ca(t)||(n=void 0,r=t,t=void 0),e=await e,r=r||{};const{url:i}=ki(e),a=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...e]:e}return r&&r.length?r:null}(t,n),o=await async function(e,t=[],r,n){if(!fa(e))return null;let i=pa(e,t,{...r,nothrow:!0},n);if(i)return i;if(bi(e)&&(i=pa(e=await e.slice(0,10).arrayBuffer(),t,r,n)),!(i||null!=r&&r.nothrow))throw new Error(ma(e));return i}(e,a,r);return o?(n=function(e,t,r=null){if(r)return r;const n={fetch:ia(t,e),...e};return Array.isArray(n.loaders)||(n.loaders=null),n}({url:i,parse:Ea,loaders:a},r=na(r,o,a,i),n),await async function(e,t,r,n){if(function(e,t="3.1.8"){Rn(e,"no worker provided");const r=e.version}(e),t=await Ta(t,e,r),e.parseTextSync&&"string"==typeof t)return r.dataType="text",e.parseTextSync(t,r,n,e);if(function(e,t){return!!ri.isSupported()&&e.worker&&(null==t?void 0:t.worker)}(e,r))return await ai(e,t,r,0,Ea);if(e.parseText&&"string"==typeof t)return await e.parseText(t,r,n,e);if(e.parse)return await e.parse(t,r,n,e);throw Rn(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,r,n)):null}const ka="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.wasm"),Aa="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.js");let Na,wa;async function Fa(e){const t=e.modules||{};return t.basis?t.basis:(Na=Na||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await ii("basis_transcoder.js","textures",e),await ii("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e(r).then((e=>{const{BasisFile:r,initializeBasis:n}=e;n(),t({BasisFile:r})}))}))}(t,r)}(e),await Na)}async function Pa(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(wa=wa||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await ii(Aa,"textures",e),await ii(ka,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e(r).then((e=>{const{BasisFile:r,KTX2File:n,initializeBasis:i,BasisEncoder:a}=e;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}(t,r)}(e),await wa)}const Ia=33776,Oa=33779,Ma=35840,La=35842,Ra=36196,Ba=37808,Ja=["","WEBKIT_","MOZ_"],ja={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let Ua=null;function Va(e){if(!Ua){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,Ua=new Set;for(const t of Ja)for(const r in ja)if(e&&e.getExtension("".concat(t).concat(r))){const e=ja[r];Ua.add(e)}}return Ua}var Ka,za,Ga,qa,Wa,Ha,Qa,Xa,$a;($a=Ka||(Ka={}))[$a.NONE=0]="NONE",$a[$a.BASISLZ=1]="BASISLZ",$a[$a.ZSTD=2]="ZSTD",$a[$a.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(za||(za={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Ga||(Ga={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(qa||(qa={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Wa||(Wa={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Ha||(Ha={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Qa||(Qa={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Xa||(Xa={}));const Ya=[171,75,84,88,32,50,48,187,13,10,26,10];const Za={etc1:{basisFormat:0,compressed:!0,format:Ra},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ia},bc3:{basisFormat:3,compressed:!0,format:Oa},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ma},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:La},"astc-4x4":{basisFormat:10,compressed:!0,format:Ba},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function eo(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getNumImages(),t=[];for(let i=0;i{try{r.onload=()=>t(r),r.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}}))}(a||n,t)}finally{a&&i.revokeObjectURL(a)}}const vo={};let bo=!0;async function xo(e,t,r){let n;if(go(r)){n=await ho(e,t,r)}else n=yo(e,r);const i=t&&t.imagebitmap;return await async function(e,t=null){!function(e){for(const t in e||vo)return!1;return!0}(t)&&bo||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),bo=!1}return await createImageBitmap(e)}(n,i)}function So(e){const t=Do(e);return function(e){const t=Do(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,false)))return null;return{mimeType:"image/png",width:t.getUint32(16,false),height:t.getUint32(20,false)}}(t)||function(e){const t=Do(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,false)&&255===t.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let i=2;for(;i+9=10&&1195984440===t.getUint32(0,false)))return null;return{mimeType:"image/gif",width:t.getUint16(6,true),height:t.getUint16(8,true)}}(t)||function(e){const t=Do(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,false)&&t.getUint32(2,true)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,true),height:t.getUint32(22,true)}}(t)}function Do(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}const Co={id:"image",module:"images",name:"Images",version:"3.1.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,r){const n=((t=t||{}).image||{}).type||"auto",{url:i}=r||{};let a;switch(function(e){switch(e){case"auto":case"data":return function(){if(lo)return"imagebitmap";if(co)return"image";if(_o)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return lo||co||_o;case"imagebitmap":return lo;case"image":return co;case"data":return _o;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":a=await xo(e,t,i);break;case"image":a=await ho(e,t,i);break;case"data":a=await async function(e,t){const{mimeType:r}=So(e)||{},n=globalThis._parseImageNode;return On(n),await n(e,r)}(e);break;default:On(!1)}return"data"===n&&(a=function(e){switch(po(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}(a)),a},tests:[e=>Boolean(So(new DataView(e)))],options:{image:{type:"auto",decode:!0}}},To=["image/png","image/jpeg","image/gif"],Eo={};function ko(e){return void 0===Eo[e]&&(Eo[e]=function(e){switch(e){case"image/webp":return function(){if(!Mn)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Mn;default:if(!Mn){const{_parseImageNode:t}=globalThis;return Boolean(t)&&To.includes(e)}return!0}}(e)),Eo[e]}function Ao(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function No(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}const wo=["SCALAR","VEC2","VEC3","VEC4"],Fo=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Po=new Map(Fo),Io={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Mo={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Lo(e){return wo[e-1]||wo[0]}function Ro(e){const t=Po.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Bo(e,t){const r=Mo[e.componentType],n=Io[e.type],i=Oo[e.componentType],a=e.count*n,o=e.count*n*i;return Ao(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}const Jo={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class jo{constructor(e){zn(this,"gltf",void 0),zn(this,"sourceBuffers",void 0),zn(this,"byteLength",void 0),this.gltf=e||{json:{...Jo},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find((t=>t===e)),r=this.json.extensions||{};return t?r[e]||!0:null}getRequiredExtension(e){const t=this.getRequiredExtensions().find((t=>t===e));return t?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];Ao(r);const n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:n,length:i}=Bo(e,t);return new n(r,t.byteOffset+e.byteOffset,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}setObjectExtension(e,t,r){(e.extensions||{})[t]=r}removeObjectExtension(e,t){const r=e.extensions||{},n=r[t];return delete r[t],n}addExtension(e,t={}){return Ao(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ao(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((t=>t===e))||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((t=>t===e))||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:r}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:r,material:n,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(r){const e=this._addIndices(r);a.primitives[0].indices=e}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const r=So(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ao(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=_i(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(e,t){const r={bufferView:e,type:Lo(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const r=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const i={size:t.size,componentType:Ro(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}addTexture(e){const{imageIndex:t}=e,r={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),i=new Uint8Array(n);let a=0;for(const e of this.sourceBuffers||[])a=pi(e,i,a);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let r=!0;for(;r;){const n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}_addAttributes(e={}){const t={};for(const r in e){const n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const r={min:null,max:null};if(e.length96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let n=0;nt[e.name]));return new ts(r,this.metadata)}selectAt(...e){const t=e.map((e=>this.fields[e])).filter(Boolean);return new ts(t,this.metadata)}assign(e){let t,r=this.metadata;if(e instanceof ts){const n=e;t=n.fields,r=rs(rs(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const i=Object.values(n);return new ts(i,r)}}function rs(e,t){return new Map([...e||new Map,...t||new Map])}class ns{constructor(e,t,r=!1,n=new Map){zn(this,"name",void 0),zn(this,"type",void 0),zn(this,"nullable",void 0),zn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new ns(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let is,as,os,ss;!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(is||(is={}));class cs{static isNull(e){return e&&e.typeId===is.Null}static isInt(e){return e&&e.typeId===is.Int}static isFloat(e){return e&&e.typeId===is.Float}static isBinary(e){return e&&e.typeId===is.Binary}static isUtf8(e){return e&&e.typeId===is.Utf8}static isBool(e){return e&&e.typeId===is.Bool}static isDecimal(e){return e&&e.typeId===is.Decimal}static isDate(e){return e&&e.typeId===is.Date}static isTime(e){return e&&e.typeId===is.Time}static isTimestamp(e){return e&&e.typeId===is.Timestamp}static isInterval(e){return e&&e.typeId===is.Interval}static isList(e){return e&&e.typeId===is.List}static isStruct(e){return e&&e.typeId===is.Struct}static isUnion(e){return e&&e.typeId===is.Union}static isFixedSizeBinary(e){return e&&e.typeId===is.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===is.FixedSizeList}static isMap(e){return e&&e.typeId===is.Map}static isDictionary(e){return e&&e.typeId===is.Dictionary}get typeId(){return is.NONE}compareTo(e){return this===e}}as=Symbol.toStringTag;class ls extends cs{constructor(e,t){super(),zn(this,"isSigned",void 0),zn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return is.Int}get[as](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class us extends ls{constructor(){super(!0,8)}}class ds extends ls{constructor(){super(!0,16)}}class _s extends ls{constructor(){super(!0,32)}}class ps extends ls{constructor(){super(!1,8)}}class fs extends ls{constructor(){super(!1,16)}}class ms extends ls{constructor(){super(!1,32)}}const gs=32,ys=64;os=Symbol.toStringTag;class hs extends cs{constructor(e){super(),zn(this,"precision",void 0),this.precision=e}get typeId(){return is.Float}get[os](){return"Float"}toString(){return"Float".concat(this.precision)}}class vs extends hs{constructor(){super(gs)}}class bs extends hs{constructor(){super(ys)}}ss=Symbol.toStringTag;class xs extends cs{constructor(e,t){super(),zn(this,"listSize",void 0),zn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return is.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[ss](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}function Ss(e,t,r){const n=function(e){switch(e.constructor){case Int8Array:return new us;case Uint8Array:return new ps;case Int16Array:return new ds;case Uint16Array:return new fs;case Int32Array:return new _s;case Uint32Array:return new ms;case Float32Array:return new vs;case Float64Array:return new bs;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new ns(e,new xs(t.size,new ns("value",n)),!1,i)}function Ds(e,t,r){return Ss(e,t,r?Cs(r.metadata):void 0)}function Cs(e){const t=new Map;for(const r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}const Ts={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Es={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class ks{constructor(e){zn(this,"draco",void 0),zn(this,"decoder",void 0),zn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!i.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const a=this._getDracoLoaderData(i,n,t),o=this._getMeshData(i,a,t),s=function(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0;const s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;ei?c:i,a=l>a?l:a,o=u>o?u:o}return[[t,r,n],[i,a,o]]}(o.attributes),c=function(e,t,r){const n=Cs(t.metadata),i=[],a=function(e){const t={};for(const r in e){const n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const r=Ds(t,e[t],a[t]);i.push(r)}if(r){const e=Ds("indices",r);i.push(e)}return new ts(i,n)}(o.attributes,a,o.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:s},...o,schema:c}}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,r){const n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}_getDracoAttributes(e,t){const r={};for(let n=0;nthis.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map((e=>t.min_value(e)))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:r=[]}=t,n=e.attribute_type();if(r.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}const As="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Ns="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),ws="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");let Fs;async function Ps(e){const t=e.modules||{};return Fs=t.draco3d?Fs||t.draco3d.createDecoderModule({}).then((e=>({draco:e}))):Fs||async function(e){let t,r;if("js"===(e.draco&&e.draco.decoderType))t=await ii(As,"draco",e);else[t,r]=await Promise.all([await ii(Ns,"draco",e),await ii(ws,"draco",e)]);return t=t||globalThis.DracoDecoderModule,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e({...r,onModuleLoaded:e=>t({draco:e})})}))}(t,r)}(e),await Fs}const Is={...es,parse:async function(e,t){const{draco:r}=await Ps(t),n=new ks(r);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};function Os(e){const{buffer:t,size:r,count:n}=function(e){let t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t,r=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e);return{value:t,size:r,byteOffset:0,count:n,type:Lo(r),componentType:Ro(t)}}async function Ms(e,t,r,n){const i=e.getObjectExtension(t,"KHR_draco_mesh_compression");if(!i)return;const a=e.getTypedArrayForBufferView(i.bufferView),o=di(a.buffer,a.byteOffset),{parse:s}=n,c={...r};delete c["3d-tiles"];const l=await s(o,Is,c,n),u=function(e){const t={};for(const r in e){const n=e[r];if("indices"!==r){const e=Os(n);t[r]=e}}return t}(l.attributes);for(const[r,n]of Object.entries(u))if(r in t.attributes){const i=t.attributes[r],a=e.getAccessor(i);null!=a&&a.min&&null!=a&&a.max&&(n.min=a.min,n.max=a.max)}t.attributes=u,l.indices&&(t.indices=Os(l.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function Ls(e,t,r=4,n,i){var a;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:e}),s=null==i||null===(a=i.parseSync)||void 0===a?void 0:a.call(i,{attributes:e}),c=n._addFauxAttributes(s.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}function*Rs(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}var Bs=Object.freeze({__proto__:null,name:"KHR_draco_mesh_compression",preprocess:function(e,t,r){const n=new jo(e);for(const e of Rs(n))n.getObjectExtension(e,"KHR_draco_mesh_compression")},decode:async function(e,t,r){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const i=new jo(e),a=[];for(const e of Rs(i))i.getObjectExtension(e,"KHR_draco_mesh_compression")&&a.push(Ms(i,e,t,r));await Promise.all(a),i.removeExtension("KHR_draco_mesh_compression")},encode:function(e,t={}){const r=new jo(e);for(const e of r.json.meshes||[])Ls(e),r.addRequiredExtension("KHR_draco_mesh_compression")}});var Js=Object.freeze({__proto__:null,name:"KHR_lights_punctual",decode:async function(e){const t=new jo(e),{json:r}=t,n=t.getExtension("KHR_lights_punctual");n&&(t.json.lights=n.lights,t.removeExtension("KHR_lights_punctual"));for(const e of r.nodes||[]){const r=t.getObjectExtension(e,"KHR_lights_punctual");r&&(e.light=r.light),t.removeObjectExtension(e,"KHR_lights_punctual")}},encode:async function(e){const t=new jo(e),{json:r}=t;if(r.lights){const e=t.addExtension("KHR_lights_punctual");Ao(!e.lights),e.lights=r.lights,delete r.lights}if(t.json.lights){for(const e of t.json.lights){const r=e.node;t.addObjectExtension(r,"KHR_lights_punctual",e)}delete t.json.lights}}});function js(e,t){const r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((t=>{e.uniforms[t].value&&!(t in r)&&(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((e=>{"object"==typeof r[e]&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}const Us=[$o,Yo,Zo,Bs,Js,Object.freeze({__proto__:null,name:"KHR_materials_unlit",decode:async function(e){const t=new jo(e),{json:r}=t;t.removeExtension("KHR_materials_unlit");for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,"KHR_materials_unlit")}},encode:function(e){const t=new jo(e),{json:r}=t;if(t.materials)for(const e of r.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}),Object.freeze({__proto__:null,name:"KHR_techniques_webgl",decode:async function(e){const t=new jo(e),{json:r}=t,n=t.getExtension("KHR_techniques_webgl");if(n){const e=function(e,t){const{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach((e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=a.decode(t.getTypedArrayForBufferView(e.bufferView))})),r.forEach((e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),i.forEach((e=>{e.program=r[e.program]})),i}(n,t);for(const n of r.materials||[]){const r=t.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,e[r.technique]),n.technique.values=js(n.technique,t)),t.removeObjectExtension(n,"KHR_techniques_webgl")}t.removeExtension("KHR_techniques_webgl")}},encode:async function(e,t){}})];function Vs(e,t){var r;const n=(null==t||null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}const Ks={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},zs={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Gs{constructor(){zn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),zn(this,"json",void 0)}normalize(e,t){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){const t=new jo(e),{json:r}=t;for(const e of r.images||[]){const r=t.getObjectExtension(e,"KHR_binary_glTF");r&&Object.assign(e,r),t.removeObjectExtension(e,"KHR_binary_glTF")}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Ks)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const r=e[t];if(r&&!Array.isArray(r)){e[t]=[];for(const n in r){const i=r[n];i.id=i.id||n;const a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}}_convertObjectIdsToArrayIndices(e){for(const t in Ks)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:r,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map((e=>this._convertIdToIndex(e,"node")))),e.meshes&&(e.meshes=e.meshes.map((e=>this._convertIdToIndex(e,"mesh"))))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map((e=>this._convertIdToIndex(e,"node"))))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const r of e[t])for(const e in r){const t=r[e],n=this._convertIdToIndex(t,e);r[e]=n}}_convertIdToIndex(e,t){const r=zs[t];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=t.values&&t.values.tex,n=e.textures.findIndex((e=>e.id===r));-1!==n&&(t.pbrMetallicRoughness.baseColorTexture={index:n})}}}const qs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ws={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hs=10240,Qs=10241,Xs=10242,$s=10243,Ys=10497,Zs={magFilter:Hs,minFilter:Qs,wrapS:Xs,wrapT:$s},ec={[Hs]:9729,[Qs]:9986,[Xs]:Ys,[$s]:Ys};class tc{constructor(){zn(this,"baseUri",""),zn(this,"json",{}),zn(this,"buffers",[]),zn(this,"images",[])}postProcess(e,t={}){const{json:r,buffers:n=[],images:i=[],baseUri:a=""}=e;return Ao(r),this.baseUri=a,this.json=r,this.buffers=n,this.images=i,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map(((e,t)=>this._resolveBufferView(e,t)))),e.images&&(e.images=e.images.map(((e,t)=>this._resolveImage(e,t)))),e.samplers&&(e.samplers=e.samplers.map(((e,t)=>this._resolveSampler(e,t)))),e.textures&&(e.textures=e.textures.map(((e,t)=>this._resolveTexture(e,t)))),e.accessors&&(e.accessors=e.accessors.map(((e,t)=>this._resolveAccessor(e,t)))),e.materials&&(e.materials=e.materials.map(((e,t)=>this._resolveMaterial(e,t)))),e.meshes&&(e.meshes=e.meshes.map(((e,t)=>this._resolveMesh(e,t)))),e.nodes&&(e.nodes=e.nodes.map(((e,t)=>this._resolveNode(e,t)))),e.skins&&(e.skins=e.skins.map(((e,t)=>this._resolveSkin(e,t)))),e.scenes&&(e.scenes=e.scenes.map(((e,t)=>this._resolveScene(e,t)))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((e=>this.getNode(e))),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((e=>this.getNode(e)))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(((e,t)=>{const r=this.getMesh(t);return e.id=r.id,e.primitives=e.primitives.concat(r.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((e=>{const t=(e={...e}).attributes;e.attributes={};for(const r in t)e.attributes[r]=this.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e}))),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Ws[r]),e.components=(n=e.type,qs[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:r,byteLength:n}=Bo(e,e.bufferView),i=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let a=t.arrayBuffer.slice(i,i+n);e.bufferView.byteStride&&(a=this._getValueFromInterleavedBuffer(t,i,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new r(a)}return e}_getValueFromInterleavedBuffer(e,t,r,n,i){const a=new Uint8Array(i*n);for(let o=0;o20);const n=t.getUint32(r+0,nc),i=t.getUint32(r+4,nc);return r+=8,On(0===i),ac(e,t,r,n),r+=n,r+=oc(e,t,r,e.header.byteLength)}(e,i,r);case 2:return function(e,t,r,n){return On(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){const i=t.getUint32(r+0,nc),a=t.getUint32(r+4,nc);switch(r+=8,a){case 1313821514:ac(e,t,r,i);break;case 5130562:oc(e,t,r,i);break;case 0:n.strict||ac(e,t,r,i);break;case 1:n.strict||oc(e,t,r,i)}r+=_i(i,4)}}(e,t,r,n),r+e.header.byteLength}(e,i,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function ac(e,t,r,n){const i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),_i(n,4)}function oc(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),_i(n,4)}async function sc(e,t,r=0,n,i){var a,o,s,c;!function(e,t,r,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!function(e,t=0,r={}){const n=new DataView(e),{magic:i=rc}=r,a=n.getUint32(t,!1);return a===i||a===rc}(t,r,n)){t=(new TextDecoder).decode(t)}if("string"==typeof t)e.json=ci(t);else if(t instanceof ArrayBuffer){const i={};r=ic(i,t,r,n.glb),Ao("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else Ao(!1,"GLTF: must be ArrayBuffer or string");const i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const a=e.json.images||[];e.images=new Array(a.length).fill({})}(e,t,r,n),function(e,t={}){(new Gs).normalize(e,t)}(e,{normalize:null==n||null===(a=n.gltf)||void 0===a?void 0:a.normalize}),function(e,t={},r){const n=Us.filter((e=>Vs(e.name,t)));for(const a of n){var i;null===(i=a.preprocess)||void 0===i||i.call(a,e,t,r)}}(e,n,i);const l=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&e.json.buffers&&await async function(e,t,r){const n=e.json.buffers||[];for(let o=0;oVs(e.name,t)));for(const a of n){var i;await(null===(i=a.decode)||void 0===i?void 0:i.call(a,e,t,r))}}(e,n,i);return l.push(u),await Promise.all(l),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(e,t){return(new tc).postProcess(e,t)}(e,n):e}async function cc(e,t,r,n,i){const{fetch:a,parse:o}=i;let s;if(t.uri){const e=No(t.uri,n),r=await a(e);s=await r.arrayBuffer()}if(Number.isFinite(t.bufferView)){const r=function(e,t,r){const n=e.bufferViews[r];Ao(n);const i=t[n.buffer];Ao(i);const a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}(e.json,e.buffers,t.bufferView);s=di(r.buffer,r.byteOffset,r.byteLength)}Ao(s,"glTF image has no data");let c=await o(s,[Co,oo],{mimeType:t.mimeType,basis:n.basis||{format:ao()}},i);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c}),e.images=e.images||[],e.images[r]=c}const lc={name:"glTF",id:"gltf",module:"gltf",version:"3.1.8",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e,t={},r){(t={...lc.options,...t}).gltf={...lc.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await sc({},e,n,t,r)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const uc={name:"GLB",id:"glb",module:"gltf",version:"3.1.8",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,parse:async function(e,t){return dc(e,t)},parseSync:dc,options:{glb:{strict:!1}}};function dc(e,t){const{byteOffset:r=0}=t||{},n={};return ic(n,e,r,null==t?void 0:t.glb),n}class _c{constructor(e,t,r){this.firstIndex=e,this.indexCount=t,this.materialID=r}}class pc{constructor(e=[]){this.primitives=e}}class fc{static async loadFromURL(e){let t=new Cc,r=function(e,t){return e.slice(-t.length)===t}(e,".glb");const n=await async function(e,t,r,n){Array.isArray(t)||ca(t)||(r=t,t=void 0);const i=ia(r);let a=e;return"string"==typeof e&&(a=await i(e)),bi(e)&&(a=await i(e)),await Ea(a,t,r)}(e,r?uc:lc,{gltf:{loadBuffers:!0,loadImages:!0}});console.log(n);let i,a=[];if(r){for(let e of n.binChunks)a.push(new mc(e.arrayBuffer.slice(e.byteOffset)));i=n.json}else i=n;let o=[];for(let e of i.bufferViews)r?o.push(gc.fromBuffer(a[e.buffer],e.byteOffset,e.byteLength,e.byteStride)):o.push(gc.fromData(e.data,e.byteOffset,e.byteLength,e.byteStride));let l=[];for(let e of i.accessors){let t=xc(e.bufferView);l.push(new hc(o[t],e.byteOffset,e.count,e.componentType,e.type,e.max,e.min))}let u=[];if(void 0!==i.images)for(let e of i.images)if(void 0!==e.bufferView){let t=o[xc(e.bufferView)],r=new Blob([t.data],{type:e.mimeType}),n=window.URL||window.webkitURL,i=n.createObjectURL(r),a=new Image;a.src=i,await a.decode(),n.revokeObjectURL(i);let s=await createImageBitmap(a);u.push(s)}else u.push(e.image);let d=[];if(void 0!==i.textures)for(let e of i.textures)d.push(new Dc(xc(e.source)));for(let e=0;e{let r=Nn(e),n=Lc(gr,r);switch(e){case En.Position:t.position=n;break;case En.Normal:t.normal=n;break;case En.Tangent:t.tangent=n;break;case En.TexCoords0:t.texCoords0=n;break;case En.TexCoords1:t.texCoords1=n;break;case En.Color:t.color=n;break;case En.Joints:t.joints=Lc(mr,r);break;case En.Weights:t.weights=n;break;default:s("vert attr is None or All")}})),Bc(t)}(this.vertexAttribSet),this.vertices.length);await e.fromArray(this.vertices);let t=yr(mr,this.indices.length);await t.fromArray(this.indices);let r=yr(new Tn(0).getInfoKernelType(),this.materials.length),n=this.materials.map((e=>e.getInfo()));await r.fromArray(n);let i,a=yr(Pn.getKernelType(),this.nodes.length);return await a.fromArray(this.nodes),this.lights.length>0&&(i=yr(In.getKernelType(),this.lights.length),await i.fromArray(this.lights)),{vertexBuffer:e,indexBuffer:t,materialInfoBuffer:r,nodesBuffer:a,lightsInfoBuffer:i}}init(){this.computeGlobalTransforms()}computeGlobalTransforms(){let e=(t,r)=>{let n=this.nodes[t];n.globalTransform=r.mul(n.localTransform);for(let t of n.children)e(t,n.globalTransform)};e(this.rootNode,new Fn)}async add(e,t=new Fn){let r=this.nodes.length;this.nodes=this.nodes.concat(e.nodes);let n=this.vertices.length;this.vertices=this.vertices.concat(e.vertices);let i=this.indices.length;for(let t=0;te+r)),-1!==t.mesh&&(t.mesh+=o);for(let t of e.materials)t.materialID+=a;for(let t of e.meshes)for(let e of t.primitives)e.firstIndex+=i,e.materialID+=a;return this.init(),s}async addGLTF(e,t=new Fn){let r=await fc.loadFromURL(e);return await this.add(r,t)}}class Tc{constructor(e){this.materialIndex=e}static getKernelType(){return Bc({materialIndex:mr})}}class Ec{constructor(e,t,r=[0,1,0],n=45,i=.1,a=1e3){this.position=e,this.direction=t,this.up=r,this.fov=n,this.near=i,this.far=a,this.view=[],this.projection=[],this.viewProjection=[]}computeMatrices(e){this.view=_n(this.position,Mr(this.position,this.direction),this.up),this.projection=pn(this.fov,e,this.near,this.far),this.viewProjection=zr(this.projection,this.view)}static getKernelType(){return Bc({position:Lc(gr,3),direction:Lc(gr,3),up:Lc(gr,3),fov:gr,near:gr,far:gr,view:Rc(gr,4,4),projection:Rc(gr,4,4),viewProjection:Rc(gr,4,4)})}track(e,t=2,r=2,n=.01){let i=!1,a=0,o=0;e.onmousedown=t=>{i=!0,a=t.offsetX/e.width,o=t.offsetY/e.height},e.onmouseup=e=>{i=!1},e.onmousemove=n=>{if(i){let i=n.offsetX/e.width,s=n.offsetY/e.height,c=i-a,l=s-o,[u,d]=(e=>{e=Ur(e);let t,r=Math.asin(e[1]),n=-e[0]/Math.cos(r),i=-e[2]/Math.cos(r);return Math.abs(n)<1e-6?t=0:(t=Math.acos(i),n<0&&(t=-t)),[t,r]})(Ur(this.direction));u+=c*t,d+=l*r;let _=Math.PI/2*.99;d>_&&(d=_),d<-_&&(d=-_),this.direction=((e,t)=>{let r=[0,0,0];return r[0]=-Math.sin(e)*Math.cos(t),r[1]=Math.sin(t),r[2]=-Math.cos(e)*Math.cos(t),r})(u,d),a=i,o=s}},e.onwheel=e=>{this.position=Mr(this.position,Rr(this.direction,-e.deltaY*n))}}}class kc{constructor(e=0,t=0,r=0,n=0,i=0){this.indexCount=e,this.instanceCount=t,this.firstIndex=r,this.baseVertex=n,this.firstInstance=i}static getKernelType(){return Bc({indexCount:mr,instanceCount:mr,firstIndex:mr,baseVertex:mr,firstInstance:mr})}}class Ac{constructor(e=0,t=0){this.nodeIndex=e,this.materialIndex=t}static getKernelType(){return Bc({nodeIndex:mr,materialIndex:mr})}}class Nc{static beginsWith(e,t){return e.trim().split(" ").filter((e=>0!==e.length))[0]===t}static tailWords(e){return e.trim().split(" ").filter((e=>0!==e.length)).splice(1)}static lastWord(e){let t=this.tailWords(e);return t[t.length-1]}static expandToVecN(e,t){let r=[];for(let n=0;nparseFloat(e))),t)}}class wc{static async loadFromURL(e){let t=await fetch(e),r=await t.text(),n=[],i=e.split("/"),a=i.slice(0,i.length-1).join("/")+"/",o=r.split("\n"),s=null;for(let e=0;e0;){if(p(l)128){if(c=(255&d[0])-128,0==c||c>s-o)throw new Error("Bad scanline data");for(;c-- >0;)u[o++]=d[1]}else{if(c=255&d[0],0==c||c>s-o)throw new Error("Bad scanline data");if(u[o++]=d[1],--c>0){if(f(u,o,c) {\n for (let I of ti.ndrange(imgField.dimensions[0], imgField.dimensions[1])) {\n let x = I.y;\n let y = imgField.dimensions[0] - I.x;\n ti.textureStore(imgTexture, [x, y], imgField[I]);\n }\n }")),this.imgFieldToTexture}static async loadFromURL(e){let t=await fetch(e),r=await t.arrayBuffer(),n=Fc(new Uint8Array(r)),i=n.shape[0],a=n.shape[1],o=Array.from(n.data),s=hr.field(4,gr,[a,i]);await s.fromArray1D(o);let c=Sr(4,[i,a]);return this.getImgFieldToTextureKernel()(s,c),new Pc(c,n.exposure)}}Ic.imgFieldToTexture=void 0;class Oc{constructor(e,t,r=[1024,1024],n=1){this.physicalSize=e,this.maxDistance=t,this.shadowMapResolution=r,this.strength=n,this.view=[],this.projection=[],this.viewProjection=[]}static createIblShadowInfo(e,t,r,n,i=[1024,1024],a=1){let o=new Oc(r,n,i,a);o.view=_n(e,Mr(e,t),[0,1,0]);let s=r;return o.projection=fn(-.5*s[0],.5*s[0],-.5*s[1],.5*s[0],0,n),o.viewProjection=zr(o.projection,o.view),o}}var Mc=Object.freeze({__proto__:null,MaterialAttribute:Cn,Material:Tn,Scene:Cc,Renderer:class{constructor(e,t){this.scene=e,this.htmlCanvas=t,this.batchInfos=[],this.batchesDrawInfos=[],this.batchesDrawInstanceInfos=[],this.batchesDrawInfoBuffers=[],this.batchesDrawInstanceInfoBuffers=[],this.lightShadowMaps=[],this.iblShadowMaps=[],this.geometryOnlyDrawInfos=[],this.geometryOnlyDrawInstanceInfos=[],this.engine=Mc,this.uvToDir=()=>{},this.dirToUV=()=>{},this.tonemap=()=>{},this.characteristic=()=>{},this.ggxDistribution=()=>{},this.getNormal=()=>{},this.getLightBrightnessAndDir=()=>{},this.lerp=()=>{},this.linearTosRGB=()=>{},this.sRGBToLinear=()=>{},this.fresnel=()=>{},this.evalSpecularBRDF=()=>{},this.evalDiffuseBRDF=()=>{},this.evalMetalBRDF=()=>{},this.evalDielectricBRDF=()=>{},this.evalBRDF=()=>{},this.evalShadow=()=>{},this.evalIBL=()=>{},this.hammersley2d=()=>{},this.generateTBN=()=>{},this.cosineSampleHemisphere=()=>{},this.cosineSampleHemispherePdf=()=>{},this.zPrePassKernel=()=>{},this.gPrePassKernel=()=>{},this.shadowKernel=()=>{},this.renderKernel=()=>{},this.ssaoKernel=()=>{},this.ssaoBlurKernel=()=>{},this.combineKernel=()=>{},this.presentKernel=()=>{},this.depthPrePassTexture=Cr([t.width,t.height],1),this.depthTexture=Cr([t.width,t.height],4),this.gNormalTexture=Sr(4,[t.width,t.height],4),this.gPositionTexture=Sr(4,[t.width,t.height],4),this.directLightingTexture=Sr(4,[t.width,t.height],4),this.environmentLightingTexture=Sr(4,[t.width,t.height],4),this.renderResultTexture=Sr(4,[t.width,t.height],4),this.ssaoTexture=Sr(4,[t.width,t.height],4),this.ssaoBlurredTexture=Sr(4,[t.width,t.height],1),this.canvasTexture=Dr(t,4),this.quadVBO=yr(Lc(gr,2),4),this.quadIBO=yr(mr,6),this.ssaoSamples=yr(Lc(gr,3),[32,5,5])}async init(){this.sceneData=await this.scene.getKernelData();for(let e of this.scene.lights)if(e.castsShadow){c(e.type===kn.Directional,"only directional lights can be shadow casters"),c(void 0!==e.shadow,"expexcting shadow info"),this.lightShadowMaps.push(Cr(e.shadow.shadowMapResolution,1)),e.shadow.view=_n(e.position,Mr(e.position,e.direction),[0,1,0]);let t=e.shadow.physicalSize;e.shadow.projection=fn(-.5*t[0],.5*t[0],-.5*t[1],.5*t[0],0,e.shadow.maxDistance),e.shadow.viewProjection=zr(e.shadow.projection,e.shadow.view)}for(let e of this.scene.iblShadows)this.iblShadowMaps.push(Cr(e.shadowMapResolution,1));await this.quadVBO.fromArray([[-1,-1],[1,-1],[-1,1],[1,1]]),await this.quadIBO.fromArray([0,1,2,1,3,2]),await this.computeDrawBatches(),await this.initHelperFuncs(),await this.initIBL(),await this.initSSAO(),await this.initKernels()}async initHelperFuncs(){this.uvToDir="(uv: ti.types.vector): ti.types.vector => {\n let y = Math.cos((1.0 - uv[1]) * Math.PI);\n let phi = ((uv[0] - 0.5) * Math.PI) / 0.5;\n let absZOverX = Math.abs(Math.tan(phi));\n let xSquared = (1.0 - y * y) / (1.0 + absZOverX * absZOverX);\n let x = Math.sqrt(xSquared);\n let z = x * absZOverX;\n if (Math.abs(phi) >= Math.PI * 0.5) {\n x = -x;\n }\n if (phi < 0) {\n z = -z;\n }\n return [x, y, z];\n }",this.dirToUV="(dir: ti.types.vector): ti.types.vector => {\n return [0.5 + (0.5 * Math.atan2(dir[2], dir[0])) / Math.PI, 1.0 - Math.acos(dir[1]) / Math.PI];\n }",this.tonemap="(color: ti.types.vector, exposure: number) => {\n let A = 2.51;\n let B = 0.03;\n let C = 2.43;\n let D = 0.59;\n let E = 0.14;\n //@ts-ignore\n let temp = color * exposure;\n temp = (temp * (A * temp + B)) / (temp * (C * temp + D) + E);\n return Math.max(0.0, Math.min(1.0, temp));\n }",this.characteristic="(x: number) => {\n let result = 1;\n if (x < 0) {\n result = 0;\n }\n return result;\n }",this.ggxDistribution="(NdotH: number, alpha: number) => {\n let numerator = alpha * alpha * this.characteristic(NdotH);\n let temp = NdotH * NdotH * (alpha * alpha - 1) + 1;\n let denominator = Math.PI * temp * temp;\n return numerator / denominator;\n }",this.getLightBrightnessAndDir="(light: any, fragPos: ti.types.vector) => {\n let brightness: ti.types.vector = [0.0, 0.0, 0.0];\n let lightDir: ti.types.vector = [0.0, 0.0, 0.0];\n if (light.type === this.engine.LightType.Point || light.type === this.engine.LightType.Spot) {\n let fragToLight = light.position - fragPos;\n let distance = ti.norm(fragToLight);\n let attenuation = 1.0 / Math.max(distance * distance, 0.01 * 0.01);\n let window = (1 - (distance / light.influenceRadius) ** 2) ** 4;\n //@ts-ignore\n brightness = light.brightness * attenuation * window;\n if (light.type === this.engine.LightType.Spot) {\n let cosAngle = ti.dot(-ti.normalized(fragToLight), light.direction);\n let spotScale =\n 1.0 / Math.max(Math.cos(light.innerConeAngle) - Math.cos(light.outerConeAngle), 1e-4);\n let spotOffset = -Math.cos(light.outerConeAngle) * spotScale;\n let t = cosAngle * spotScale + spotOffset;\n t = Math.max(0.0, Math.min(1.0, t));\n //@ts-ignore\n brightness = brightness * t * t;\n }\n lightDir = ti.normalized(fragToLight);\n } else if (light.type === this.engine.LightType.Directional) {\n brightness = light.brightness;\n lightDir = -light.direction;\n }\n return {\n brightness,\n lightDir,\n };\n }",this.lerp="(x: ti.types.vector | number, y: ti.types.vector | number, s: number): ti.types.vector | number => {\n return x * (1.0 - s) + y * s;\n }",this.linearTosRGB="(x: ti.types.vector | number): ti.types.vector | number => {\n return Math.pow(x, 1.0 / 2.2);\n }",this.sRGBToLinear="(x: ti.types.vector | number): ti.types.vector | number => {\n return Math.pow(x, 2.2);\n }",this.fresnel="(F0: ti.types.vector | number, directions: any) => {\n return F0 + (1.0 - F0) * (1.0 - Math.abs(directions.HdotV)) ** 5;\n }",this.evalSpecularBRDF="(alpha: number, Fr: ti.types.vector | number, directions: any) => {\n let D = this.ggxDistribution(directions.NdotH, alpha);\n let NdotL = Math.abs(directions.NdotL);\n let NdotV = Math.abs(directions.NdotV);\n let G2_Over_4_NdotL_NdotV = 0.5 / this.lerp(2 * NdotL * NdotV, NdotL + NdotV, alpha);\n return (\n G2_Over_4_NdotL_NdotV *\n D *\n Fr *\n this.characteristic(directions.HdotL) *\n this.characteristic(directions.HdotV)\n );\n }",this.evalDiffuseBRDF="(albedo: any, directions: any) => {\n return (\n albedo * (1.0 / Math.PI) * this.characteristic(directions.NdotL) * this.characteristic(directions.NdotV)\n );\n }",this.evalMetalBRDF="(alpha: number, baseColor: ti.types.vector, directions: any) => {\n let F0 = baseColor;\n let Fr = this.fresnel(F0, directions);\n return this.evalSpecularBRDF(alpha, Fr, directions);\n }",this.evalDielectricBRDF="(alpha: number, baseColor: ti.types.vector, directions: any) => {\n let dielectricF0: ti.types.vector = [0.04, 0.04, 0.04];\n let Fr = this.fresnel(dielectricF0, directions);\n let specular = this.evalSpecularBRDF(alpha, Fr, directions);\n let diffuse = this.evalDiffuseBRDF(baseColor, directions);\n return diffuse * (1 - Fr) + specular;\n }",this.evalBRDF="(material: any, normal: ti.types.vector, lightDir: ti.types.vector, viewDir: ti.types.vector) => {\n let halfDir = ti.normalized(viewDir + lightDir);\n let directions = {\n normal: normal,\n lightDir: lightDir,\n viewDir: viewDir,\n halfDir: halfDir,\n NdotH: ti.dot(normal, halfDir),\n NdotV: ti.dot(normal, viewDir),\n NdotL: ti.dot(normal, lightDir),\n HdotV: ti.dot(halfDir, viewDir),\n HdotL: ti.dot(halfDir, lightDir),\n };\n let alpha = material.roughness * material.roughness;\n let metallicBRDF = this.evalMetalBRDF(alpha, material.baseColor.rgb, directions);\n let dielectricBRDF = this.evalDielectricBRDF(alpha, material.baseColor.rgb, directions);\n return material.metallic * metallicBRDF + (1.0 - material.metallic) * dielectricBRDF;\n }",this.evalShadow="(pos: ti.types.vector, shadowMap: DepthTexture, shadowInfo: ShadowInfo) => {\n let vp = shadowInfo.viewProjection;\n let clipSpacePos = ti.matmul(vp, pos.concat([1.0]));\n let depth = clipSpacePos.z / clipSpacePos.w;\n let coords: ti.types.vector = (clipSpacePos.xy / clipSpacePos.w) * 0.5 + 0.5;\n coords.y = 1.0 - coords.y;\n let visibility = ti.textureSampleCompare(shadowMap, coords, depth - 0.001);\n let contribution = 1.0 - (1.0 - visibility) * shadowInfo.strength;\n return contribution;\n }",this.evalIBL="(material: any, normal: ti.types.vector, viewDir: ti.types.vector, pos: ti.types.vector) => {\n let dielectricF0: ti.types.vector = [0.04, 0.04, 0.04];\n let result: ti.types.vector = [0.0, 0.0, 0.0];\n if (ti.Static(this.scene.ibl !== undefined)) {\n let diffuseColor = (1.0 - material.metallic) * (1.0 - dielectricF0) * material.baseColor.rgb;\n let normalUV = this.dirToUV(normal);\n let diffuseLight = ti.textureSample(this.iblLambertianFiltered!, normalUV).rgb;\n let diffuse = diffuseColor * diffuseLight;\n\n let specularColor =\n (1.0 - material.metallic) * dielectricF0 + material.metallic * material.baseColor.rgb;\n let reflection = ti.normalized(2.0 * normal * ti.dot(normal, viewDir) - viewDir);\n let reflectionUV = this.dirToUV(reflection);\n let specularLight = ti.textureSample(\n this.iblGGXFiltered!,\n reflectionUV.concat([material.roughness])\n ).rgb;\n let NdotV = ti.dot(normal, viewDir);\n let scaleBias = ti.textureSample(this.LUT!, [NdotV, material.roughness]).rg;\n let specular = specularLight * (specularColor * scaleBias[0] + scaleBias[1]);\n\n result = specular + diffuse;\n for (let i of ti.Static(ti.range(this.scene.iblShadows.length))) {\n let contribution = this.evalShadow(pos, this.iblShadowMaps[i], this.scene.iblShadows[i]);\n result *= contribution;\n }\n result = result * this.scene.iblIntensity;\n }\n return result;\n }",this.getNormal="(\n normal: ti.types.vector,\n normalMap: ti.types.vector,\n texCoords: ti.types.vector,\n position: ti.types.vector\n ) => {\n let uvDx: ti.types.vector = ti.dpdx(texCoords.concat([0.0]));\n let uvDy: ti.types.vector = ti.dpdy(texCoords.concat([0.0]));\n let posDx: ti.types.vector = ti.dpdx(position);\n let posDy: ti.types.vector = ti.dpdy(position);\n let denom = uvDx[0] * uvDy[1] - uvDy[0] * uvDx[1];\n let temp = (uvDy[1] * posDx - uvDx[1] * posDy) / denom;\n let tangent = temp - normal * ti.dot(normal, temp);\n let tangentNorm = ti.norm(tangent);\n let bitangent = ti.cross(normal, tangent);\n let bitangentNorm = ti.norm(bitangent);\n let mat = ti.transpose([tangent / tangentNorm, bitangent / bitangentNorm, normal]);\n let normalMapValue = ti.normalized(normalMap * 2.0 - 1.0);\n let result = ti.normalized(ti.matmul(mat, normalMapValue));\n if (denom === 0.0 || tangentNorm === 0.0 || bitangentNorm === 0.0) {\n result = normal;\n }\n return result;\n }",this.hammersley2d="(i: number, N: number) => {\n let radicalInverseVdC = (bits: number) => {\n bits = (bits << 16) | (bits >>> 16);\n bits = ((bits & 0x55555555) << 1) | ((bits & 0xaaaaaaaa) >>> 1);\n bits = ((bits & 0x33333333) << 2) | ((bits & 0xcccccccc) >>> 2);\n bits = ((bits & 0x0f0f0f0f) << 4) | ((bits & 0xf0f0f0f0) >>> 4);\n bits = ((bits & 0x00ff00ff) << 8) | ((bits & 0xff00ff00) >>> 8);\n //@ts-ignore\n let result = f32(bits) * 2.3283064365386963e-10;\n if (bits < 0) {\n //@ts-ignore\n result = 1.0 + f32(bits) * 2.3283064365386963e-10;\n }\n return result;\n };\n //@ts-ignore\n return [f32(i) / N, radicalInverseVdC(i32(i))];\n }",this.generateTBN="(normal: ti.types.vector) => {\n let bitangent = [0.0, 1.0, 0.0];\n\n let NdotUp = ti.dot(normal, [0.0, 1.0, 0.0]);\n let epsilon = 0.0000001;\n if (1.0 - Math.abs(NdotUp) <= epsilon) {\n // Sampling +Y or -Y, so we need a more robust bitangent.\n if (NdotUp > 0.0) {\n bitangent = [0.0, 0.0, 1.0];\n } else {\n bitangent = [0.0, 0.0, -1.0];\n }\n }\n\n let tangent = ti.normalized(ti.cross(bitangent, normal));\n bitangent = ti.cross(normal, tangent);\n\n return ti.transpose([tangent, bitangent, normal]);\n }",this.cosineSampleHemisphere="(randomSource: ti.types.vector) => {\n let concentricSampleDisk = (randomSource: ti.types.vector) => {\n let result: ti.types.vector = [0.0, 0.0];\n let uOffset: ti.types.vector = 2.0 * randomSource - 1.0;\n if (uOffset.x !== 0 || uOffset.y !== 0) {\n let theta = 0.0;\n let r = 0.0;\n if (Math.abs(uOffset.x) > Math.abs(uOffset.y)) {\n r = uOffset.x;\n theta = (Math.PI / 4.0) * (uOffset.y / uOffset.x);\n } else {\n r = uOffset.y;\n theta = Math.PI / 2.0 - (Math.PI / 4.0) * (uOffset.x / uOffset.y);\n }\n //@ts-ignore\n result = r * [Math.cos(theta), Math.sin(theta)];\n }\n return result;\n };\n let d = concentricSampleDisk(randomSource);\n let z = Math.sqrt(Math.max(0.0, 1 - d.x * d.x - d.y * d.y));\n return [d.x, d.y, z];\n }",this.cosineSampleHemispherePdf="(sampled: ti.types.vector) => {\n let cosTheta = sampled.z;\n return cosTheta / Math.PI;\n }"}async initKernels(){this.zPrePassKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthPrePassTexture);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n //no-op\n }\n }"),this.gPrePassKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.gNormalTexture, [0.0, 0.0, 0.0, 0.0]);\n ti.clearColor(this.gPositionTexture, [0.0, 0.0, 0.0, 0.0]);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let normal = ti.normalized(f.normal);\n ti.outputColor(this.gNormalTexture, normal.concat([1.0]));\n ti.outputColor(this.gPositionTexture, f.position.concat([1.0]));\n }\n }"),this.renderKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.directLightingTexture, [0, 0, 0, 1]);\n ti.clearColor(this.environmentLightingTexture, [0, 0, 0, 1]);\n\n for (let batchID of ti.Static(ti.range(this.batchesDrawInfoBuffers.length))) {\n let getMaterial = (fragment: any, materialID: number) => {\n //@ts-ignore\n let materialInfo = this.sceneData.materialInfoBuffer[materialID];\n let material = {\n baseColor: materialInfo.baseColor.value,\n metallic: materialInfo.metallicRoughness.value[0],\n roughness: materialInfo.metallicRoughness.value[1],\n emissive: materialInfo.emissive.value,\n normalMap: materialInfo.normalMap.value,\n };\n if (ti.Static(this.batchInfos[batchID].materialIndex != -1)) {\n let texCoords = fragment.texCoords0;\n let materialRef = this.scene.materials[this.batchInfos[batchID].materialIndex];\n if (ti.Static(materialRef.baseColor.texture !== undefined)) {\n if (ti.Static(materialRef.baseColor.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledBaseColor = ti.textureSample(materialRef.baseColor.texture!, texCoords);\n sampledBaseColor.rgb = this.sRGBToLinear(sampledBaseColor.rgb);\n material.baseColor *= sampledBaseColor;\n }\n if (ti.Static(materialRef.metallicRoughness.texture !== undefined)) {\n if (ti.Static(materialRef.metallicRoughness.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let metallicRoughness = ti.textureSample(materialRef.metallicRoughness.texture!, texCoords);\n material.metallic *= metallicRoughness.b;\n material.roughness *= metallicRoughness.g;\n }\n if (ti.Static(materialRef.emissive.texture !== undefined)) {\n if (ti.Static(materialRef.emissive.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledEmissive = ti.textureSample(materialRef.emissive.texture!, texCoords).rgb;\n sampledEmissive = this.sRGBToLinear(sampledEmissive);\n material.emissive *= sampledEmissive;\n }\n if (ti.Static(materialRef.normalMap.texture !== undefined)) {\n if (ti.Static(materialRef.normalMap.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledNormal = ti.textureSample(materialRef.normalMap.texture!, texCoords).rgb;\n material.normalMap = sampledNormal;\n }\n }\n return material;\n };\n\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.batchesDrawInfoBuffers[batchID]),\n ti.Static(this.batchesDrawInfoBuffers[batchID].dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.batchesDrawInstanceInfoBuffers[batchID][instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n let materialIndex = instanceInfo.materialIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = camera.viewProjection.matmul(v.position.concat([1.0]));\n ti.outputPosition(pos);\n let vertexOutput = ti.mergeStructs(v, { materialIndex: materialIndex });\n ti.outputVertex(vertexOutput);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let materialID = f.materialIndex;\n let material = getMaterial(f, materialID);\n let normal = f.normal.normalized();\n normal = this.getNormal(normal, material.normalMap, f.texCoords0, f.position);\n let viewDir = ti.normalized(camera.position - f.position);\n\n let directLighting: ti.types.vector = [0.0, 0.0, 0.0];\n directLighting += material.emissive;\n\n let evalLight = (light: any) => {\n let brightnessAndDir = this.getLightBrightnessAndDir(light, f.position);\n let brdf = this.evalBRDF(material, normal, brightnessAndDir.lightDir, viewDir);\n return brightnessAndDir.brightness * brdf;\n };\n\n if (ti.Static(this.scene.lights.length > 0)) {\n for (let i of ti.range(this.scene.lights.length)) {\n //@ts-ignore\n let light = this.sceneData.lightsInfoBuffer[i];\n if (!light.castsShadow) {\n directLighting += evalLight(light);\n }\n }\n for (let i of ti.Static(ti.range(this.scene.lights.length))) {\n if (ti.Static(this.scene.lights[i].castsShadow)) {\n directLighting +=\n evalLight(this.scene.lights[i]) *\n this.evalShadow(f.position, this.lightShadowMaps[i]!, this.scene.lights[i].shadow!);\n }\n }\n }\n\n let environmentLighting: ti.types.vector = this.evalIBL(material, normal, viewDir, f.position);\n directLighting += environmentLighting;\n\n ti.outputColor(this.directLightingTexture, directLighting.concat([1.0]));\n ti.outputColor(this.environmentLightingTexture, environmentLighting.concat([1.0]));\n }\n }\n if (ti.Static(this.scene.ibl !== undefined)) {\n for (let v of ti.inputVertices(this.skyboxVBO!, this.skyboxIBO!)) {\n let pos = camera.viewProjection.matmul((v + camera.position).concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (1.0 > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy))) {\n ti.discard();\n }\n let dir = f.normalized();\n let uv = this.dirToUV(dir);\n let color = ti.textureSample(this.iblGGXFiltered!, uv.concat([this.scene.iblBackgroundBlur]));\n //color *= this.scene.iblIntensity\n color.rgb = this.tonemap(color.rgb, this.scene.ibl!.exposure);\n color[3] = 1.0;\n ti.outputColor(this.directLightingTexture, color);\n ti.outputColor(this.environmentLightingTexture, [0.0, 0.0, 0.0, 0.0]);\n ti.outputDepth(1.0);\n }\n }\n }"),this.ssaoKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.ssaoTexture, [0, 0, 0, 1]);\n\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let normal = f.normal.normalized();\n let TBN = this.generateTBN(normal);\n\n let clipSpacePos = ti.matmul(camera.viewProjection, f.position.concat([1.0]));\n let screenSpaceCoords: ti.types.vector = (clipSpacePos.xy / clipSpacePos.w) * 0.5 + 0.5;\n //@ts-ignore\n let texelIndex = ti.i32(\n [screenSpaceCoords.x, 1.0 - screenSpaceCoords.y] *\n ([this.htmlCanvas.width, this.htmlCanvas.height] - 1)\n );\n let indexInBlock: ti.types.vector = [\n texelIndex.x % this.ssaoSamples.dimensions[1],\n texelIndex.y % this.ssaoSamples.dimensions[2],\n ];\n //@ts-ignore\n let numSamples = this.ssaoSamples.dimensions[0];\n let sampleRadius = ti.norm(camera.position - f.position) * 0.05;\n\n let sumVisibility = 0.0;\n\n for (let i of ti.range(numSamples)) {\n //@ts-ignore\n let ssaoSample = this.ssaoSamples[[i, indexInBlock.x, indexInBlock.y]];\n let deltaPos = ti.matmul(TBN, ssaoSample) * sampleRadius;\n let sampledPoint = deltaPos + f.position;\n let sampledPointClipSpace = ti.matmul(camera.viewProjection, sampledPoint.concat([1.0]));\n //@ts-ignore\n let sampledPointDepth = sampledPointClipSpace.z / sampledPointClipSpace.w;\n let sampledPointScreenSpace: ti.types.vector =\n (sampledPointClipSpace.xy / sampledPointClipSpace.w) * 0.5 + 0.5;\n let texCoords = [sampledPointScreenSpace.x, 1.0 - sampledPointScreenSpace.y];\n\n let vis = 1.0;\n //@ts-ignore\n if (\n sampledPointDepth >=\n ti.textureLoad(\n this.depthPrePassTexture,\n ti.i32(texCoords * (this.depthPrePassTexture.dimensions - 1))\n )\n ) {\n vis = 0.0;\n }\n sumVisibility += vis; // should multiply by cosTheta here (see games 202 lecture), but this is cancelled by dividing the PDF\n }\n let meanVisibility = sumVisibility / numSamples;\n ti.outputColor(this.ssaoTexture, [0.0, 0.0, 0.0, meanVisibility]);\n //ti.outputColor(this.ssaoTexture, [1 - result.w, 1-result.w, 1-result.w, 1.0])\n }\n }"),this.ssaoBlurKernel=_r(this,"() => {\n for (let I of ti.ndrange(this.ssaoTexture.dimensions[0], this.ssaoTexture.dimensions[1])) {\n let ssaoSum: ti.types.vector = [0.0, 0.0, 0.0, 0.0];\n for (let delta of ti.ndrange(5, 5)) {\n let J: ti.types.vector = I + delta - 1;\n //@ts-ignore\n J = Math.max(0, Math.min(this.ssaoTexture.dimensions - 1, J));\n let ssao = ti.textureLoad(this.ssaoTexture, J);\n ssaoSum += ssao;\n }\n ti.textureStore(this.ssaoBlurredTexture, I, ssaoSum / 25.0);\n }\n }"),this.shadowKernel=_r(this,{shadowMap:ur(),shadowInfo:ur()},"(shadowMap: DepthTexture, shadowInfo: ShadowInfo) => {\n ti.useDepth(shadowMap);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(shadowInfo.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n //no-op\n }\n }"),this.combineKernel=_r(this,{},"() => {\n ti.clearColor(this.renderResultTexture, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.quadVBO, this.quadIBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord: ti.types.vector = (f + 1) / 2.0;\n coord[1] = 1 - coord[1];\n\n let directLighting = ti.textureSample(this.directLightingTexture, coord).rgb;\n let environmentLighting = ti.textureSample(this.environmentLightingTexture, coord).rgb;\n let ssao = ti.textureSample(this.ssaoBlurredTexture, coord);\n let occlusion = ssao[3];\n let color: ti.types.vector = directLighting - environmentLighting * (1.0 - occlusion);\n color = this.linearTosRGB(this.tonemap(color, 1.0));\n //color = [occlusion, occlusion, occlusion]\n ti.outputColor(this.renderResultTexture, color.concat([1.0]));\n }\n }"),this.presentKernel=_r(this,{presentedTexture:ur()},"(presentedTexture: Texture) => {\n ti.clearColor(this.canvasTexture, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.quadVBO, this.quadIBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord: ti.types.vector = (f + 1) / 2.0;\n coord[1] = 1 - coord[1];\n\n let color = ti.textureSample(presentedTexture, coord);\n color[3] = 1.0;\n ti.outputColor(this.canvasTexture, color);\n }\n }")}async initSSAO(){let e=_r(this,"() => {\n let numSamples = this.ssaoSamples.dimensions[0];\n let blockSizeX = this.ssaoSamples.dimensions[1];\n let blockSizeY = this.ssaoSamples.dimensions[2];\n for (let I of ti.ndrange(numSamples, blockSizeX, blockSizeY)) {\n let sampleId = I[0];\n let randomSource = this.hammersley2d(sampleId, numSamples);\n let sample = this.cosineSampleHemisphere(randomSource);\n let length = Math.random();\n length = this.lerp(0.1, 1.0, length);\n sample *= length;\n //@ts-ignore\n this.ssaoSamples[I] = sample;\n }\n }");await e()}async initIBL(){if(this.scene.ibl){this.iblLambertianFiltered=Sr(4,this.scene.ibl.texture.dimensions),this.iblGGXFiltered=Sr(4,this.scene.ibl.texture.dimensions.concat([16]),1,{wrapModeW:n.ClampToEdge}),this.LUT=Sr(4,[512,512],1,{wrapModeU:n.ClampToEdge,wrapModeV:n.ClampToEdge}),this.skyboxVBO=yr(Lc(gr,3),8),this.skyboxIBO=yr(mr,36),await this.skyboxVBO.fromArray([[-1,-1,-1],[-1,-1,1],[-1,1,-1],[-1,1,1],[1,-1,-1],[1,-1,1],[1,1,-1],[1,1,1]]),await this.skyboxIBO.fromArray([0,1,2,1,3,2,4,5,6,5,7,6,0,2,4,2,6,4,1,3,5,3,7,5,0,1,4,1,5,4,2,3,6,3,7,6]);let e=_r(this,"() => {\n let kSampleCount = 1024;\n\n let computeLod = (pdf: number) => {\n return (\n (0.5 *\n Math.log(\n (6.0 *\n this.scene.ibl!.texture.dimensions[0] *\n this.scene.ibl!.texture.dimensions[0]) /\n (kSampleCount * pdf)\n )) /\n Math.log(2.0)\n );\n };\n\n let getLambertianImportanceSample = (normal: ti.types.vector, xi: ti.types.vector) => {\n let localSpaceDirection = this.cosineSampleHemisphere(xi);\n let pdf = this.cosineSampleHemispherePdf(localSpaceDirection);\n let TBN = this.generateTBN(normal);\n let direction = ti.matmul(TBN, localSpaceDirection);\n return {\n pdf: pdf,\n direction: direction,\n };\n };\n\n let filterLambertian = (normal: ti.types.vector) => {\n let color: any = [0.0, 0.0, 0.0];\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getLambertianImportanceSample(normal, xi);\n let halfDir = importanceSample.direction;\n let pdf = importanceSample.pdf;\n let lod = computeLod(pdf);\n let halfDirCoords = this.dirToUV(halfDir);\n let sampled = ti.textureSampleLod(this.scene.ibl!.texture, halfDirCoords, lod);\n //@ts-ignore\n color += sampled.rgb / kSampleCount;\n }\n return color;\n };\n\n for (let I of ti.ndrange(\n this.iblLambertianFiltered!.dimensions[0],\n this.iblLambertianFiltered!.dimensions[1]\n )) {\n //@ts-ignore\n let uv = I / (this.iblLambertianFiltered.dimensions - [1.0, 1.0]);\n let dir = this.uvToDir(uv);\n let filtered = filterLambertian(dir);\n ti.textureStore(this.iblLambertianFiltered!, I, filtered.concat([1.0]));\n }\n\n let saturate = (v: any) => {\n return Math.max(0.0, Math.min(1.0, v));\n };\n\n let getGGXImportanceSample = (normal: ti.types.vector, roughness: number, xi: ti.types.vector) => {\n let alpha = roughness * roughness;\n let cosTheta = saturate(Math.sqrt((1.0 - xi[1]) / (1.0 + (alpha * alpha - 1.0) * xi[1])));\n let sinTheta = Math.sqrt(1.0 - cosTheta * cosTheta);\n let phi = 2.0 * Math.PI * xi[0];\n\n let pdf = this.ggxDistribution(cosTheta, alpha) / 4.0;\n let localSpaceDirection = [sinTheta * Math.cos(phi), sinTheta * Math.sin(phi), cosTheta];\n let TBN = this.generateTBN(normal);\n let direction = ti.matmul(TBN, localSpaceDirection);\n return {\n pdf: pdf,\n direction: direction,\n };\n };\n\n let filterGGX = (normal: ti.types.vector, roughness: number) => {\n let color = [0.0, 0.0, 0.0];\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getGGXImportanceSample(normal, roughness, xi);\n let halfDir = importanceSample.direction;\n let pdf = importanceSample.pdf;\n let lod = computeLod(pdf);\n if (roughness == 0.0) {\n lod = 0.0;\n }\n let halfDirCoords = this.dirToUV(halfDir);\n let sampled = ti.textureSampleLod(this.scene.ibl!.texture, halfDirCoords, lod);\n //@ts-ignore\n color += sampled.rgb / kSampleCount;\n }\n return color;\n };\n\n for (let I of ti.ndrange(this.iblGGXFiltered!.dimensions[0], this.iblGGXFiltered!.dimensions[1])) {\n let numLevels = this.iblGGXFiltered!.dimensions[2];\n for (let level of ti.range(numLevels)) {\n let roughness = level / (numLevels - 1);\n //@ts-ignore\n let uv = I / (this.iblGGXFiltered.dimensions.slice(0, 2) - [1.0, 1.0]);\n let dir = this.uvToDir(uv);\n let filtered = filterGGX(dir, roughness);\n ti.textureStore(this.iblGGXFiltered!, I.concat([level]), filtered.concat([1.0]));\n }\n }\n\n let computeLUT = (NdotV: number, roughness: number): ti.types.vector => {\n let V: any = [Math.sqrt(1.0 - NdotV * NdotV), 0.0, NdotV];\n let N = [0.0, 0.0, 1.0];\n\n let A = 0.0;\n let B = 0.0;\n let C = 0.0;\n\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getGGXImportanceSample(N, roughness, xi);\n let H: any = importanceSample.direction;\n // float pdf = importanceSample.w;\n //@ts-ignore\n let L = ti.normalized(2.0 * H * ti.dot(H, V) - V);\n\n let NdotL = saturate(L[2]);\n let NdotH = saturate(H[2]);\n let VdotH = saturate(ti.dot(V, H));\n\n if (NdotL > 0.0) {\n let a2 = Math.pow(roughness, 4.0);\n let GGXV = NdotL * Math.sqrt(NdotV * NdotV * (1.0 - a2) + a2);\n let GGXL = NdotV * Math.sqrt(NdotL * NdotL * (1.0 - a2) + a2);\n let V_pdf = ((0.5 / (GGXV + GGXL)) * VdotH * NdotL) / NdotH;\n let Fc = Math.pow(1.0 - VdotH, 5.0);\n A += (1.0 - Fc) * V_pdf;\n B += Fc * V_pdf;\n C += 0.0;\n }\n }\n //@ts-ignore\n return [4.0 * A, 4.0 * B, 4.0 * 2.0 * Math.PI * C] / kSampleCount;\n };\n\n for (let I of ti.ndrange(this.LUT!.dimensions[0], this.LUT!.dimensions[1])) {\n //@ts-ignore\n let uv: ti.types.vector = I / (this.LUT.dimensions - [1.0, 1.0]);\n let texel = computeLUT(uv[0], uv[1]);\n ti.textureStore(this.LUT!, I, texel.concat([1.0]));\n }\n }",void 0);await e()}}async computeDrawBatches(){this.batchesDrawInfos=[],this.batchesDrawInstanceInfos=[];let e=[],t=[];for(let r=0;r=0){let n=this.scene.meshes[t.mesh];for(let t of n.primitives)if(t.materialID===r){let n=new kc(t.indexCount,1,t.firstIndex,0,-1);i.push(n);let o=new Ac(e,r);a.push(o)}}}n.hasTexture()?(this.batchesDrawInfos.push(i),this.batchesDrawInstanceInfos.push(a),this.batchInfos.push(new Tc(r))):(e=e.concat(i),t=t.concat(a))}e.length>0&&t.length>0&&(this.batchesDrawInfos.push(e),this.batchesDrawInstanceInfos.push(t),this.batchInfos.push(new Tc(-1)));for(let e of this.batchesDrawInfos)for(let t=0;t=0){let r=this.scene.meshes[t.mesh];for(let t of r.primitives){let r=this.geometryOnlyDrawInstanceInfos.length,n=new kc(t.indexCount,1,t.firstIndex,0,r);this.geometryOnlyDrawInfos.push(n);let i=new Ac(e,t.materialID);this.geometryOnlyDrawInstanceInfos.push(i)}}}this.geometryOnlyDrawInfoBuffer=yr(kc.getKernelType(),this.geometryOnlyDrawInfos.length),await this.geometryOnlyDrawInfoBuffer.fromArray(this.geometryOnlyDrawInfos),this.geometryOnlyDrawInstanceInfoBuffer=yr(Ac.getKernelType(),this.geometryOnlyDrawInstanceInfos.length),await this.geometryOnlyDrawInstanceInfoBuffer.fromArray(this.geometryOnlyDrawInstanceInfos)}async render(e){let t=this.htmlCanvas.width/this.htmlCanvas.height;e.computeMatrices(t);for(let e=0;eparseInt(e)-1)),o=a[0];e[r]=o,a.length>=2&&0!==i[1].length&&(n.vertices[o].texCoords0=s[a[1]]),3===a.length&&(n.vertices[o].normal=c[a[2]])}n.indices.push(e[0]),n.indices.push(e[1]),n.indices.push(e[2]),l.indexCount+=3,4===e.length&&(n.indices.push(e[0]),n.indices.push(e[2]),n.indices.push(e[3]),l.indexCount+=3)}}l&&u.push(l);let d=new Pn;n.rootNode=0,n.nodes=[d];for(let e of u){let t=new pc([e]),r=n.meshes.length;n.meshes.push(t);let i=new Pn,a=n.nodes.length;i.mesh=r,i.parent=0,d.children.push(a),n.nodes.push(i)}return n.init(),n}static getNewVertex(e,t){let r=new wn(t);return r.position=e,r}},MtlLoader:wc,GltfLoader:fc,HdrTexture:Pc,HdrLoader:Ic,get LightType(){return kn},LightInfo:In,PointLightInfo:class extends In{constructor(e,t,r,n,i=!1,a){super(kn.Point,e,t,r,n,[0,0,0],0,0,i,a)}},SpotLightInfo:class extends In{constructor(e,t,r,n,i,a=0,o=Math.PI/4,s=!1,c){super(kn.Spot,e,t,r,n,i,a,o,s,c),this.innerConeAngle=a,this.outerConeAngle=o}},DirectionalLightInfo:class extends In{constructor(e,t,r,n=!1,i=[0,0,0],a){super(kn.Directional,e,t,0,i,r,0,0,n,a)}},DrawInfo:kc,BatchInfo:Tc,InstanceInfo:Ac,Transform:Fn,ShadowInfo:Oc});function Lc(e,t){return new d(e,t)}function Rc(e,t,r){return new _(e,t,r)}function Bc(e){return new f(e)}var Jc=Object.freeze({__proto__:null,vector:Lc,matrix:Rc,struct:Bc});function jc(e,t,r=1e-6){if("number"==typeof t)return c("number"==typeof e,"expecting number"),!(isNaN(e)!=isNaN(t)||Math.abs(e-t)>r)||(s(`Mismatch: expecting ${t}, but received ${e}`),!1);if(Array.isArray(t)){c(Array.isArray(e),"expecting array"),c(e.length===t.length,"length mismatch ",e.length,t.length);for(let n=0;n {\n //@ts-ignore\n for (let i of range(2)) {\n for (let j of range(2)) {\n m[[i, j]][[0, 0]] = i * 1000 + j * 100;\n m[[i, j]][[0, 1]] = i * 1000 + j * 100 + 1;\n m[[i, j]][[1, 0]] = i * 1000 + j * 100 + 10;\n m[[i, j]][[1, 1]] = i * 1000 + j * 100 + 11;\n }\n }\n v[0] = m[[1, 1]][1];\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,10,11,100,101,110,111,1e3,1001,1010,1011,1100,1101,1110,1111])&&jc(n,[1110,1111])}()),e&&(e=await async function(){console.log("testVectorLocalVar"),await ie();let e=hr.field(2,mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j + 10000];\n f[[i, j]] = v;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testMatrixLocalVar"),await ie();let e=vr.field(2,2,mr,[2,2]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(2)) {\n for (let j of range(2)) {\n let m = [\n [i * 1000 + j * 100, i * 1000 + j * 100 + 1],\n [i * 1000 + j * 100 + 10, i * 1000 + j * 100 + 11],\n ];\n f[[i, j]] = m;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,10,11,100,101,110,111,1e3,1001,1010,1011,1100,1101,1110,1111])}()),e&&(e=await async function(){console.log("testMultipleSNodeTree"),await ie();let e=yr(mr,[7]);cr({f1:e}),dr("function k1() {\n //@ts-ignore\n for (let i of range(7)) {\n f1[i] = i;\n }\n }")();let t=yr(mr,[7]);cr({f1:e,f2:t}),dr("function k2() {\n //@ts-ignore\n for (let i of range(7)) {\n f2[i] = f1[i] + 1;\n }\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2,3,4,5,6])&&jc(n,[1,2,3,4,5,6,7])}()),e&&(e=await async function(){console.log("testNdrange"),await ie();let e=yr(mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let I of ndrange(3, 3)) {\n let i = I[0];\n let j = I[1];\n f[[i, j]] = i * 10 + j;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,10,11,12,20,21,22])}()),e&&(e=await async function(){console.log("testVectorArithmetic"),await ie();let e=hr.field(2,mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j] + [0, 10000];\n v = v * 2;\n f[[i, j]] = i32(v / 2);\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testFloat"),await ie();let e=hr.field(2,gr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j] + [0, 10000];\n v = v * 2;\n f[[i, j]] = v / 2;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testSerial"),await ie();let e=hr.field(2,gr,[1]);cr({f:e}),dr("function k() {\n let v = [1.5, 4.5];\n v = v * 2;\n f[0] = v;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[3,9])}()),e&&(e=await async function(){console.log("testMath"),await ie();let e=yr(gr,[9]);cr({f:e}),dr("function k() {\n let x = max(0.5, 0.75);\n f[0] = x;\n\n let c = sin(x);\n let s = cos(x);\n f[1] = c * c + s * s;\n\n f[2] = log(4) / log(2);\n\n f[3] = 3;\n f[4] = f[3] += 3; // += is considered atomic, so the value returned is the old value\n\n f[5] = 5;\n f[6] = f[5] *= 5; // += is not atomic, so the value returned is the new value\n\n let temp = 6.0;\n f[7] = temp /= 2;\n f[8] = temp;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[.75,1,2,6,3,25,25,3,3])}()),e&&(e=await async function(){console.log("testKernelScope"),await ie();let e=[313,326],t=[[313,533],[326,799]],r=yr(gr,[1]),n=hr.field(2,gr,[1]),i=vr.field(2,2,gr,[1]);cr({a:2533,b:e,c:t,f:r,v:n,m:i}),dr("function k() {\n f[0] = (a * 2) / 2;\n v[0] = (b * 3) / 3;\n m[0] = c + 4 - 4;\n }")();let a=await r.toArray1D(),o=await n.toArray1D(),s=await i.toArray1D();return console.log(a,o,s),jc(a,[2533])&&jc(o,e)&&jc(s,t[0].concat(t[1]))}()),e&&(e=await async function(){console.log("testIf"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(10)) {\n if (i < 3 || i >= 8) {\n f[i] = i;\n } else {\n f[i] = 0;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,0,0,0,0,0,8,9])}()),e&&(e=await async function(){console.log("testWhile"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 5) {\n f[i] = i;\n i = i + 1;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,4,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testBreak"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 5) {\n f[i] = i;\n i = i + 1;\n if (i > 3) {\n break;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,0,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testContinue"),await ie();let e=yr(mr,[10]),t=yr(mr,[10]),r=yr(mr,[10]);cr({f1:e,f2:t,f3:r}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 10) {\n if (i < 5) {\n i = i + 1;\n continue;\n }\n f1[i] = i;\n i = i + 1;\n }\n for (let j of ti.range(10)) {\n if (j < 5) {\n continue;\n }\n f2[j] = 2 * j;\n }\n for (let k of ti.range(1)) {\n for (let j of ti.range(10)) {\n if (j < 5) {\n continue;\n }\n f3[j] = 2 * j;\n }\n }\n }")();let n=await e.toArray1D(),i=await t.toArray1D(),a=await r.toArray1D();return console.log(n,i,a),jc(n,[0,0,0,0,0,5,6,7,8,9])&&jc(i,[0,0,0,0,0,10,12,14,16,18])&&jc(a,[0,0,0,0,0,10,12,14,16,18])}()),e&&(e=await async function(){console.log("testUnary"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(10)) {\n if (!(i >= 5)) {\n f[i] = -i;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,-1,-2,-3,-4,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testArrowFunctionKernel"),await ie();let e=yr(gr,[10]);cr({f:e}),dr("() => {\n for (let i of range(10)) {\n f[i] = i + i;\n }\n for (let i of range(10)) {\n f[i] = f[i] + i;\n }\n for (let i of range(10)) {\n f[i + 1 - 1] = f[i - 1 + 1] / 3;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,4,5,6,7,8,9])}()),e&&(e=await async function(){console.log("testArgs"),await ie();let e=yr(gr,[10]);cr({f:e}),dr("(x) => {\n //@ts-ignore\n for (let i of range(10)) {\n f[i] = i + x;\n }\n }")(3);let t=await e.toArray1D();return console.log(t),jc(t,[3,4,5,6,7,8,9,10,11,12])}()),e&&(e=await async function(){console.log("testFunc"),await ie();let e=yr(mr,[10]),t=hr.field(2,mr,[10]),r=hr.field(2,mr,[10]),n=hr.field(2,mr,[10]),i=hr.field(2,mr,[10]);cr({f1:e,f2:t,f3:r,f4:n,f5:i,returnOne:()=>1,identity:e=>e,plusOne:e=>1+e,getMirrorVec:e=>[e,-e],modify:"(x, i) => { x = x + i }",modifyUseless:(e,t)=>e}),dr("() => {\n //@ts-ignore\n for (let i of range(10)) {\n f1[i] = plusOne(i);\n f2[i] = plusOne([i, i]);\n f3[i] = getMirrorVec(i);\n modify(f4[i], [i, i]);\n f5[i] = modifyUseless(i, 123);\n }\n }")();let a=await e.toArray1D(),o=await t.toArray1D(),s=await r.toArray1D(),c=await n.toArray1D();return console.log(a,o,s,c),jc(a,[1,2,3,4,5,6,7,8,9,10])&&jc(o,[1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10])&&jc(s,[0,0,1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,8,-8,9,-9])&&jc(c,[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9])}()),e&&(e=await async function(){console.log("testVectorComponent"),await ie();let e=hr.field(2,gr,1);cr({f:e,res:[2,4]});let t=dr("() => {\n //@ts-ignore\n for (let i of range(1)) {\n f[i] = [i + 1, i + 1];\n }\n }"),r=dr("() => {\n //@ts-ignore\n for (let i of range(1)) {\n let x = f[i] * [2, 3] + [0.5, 0.0];\n x[0] = x[0] * res[0];\n x[1] = x[1] * res[1];\n let ix = i32(x);\n f[i] = x;\n }\n }");t(),r();let n=await e.toArray1D();return console.log(n),jc(n,[5,12])}()),e&&(e=await async function(){console.log("testPropertyFunc"),await ie();let e=yr(gr,[13]);cr({f:e,dot_f:(e,t)=>e.dot(t)}),dr("() => {\n //@ts-ignore\n let x = [3.0, 4.0];\n f[0] = x.norm();\n f[1] = x.normSqr();\n f[2] = x.length();\n f[3] = x.sum();\n\n f[4] = [3.0, 4.0].norm();\n f[5] = [3.0, 4.0].normSqr();\n f[6] = [3.0, 4.0].length();\n f[7] = [3.0, 4.0].sum();\n\n let y = [1.0, 2.0];\n f[8] = dot(x, y);\n f[9] = x.dot(y);\n f[10] = dot_f(x, y);\n\n f[11] = [3.0, 4.0].normalized().x;\n f[12] = [3.0, 4.0].normalized().y;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[5,25,2,7,5,25,2,7,11,11,11,.6,.8])}()),e&&(e=await async function(){console.log("testSwizzle"),await ie();let e=yr(gr,[10]),t=hr.field(4,gr,[2]);cr({f:e,v:t}),dr("() => {\n //@ts-ignore\n let v0 = [0.0, 1.0, 2.0, 3.0];\n let v1 = v0.xyzw;\n f[0] = v1.x;\n f[1] = v1.y;\n f[2] = v1.z;\n f[3] = v1.w;\n\n let v2 = [0.0, 1.0, 2.0, 3.0].bgra;\n f[4] = v2.r;\n f[5] = v2.g;\n f[6] = v2.b;\n f[7] = v2.a;\n\n let v3 = [0.0, 1.0].uv;\n f[8] = v3.v;\n f[9] = v3.u;\n\n let v4 = [0.0, 0.0, 0.0, 0.0];\n v4.x = 1;\n v4.y = 2;\n v4.z = 3;\n v4.w = 4;\n v[0] = v4;\n\n let v5 = [0.0, 0.0, 0.0, 0.0];\n v5.wzyx = [1, 2, 3, 4].wzwz;\n v[1] = v5;\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2,3,2,1,0,3,1,0])&&jc(n,[1,2,3,4,3,4,3,4])}()),e&&(e=await async function(){console.log("testRandom"),await ie();let e=1e4,t=yr(gr,[e]);cr({f:t,N:e}),dr("() => {\n for (let i of range(N)) {\n f[i] = random();\n }\n }")();let r=await t.toArray1D(),n=0,i=0;for(let e of r)n+=e,i+=e*e;let a=n/e,o=i/e;return console.log(a,o),console.log(r),jc([a],[.5],.01)&&jc([o],[1/3],.01)}()),e&&(e=await async function(){console.log("testAtomic"),await ie();let e=100,t=100,r=1e5,n=yr(gr,[1]),i=yr(gr,[1]),a=yr(gr,[1]),o=yr(mr,[1]),s=yr(mr,[t]),c=yr(mr,[1]);cr({f1:n,f2:i,f3:a,i1:o,i2:s,i3:c,n1:e,n2:t,n3:r});let l=dr("() => {\n for (let i of range(n1)) {\n f1[0] += i;\n atomicAdd(i1[0], i);\n }\n for (let i of range(n2)) {\n let my_index = (f2[0] += 1);\n i2[i] = i32(my_index);\n }\n for (let i of range(n3)) {\n atomicAdd(f3[0], 1);\n i3[0] += 1;\n }\n }");await l();let u=await n.toArray1D(),d=await i.toArray1D(),_=await a.toArray1D(),p=await o.toArray1D(),f=await s.toArray1D(),m=await c.toArray1D();console.log(u),console.log(d),console.log(_),console.log(p),console.log(f),console.log(m);let g=!0;g&&(g=jc(u,[4950])),g&&(g=jc(p,[4950])),g&&(g=jc(_,[r])),g&&(g=jc(m,[r])),g&&(g=jc(d,[t])),f.sort((function(e,t){return e-t}));for(let e=0;e {\n let s = 0.0;\n for (let i of range(100)) {\n s += i;\n }\n return s;\n }"),h=await y(),v=0;for(let e of Nr(100))v+=e;return g&&(g=jc(h,v)),console.log(h),g}()),e&&(e=await async function(){console.log("testMatrixOps"),await ie();let e=vr.field(2,2,gr,[4]),t=hr.field(2,gr,[1]);cr({f:e,v:t}),dr("() => {\n //@ts-ignore\n let m1 = [\n [1, 2],\n [3, 4],\n ];\n let m2 = [\n [5, 6],\n [7, 8],\n ];\n let m3 = m1.matmul(m2);\n f[0] = m3;\n f[1] = m2.transpose();\n f[2] = m1.transpose().transpose();\n f[3] = [1, 2].outerProduct([3, 4]);\n let v1 = [9, 10];\n let v2 = m1.matmul(v1);\n v[0] = v2;\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[19,22,43,50,5,7,6,8,1,2,3,4,3,4,6,8])&&jc(n,[29,67])}()),e&&(e=await async function(){console.log("testLibraryFuncs"),await ti.init();let e=ti.Matrix.field(2,2,ti.f32,[5]),t=ti.Matrix.field(3,3,ti.f32,[3]);ti.addToKernelScope({f2:e,f3:t}),ti.kernel("() => {\n //@ts-ignore\n let m2 = [\n [1.0, 2.0],\n [3.0, 4.0],\n ];\n let polar2DResult = ti.polarDecompose2D(m2);\n let svd2DResult = ti.svd2D(m2);\n f2[0] = polar2DResult.U;\n f2[1] = polar2DResult.P;\n f2[2] = svd2DResult.U;\n f2[3] = svd2DResult.E;\n f2[4] = svd2DResult.V;\n\n let m3 = [\n [1.0, 2.0, 3.0],\n [4.0, 5.0, 6.0],\n [7.0, 8.0, 9.0],\n ];\n let svd3DResult = ti.svd3D(m3);\n f3[0] = svd3DResult.U;\n f3[1] = svd3DResult.E;\n f3[2] = svd3DResult.V;\n }")();let r=await e.toArray1D();console.log(r);let n=await t.toArray();return console.log(n),jc(r,[.9805807,-.19611613,.19611613,.9805807,1.5689291,2.745626,2.7456257,3.5300906,-.40455358,.9145143,-.9145143,-.40455358,5.4649857,0,0,-.36596619,-.57604844,.81741556,-.81741556,-.57604844])&&jc(n,[[[-.214837,-.887231,-.408248],[-.520588,-.249644,.816496],[-.826337,.387943,-.408248]],[[16.8481,0,0],[0,1.06837,0],[0,0,-4.86675e-8]],[[-.479671,.776689,.408253],[-.572368,.0756911,-.816496],[-.665064,-.62532,.408245]]],1e-4)}()),e&&(e=await async function(){console.log("testStaticLoopUnroll"),await ti.init();let e=ti.Vector.field(3,ti.i32,[1]),t=ti.Matrix.field(3,3,ti.i32,[2]);ti.addToKernelScope({v:e,m:t}),ti.kernel("() => {\n //@ts-ignore\n for (let _ of range(1)) {\n for (let i of ti.static(ti.range(3))) {\n v[0][i] = i;\n }\n for (let i of ti.static(ti.range(3))) {\n for (let j of ti.static(ti.range(3))) {\n m[0][[i, j]] = i * 10 + j;\n }\n }\n for (let I of ti.static(ti.ndrange(3, 3))) {\n m[1][[I[0], I[1]]] = I[0] * 10 + I[1];\n }\n }\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2])&&jc(n,[0,1,2,10,11,12,20,21,22,0,1,2,10,11,12,20,21,22])}()),e&&(e=await async function(){console.log("testBroadcast"),await ie();let e=vr.field(2,2,mr,[1]),t=hr.field(2,mr,[1]);cr({m:e,v:t}),dr((()=>{e[0]=1,t[0]=1+[2,3]}))();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[1,1,1,1])&&jc(n,[3,4])}()),e&&(e=await async function(){console.log("testTypes"),await ie();let e=Lc(mr,3),t=yr(Rc(gr,2,2),[1]),r=yr(e,[1]);cr({m:t,v:r}),dr("() => {\n v[0] = [0, 1, 2];\n m[0] = [\n [0, 1],\n [2, 3],\n ];\n }")();let n=await t.toArray1D(),i=await r.toArray1D();return console.log(n,i),jc(n,[0,1,2,3])&&jc(i,[0,1,2])}()),e&&(e=await async function(){console.log("testToArray"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]);cr({s1:e,s2:t,s3:r,v1:n,v2:i,v3:a,m1:o,m2:s}),dr("() => {\n for (let i of range(2)) {\n s1[i] = i;\n v1[i] = [2 * i, 2 * i + 1];\n m1[i] = [\n [4 * i, 4 * i + 1],\n [4 * i + 2, 4 * i + 3],\n ];\n for (let j of range(2)) {\n let index = i * 2 + j;\n s2[[i, j]] = index;\n v2[[i, j]] = [index * 2, index * 2 + 1];\n m2[[i, j]] = [\n [4 * index, 4 * index + 1],\n [4 * index + 2, 4 * index + 3],\n ];\n for (let k of range(2)) {\n let index = i * 4 + j * 2 + k;\n s3[[i, j, k]] = index;\n v3[[i, j, k]] = [index * 2, index * 2 + 1];\n }\n }\n }\n }")();let c=await e.toArray(),l=await t.toArray(),u=await r.toArray(),d=await n.toArray(),_=await i.toArray(),p=await a.toArray(),f=await o.toArray(),m=await s.toArray();return console.log(c,l,u,d,_,p,f,m),jc(c,[0,1])&&jc(l,[[0,1],[2,3]])&&jc(u,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(d,[[0,1],[2,3]])&&jc(_,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(p,[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]])&&jc(f,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(m,[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]])}()),e&&(e=await async function(){console.log("testFieldAccessor"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]);cr({s1:e,s2:t,s3:r,v1:n,v2:i,v3:a,m1:o,m2:s}),dr("() => {\n for (let i of range(2)) {\n s1[i] = i;\n v1[i] = [2 * i, 2 * i + 1];\n m1[i] = [\n [4 * i, 4 * i + 1],\n [4 * i + 2, 4 * i + 3],\n ];\n for (let j of range(2)) {\n let index = i * 2 + j;\n s2[[i, j]] = index;\n v2[[i, j]] = [index * 2, index * 2 + 1];\n m2[[i, j]] = [\n [4 * index, 4 * index + 1],\n [4 * index + 2, 4 * index + 3],\n ];\n for (let k of range(2)) {\n let index = i * 4 + j * 2 + k;\n s3[[i, j, k]] = index;\n v3[[i, j, k]] = [index * 2, index * 2 + 1];\n }\n }\n }\n }")();let c=!0;return console.log(await e.get([1])),console.log(await t.get([1,1])),console.log(await r.get([1,0,1])),console.log(await n.get([1])),console.log(await i.get([1,0])),console.log(await a.get([1,1,0])),console.log(await o.get([0])),console.log(await s.get([1,1])),c&&(c=jc(await e.get([1]),1)&&jc(await t.get([1,1]),3)&&jc(await r.get([1,0,1]),5)&&jc(await n.get([1]),[2,3])&&jc(await i.get([1,0]),[4,5])&&jc(await a.get([1,1,0]),[12,13])&&jc(await o.get([0]),[[0,1],[2,3]])&&jc(await s.get([1,1]),[[12,13],[14,15]])),await e.set([0],123),c&&(c=jc(await e.get([0]),123)),await t.set([0,1],456.333),c&&(c=jc(await t.get([0,1]),456.333,1e-5)),await r.set([0,1,0],789),c&&(c=jc(await r.get([0,1,0]),789)),await n.set([1],[123,456]),c&&(c=jc(await n.get([1]),[123,456])),await i.set([1,0],[456.789,789.456]),c&&(c=jc(await i.get([1,0]),[456.789,789.456],1e-5)),await a.set([1,1,1],[10,11]),c&&(c=jc(await a.get([1,1,1]),[10,11])),await o.set([1],[[1,23],[4,56]]),c&&(c=jc(await o.get([1]),[[1,23],[4,56]])),await s.set([1,1],[[45,6],[78,9]]),c&&(c=jc(await s.get([1,1]),[[45,6],[78,9]])),c}()),e&&(e=await async function(){console.log("testFromArray"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]),c=[0,1],l=[[0,1],[2,3]],u=[[[0,1],[2,3]],[[4,5],[6,7]]],d=[[0,1],[2,3]],_=[[[0,1],[2,3]],[[4,5],[6,7]]],p=[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]],f=[[[0,1],[2,3]],[[4,5],[6,7]]],m=[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]];await e.fromArray(c),await t.fromArray(l),await r.fromArray(u),await n.fromArray(d),await i.fromArray(_),await a.fromArray(p),await o.fromArray(f),await s.fromArray(m);let g=!0;g&&(g=jc(await e.toArray(),c)&&jc(await t.toArray(),l)&&jc(await r.toArray(),u)&&jc(await n.toArray(),d)&&jc(await i.toArray(),_)&&jc(await a.toArray(),p)&&jc(await o.toArray(),f)&&jc(await s.toArray(),m));let y=c.map((e=>Math.random())),h=l.flat(1).map((e=>Math.random())),v=u.flat(2).map((e=>Math.random())),b=d.flat(1).map((e=>Math.random())),x=_.flat(2).map((e=>Math.random())),S=p.flat(3).map((e=>Math.random())),D=f.flat(2).map((e=>Math.floor(100*Math.random()))),C=m.flat(3).map((e=>Math.floor(100*Math.random())));return await e.fromArray1D(y),await t.fromArray1D(h),await r.fromArray1D(v),await n.fromArray1D(b),await i.fromArray1D(x),await a.fromArray1D(S),await o.fromArray1D(D),await s.fromArray1D(C),g&&(g=jc(await e.toArray1D(),y)&&jc(await t.toArray1D(),h)&&jc(await r.toArray1D(),v)&&jc(await n.toArray1D(),b)&&jc(await i.toArray1D(),x)&&jc(await a.toArray1D(),S)&&jc(await o.toArray1D(),D)&&jc(await s.toArray1D(),C)),g}()),e&&(e=await async function(){console.log("testStruct"),await ie();let e=Bc({f:gr,f3:Lc(gr,3),i4:Lc(mr,4)}),t=Bc({i:mr,s1:e}),r=yr(e,[4]),n=yr(t,[2]);cr({f1:r,f2:n});let i=!0;dr("() => {\n f1[0] = {\n f: 0.1,\n f3: [0.2, 0.3, 0.4],\n i4: [1, 2, 3, 4],\n };\n f1[1].f = 0.5;\n f1[1].f3 = [0.6, 0.6, 0.6];\n f1[1].f3.yz = [0.7, 0.8];\n f1[1].i4 = [5, 6, 7, 8];\n\n let s1Temp1 = f1[0];\n f1[2] = s1Temp1;\n\n let s1Temp2 = {\n f: 0.5,\n f3: [0.6, 0.7, 0.8],\n i4: [5, 6, 7, 8],\n };\n f1[3] = s1Temp2;\n\n f2[0] = {\n i: 0,\n s1: f1[0],\n };\n let s2Temp1 = {\n i: 1,\n s1: f2[0].s1,\n };\n s2Temp1.s1 = {\n f: 0.5,\n f3: [0.6, 0.7, 0.8],\n i4: [5, 6, 7, 8],\n };\n f2[1] = s2Temp1;\n }")();let a=await r.toArray(),o=await n.toArray();console.log(a,o),i&&(i=jc(a,[{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]},{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]},{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]},{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]}])),i&&(i=jc(o,[{i:0,s1:{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]}},{i:1,s1:{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]}}]));let s={f:.6,f3:[.7,.8,.9],i4:[9,0,1,2]};await r.set([0],s),i&&(i=jc(await r.get([0]),s));let c={i:123,s1:s};return await n.set([0],c),i&&(i=jc(await n.get([0]),c)),i}()),e&&(e=await async function(){console.log("testRets"),await ie();let e=[2,3],t=[[4,5]],r={s:6.6,v:[7.7,8.8]},n={s:9,v:[10,11],ss:r};cr({scalar:1,vector:e,matrix:t,struct:r,nestedStruct:n});let i=dr("() => {\n return scalar;\n }"),a=dr("() => {\n return vector;\n }"),o=dr("() => {\n return matrix;\n }"),s=dr("() => {\n return struct;\n }"),c=dr("() => {\n return nestedStruct;\n }"),l=await i(),u=await a(),d=await o(),_=await s(),p=await c();return console.log(l,u,d,_,p),jc(1,l)&&jc(e,u)&&jc(t,d)&&jc(r,_)&&jc(n,p)}()),e&&(e=await async function(){console.log("testArgAnnotation"),await ie();let e=12345,t=[1.1,2.2],r=[[1.1,2.2],[3.3,4.4]],n={i:e,f:1.1,v:t,m:r},i=mr,a=gr,o=Lc(gr,2),s=Rc(gr,2,2),c=Bc({i:i,f:a,v:o,m:s}),l=yr(i,[1]),u=yr(a,[1]),d=yr(o,[1]),_=yr(s,[1]),p=yr(c,[1]);return cr({iField:l,fField:u,vField:d,mField:_,oField:p}),dr({i:i,f:a,v:o,m:s,o:c},"(i, f, v, m, o) => {\n iField[0] = i;\n fField[0] = f;\n vField[0] = v;\n mField[0] = m;\n oField[0] = o;\n }")(e,1.1,t,r,n),console.log(await l.get([0])),console.log(await u.get([0])),console.log(await d.get([0])),console.log(await _.get([0])),console.log(await p.get([0])),jc(await l.get([0]),e)&&jc(await u.get([0]),1.1)&&jc(await d.get([0]),t)&&jc(await _.get([0]),r)&&jc(await p.get([0]),n)}()),e&&(e=await async function(){console.log("testTemplateArgs"),await ie();let e=12345,t=1.1,r=[1.1,2.2],n=[[1.1,2.2],[3.3,4.4]],i={i:e,f:t,v:r,m:n},a=mr,o=gr,s=Lc(gr,2),c=Rc(gr,2,2),l=Bc({i:a,f:o,v:s,m:c}),u=yr(a,[1]),d=yr(o,[1]),_=yr(s,[1]),p=yr(c,[1]),f=yr(l,[1]),m=dr({i:ur(),f:ur(),v:ur(),m:ur(),o:ur(),iField:ur(),fField:ur(),mField:ur(),vField:ur(),oField:ur()},"(i, f, v, m, o, iField, fField, vField, mField, oField) => {\n iField[0] = i;\n fField[0] = f;\n vField[0] = v;\n mField[0] = m;\n oField[0] = o;\n }");await m(e,t,r,n,i,u,d,_,p,f),console.log(await u.get([0])),console.log(await d.get([0])),console.log(await _.get([0])),console.log(await p.get([0])),console.log(await f.get([0]));let g=jc(await u.get([0]),e)&&jc(await d.get([0]),t)&&jc(await _.get([0]),r)&&jc(await p.get([0]),n)&&jc(await f.get([0]),i),y=yr(a,[1]);return await m(54321,t,r,n,i,y,d,_,p,f),console.log(await y.get([0])),g&&(g=jc(await y.get([0]),54321)),g}()),e&&(e=await async function(){console.log("testLambda"),await ie();let e=yr(gr,[6]);cr({f:e,globalFunc:()=>4}),dr("() => {\n let f0 = () => {\n return 0;\n };\n function f1() {\n return 1;\n }\n let f2 = (x) => {\n return x * 2;\n };\n let f3 = () => {\n f[3] = 3;\n };\n let one = 1;\n let f5 = () => {\n return one + f2(f2(one));\n };\n f[0] = f0();\n f[1] = f1();\n f[2] = f2(1);\n f3();\n f[4] = globalFunc();\n f[5] = f5();\n }")();let t=await e.toArray();return console.log(t),jc(t,[0,1,2,3,4,5])}()),e&&(e=await async function(){console.log("testHostObjectReference"),await ti.init();let e=[{valueWanted:123,field:ti.field(ti.f32,1)},{valueWanted:456,field:void 0},{valueWanted:789,field:ti.field(ti.f32,1)}];ti.addToKernelScope({data:e}),ti.kernel("() => {\n for (let i of ti.static(range(3))) {\n if (ti.static(data[i].field !== undefined)) {\n data[i].field[0] = data[i].valueWanted;\n }\n }\n }")();let t=!0;for(let r=0;r<3;++r)void 0!==e[r].field&&(console.log(await e[r].field.toArray(),e[r].valueWanted),t&&(t=jc(await e[r].field.get([0]),e[r].valueWanted)));return t}()),e&&(e=await async function(){console.log("testStaticIf"),await ti.init();let e=ti.field(ti.i32,6),t={x:456,y:567,z:[e,e]};ti.addToKernelScope({f:e,data0:[123],data1:t}),ti.kernel("() => {\n if (ti.static(1)) {\n f[0] = 1;\n } else {\n a.b().c().d();\n }\n\n if (ti.static(data0[0] === data0[0])) {\n f[1] = 1;\n } else {\n a.b().c().d();\n }\n\n if (ti.static(data1 === undefined)) {\n a.b().c().d();\n } else {\n f[2] = 1;\n }\n\n if (ti.static(data1.x > data1.y)) {\n a.b().c().d();\n } else {\n f[3] = 1;\n }\n\n if (ti.static(data1.z[1] === undefined)) {\n a.b().c().d();\n } else {\n f[4] = 1;\n }\n\n if (ti.static(data1.z[2] === undefined)) {\n f[5] = 1;\n } else {\n a.b().c().d();\n }\n }")();let r=await e.toArray();return console.log(r),jc(r,[1,1,1,1,1,1])}()),e&&(e=await async function(){console.log("testClassKernel"),await ie();let e=new class{constructor(){this.x=3,this.f=yr(gr,[1]),this.k=_r(this,"() => {\n this.f[0] = this.x;\n return this.x;\n }"),this.tk=_r(this,{f:ur(),x:gr},"(f, x) => {\n f[0] = x;\n return x;\n }")}},t=!0,r=await e.k(),n=await e.f.toArray();console.log(r,n),t&&(t=jc(r,3)),t&&(t=jc(n,[3]));let i=yr(gr,[1]),a=await e.tk(i,5),o=await i.toArray();return console.log(a,o),t&&(t=jc(a,5)),t&&(t=jc(o,[5])),t}()),e?console.log("All tests passed"):s("TESTS FAILED")}globalThis.ti=a;export{Er as Canvas,T as CubeTexture,vr as Matrix,Dn as Static,br as Struct,S as Texture,kr as Timer,hr as Vector,n as WrapMode,Mr as add,cr as addToKernelScope,bn as bitcast_f32,vn as bitcast_i32,Dr as canvasTexture,_r as classKernel,Xr as clearColor,lr as clearKernelScope,Kr as cross,Cr as depthTexture,en as discard,Br as div,Vr as dot,un as dpdx,dn as dpdy,Mc as engine,gr as f32,yr as field,pr as func,ln as getFragCoord,cn as getInstanceIndex,sn as getVertexIndex,mr as i32,ie as init,Pr as inputFragments,Fr as inputVertices,qr as inverse,dr as kernel,_n as lookAt,xr as materializeFields,zr as matmul,hn as mergeStructs,Rr as mul,wr as ndrange,Or as neg,jr as norm,Jr as normSqr,Ur as normalized,xn as not,fn as ortho,Yr as outputColor,Zr as outputDepth,Qr as outputPosition,Hr as outputVertex,pn as perspective,Wr as polarDecompose2D,Nr as range,mn as rotateAxisAngle,Sn as rsqrt,Uc as runAllTests,yn as scale,Lr as sub,fr as sync,ur as template,Sr as texture,an as textureLoad,tn as textureSample,nn as textureSampleCompare,rn as textureSampleLod,on as textureStore,gn as translate,Gr as transpose,Jc as types,$r as useDepth}; diff --git a/src/visualization/plotSolutionScript.js b/src/visualization/plotSolutionScript.js index 75fbe72..df2d0d5 100644 --- a/src/visualization/plotSolutionScript.js +++ b/src/visualization/plotSolutionScript.js @@ -8,6 +8,9 @@ // |_| | |_ // // Website: https://feascript.com/ \__| // +const math = window.math; +const Plotly = window.Plotly; + /** * Function to create plots of the solution vector * @param {*} solutionVector - The computed solution vector diff --git a/src/workers/webgpuComputeWorker.js b/src/workers/webgpuComputeWorker.js new file mode 100644 index 0000000..06f354f --- /dev/null +++ b/src/workers/webgpuComputeWorker.js @@ -0,0 +1,188 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +import * as Comlink from "../vendor/comlink.mjs"; +import * as ti from "../vendor/taichi.esm.js"; +import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; + +class WebGPUComputeWorker { + constructor() { + this.computeEngine = null; + this.initialized = false; + } + + async initialize() { + if (!this.initialized) { + await ti.init(); + this.initialized = true; + } + if (!this.computeEngine) { + this.computeEngine = new WebGPUComputeEngine(); + // Don't initialize again, already done + } + } + + async vecAdd(a, b) { + await this.initialize(); + return this.computeEngine.vecAdd(a, b); + } + + async matVecMul(A, x) { + await this.initialize(); + return this.computeEngine.matVecMul(A, x); + } + + async matMatMul(A, B) { + await this.initialize(); + return this.computeEngine.matMatMul(A, B); + } + + async transpose(A) { + await this.initialize(); + return this.computeEngine.transpose(A); + } + + async diagonal(A) { + await this.initialize(); + return this.computeEngine.diagonal(A); + } + + async sparseMatVecMul(sparseMatrix, x) { + await this.initialize(); + return this.computeEngine.sparseMatVecMul(sparseMatrix, x); + } + + async dotProduct(a, b) { + await this.initialize(); + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + bField.fromArray(b); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * bField[i]); + } + })(n); + + const result = await resultField.toArray(); + return result[0]; + } + + async norm(vector) { + await this.initialize(); + const n = vector.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(vector); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel(() => { + resultField[0] = ti.sqrt(resultField[0]); + })(); + + const result = await resultField.toArray(); + return result[0]; + } + + async normalize(vector) { + await this.initialize(); + const n = vector.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + const tempField = ti.field(ti.f32, [1]); + + aField.fromArray(vector); + tempField.fromArray([0]); + + ti.addToKernelScope({aField, resultField, tempField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(tempField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel((n) => { + const normVal = ti.sqrt(tempField[0]); + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / normVal; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + async copy(data) { + await this.initialize(); + return this.computeEngine.copy(data); + } + + async fill(data, value) { + await this.initialize(); + return this.computeEngine.fill(data, value); + } + + async scale(data, scalar) { + await this.initialize(); + return this.computeEngine.scale(data, scalar); + } + + async residual(A, x, b) { + await this.initialize(); + return this.computeEngine.residual(A, x, b); + } + + async preconditioner(A, r, type = 'jacobi', omega = 1.0) { + await this.initialize(); + return this.computeEngine.preconditioner(A, r, type, omega); + } + + async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + await this.initialize(); + return this.computeEngine.conjugateGradient(A, b, x0, tol, maxIter, preconditionerType); + } + + async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { + await this.initialize(); + try { + return await this.computeEngine.jacobiSolve(A, b, x0, maxIter, tol); + } catch (e) { + console.error('Error in jacobiSolve:', e); + throw new Error('Jacobi solve failed: ' + e.message); + } + } + + async destroy() { + if (this.computeEngine) { + this.computeEngine.destroy(); + this.computeEngine = null; + } + this.initialized = false; + } +} + +Comlink.expose(new WebGPUComputeWorker()); \ No newline at end of file diff --git a/src/workers/webgpuJacobiWorker.js b/src/workers/webgpuJacobiWorker.js new file mode 100644 index 0000000..aceb1dc --- /dev/null +++ b/src/workers/webgpuJacobiWorker.js @@ -0,0 +1,109 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +import * as Comlink from "../vendor/comlink.mjs"; +import * as ti from '../vendor/taichi.esm.js'; + +class WebGPUJacobiWorker { + constructor() { + this.initialized = false; + } + + async initialize() { + if (this.initialized) return; + + await ti.init(); + this.initialized = true; + } + + async jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) { + await this.initialize(); + + const n = A.length; + let x = [...x0]; + let xNew = new Array(n).fill(0); + + let iterationsCompleted = 0; + let hasConverged = false; + + // Main iteration loop + for (let iteration = 0; iteration < maxIterations; iteration++) { + // Perform Jacobi update using Taichi + const matrixField = ti.field(ti.f32, [n * n]); + const bField = ti.field(ti.f32, [n]); + const xField = ti.field(ti.f32, [n]); + const xNewField = ti.field(ti.f32, [n]); + + // Flatten the matrix for Taichi + const flatA = A.flat(); + matrixField.fromArray(flatA); + bField.fromArray(b); + xField.fromArray(x); + + ti.addToKernelScope({matrixField, bField, xField, xNewField}); + + ti.kernel((n) => { + for (let i = 0; i < n; i++) { + let sum = 0.0; + for (let j = 0; j < n; j++) { + if (j !== i) { + sum += matrixField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + } + let diagonal = matrixField[ti.i32(i) * ti.i32(n) + ti.i32(i)]; + xNewField[i] = (bField[i] - sum) / diagonal; + } + })(n); + + xNew = await xNewField.toArray(); + + // Check convergence by computing max difference + const diffField = ti.field(ti.f32, [n]); + diffField.fromArray(xNew.map((val, i) => val - x[i])); + + ti.addToKernelScope({diffField, absDiffField}); + + ti.kernel((n) => { + for (let i = 0; i < n; i++) { + absDiffField[i] = ti.abs(diffField[i]); + } + })(n); + + const absDiffData = await absDiffField.toArray(); + + // Find maximum absolute difference + let maxDiff = 0; + for (let i = 0; i < n; i++) { + if (absDiffData[i] > maxDiff) maxDiff = absDiffData[i]; + } + + if (maxDiff < tolerance) { + hasConverged = true; + iterationsCompleted = iteration + 1; + break; + } + + // Swap for next iteration + x = [...xNew]; + + if (iteration === maxIterations - 1) { + iterationsCompleted = maxIterations; + } + } + + return { + solution: xNew, + iterations: iterationsCompleted, + converged: hasConverged, + }; + } +} + +Comlink.expose(new WebGPUJacobiWorker()); \ No newline at end of file diff --git a/testWebGPU.html b/testWebGPU.html new file mode 100644 index 0000000..d0ea066 --- /dev/null +++ b/testWebGPU.html @@ -0,0 +1,651 @@ + + + + + + WebGPU Compute Engine Test + + + +

WebGPU Compute Engine Test

+

This page tests the basic functionality of the WebGPU compute engine.

+ +
+

Vector Addition Test

+ +
+
+ +
+

Matrix-Vector Multiplication Test

+ +
+
+ +
+

Dot Product Test

+ +
+
+ +
+

Vector Norm Test

+ +
+
+ +
+

Vector Normalization Test

+ +
+
+ +
+

Matrix-Matrix Multiplication Test

+ +
+
+ +
+

Matrix Transpose Test

+ +
+
+ +
+

Matrix Diagonal Test

+ +
+
+ +
+

Sparse Matrix-Vector Multiplication Test

+ +
+
+ +
+

Copy Test

+ +
+
+ +
+

Fill Test

+ +
+
+ +
+

Scale Test

+ +
+
+ +
+

Conjugate Gradient Solver Test

+ +
+
+ +
+

Cleanup

+ +
+
+ + + + \ No newline at end of file From 82929d65949004d12c615594afba50a5c94a7e2d Mon Sep 17 00:00:00 2001 From: "Sridhar.Mani" Date: Wed, 21 May 2025 19:08:52 +0530 Subject: [PATCH 04/12] Made the initial build for npm --- .npmignore | 3 + dist/feascript.cjs.js.map | 2 +- dist/feascript.umd.js | 4 +- dist/feascript.umd.js.map | 2 +- package-lock.json | 4039 +++---------------------------------- rollup.config.js | 16 +- 6 files changed, 317 insertions(+), 3749 deletions(-) diff --git a/.npmignore b/.npmignore index 1742c61..e2f3270 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,7 @@ examples/ test/ .gitignore +README.md +LICENSE +dist/ package-lock.json \ No newline at end of file diff --git a/dist/feascript.cjs.js.map b/dist/feascript.cjs.js.map index 1bd9119..4798ac2 100644 --- a/dist/feascript.cjs.js.map +++ b/dist/feascript.cjs.js.map @@ -1 +1 @@ -{"version":3,"file":"feascript.cjs.js","sources":["../src/methods/euclideanNormScript.js","../src/utilities/loggingScript.js","../src/methods/linearSystemSolverScript.js","../src/methods/jacobiSolverScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/methods/numericalIntegrationScript.js","../src/mesh/meshUtilsScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/solvers/heatConductionScript.js","../src/solvers/genericBoundaryConditionsScript.js","../src/solvers/frontPropagationScript.js","../src/methods/frontalSolverScript.js","../src/methods/newtonRaphsonScript.js","../src/vendor/comlink.mjs","../src/FEAScript.js","../src/solvers/generalFormPDEScript.js","../src/workers/workerScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/index.js"],"sourcesContent":["// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to calculate the Euclidean norm of a vector\n * @param {array} vector - The input vector\n * @returns {number} The Euclidean norm of the vector\n */\nexport function euclideanNorm(vector) {\n let norm = 0;\n for (let i = 0; i < vector.length; i++) {\n norm += vector[i] * vector[i];\n }\n norm = Math.sqrt(norm);\n return norm;\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\");\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\");\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\");\n}\n\n/**\n * Function to log warning messages\n * @param {string} message - Message to log\n */\nexport function warnLog(message) {\n console.log(\"%c[WARN] \" + message, \"color: #FF9800; font-weight: bold;\");\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersionInformation() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiSolver } from \"./jacobiSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to solve a system of linear equations using different solver methods\n * @param {string} solverMethod - The solver method to use (\"lusolve\" or \"jacobi\")\n * @param {Array} jacobianMatrix - The coefficient matrix\n * @param {Array} residualVector - The right-hand side vector\n * @param {object} [options] - Additional options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - converged: Boolean indicating whether the method converged (for iterative methods)\n * - iterations: Number of iterations performed (for iterative methods)\n */\nexport function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n\n let solutionVector = [];\n let converged = true;\n let iterations = 0;\n\n // Solve the linear system based on the specified solver method\n basicLog(`Solving system using ${solverMethod}...`);\n console.time(\"systemSolving\");\n\n if (solverMethod === \"lusolve\") {\n // Use LU decomposition method\n const jacobianMatrixSparse = math.sparse(jacobianMatrix);\n const luFactorization = math.slu(jacobianMatrixSparse, 1, 1); // order=1, threshold=1 for pivoting\n let solutionMatrix = math.lusolve(luFactorization, residualVector);\n solutionVector = math.squeeze(solutionMatrix).valueOf();\n //solutionVector = math.lusolve(jacobianMatrix, residualVector); // In the case of a dense matrix\n } else if (solverMethod === \"jacobi\") {\n // Use Jacobi method\n const initialGuess = new Array(residualVector.length).fill(0);\n const jacobiSolverResult = jacobiSolver(jacobianMatrix, residualVector, initialGuess, {\n maxIterations,\n tolerance,\n });\n\n // Log convergence information\n if (jacobiSolverResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiSolverResult.iterations} iterations`);\n } else {\n errorLog(`Jacobi method did not converge after ${jacobiSolverResult.iterations} iterations`);\n }\n\n solutionVector = jacobiSolverResult.solutionVector;\n converged = jacobiSolverResult.converged;\n iterations = jacobiSolverResult.iterations;\n } else {\n errorLog(`Unknown solver method: ${solverMethod}`);\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, converged, iterations };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * @param {array} jacobianMatrix - The coefficient matrix (must be square)\n * @param {array} residualVector - The right-hand side vector\n * @param {array} initialGuess - Initial guess for solution vector\n * @param {object} [options] - Options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum number of iterations\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport function jacobiSolver(jacobianMatrix, residualVector, initialGuess, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n const n = jacobianMatrix.length; // Size of the square matrix\n let x = [...initialGuess]; // Current solution (starts with initial guess)\n let xNew = new Array(n); // Next iteration's solution\n\n for (let iteration = 0; iteration < maxIterations; iteration++) {\n // Perform one iteration\n for (let i = 0; i < n; i++) {\n let sum = 0;\n // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠ i\n for (let j = 0; j < n; j++) {\n if (j !== i) {\n sum += jacobianMatrix[i][j] * x[j];\n }\n }\n // Update xNew[i] using the Jacobi formula\n xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i];\n }\n\n // Check convergence\n let maxDiff = 0;\n for (let i = 0; i < n; i++) {\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\n }\n\n // Update x for next iteration\n x = [...xNew];\n\n // Successfully converged if maxDiff is less than tolerance\n if (maxDiff < tolerance) {\n return {\n solutionVector: x,\n iterations: iteration + 1,\n converged: true,\n };\n }\n }\n\n // maxIterations were reached without convergence\n return {\n solutionVector: x,\n iterations: maxIterations,\n converged: false,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class BasisFunctions {\n /**\n * Constructor to initialize the BasisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Basic structure for the mesh\n */\nexport class Mesh {\n /**\n * Constructor to initialize the Mesh class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n\n this.boundaryElementsProcessed = false;\n\n if (this.parsedMesh) {\n basicLog(\"Using pre-parsed mesh from gmshReader data for mesh generation.\");\n this.parseMeshFromGmsh();\n }\n }\n\n /**\n * Method to parse the mesh from the GMSH format to the FEAScript format\n */\n parseMeshFromGmsh() {\n if (!this.parsedMesh.nodalNumbering) {\n errorLog(\"No valid nodal numbering found in the parsed mesh.\");\n }\n\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n errorLog(\"Element type is neither triangle nor quad; mapping for this type is not implemented yet.\");\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n // TODO: Transform into dictionaries for better readability\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n\n return this.parsedMesh;\n }\n}\n\nexport class Mesh1D extends Mesh {\n /**\n * Constructor to initialize the 1D mesh\n * @param {object} config - Configuration object for the 1D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({ numElementsX = null, maxX = null, elementOrder = \"linear\", parsedMesh = null }) {\n super({\n numElementsX,\n maxX,\n numElementsY: 1,\n maxY: 0,\n meshDimension: \"1D\",\n elementOrder,\n parsedMesh,\n });\n\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n const xStart = 0;\n let totalNodesX, deltaX;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate1DNodalNumbering(this.numElementsX, totalNodesX, this.elementOrder);\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate1DNodalNumbering(numElementsX, totalNodesX, elementOrder) {\n // TODO: The totalNodesX is not used in the original function. Verify if\n // there is a multiple calculation on the totalNodes.\n\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 2; // For 1D, we only have two sides (left and right)\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n\nexport class Mesh2D extends Mesh {\n /**\n * Constructor to initialize the 2D mesh\n * @param {object} config - Configuration object for the 2D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY] - Number of elements along the y-axis (required for geometry-based mesh)\n * @param {number} [config.maxY] - Maximum y-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n super({\n numElementsX,\n maxX,\n numElementsY,\n maxY,\n meshDimension: \"2D\",\n elementOrder,\n parsedMesh,\n });\n\n // Validate geometry parameters (when not using a parsed mesh)\n if (\n !parsedMesh &&\n (this.numElementsX === null || this.maxX === null || this.numElementsY === null || this.maxY === null)\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate2DNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesY,\n this.elementOrder\n );\n\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return statement\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate2DNodalNumbering(numElementsX, numElementsY, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 4; // For 2D, we have four sides (left, right, bottom, top)\n\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // TODO: Why to loop through all elements? Is it not better to loop over only the\n // elements that are on the boundary? eg: [0, this.numElementsX - 1] on x and\n // [0, this.numElementsY - 1] on y\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class NumericalIntegration {\n /**\n * Constructor to initialize the NumericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport { BasisFunctions } from \"./basisFunctionsScript.js\";\nimport { Mesh1D, Mesh2D } from \"./meshGenerationScript.js\";\nimport { NumericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to prepare the mesh for finite element analysis\n * @param {object} meshConfig - Object containing computational mesh details\n * @returns {object} An object containing all mesh-related data\n */\nexport function prepareMesh(meshConfig) {\n const { meshDimension, numElementsX, numElementsY, maxX, maxY, elementOrder, parsedMesh } = meshConfig;\n\n // Create a new instance of the Mesh class\n let mesh;\n if (meshDimension === \"1D\") {\n mesh = new Mesh1D({ numElementsX, maxX, elementOrder, parsedMesh });\n } else if (meshDimension === \"2D\") {\n mesh = new Mesh2D({ numElementsX, maxX, numElementsY, maxY, elementOrder, parsedMesh });\n } else {\n errorLog(\"Mesh dimension must be either '1D' or '2D'.\");\n }\n\n // Use the parsed mesh in case it was already passed with Gmsh format\n const nodesCoordinatesAndNumbering = mesh.boundaryElementsProcessed ? mesh.parsedMesh : mesh.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nop,\n boundaryElements,\n totalElements,\n totalNodes,\n meshDimension,\n elementOrder,\n };\n}\n\n/**\n * Function to initialize the FEA matrices and numerical tools\n * @param {object} meshData - Object containing mesh data from prepareMesh()\n * @returns {object} An object containing initialized matrices and numerical tools\n */\nexport function initializeFEA(meshData) {\n const { totalNodes, nop, meshDimension, elementOrder } = meshData;\n\n // Initialize variables for matrix assembly\n let residualVector = [];\n let jacobianMatrix = [];\n let localToGlobalMap = [];\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the BasisFunctions class\n const basisFunctions = new BasisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the NumericalIntegration class\n const numericalIntegration = new NumericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numericalIntegration.getGaussPointsAndWeights();\n let gaussPoints = gaussPointsAndWeights.gaussPoints;\n let gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n return {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 1D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping1D(params) {\n const { basisFunction, basisFunctionDerivKsi, nodesXCoordinates, localToGlobalMap, numNodes } = params;\n\n let xCoordinates = 0;\n let ksiDerivX = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n }\n let detJacobian = ksiDerivX;\n\n // Compute x-derivative of basis functions\n let basisFunctionDerivX = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian;\n }\n\n return {\n xCoordinates,\n detJacobian,\n basisFunctionDerivX,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 2D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping2D(params) {\n const {\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n } = params;\n\n let xCoordinates = 0;\n let yCoordinates = 0;\n let ksiDerivX = 0;\n let etaDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivY = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n }\n let detJacobian = ksiDerivX * etaDerivY - etaDerivX * ksiDerivY;\n\n // Compute x-derivative and y-derivative of basis functions\n let basisFunctionDerivX = [];\n let basisFunctionDerivY = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // The x-derivative of the n basis function\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian;\n // The y-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian;\n }\n\n return {\n xCoordinates,\n yCoordinates,\n detJacobian,\n basisFunctionDerivX,\n basisFunctionDerivY,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant temperature boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantTempBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions for the frontal solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix with convection contributions\n * - localResidualVector: Residual vector with convection contributions\n */\n imposeConvectionBoundaryConditionsFront(\n elementIndex,\n nodesXCoordinates,\n nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n // Initialize local Jacobian matrix and local residual vector\n const numNodes = this.nop[elementIndex].length;\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Check if this element is on a convection boundary\n for (const boundaryKey in this.boundaryElements) {\n if (this.boundaryConditions[boundaryKey]?.[0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n\n // Find if this element is on this boundary and which side\n const boundaryElement = this.boundaryElements[boundaryKey].find(\n ([elemIdx, _]) => elemIdx === elementIndex\n );\n\n if (boundaryElement) {\n const side = boundaryElement[1];\n\n if (this.meshDimension === \"1D\") {\n // Handle 1D case\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n nodeIndex = side === 0 ? 0 : 1;\n } else if (this.elementOrder === \"quadratic\") {\n nodeIndex = side === 0 ? 0 : 2;\n }\n\n // Add contribution to local Jacobian matrix and local residual vector\n debugLog(\n ` - Applied convection boundary condition to node ${nodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n localResidualVector[nodeIndex] += -convectionCoeff * extTemp;\n localJacobianMatrix[nodeIndex][nodeIndex] += convectionCoeff;\n } else if (this.meshDimension === \"2D\") {\n // Handle 2D case\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n // Get basis functions\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n const basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n const basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n // Calculate tangent vector components\n let ksiDerivX = 0,\n ksiDerivY = 0,\n etaDerivX = 0,\n etaDerivY = 0;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n } else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute tangent vector length\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n // Handle quadratic elements (similar pattern but with more Gauss points)\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the solid heat transfer model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\nexport function assembleHeatConductionMat(meshData, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n // 2D solid heat transfer\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n );\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the solid heat transfer model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - localResidualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n if (meshDimension === \"1D\") {\n // 1D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n // 2D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Create mapping from local element space to global mesh (convert to 0-based indexing)\n const localToGlobalMap = ngl.map((globalIndex) => globalIndex - 1);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle generic boundary conditions application\n */\nexport class GenericBoundaryConditions {\n /**\n * Constructor to initialize the GenericBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose Dirichlet boundary conditions\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeDirichletBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant value (Dirichlet) boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantValueBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n// Base viscous term that remains when eikonal equation is fully activated\nconst baseEikonalViscousTerm = 1e-2;\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the front propagation model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleFrontPropagationMat(\n meshData,\n boundaryConditions,\n solutionVector,\n eikonalActivationFlag\n) {\n basicLog(\"Starting front propagation matrix assembly...\");\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n debugLog(`eikonalViscousTerm: ${eikonalViscousTerm}`);\n debugLog(`eikonalActivationFlag: ${eikonalActivationFlag}`);\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // jacobianMatrix\n // TODO jacobianMatrix calculation here\n }\n }\n }\n // 2D front propagation (eikonal) equation\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n\n // residualVector: Viscous term contribution (to stabilize the solution)\n residualVector[localToGlobalMap1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // residualVector: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n residualVector[localToGlobalMap1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n\n // jacobianMatrix: Viscous term contribution\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // jacobianMatrix: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Dirichlet boundary conditions\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Front propagation matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the front propagation model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - residualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleFrontPropagationFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n solutionVector,\n eikonalActivationFlag,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // localJacobianMatrix\n // TODO localJacobianMatrix calculation here\n }\n }\n // 2D front propagation (eikonal) equation\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // Viscous term contribution\n localResidualVector[localNodeIndex1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localResidualVector[localNodeIndex1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Viscous term contribution\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { BasisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { initializeFEA } from \"../mesh/meshUtilsScript.js\";\nimport { assembleHeatConductionFront } from \"../solvers/heatConductionScript.js\";\nimport { ThermalBoundaryConditions } from \"../solvers/thermalBoundaryConditionsScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\nimport { GenericBoundaryConditions } from \"../solvers/genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n// Create object templates\nconst frontalData = {};\nconst frontalState = {};\nconst elementData = { currentElementIndex: 0 };\nconst frontStorage = {};\nlet basisFunctions;\n\n/**\n * Function to run the frontal solver and obtain results for plotting\n * @param {function} assembleFront - Matrix assembler based on the physical model\n * @param {object} meshData - Object containing mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} [options] - Additional options for the solver\n * @returns {object} An object containing the solution vector and node coordinates\n */\nexport function runFrontalSolver(assembleFront, meshData, boundaryConditions, options = {}) {\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const totalNodes = meshData.nodesXCoordinates.length;\n const numElements = meshData.totalElements;\n const numNodes = FEAData.numNodes;\n\n // Calculate required array sizes\n initializeFrontalArrays(numNodes, numElements);\n\n // Start timing for system solving (frontal algorithm)\n basicLog(\"Solving system using frontal...\");\n console.time(\"systemSolving\");\n\n // Initialize basis functions\n basisFunctions = new BasisFunctions({\n meshDimension: meshData.meshDimension,\n elementOrder: meshData.elementOrder,\n });\n\n // Copy node connectivity array into frontalData storage\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n for (let nodeIndex = 0; nodeIndex < FEAData.numNodes; nodeIndex++) {\n frontalData.nodalNumbering[elementIndex][nodeIndex] = meshData.nop[elementIndex][nodeIndex];\n }\n }\n\n // Apply Dirichlet-type boundary conditions\n // Initialize all nodes with no boundary condition\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.nodeConstraintCode[nodeIndex] = 0;\n frontalData.boundaryValues[nodeIndex] = 0;\n }\n\n // Handle Dirichlet-type boundary conditions differently based on which solver is being used\n let dirichletBoundaryConditionsHandler;\n // Solid heat transfer model (heatConductionScript solver)\n if (assembleFront === assembleHeatConductionFront) {\n dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantTempBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n // Front propagation model (frontPropagationScript solver)\n } else if (assembleFront === assembleFrontPropagationFront) {\n dirichletBoundaryConditionsHandler = new GenericBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantValueBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n }\n // Initialize global residual vector\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.globalResidualVector[nodeIndex] = 0;\n }\n\n frontalState.totalNodes = meshData.nodesXCoordinates.length;\n frontalState.writeFlag = 0;\n frontalState.transformationFlag = 1;\n frontalState.determinant = 1;\n\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n frontalState.nodesPerElement[elementIndex] = FEAData.numNodes;\n }\n\n // Parameters for non-linear assemblers\n frontalState.currentSolutionVector = options.solutionVector;\n frontalState.eikonalActivationFlag = options.eikonalActivationFlag;\n\n // Pass assembleFront and dirichletBoundaryConditionsHandler to runFrontalAlgorithm\n runFrontalAlgorithm(meshData, FEAData, dirichletBoundaryConditionsHandler, assembleFront);\n\n // Copy solution\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.solutionVector[nodeIndex] = frontalState.globalSolutionVector[nodeIndex];\n }\n\n // Output results to console for debugging\n const { nodesXCoordinates, nodesYCoordinates } = meshData;\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n if (meshData.meshDimension === \"1D\") {\n // 1D case - only output X coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${frontalData.solutionVector[\n nodeIndex\n ].toExponential(5)}`\n );\n } else {\n // 2D case - output X, Y coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${nodesYCoordinates[nodeIndex].toExponential(\n 5\n )} ${frontalData.solutionVector[nodeIndex].toExponential(5)}`\n );\n }\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n const { nodesXCoordinates: finalNodesX, nodesYCoordinates: finalNodesY } = meshData;\n return {\n solutionVector: frontalData.solutionVector.slice(0, totalNodes),\n nodesCoordinates: {\n nodesXCoordinates: finalNodesX,\n nodesYCoordinates: finalNodesY,\n },\n };\n}\n\n/**\n * Function to initialize arrays dynamically based on problem size\n * @param {number} numNodes - Number of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n */\nfunction initializeFrontalArrays(numNodes, numElements) {\n // Use the actual number of elements from the mesh\n frontalData.nodalNumbering = Array(numElements)\n .fill()\n .map(() => Array(numNodes).fill(0));\n frontalData.nodeConstraintCode = Array(numNodes).fill(0);\n frontalData.boundaryValues = Array(numNodes).fill(0);\n frontalData.globalResidualVector = Array(numNodes).fill(0);\n frontalData.solutionVector = Array(numNodes).fill(0);\n frontalData.topologyData = Array(numElements).fill(0);\n frontalData.lateralData = Array(numElements).fill(0);\n\n // Initialize frontalState arrays\n frontalState.writeFlag = 0;\n frontalState.totalNodes = numNodes;\n frontalState.transformationFlag = 0;\n frontalState.nodesPerElement = Array(numElements).fill(0);\n frontalState.determinant = 1;\n\n // For matrix operations, estimate required size based on problem complexity\n const systemSize = Math.max(numNodes, 2000);\n frontalState.globalSolutionVector = Array(systemSize).fill(0);\n frontalState.frontDataIndex = 0;\n\n // Initialize elementData arrays\n elementData.localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n elementData.currentElementIndex = 0;\n\n // Initialize frontStorage arrays\n const frontSize = estimateFrontSize(numNodes, numElements);\n frontStorage.frontValues = Array(frontSize).fill(0);\n frontStorage.columnHeaders = Array(systemSize).fill(0);\n frontStorage.pivotRow = Array(systemSize).fill(0);\n frontStorage.pivotData = Array(frontSize).fill(0);\n}\n\n/**\n * Function to estimate the required front size\n * @param {number} numNodes - Number of of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n * @returns {number} Estimated front size\n */\nfunction estimateFrontSize(numNodes, numElements) {\n const frontWidthEstimate = Math.max(Math.ceil(Math.sqrt(numElements)) * numNodes, numNodes * 2);\n return frontWidthEstimate * numElements;\n}\n// Old function to estimate the required front size\n// function estimateFrontSize(numNodes, numElements, numNodes) {\n// const frontWidthEstimate = Math.ceil(Math.sqrt(numElements) * numNodes * 2);\n// const frontSize = frontWidthEstimate * numNodes * 4;\n// return Math.max(frontSize, 10000);\n// }\n\n/**\n * Function to compute local Jacobian matrix and local residual vector\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n const elementIndex = elementData.currentElementIndex - 1;\n\n // Guard against out-of-range indices\n if (elementIndex < 0 || elementIndex >= meshData.totalElements) {\n errorLog(`Skipping out-of-range elementIndex=${elementIndex} (totalElements=${meshData.totalElements})`);\n return false;\n }\n\n // Domain terms\n const { localJacobianMatrix, localResidualVector, ngl } = assembleFront({\n elementIndex,\n nop: frontalData.nodalNumbering,\n meshData,\n basisFunctions: basisFunctions,\n FEAData,\n // These are ignored by linear assemblers\n solutionVector: frontalState.currentSolutionVector,\n eikonalActivationFlag: frontalState.eikonalActivationFlag,\n });\n\n // Handle Robin-type boundary conditions differently based on which solver is being used\n let boundaryLocalJacobianMatrix = Array(FEAData.numNodes)\n .fill()\n .map(() => Array(FEAData.numNodes).fill(0));\n let boundaryResidualVector = Array(FEAData.numNodes).fill(0);\n\n // heatConductionScript solver\n if (assembleFront === assembleHeatConductionFront) {\n // Check if this element is on a Robin-type boundary\n let isOnRobinTypeBoundary = false;\n for (const boundaryKey in meshData.boundaryElements) {\n if (\n thermalBoundaryConditions.boundaryConditions[boundaryKey]?.[0] === \"convection\" &&\n meshData.boundaryElements[boundaryKey].some(([elemIdx, _]) => elemIdx === elementIndex)\n ) {\n isOnRobinTypeBoundary = true;\n break;\n }\n }\n\n // Only calculate Robin-type for elements when required\n if (isOnRobinTypeBoundary) {\n const { gaussPoints, gaussWeights } = FEAData;\n const result = thermalBoundaryConditions.imposeConvectionBoundaryConditionsFront(\n elementIndex,\n meshData.nodesXCoordinates,\n meshData.nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n );\n boundaryLocalJacobianMatrix = result.localJacobianMatrix;\n boundaryResidualVector = result.localResidualVector;\n }\n } else if (assembleFront === assembleFrontPropagationFront) {\n // For now, no Robin-type boundary conditions exist for any other solver\n }\n\n // Combine domain and boundary contributions\n for (let localNodeI = 0; localNodeI < FEAData.numNodes; localNodeI++) {\n for (let localNodeJ = 0; localNodeJ < FEAData.numNodes; localNodeJ++) {\n elementData.localJacobianMatrix[localNodeI][localNodeJ] =\n localJacobianMatrix[localNodeI][localNodeJ] + boundaryLocalJacobianMatrix[localNodeI][localNodeJ];\n }\n }\n\n // Assemble local element residual\n for (let localNodeIndex = 0; localNodeIndex < FEAData.numNodes; localNodeIndex++) {\n const globalNodeIndex = ngl[localNodeIndex] - 1;\n frontalData.globalResidualVector[globalNodeIndex] +=\n localResidualVector[localNodeIndex] + boundaryResidualVector[localNodeIndex];\n }\n\n return true;\n}\n\n/**\n * Function to implement the frontal solver algorithm\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction runFrontalAlgorithm(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n // Allocate local arrays dynamically\n const totalElements = meshData.totalElements;\n const numNodes = meshData.nodesXCoordinates.length;\n const systemSize = Math.max(numNodes, frontalState.globalSolutionVector.length);\n let localDestination = Array(FEAData.numNodes).fill(0);\n let rowDestination = Array(FEAData.numNodes).fill(0);\n let rowHeaders = Array(systemSize).fill(0);\n let pivotRowIndices = Array(systemSize).fill(0);\n let pivotColumnIndices = Array(systemSize).fill(0);\n let modifiedRows = Array(systemSize).fill(0);\n let pivotColumn = Array(systemSize).fill(0);\n let frontMatrix = Array(systemSize)\n .fill()\n .map(() => Array(systemSize).fill(0));\n let rowSwapCount = Array(numNodes).fill(0);\n let columnSwapCount = Array(numNodes).fill(0);\n let lastAppearanceCheck = Array(numNodes).fill(0);\n let pivotColumnGlobalIndex; // Pivot column global index\n\n let frontDataCounter = 1;\n frontalState.writeFlag++;\n let pivotDataIndex = 1;\n let summedRows = 1;\n elementData.currentElementIndex = 0;\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n rowSwapCount[nodeIndex] = 0;\n columnSwapCount[nodeIndex] = 0;\n }\n\n if (frontalState.transformationFlag !== 0) {\n // Prefront: find last appearance of each node\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n lastAppearanceCheck[nodeIndex] = 0;\n }\n\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n let reverseElementIndex = totalElements - elementIndex - 1;\n for (\n let localNodeIndex = 0;\n localNodeIndex < frontalState.nodesPerElement[reverseElementIndex];\n localNodeIndex++\n ) {\n let globalNodeIndex = frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n if (lastAppearanceCheck[globalNodeIndex - 1] === 0) {\n lastAppearanceCheck[globalNodeIndex - 1] = 1;\n frontalData.nodalNumbering[reverseElementIndex][localNodeIndex] =\n -frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n }\n }\n }\n }\n\n frontalState.transformationFlag = 0;\n let columnCount = 0;\n let rowCount = 0;\n\n for (let i = 0; i < systemSize; i++) {\n for (let j = 0; j < systemSize; j++) {\n frontMatrix[j][i] = 0;\n }\n }\n\n while (true) {\n // Assemble a new element only while we still have elements\n let assembled = false;\n let numElementNodes = 0;\n let numElementColumns = 0;\n\n if (elementData.currentElementIndex < totalElements) {\n elementData.currentElementIndex++;\n assembled = assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront);\n }\n\n if (assembled) {\n const currentElement = elementData.currentElementIndex;\n numElementNodes = frontalState.nodesPerElement[currentElement - 1];\n numElementColumns = frontalState.nodesPerElement[currentElement - 1];\n\n for (let localNodeIndex = 0; localNodeIndex < numElementColumns; localNodeIndex++) {\n let globalNodeIndex = frontalData.nodalNumbering[currentElement - 1][localNodeIndex];\n let columnIndex;\n\n if (columnCount === 0) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n for (columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(frontStorage.columnHeaders[columnIndex])) break;\n }\n\n if (columnIndex === columnCount) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n localDestination[localNodeIndex] = columnIndex + 1;\n frontStorage.columnHeaders[columnIndex] = globalNodeIndex;\n }\n }\n\n let rowIndex;\n if (rowCount === 0) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(rowHeaders[rowIndex])) break;\n }\n\n if (rowIndex === rowCount) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n rowDestination[localNodeIndex] = rowIndex + 1;\n rowHeaders[rowIndex] = globalNodeIndex;\n }\n }\n }\n\n if (rowCount > systemSize || columnCount > systemSize) {\n errorLog(\"Error: systemSize not large enough\");\n return;\n }\n\n for (let localColumnIndex = 0; localColumnIndex < numElementColumns; localColumnIndex++) {\n let frontColumnIndex = localDestination[localColumnIndex];\n for (let localRowIndex = 0; localRowIndex < numElementNodes; localRowIndex++) {\n let frontRowIndex = rowDestination[localRowIndex];\n frontMatrix[frontRowIndex - 1][frontColumnIndex - 1] +=\n elementData.localJacobianMatrix[localRowIndex][localColumnIndex];\n }\n }\n }\n\n // Pivoting/elimination continues whether or not a new element was assembled\n let availableColumnCount = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (frontStorage.columnHeaders[columnIndex] < 0) {\n pivotColumnIndices[availableColumnCount] = columnIndex + 1;\n availableColumnCount++;\n }\n }\n\n let constrainedRowCount = 0;\n let availableRowCount = 0;\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n let globalNodeIndex = rowHeaders[rowIndex];\n if (globalNodeIndex < 0) {\n pivotRowIndices[availableRowCount] = rowIndex + 1;\n availableRowCount++;\n let absoluteNodeIndex = Math.abs(globalNodeIndex);\n if (frontalData.nodeConstraintCode[absoluteNodeIndex - 1] === 1) {\n modifiedRows[constrainedRowCount] = rowIndex + 1;\n constrainedRowCount++;\n frontalData.nodeConstraintCode[absoluteNodeIndex - 1] = 2;\n frontalData.globalResidualVector[absoluteNodeIndex - 1] =\n frontalData.boundaryValues[absoluteNodeIndex - 1];\n }\n }\n }\n\n if (constrainedRowCount > 0) {\n for (let constrainedIndex = 0; constrainedIndex < constrainedRowCount; constrainedIndex++) {\n let rowIndex = modifiedRows[constrainedIndex] - 1;\n let globalNodeIndex = Math.abs(rowHeaders[rowIndex]);\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] = 0;\n let columnGlobalIndex = Math.abs(frontStorage.columnHeaders[columnIndex]);\n if (columnGlobalIndex === globalNodeIndex) frontMatrix[rowIndex][columnIndex] = 1;\n }\n }\n }\n\n if (availableColumnCount > summedRows || elementData.currentElementIndex < totalElements) {\n if (availableColumnCount === 0) {\n errorLog(\"Error: no more rows fully summed\");\n return;\n }\n\n let pivotRowIndex = pivotRowIndices[0];\n let pivotColumnIndex = pivotColumnIndices[0];\n let pivotValue = frontMatrix[pivotRowIndex - 1][pivotColumnIndex - 1];\n\n if (Math.abs(pivotValue) < 1e-4) {\n pivotValue = 0;\n for (let columnIndex = 0; columnIndex < availableColumnCount; columnIndex++) {\n let testColumnIndex = pivotColumnIndices[columnIndex];\n for (let rowIndex = 0; rowIndex < availableRowCount; rowIndex++) {\n let testRowIndex = pivotRowIndices[rowIndex];\n let testValue = frontMatrix[testRowIndex - 1][testColumnIndex - 1];\n if (Math.abs(testValue) > Math.abs(pivotValue)) {\n pivotValue = testValue;\n pivotColumnIndex = testColumnIndex;\n pivotRowIndex = testRowIndex;\n }\n }\n }\n }\n\n let pivotGlobalRowIndex = Math.abs(rowHeaders[pivotRowIndex - 1]);\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]); // Assign, don't declare\n let permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n if (nodeIndex >= pivotGlobalRowIndex) rowSwapCount[nodeIndex]--;\n if (nodeIndex >= pivotColumnGlobalIndex) columnSwapCount[nodeIndex]--;\n }\n\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontMatrix[pivotRowIndex - 1][columnIndex] / pivotValue;\n }\n\n let rightHandSide = frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] = rightHandSide;\n pivotColumn[pivotRowIndex - 1] = pivotValue;\n\n if (pivotRowIndex > 1) {\n for (let rowIndex = 0; rowIndex < pivotRowIndex - 1; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1 && eliminationFactor !== 0) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] -= eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n if (pivotRowIndex < rowCount) {\n for (let rowIndex = pivotRowIndex; rowIndex < rowCount; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = pivotColumn[i];\n }\n pivotDataIndex += rowCount;\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = rowHeaders[i];\n }\n pivotDataIndex += rowCount;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.pivotRow[i];\n }\n frontDataCounter += columnCount;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.columnHeaders[i];\n }\n frontDataCounter += columnCount;\n\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n frontMatrix[rowIndex][columnCount - 1] = 0;\n }\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowCount - 1][columnIndex] = 0;\n }\n\n columnCount--;\n if (pivotColumnIndex < columnCount + 1) {\n for (let columnIndex = pivotColumnIndex - 1; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] = frontStorage.columnHeaders[columnIndex + 1];\n }\n }\n\n rowCount--;\n if (pivotRowIndex < rowCount + 1) {\n for (let rowIndex = pivotRowIndex - 1; rowIndex < rowCount; rowIndex++) {\n rowHeaders[rowIndex] = rowHeaders[rowIndex + 1];\n }\n }\n\n if (rowCount > 1 || elementData.currentElementIndex < totalElements) continue;\n\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[0]); // Assign, don't declare\n pivotRowIndex = 1;\n pivotValue = frontMatrix[0][0];\n pivotGlobalRowIndex = Math.abs(rowHeaders[0]);\n pivotColumnIndex = 1;\n permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n frontStorage.pivotRow[0] = 1;\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] =\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.pivotRow[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.columnHeaders[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotColumn[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = rowHeaders[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n frontalState.frontDataIndex = frontDataCounter;\n if (frontalState.writeFlag === 1)\n debugLog(`total ecs transfer in matrix reduction=${frontDataCounter}`);\n\n // Back substitution\n performBackSubstitution(frontDataCounter);\n break;\n }\n }\n}\n\n/**\n * Function to perform back substitution for the frontal solver\n * @param {number} frontDataCounter - Index counter for the element contributions\n */\nfunction performBackSubstitution(frontDataCounter) {\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n frontalState.globalSolutionVector[nodeIndex] = frontalData.boundaryValues[nodeIndex];\n }\n\n for (let iterationIndex = 1; iterationIndex <= frontalState.totalNodes; iterationIndex++) {\n frontDataCounter -= 4;\n let pivotGlobalRowIndex = frontStorage.frontValues[frontDataCounter - 1];\n let columnCount = frontStorage.frontValues[frontDataCounter];\n let pivotColumnIndex = frontStorage.frontValues[frontDataCounter + 1];\n let pivotValue = frontStorage.frontValues[frontDataCounter + 2];\n\n if (iterationIndex === 1) {\n frontDataCounter--;\n frontStorage.columnHeaders[0] = frontStorage.frontValues[frontDataCounter - 1];\n frontDataCounter--;\n frontStorage.pivotRow[0] = frontStorage.frontValues[frontDataCounter - 1];\n } else {\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] =\n frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n }\n\n let pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]);\n if (frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] > 0) continue;\n\n let accumulatedValue = 0;\n frontStorage.pivotRow[pivotColumnIndex - 1] = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n accumulatedValue -=\n frontStorage.pivotRow[columnIndex] *\n frontalState.globalSolutionVector[Math.abs(frontStorage.columnHeaders[columnIndex]) - 1];\n }\n\n frontalState.globalSolutionVector[pivotColumnGlobalIndex - 1] =\n accumulatedValue + frontalData.globalResidualVector[pivotGlobalRowIndex - 1];\n\n frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] = 1;\n }\n\n if (frontalState.writeFlag === 1)\n debugLog(`value of frontDataCounter after backsubstitution=${frontDataCounter}`);\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { euclideanNorm } from \"../methods/euclideanNormScript.js\";\nimport { solveLinearSystem } from \"./linearSystemSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\nimport { runFrontalSolver } from \"./frontalSolverScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\n\n/**\n * Function to solve a system of non-linear equations using the Newton-Raphson method\n * @param {function} assembleMat - Matrix assembler based on the physical model\n * @param {object} context - Context object containing simulation data and options\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-4] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\n\nexport function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-4) {\n let errorNorm = 0;\n let converged = false;\n let iterations = 0;\n let deltaX = [];\n let solutionVector = [];\n let jacobianMatrix = [];\n let residualVector = [];\n\n // Calculate system size\n let totalNodes = context.meshData.nodesXCoordinates.length;\n\n // Initialize arrays with proper size\n for (let i = 0; i < totalNodes; i++) {\n deltaX[i] = 0;\n solutionVector[i] = 0;\n }\n\n // Initialize solution from context if available\n if (context.initialSolution && context.initialSolution.length === totalNodes) {\n solutionVector = [...context.initialSolution];\n }\n\n while (iterations < maxIterations && !converged) {\n // Update solution\n for (let i = 0; i < solutionVector.length; i++) {\n solutionVector[i] = Number(solutionVector[i]) + Number(deltaX[i]);\n }\n\n // Check if using frontal solver\n if (context.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleFrontPropagationFront,\n context.meshData,\n context.boundaryConditions,\n { solutionVector, eikonalActivationFlag: context.eikonalActivationFlag }\n );\n deltaX = frontalResult.solutionVector;\n } else {\n // Compute Jacobian and residual matrices\n ({ jacobianMatrix, residualVector } = assembleMat(\n context.meshData,\n context.boundaryConditions,\n solutionVector, // The solution vector is required in the case of a non-linear equation\n context.eikonalActivationFlag // Currently used only in the front propagation solver (TODO refactor in case of a solver not needing it)\n ));\n\n // Solve the linear system based on the specified solver method\n const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);\n deltaX = linearSystemResult.solutionVector;\n }\n\n // Check convergence\n errorNorm = euclideanNorm(deltaX);\n\n // Norm for each iteration\n basicLog(`Newton-Raphson iteration ${iterations + 1}: Error norm = ${errorNorm.toExponential(4)}`);\n\n if (errorNorm <= tolerance) {\n converged = true;\n } else if (errorNorm > 1e2) {\n errorLog(`Solution not converged. Error norm: ${errorNorm}`);\n break;\n }\n\n iterations++;\n }\n\n return {\n solutionVector,\n converged,\n iterations,\n jacobianMatrix,\n residualVector,\n };\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { newtonRaphson } from \"./methods/newtonRaphsonScript.js\";\nimport { solveLinearSystem } from \"./methods/linearSystemSolverScript.js\";\nimport { prepareMesh } from \"./mesh/meshUtilsScript.js\";\nimport { assembleFrontPropagationMat } from \"./solvers/frontPropagationScript.js\";\nimport { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from \"./solvers/generalFormPDEScript.js\";\nimport { assembleHeatConductionMat, assembleHeatConductionFront } from \"./solvers/heatConductionScript.js\";\nimport { runFrontalSolver } from \"./methods/frontalSolverScript.js\";\nimport { basicLog, debugLog, warnLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n this.coefficientFunctions = null; // Add storage for coefficient functions\n warnLog(\n \"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE\"\n );\n basicLog(\"FEAScriptModel instance created\");\n }\n\n /**\n * Sets the solver configuration\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} [options] - Optional additional configuration\n */\n setSolverConfig(solverConfig, options = {}) {\n this.solverConfig = solverConfig;\n\n // Store coefficient functions if provided\n if (options && options.coefficientFunctions) {\n this.coefficientFunctions = options.coefficientFunctions;\n debugLog(\"Coefficient functions set\");\n }\n\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n /**\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let initialSolution = [];\n\n // Prepare the mesh\n basicLog(\"Preparing mesh...\");\n const meshData = prepareMesh(this.meshConfig);\n basicLog(\"Mesh preparation completed\");\n\n // Extract node coordinates from meshData\n const nodesCoordinates = {\n nodesXCoordinates: meshData.nodesXCoordinates,\n nodesYCoordinates: meshData.nodesYCoordinates,\n };\n\n // Select and execute the appropriate solver based on solverConfig\n basicLog(\"Beginning solving process...\");\n console.time(\"totalSolvingTime\");\n if (this.solverConfig === \"heatConductionScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleHeatConductionFront,\n meshData,\n this.boundaryConditions\n );\n solutionVector = frontalResult.solutionVector;\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n } else if (this.solverConfig === \"frontPropagationScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Initialize eikonalActivationFlag\n let eikonalActivationFlag = 0;\n const eikonalExteralIterations = 5; // Number of incremental steps for the eikonal equation\n\n // Create context object with all necessary properties\n const context = {\n meshData: meshData,\n boundaryConditions: this.boundaryConditions,\n eikonalActivationFlag: eikonalActivationFlag,\n solverMethod: this.solverMethod,\n initialSolution,\n };\n\n while (eikonalActivationFlag <= 1) {\n // Update the context object with current eikonalActivationFlag\n context.eikonalActivationFlag = eikonalActivationFlag;\n\n // Pass the previous solution as initial guess\n if (solutionVector.length > 0) {\n context.initialSolution = [...solutionVector];\n }\n\n // Solve the assembled non-linear system\n const newtonRaphsonResult = newtonRaphson(assembleFrontPropagationMat, context, 100, 1e-4);\n\n // Extract results\n jacobianMatrix = newtonRaphsonResult.jacobianMatrix;\n residualVector = newtonRaphsonResult.residualVector;\n solutionVector = newtonRaphsonResult.solutionVector;\n\n // Increment for next iteration\n eikonalActivationFlag += 1 / eikonalExteralIterations;\n }\n } else if (this.solverConfig === \"generalFormPDEScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n errorLog(\n \"Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.\"\n );\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleGeneralFormPDEMat(\n meshData,\n this.boundaryConditions,\n this.coefficientFunctions\n ));\n\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n }\n console.timeEnd(\"totalSolvingTime\");\n basicLog(\"Solving process completed\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { initializeFEA, performIsoparametricMapping1D } from \"../mesh/meshUtilsScript.js\";\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the general form PDE model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} coefficientFunctions - Functions A(x), B(x), C(x), D(x) for the PDE\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleGeneralFormPDEMat(meshData, boundaryConditions, coefficientFunctions) {\n basicLog(\"Starting general form PDE matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Extract coefficient functions\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Convert to 0-based indexing\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n const globalNodeIndex1 = localToGlobalMap[localNodeIndex1];\n\n // Source term contribution to residual vector\n residualVector[globalNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n const globalNodeIndex2 = localToGlobalMap[localNodeIndex2];\n\n // Diffusion term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEMat.\");\n // 2D general form PDE - empty for now\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Apply Dirichlet boundary conditions only\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n\n basicLog(\"General form PDE matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the frontal solver matrix for the general form PDE model\n * @param {object} data - Object containing element data for the frontal solver\n * @returns {object} An object containing local Jacobian matrix and residual vector\n */\nexport function assembleGeneralFormPDEFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n coefficientFunctions,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of local Jacobian matrix and residual vector\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n // Source term contribution to local residual vector\n localResidualVector[localNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Diffusion term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEFront.\");\n // 2D general form PDE - empty for now\n }\n\n return {\n localJacobianMatrix,\n localResidualVector,\n ngl,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n\n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n\n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map((val) => val[0]);\n } else {\n zValues = solutionVector;\n }\n\n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n\n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: \"closest\",\n };\n\n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: \"Solution Field\",\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n name: \"Solution Field\",\n };\n\n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const printVersion = \"0.1.3\";"],"names":["euclideanNorm","vector","norm","i","length","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","solveLinearSystem","solverMethod","jacobianMatrix","residualVector","options","maxIterations","tolerance","solutionVector","converged","iterations","time","jacobianMatrixSparse","math","sparse","luFactorization","slu","solutionMatrix","lusolve","squeeze","valueOf","jacobiSolverResult","initialGuess","n","x","xNew","Array","iteration","sum","j","maxDiff","max","abs","jacobiSolver","fill","timeEnd","BasisFunctions","constructor","meshDimension","elementOrder","this","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","Mesh","numElementsX","maxX","numElementsY","maxY","parsedMesh","boundaryElementsProcessed","parseMeshFromGmsh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","boundaryNodePairs","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","Mesh1D","super","generateMesh","nodesXCoordinates","totalNodesX","deltaX","nodeIndex","generate1DNodalNumbering","findBoundaryElements","nop","elementIndex","columnCounter","sideIndex","Mesh2D","nodesYCoordinates","totalNodesY","deltaY","nodeIndexY","nodeIndexX","nnode","generate2DNodalNumbering","rowCounter","elementIndexX","elementIndexY","nodeIndex1","nodeIndex2","NumericalIntegration","getGaussPointsAndWeights","gaussPoints","gaussWeights","initializeFEA","meshData","totalNodes","colIndex","basisFunctions","gaussPointsAndWeights","localToGlobalMap","numNodes","performIsoparametricMapping1D","params","xCoordinates","ksiDerivX","localNodeIndex","detJacobian","basisFunctionDerivX","performIsoparametricMapping2D","yCoordinates","etaDerivX","ksiDerivY","etaDerivY","basisFunctionDerivY","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","Object","keys","boundaryKey","tempValue","globalNodeIndex","imposeConstantTempBoundaryConditionsFront","nodeConstraintCode","boundaryValues","imposeConvectionBoundaryConditions","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","tangentVectorLength","localNodeIndex2","globalNodeIndex2","gaussPointIndex","imposeConvectionBoundaryConditionsFront","localJacobianMatrix","map","localResidualVector","boundaryElement","find","_","assembleHeatConductionFront","FEAData","ngl","gaussPointIndex1","localNodeIndex1","gaussPointIndex2","globalIndex","GenericBoundaryConditions","imposeDirichletBoundaryConditions","value","imposeConstantValueBoundaryConditionsFront","assembleFrontPropagationMat","eikonalActivationFlag","eikonalViscousTerm","totalElements","mappingResult","solutionDerivX","solutionDerivY","localToGlobalMap1","localToGlobalMap2","assembleFrontPropagationFront","frontalData","frontalState","elementData","currentElementIndex","frontStorage","runFrontalSolver","assembleFront","numElements","globalResidualVector","topologyData","lateralData","writeFlag","transformationFlag","nodesPerElement","determinant","systemSize","globalSolutionVector","frontDataIndex","frontSize","frontWidthEstimate","ceil","estimateFrontSize","frontValues","columnHeaders","pivotRow","pivotData","initializeFrontalArrays","dirichletBoundaryConditionsHandler","currentSolutionVector","thermalBoundaryConditions","pivotColumnGlobalIndex","localDestination","rowDestination","rowHeaders","pivotRowIndices","pivotColumnIndices","modifiedRows","pivotColumn","frontMatrix","rowSwapCount","columnSwapCount","lastAppearanceCheck","frontDataCounter","pivotDataIndex","summedRows","reverseElementIndex","columnCount","rowCount","assembled","numElementNodes","numElementColumns","assembleElementContribution","currentElement","columnIndex","rowIndex","localColumnIndex","frontColumnIndex","localRowIndex","availableColumnCount","constrainedRowCount","availableRowCount","absoluteNodeIndex","constrainedIndex","pivotRowIndex","pivotColumnIndex","pivotValue","testColumnIndex","testRowIndex","testValue","pivotGlobalRowIndex","permutationHelper","rightHandSide","globalRowIndex","eliminationFactor","performBackSubstitution","runFrontalAlgorithm","toExponential","finalNodesX","finalNodesY","slice","nodesCoordinates","boundaryLocalJacobianMatrix","boundaryResidualVector","isOnRobinTypeBoundary","some","result","localNodeI","localNodeJ","iterationIndex","accumulatedValue","newtonRaphson","assembleMat","context","errorNorm","initialSolution","Number","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","floor","random","MAX_SAFE_INTEGER","solverConfig","meshConfig","coefficientFunctions","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","mesh","nodesCoordinatesAndNumbering","prepareMesh","assembleHeatConductionMat","eikonalExteralIterations","newtonRaphsonResult","A","B","C","D","xCoord","a","b","d","globalNodeIndex1","assembleGeneralFormPDEMat","worker","feaWorker","isReady","_initWorker","Worker","URL","document","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar"],"mappings":"aAeO,SAASA,EAAcC,GAC5B,IAAIC,EAAO,EACX,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,IACjCD,GAAQD,EAAOE,GAAKF,EAAOE,GAG7B,OADAD,EAAOG,KAAKC,KAAKJ,GACVA,CACT,wDCXA,IAAIK,EAAkB,QAuBf,SAASC,EAASC,GACC,UAApBF,GACFG,QAAQC,IAAI,aAAeF,EAAS,qCAExC,CAMO,SAASG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CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChB/gB,EAAG0E,EACHiZ,EAAGtY,EACH2b,EAAGd,EACHxM,KAAM,UACNuN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETrb,KAAM,kBAIR4b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,uBCrJ4B"} \ No newline at end of file +{"version":3,"file":"feascript.cjs.js","sources":["../src/methods/euclideanNormScript.js","../src/utilities/loggingScript.js","../src/methods/linearSystemSolverScript.js","../src/methods/jacobiSolverScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/methods/numericalIntegrationScript.js","../src/mesh/meshUtilsScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/solvers/heatConductionScript.js","../src/solvers/genericBoundaryConditionsScript.js","../src/solvers/frontPropagationScript.js","../src/methods/frontalSolverScript.js","../src/methods/newtonRaphsonScript.js","../src/vendor/comlink.mjs","../src/FEAScript.js","../src/solvers/generalFormPDEScript.js","../src/workers/workerScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/index.js"],"sourcesContent":["// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to calculate the Euclidean norm of a vector\n * @param {array} vector - The input vector\n * @returns {number} The Euclidean norm of the vector\n */\nexport function euclideanNorm(vector) {\n let norm = 0;\n for (let i = 0; i < vector.length; i++) {\n norm += vector[i] * vector[i];\n }\n norm = Math.sqrt(norm);\n return norm;\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\");\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\");\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\");\n}\n\n/**\n * Function to log warning messages\n * @param {string} message - Message to log\n */\nexport function warnLog(message) {\n console.log(\"%c[WARN] \" + message, \"color: #FF9800; font-weight: bold;\");\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersionInformation() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiSolver } from \"./jacobiSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to solve a system of linear equations using different solver methods\n * @param {string} solverMethod - The solver method to use (\"lusolve\" or \"jacobi\")\n * @param {Array} jacobianMatrix - The coefficient matrix\n * @param {Array} residualVector - The right-hand side vector\n * @param {object} [options] - Additional options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - converged: Boolean indicating whether the method converged (for iterative methods)\n * - iterations: Number of iterations performed (for iterative methods)\n */\nexport function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n\n let solutionVector = [];\n let converged = true;\n let iterations = 0;\n\n // Solve the linear system based on the specified solver method\n basicLog(`Solving system using ${solverMethod}...`);\n console.time(\"systemSolving\");\n\n if (solverMethod === \"lusolve\") {\n // Use LU decomposition method\n const jacobianMatrixSparse = math.sparse(jacobianMatrix);\n const luFactorization = math.slu(jacobianMatrixSparse, 1, 1); // order=1, threshold=1 for pivoting\n let solutionMatrix = math.lusolve(luFactorization, residualVector);\n solutionVector = math.squeeze(solutionMatrix).valueOf();\n //solutionVector = math.lusolve(jacobianMatrix, residualVector); // In the case of a dense matrix\n } else if (solverMethod === \"jacobi\") {\n // Use Jacobi method\n const initialGuess = new Array(residualVector.length).fill(0);\n const jacobiSolverResult = jacobiSolver(jacobianMatrix, residualVector, initialGuess, {\n maxIterations,\n tolerance,\n });\n\n // Log convergence information\n if (jacobiSolverResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiSolverResult.iterations} iterations`);\n } else {\n errorLog(`Jacobi method did not converge after ${jacobiSolverResult.iterations} iterations`);\n }\n\n solutionVector = jacobiSolverResult.solutionVector;\n converged = jacobiSolverResult.converged;\n iterations = jacobiSolverResult.iterations;\n } else {\n errorLog(`Unknown solver method: ${solverMethod}`);\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, converged, iterations };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * @param {array} jacobianMatrix - The coefficient matrix (must be square)\n * @param {array} residualVector - The right-hand side vector\n * @param {array} initialGuess - Initial guess for solution vector\n * @param {object} [options] - Options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum number of iterations\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport function jacobiSolver(jacobianMatrix, residualVector, initialGuess, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n const n = jacobianMatrix.length; // Size of the square matrix\n let x = [...initialGuess]; // Current solution (starts with initial guess)\n let xNew = new Array(n); // Next iteration's solution\n\n for (let iteration = 0; iteration < maxIterations; iteration++) {\n // Perform one iteration\n for (let i = 0; i < n; i++) {\n let sum = 0;\n // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠ i\n for (let j = 0; j < n; j++) {\n if (j !== i) {\n sum += jacobianMatrix[i][j] * x[j];\n }\n }\n // Update xNew[i] using the Jacobi formula\n xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i];\n }\n\n // Check convergence\n let maxDiff = 0;\n for (let i = 0; i < n; i++) {\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\n }\n\n // Update x for next iteration\n x = [...xNew];\n\n // Successfully converged if maxDiff is less than tolerance\n if (maxDiff < tolerance) {\n return {\n solutionVector: x,\n iterations: iteration + 1,\n converged: true,\n };\n }\n }\n\n // maxIterations were reached without convergence\n return {\n solutionVector: x,\n iterations: maxIterations,\n converged: false,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class BasisFunctions {\n /**\n * Constructor to initialize the BasisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Basic structure for the mesh\n */\nexport class Mesh {\n /**\n * Constructor to initialize the Mesh class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n\n this.boundaryElementsProcessed = false;\n\n if (this.parsedMesh) {\n basicLog(\"Using pre-parsed mesh from gmshReader data for mesh generation.\");\n this.parseMeshFromGmsh();\n }\n }\n\n /**\n * Method to parse the mesh from the GMSH format to the FEAScript format\n */\n parseMeshFromGmsh() {\n if (!this.parsedMesh.nodalNumbering) {\n errorLog(\"No valid nodal numbering found in the parsed mesh.\");\n }\n\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n errorLog(\"Element type is neither triangle nor quad; mapping for this type is not implemented yet.\");\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n // TODO: Transform into dictionaries for better readability\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n\n return this.parsedMesh;\n }\n}\n\nexport class Mesh1D extends Mesh {\n /**\n * Constructor to initialize the 1D mesh\n * @param {object} config - Configuration object for the 1D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({ numElementsX = null, maxX = null, elementOrder = \"linear\", parsedMesh = null }) {\n super({\n numElementsX,\n maxX,\n numElementsY: 1,\n maxY: 0,\n meshDimension: \"1D\",\n elementOrder,\n parsedMesh,\n });\n\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n const xStart = 0;\n let totalNodesX, deltaX;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate1DNodalNumbering(this.numElementsX, totalNodesX, this.elementOrder);\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate1DNodalNumbering(numElementsX, totalNodesX, elementOrder) {\n // TODO: The totalNodesX is not used in the original function. Verify if\n // there is a multiple calculation on the totalNodes.\n\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 2; // For 1D, we only have two sides (left and right)\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n\nexport class Mesh2D extends Mesh {\n /**\n * Constructor to initialize the 2D mesh\n * @param {object} config - Configuration object for the 2D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY] - Number of elements along the y-axis (required for geometry-based mesh)\n * @param {number} [config.maxY] - Maximum y-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n super({\n numElementsX,\n maxX,\n numElementsY,\n maxY,\n meshDimension: \"2D\",\n elementOrder,\n parsedMesh,\n });\n\n // Validate geometry parameters (when not using a parsed mesh)\n if (\n !parsedMesh &&\n (this.numElementsX === null || this.maxX === null || this.numElementsY === null || this.maxY === null)\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate2DNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesY,\n this.elementOrder\n );\n\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return statement\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate2DNodalNumbering(numElementsX, numElementsY, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 4; // For 2D, we have four sides (left, right, bottom, top)\n\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // TODO: Why to loop through all elements? Is it not better to loop over only the\n // elements that are on the boundary? eg: [0, this.numElementsX - 1] on x and\n // [0, this.numElementsY - 1] on y\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class NumericalIntegration {\n /**\n * Constructor to initialize the NumericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport { BasisFunctions } from \"./basisFunctionsScript.js\";\nimport { Mesh1D, Mesh2D } from \"./meshGenerationScript.js\";\nimport { NumericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to prepare the mesh for finite element analysis\n * @param {object} meshConfig - Object containing computational mesh details\n * @returns {object} An object containing all mesh-related data\n */\nexport function prepareMesh(meshConfig) {\n const { meshDimension, numElementsX, numElementsY, maxX, maxY, elementOrder, parsedMesh } = meshConfig;\n\n // Create a new instance of the Mesh class\n let mesh;\n if (meshDimension === \"1D\") {\n mesh = new Mesh1D({ numElementsX, maxX, elementOrder, parsedMesh });\n } else if (meshDimension === \"2D\") {\n mesh = new Mesh2D({ numElementsX, maxX, numElementsY, maxY, elementOrder, parsedMesh });\n } else {\n errorLog(\"Mesh dimension must be either '1D' or '2D'.\");\n }\n\n // Use the parsed mesh in case it was already passed with Gmsh format\n const nodesCoordinatesAndNumbering = mesh.boundaryElementsProcessed ? mesh.parsedMesh : mesh.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nop,\n boundaryElements,\n totalElements,\n totalNodes,\n meshDimension,\n elementOrder,\n };\n}\n\n/**\n * Function to initialize the FEA matrices and numerical tools\n * @param {object} meshData - Object containing mesh data from prepareMesh()\n * @returns {object} An object containing initialized matrices and numerical tools\n */\nexport function initializeFEA(meshData) {\n const { totalNodes, nop, meshDimension, elementOrder } = meshData;\n\n // Initialize variables for matrix assembly\n let residualVector = [];\n let jacobianMatrix = [];\n let localToGlobalMap = [];\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the BasisFunctions class\n const basisFunctions = new BasisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the NumericalIntegration class\n const numericalIntegration = new NumericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numericalIntegration.getGaussPointsAndWeights();\n let gaussPoints = gaussPointsAndWeights.gaussPoints;\n let gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n return {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 1D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping1D(params) {\n const { basisFunction, basisFunctionDerivKsi, nodesXCoordinates, localToGlobalMap, numNodes } = params;\n\n let xCoordinates = 0;\n let ksiDerivX = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n }\n let detJacobian = ksiDerivX;\n\n // Compute x-derivative of basis functions\n let basisFunctionDerivX = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian;\n }\n\n return {\n xCoordinates,\n detJacobian,\n basisFunctionDerivX,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 2D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping2D(params) {\n const {\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n } = params;\n\n let xCoordinates = 0;\n let yCoordinates = 0;\n let ksiDerivX = 0;\n let etaDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivY = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n }\n let detJacobian = ksiDerivX * etaDerivY - etaDerivX * ksiDerivY;\n\n // Compute x-derivative and y-derivative of basis functions\n let basisFunctionDerivX = [];\n let basisFunctionDerivY = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // The x-derivative of the n basis function\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian;\n // The y-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian;\n }\n\n return {\n xCoordinates,\n yCoordinates,\n detJacobian,\n basisFunctionDerivX,\n basisFunctionDerivY,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant temperature boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantTempBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions for the frontal solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix with convection contributions\n * - localResidualVector: Residual vector with convection contributions\n */\n imposeConvectionBoundaryConditionsFront(\n elementIndex,\n nodesXCoordinates,\n nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n // Initialize local Jacobian matrix and local residual vector\n const numNodes = this.nop[elementIndex].length;\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Check if this element is on a convection boundary\n for (const boundaryKey in this.boundaryElements) {\n if (this.boundaryConditions[boundaryKey]?.[0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n\n // Find if this element is on this boundary and which side\n const boundaryElement = this.boundaryElements[boundaryKey].find(\n ([elemIdx, _]) => elemIdx === elementIndex\n );\n\n if (boundaryElement) {\n const side = boundaryElement[1];\n\n if (this.meshDimension === \"1D\") {\n // Handle 1D case\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n nodeIndex = side === 0 ? 0 : 1;\n } else if (this.elementOrder === \"quadratic\") {\n nodeIndex = side === 0 ? 0 : 2;\n }\n\n // Add contribution to local Jacobian matrix and local residual vector\n debugLog(\n ` - Applied convection boundary condition to node ${nodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n localResidualVector[nodeIndex] += -convectionCoeff * extTemp;\n localJacobianMatrix[nodeIndex][nodeIndex] += convectionCoeff;\n } else if (this.meshDimension === \"2D\") {\n // Handle 2D case\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n // Get basis functions\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n const basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n const basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n // Calculate tangent vector components\n let ksiDerivX = 0,\n ksiDerivY = 0,\n etaDerivX = 0,\n etaDerivY = 0;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n } else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute tangent vector length\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n // Handle quadratic elements (similar pattern but with more Gauss points)\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the solid heat transfer model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\nexport function assembleHeatConductionMat(meshData, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n // 2D solid heat transfer\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n );\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the solid heat transfer model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - localResidualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n if (meshDimension === \"1D\") {\n // 1D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n // 2D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Create mapping from local element space to global mesh (convert to 0-based indexing)\n const localToGlobalMap = ngl.map((globalIndex) => globalIndex - 1);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle generic boundary conditions application\n */\nexport class GenericBoundaryConditions {\n /**\n * Constructor to initialize the GenericBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose Dirichlet boundary conditions\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeDirichletBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant value (Dirichlet) boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantValueBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n// Base viscous term that remains when eikonal equation is fully activated\nconst baseEikonalViscousTerm = 1e-2;\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the front propagation model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleFrontPropagationMat(\n meshData,\n boundaryConditions,\n solutionVector,\n eikonalActivationFlag\n) {\n basicLog(\"Starting front propagation matrix assembly...\");\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n debugLog(`eikonalViscousTerm: ${eikonalViscousTerm}`);\n debugLog(`eikonalActivationFlag: ${eikonalActivationFlag}`);\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // jacobianMatrix\n // TODO jacobianMatrix calculation here\n }\n }\n }\n // 2D front propagation (eikonal) equation\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n\n // residualVector: Viscous term contribution (to stabilize the solution)\n residualVector[localToGlobalMap1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // residualVector: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n residualVector[localToGlobalMap1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n\n // jacobianMatrix: Viscous term contribution\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // jacobianMatrix: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Dirichlet boundary conditions\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Front propagation matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the front propagation model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - residualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleFrontPropagationFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n solutionVector,\n eikonalActivationFlag,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // localJacobianMatrix\n // TODO localJacobianMatrix calculation here\n }\n }\n // 2D front propagation (eikonal) equation\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // Viscous term contribution\n localResidualVector[localNodeIndex1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localResidualVector[localNodeIndex1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Viscous term contribution\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { BasisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { initializeFEA } from \"../mesh/meshUtilsScript.js\";\nimport { assembleHeatConductionFront } from \"../solvers/heatConductionScript.js\";\nimport { ThermalBoundaryConditions } from \"../solvers/thermalBoundaryConditionsScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\nimport { GenericBoundaryConditions } from \"../solvers/genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n// Create object templates\nconst frontalData = {};\nconst frontalState = {};\nconst elementData = { currentElementIndex: 0 };\nconst frontStorage = {};\nlet basisFunctions;\n\n/**\n * Function to run the frontal solver and obtain results for plotting\n * @param {function} assembleFront - Matrix assembler based on the physical model\n * @param {object} meshData - Object containing mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} [options] - Additional options for the solver\n * @returns {object} An object containing the solution vector and node coordinates\n */\nexport function runFrontalSolver(assembleFront, meshData, boundaryConditions, options = {}) {\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const totalNodes = meshData.nodesXCoordinates.length;\n const numElements = meshData.totalElements;\n const numNodes = FEAData.numNodes;\n\n // Calculate required array sizes\n initializeFrontalArrays(numNodes, numElements);\n\n // Start timing for system solving (frontal algorithm)\n basicLog(\"Solving system using frontal...\");\n console.time(\"systemSolving\");\n\n // Initialize basis functions\n basisFunctions = new BasisFunctions({\n meshDimension: meshData.meshDimension,\n elementOrder: meshData.elementOrder,\n });\n\n // Copy node connectivity array into frontalData storage\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n for (let nodeIndex = 0; nodeIndex < FEAData.numNodes; nodeIndex++) {\n frontalData.nodalNumbering[elementIndex][nodeIndex] = meshData.nop[elementIndex][nodeIndex];\n }\n }\n\n // Apply Dirichlet-type boundary conditions\n // Initialize all nodes with no boundary condition\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.nodeConstraintCode[nodeIndex] = 0;\n frontalData.boundaryValues[nodeIndex] = 0;\n }\n\n // Handle Dirichlet-type boundary conditions differently based on which solver is being used\n let dirichletBoundaryConditionsHandler;\n // Solid heat transfer model (heatConductionScript solver)\n if (assembleFront === assembleHeatConductionFront) {\n dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantTempBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n // Front propagation model (frontPropagationScript solver)\n } else if (assembleFront === assembleFrontPropagationFront) {\n dirichletBoundaryConditionsHandler = new GenericBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantValueBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n }\n // Initialize global residual vector\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.globalResidualVector[nodeIndex] = 0;\n }\n\n frontalState.totalNodes = meshData.nodesXCoordinates.length;\n frontalState.writeFlag = 0;\n frontalState.transformationFlag = 1;\n frontalState.determinant = 1;\n\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n frontalState.nodesPerElement[elementIndex] = FEAData.numNodes;\n }\n\n // Parameters for non-linear assemblers\n frontalState.currentSolutionVector = options.solutionVector;\n frontalState.eikonalActivationFlag = options.eikonalActivationFlag;\n\n // Pass assembleFront and dirichletBoundaryConditionsHandler to runFrontalAlgorithm\n runFrontalAlgorithm(meshData, FEAData, dirichletBoundaryConditionsHandler, assembleFront);\n\n // Copy solution\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.solutionVector[nodeIndex] = frontalState.globalSolutionVector[nodeIndex];\n }\n\n // Output results to console for debugging\n const { nodesXCoordinates, nodesYCoordinates } = meshData;\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n if (meshData.meshDimension === \"1D\") {\n // 1D case - only output X coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${frontalData.solutionVector[\n nodeIndex\n ].toExponential(5)}`\n );\n } else {\n // 2D case - output X, Y coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${nodesYCoordinates[nodeIndex].toExponential(\n 5\n )} ${frontalData.solutionVector[nodeIndex].toExponential(5)}`\n );\n }\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n const { nodesXCoordinates: finalNodesX, nodesYCoordinates: finalNodesY } = meshData;\n return {\n solutionVector: frontalData.solutionVector.slice(0, totalNodes),\n nodesCoordinates: {\n nodesXCoordinates: finalNodesX,\n nodesYCoordinates: finalNodesY,\n },\n };\n}\n\n/**\n * Function to initialize arrays dynamically based on problem size\n * @param {number} numNodes - Number of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n */\nfunction initializeFrontalArrays(numNodes, numElements) {\n // Use the actual number of elements from the mesh\n frontalData.nodalNumbering = Array(numElements)\n .fill()\n .map(() => Array(numNodes).fill(0));\n frontalData.nodeConstraintCode = Array(numNodes).fill(0);\n frontalData.boundaryValues = Array(numNodes).fill(0);\n frontalData.globalResidualVector = Array(numNodes).fill(0);\n frontalData.solutionVector = Array(numNodes).fill(0);\n frontalData.topologyData = Array(numElements).fill(0);\n frontalData.lateralData = Array(numElements).fill(0);\n\n // Initialize frontalState arrays\n frontalState.writeFlag = 0;\n frontalState.totalNodes = numNodes;\n frontalState.transformationFlag = 0;\n frontalState.nodesPerElement = Array(numElements).fill(0);\n frontalState.determinant = 1;\n\n // For matrix operations, estimate required size based on problem complexity\n const systemSize = Math.max(numNodes, 2000);\n frontalState.globalSolutionVector = Array(systemSize).fill(0);\n frontalState.frontDataIndex = 0;\n\n // Initialize elementData arrays\n elementData.localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n elementData.currentElementIndex = 0;\n\n // Initialize frontStorage arrays\n const frontSize = estimateFrontSize(numNodes, numElements);\n frontStorage.frontValues = Array(frontSize).fill(0);\n frontStorage.columnHeaders = Array(systemSize).fill(0);\n frontStorage.pivotRow = Array(systemSize).fill(0);\n frontStorage.pivotData = Array(frontSize).fill(0);\n}\n\n/**\n * Function to estimate the required front size\n * @param {number} numNodes - Number of of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n * @returns {number} Estimated front size\n */\nfunction estimateFrontSize(numNodes, numElements) {\n const frontWidthEstimate = Math.max(Math.ceil(Math.sqrt(numElements)) * numNodes, numNodes * 2);\n return frontWidthEstimate * numElements;\n}\n// Old function to estimate the required front size\n// function estimateFrontSize(numNodes, numElements, numNodes) {\n// const frontWidthEstimate = Math.ceil(Math.sqrt(numElements) * numNodes * 2);\n// const frontSize = frontWidthEstimate * numNodes * 4;\n// return Math.max(frontSize, 10000);\n// }\n\n/**\n * Function to compute local Jacobian matrix and local residual vector\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n const elementIndex = elementData.currentElementIndex - 1;\n\n // Guard against out-of-range indices\n if (elementIndex < 0 || elementIndex >= meshData.totalElements) {\n errorLog(`Skipping out-of-range elementIndex=${elementIndex} (totalElements=${meshData.totalElements})`);\n return false;\n }\n\n // Domain terms\n const { localJacobianMatrix, localResidualVector, ngl } = assembleFront({\n elementIndex,\n nop: frontalData.nodalNumbering,\n meshData,\n basisFunctions: basisFunctions,\n FEAData,\n // These are ignored by linear assemblers\n solutionVector: frontalState.currentSolutionVector,\n eikonalActivationFlag: frontalState.eikonalActivationFlag,\n });\n\n // Handle Robin-type boundary conditions differently based on which solver is being used\n let boundaryLocalJacobianMatrix = Array(FEAData.numNodes)\n .fill()\n .map(() => Array(FEAData.numNodes).fill(0));\n let boundaryResidualVector = Array(FEAData.numNodes).fill(0);\n\n // heatConductionScript solver\n if (assembleFront === assembleHeatConductionFront) {\n // Check if this element is on a Robin-type boundary\n let isOnRobinTypeBoundary = false;\n for (const boundaryKey in meshData.boundaryElements) {\n if (\n thermalBoundaryConditions.boundaryConditions[boundaryKey]?.[0] === \"convection\" &&\n meshData.boundaryElements[boundaryKey].some(([elemIdx, _]) => elemIdx === elementIndex)\n ) {\n isOnRobinTypeBoundary = true;\n break;\n }\n }\n\n // Only calculate Robin-type for elements when required\n if (isOnRobinTypeBoundary) {\n const { gaussPoints, gaussWeights } = FEAData;\n const result = thermalBoundaryConditions.imposeConvectionBoundaryConditionsFront(\n elementIndex,\n meshData.nodesXCoordinates,\n meshData.nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n );\n boundaryLocalJacobianMatrix = result.localJacobianMatrix;\n boundaryResidualVector = result.localResidualVector;\n }\n } else if (assembleFront === assembleFrontPropagationFront) {\n // For now, no Robin-type boundary conditions exist for any other solver\n }\n\n // Combine domain and boundary contributions\n for (let localNodeI = 0; localNodeI < FEAData.numNodes; localNodeI++) {\n for (let localNodeJ = 0; localNodeJ < FEAData.numNodes; localNodeJ++) {\n elementData.localJacobianMatrix[localNodeI][localNodeJ] =\n localJacobianMatrix[localNodeI][localNodeJ] + boundaryLocalJacobianMatrix[localNodeI][localNodeJ];\n }\n }\n\n // Assemble local element residual\n for (let localNodeIndex = 0; localNodeIndex < FEAData.numNodes; localNodeIndex++) {\n const globalNodeIndex = ngl[localNodeIndex] - 1;\n frontalData.globalResidualVector[globalNodeIndex] +=\n localResidualVector[localNodeIndex] + boundaryResidualVector[localNodeIndex];\n }\n\n return true;\n}\n\n/**\n * Function to implement the frontal solver algorithm\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction runFrontalAlgorithm(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n // Allocate local arrays dynamically\n const totalElements = meshData.totalElements;\n const numNodes = meshData.nodesXCoordinates.length;\n const systemSize = Math.max(numNodes, frontalState.globalSolutionVector.length);\n let localDestination = Array(FEAData.numNodes).fill(0);\n let rowDestination = Array(FEAData.numNodes).fill(0);\n let rowHeaders = Array(systemSize).fill(0);\n let pivotRowIndices = Array(systemSize).fill(0);\n let pivotColumnIndices = Array(systemSize).fill(0);\n let modifiedRows = Array(systemSize).fill(0);\n let pivotColumn = Array(systemSize).fill(0);\n let frontMatrix = Array(systemSize)\n .fill()\n .map(() => Array(systemSize).fill(0));\n let rowSwapCount = Array(numNodes).fill(0);\n let columnSwapCount = Array(numNodes).fill(0);\n let lastAppearanceCheck = Array(numNodes).fill(0);\n let pivotColumnGlobalIndex; // Pivot column global index\n\n let frontDataCounter = 1;\n frontalState.writeFlag++;\n let pivotDataIndex = 1;\n let summedRows = 1;\n elementData.currentElementIndex = 0;\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n rowSwapCount[nodeIndex] = 0;\n columnSwapCount[nodeIndex] = 0;\n }\n\n if (frontalState.transformationFlag !== 0) {\n // Prefront: find last appearance of each node\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n lastAppearanceCheck[nodeIndex] = 0;\n }\n\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n let reverseElementIndex = totalElements - elementIndex - 1;\n for (\n let localNodeIndex = 0;\n localNodeIndex < frontalState.nodesPerElement[reverseElementIndex];\n localNodeIndex++\n ) {\n let globalNodeIndex = frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n if (lastAppearanceCheck[globalNodeIndex - 1] === 0) {\n lastAppearanceCheck[globalNodeIndex - 1] = 1;\n frontalData.nodalNumbering[reverseElementIndex][localNodeIndex] =\n -frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n }\n }\n }\n }\n\n frontalState.transformationFlag = 0;\n let columnCount = 0;\n let rowCount = 0;\n\n for (let i = 0; i < systemSize; i++) {\n for (let j = 0; j < systemSize; j++) {\n frontMatrix[j][i] = 0;\n }\n }\n\n while (true) {\n // Assemble a new element only while we still have elements\n let assembled = false;\n let numElementNodes = 0;\n let numElementColumns = 0;\n\n if (elementData.currentElementIndex < totalElements) {\n elementData.currentElementIndex++;\n assembled = assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront);\n }\n\n if (assembled) {\n const currentElement = elementData.currentElementIndex;\n numElementNodes = frontalState.nodesPerElement[currentElement - 1];\n numElementColumns = frontalState.nodesPerElement[currentElement - 1];\n\n for (let localNodeIndex = 0; localNodeIndex < numElementColumns; localNodeIndex++) {\n let globalNodeIndex = frontalData.nodalNumbering[currentElement - 1][localNodeIndex];\n let columnIndex;\n\n if (columnCount === 0) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n for (columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(frontStorage.columnHeaders[columnIndex])) break;\n }\n\n if (columnIndex === columnCount) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n localDestination[localNodeIndex] = columnIndex + 1;\n frontStorage.columnHeaders[columnIndex] = globalNodeIndex;\n }\n }\n\n let rowIndex;\n if (rowCount === 0) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(rowHeaders[rowIndex])) break;\n }\n\n if (rowIndex === rowCount) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n rowDestination[localNodeIndex] = rowIndex + 1;\n rowHeaders[rowIndex] = globalNodeIndex;\n }\n }\n }\n\n if (rowCount > systemSize || columnCount > systemSize) {\n errorLog(\"Error: systemSize not large enough\");\n return;\n }\n\n for (let localColumnIndex = 0; localColumnIndex < numElementColumns; localColumnIndex++) {\n let frontColumnIndex = localDestination[localColumnIndex];\n for (let localRowIndex = 0; localRowIndex < numElementNodes; localRowIndex++) {\n let frontRowIndex = rowDestination[localRowIndex];\n frontMatrix[frontRowIndex - 1][frontColumnIndex - 1] +=\n elementData.localJacobianMatrix[localRowIndex][localColumnIndex];\n }\n }\n }\n\n // Pivoting/elimination continues whether or not a new element was assembled\n let availableColumnCount = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (frontStorage.columnHeaders[columnIndex] < 0) {\n pivotColumnIndices[availableColumnCount] = columnIndex + 1;\n availableColumnCount++;\n }\n }\n\n let constrainedRowCount = 0;\n let availableRowCount = 0;\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n let globalNodeIndex = rowHeaders[rowIndex];\n if (globalNodeIndex < 0) {\n pivotRowIndices[availableRowCount] = rowIndex + 1;\n availableRowCount++;\n let absoluteNodeIndex = Math.abs(globalNodeIndex);\n if (frontalData.nodeConstraintCode[absoluteNodeIndex - 1] === 1) {\n modifiedRows[constrainedRowCount] = rowIndex + 1;\n constrainedRowCount++;\n frontalData.nodeConstraintCode[absoluteNodeIndex - 1] = 2;\n frontalData.globalResidualVector[absoluteNodeIndex - 1] =\n frontalData.boundaryValues[absoluteNodeIndex - 1];\n }\n }\n }\n\n if (constrainedRowCount > 0) {\n for (let constrainedIndex = 0; constrainedIndex < constrainedRowCount; constrainedIndex++) {\n let rowIndex = modifiedRows[constrainedIndex] - 1;\n let globalNodeIndex = Math.abs(rowHeaders[rowIndex]);\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] = 0;\n let columnGlobalIndex = Math.abs(frontStorage.columnHeaders[columnIndex]);\n if (columnGlobalIndex === globalNodeIndex) frontMatrix[rowIndex][columnIndex] = 1;\n }\n }\n }\n\n if (availableColumnCount > summedRows || elementData.currentElementIndex < totalElements) {\n if (availableColumnCount === 0) {\n errorLog(\"Error: no more rows fully summed\");\n return;\n }\n\n let pivotRowIndex = pivotRowIndices[0];\n let pivotColumnIndex = pivotColumnIndices[0];\n let pivotValue = frontMatrix[pivotRowIndex - 1][pivotColumnIndex - 1];\n\n if (Math.abs(pivotValue) < 1e-4) {\n pivotValue = 0;\n for (let columnIndex = 0; columnIndex < availableColumnCount; columnIndex++) {\n let testColumnIndex = pivotColumnIndices[columnIndex];\n for (let rowIndex = 0; rowIndex < availableRowCount; rowIndex++) {\n let testRowIndex = pivotRowIndices[rowIndex];\n let testValue = frontMatrix[testRowIndex - 1][testColumnIndex - 1];\n if (Math.abs(testValue) > Math.abs(pivotValue)) {\n pivotValue = testValue;\n pivotColumnIndex = testColumnIndex;\n pivotRowIndex = testRowIndex;\n }\n }\n }\n }\n\n let pivotGlobalRowIndex = Math.abs(rowHeaders[pivotRowIndex - 1]);\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]); // Assign, don't declare\n let permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n if (nodeIndex >= pivotGlobalRowIndex) rowSwapCount[nodeIndex]--;\n if (nodeIndex >= pivotColumnGlobalIndex) columnSwapCount[nodeIndex]--;\n }\n\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontMatrix[pivotRowIndex - 1][columnIndex] / pivotValue;\n }\n\n let rightHandSide = frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] = rightHandSide;\n pivotColumn[pivotRowIndex - 1] = pivotValue;\n\n if (pivotRowIndex > 1) {\n for (let rowIndex = 0; rowIndex < pivotRowIndex - 1; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1 && eliminationFactor !== 0) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] -= eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n if (pivotRowIndex < rowCount) {\n for (let rowIndex = pivotRowIndex; rowIndex < rowCount; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = pivotColumn[i];\n }\n pivotDataIndex += rowCount;\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = rowHeaders[i];\n }\n pivotDataIndex += rowCount;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.pivotRow[i];\n }\n frontDataCounter += columnCount;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.columnHeaders[i];\n }\n frontDataCounter += columnCount;\n\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n frontMatrix[rowIndex][columnCount - 1] = 0;\n }\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowCount - 1][columnIndex] = 0;\n }\n\n columnCount--;\n if (pivotColumnIndex < columnCount + 1) {\n for (let columnIndex = pivotColumnIndex - 1; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] = frontStorage.columnHeaders[columnIndex + 1];\n }\n }\n\n rowCount--;\n if (pivotRowIndex < rowCount + 1) {\n for (let rowIndex = pivotRowIndex - 1; rowIndex < rowCount; rowIndex++) {\n rowHeaders[rowIndex] = rowHeaders[rowIndex + 1];\n }\n }\n\n if (rowCount > 1 || elementData.currentElementIndex < totalElements) continue;\n\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[0]); // Assign, don't declare\n pivotRowIndex = 1;\n pivotValue = frontMatrix[0][0];\n pivotGlobalRowIndex = Math.abs(rowHeaders[0]);\n pivotColumnIndex = 1;\n permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n frontStorage.pivotRow[0] = 1;\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] =\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.pivotRow[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.columnHeaders[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotColumn[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = rowHeaders[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n frontalState.frontDataIndex = frontDataCounter;\n if (frontalState.writeFlag === 1)\n debugLog(`total ecs transfer in matrix reduction=${frontDataCounter}`);\n\n // Back substitution\n performBackSubstitution(frontDataCounter);\n break;\n }\n }\n}\n\n/**\n * Function to perform back substitution for the frontal solver\n * @param {number} frontDataCounter - Index counter for the element contributions\n */\nfunction performBackSubstitution(frontDataCounter) {\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n frontalState.globalSolutionVector[nodeIndex] = frontalData.boundaryValues[nodeIndex];\n }\n\n for (let iterationIndex = 1; iterationIndex <= frontalState.totalNodes; iterationIndex++) {\n frontDataCounter -= 4;\n let pivotGlobalRowIndex = frontStorage.frontValues[frontDataCounter - 1];\n let columnCount = frontStorage.frontValues[frontDataCounter];\n let pivotColumnIndex = frontStorage.frontValues[frontDataCounter + 1];\n let pivotValue = frontStorage.frontValues[frontDataCounter + 2];\n\n if (iterationIndex === 1) {\n frontDataCounter--;\n frontStorage.columnHeaders[0] = frontStorage.frontValues[frontDataCounter - 1];\n frontDataCounter--;\n frontStorage.pivotRow[0] = frontStorage.frontValues[frontDataCounter - 1];\n } else {\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] =\n frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n }\n\n let pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]);\n if (frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] > 0) continue;\n\n let accumulatedValue = 0;\n frontStorage.pivotRow[pivotColumnIndex - 1] = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n accumulatedValue -=\n frontStorage.pivotRow[columnIndex] *\n frontalState.globalSolutionVector[Math.abs(frontStorage.columnHeaders[columnIndex]) - 1];\n }\n\n frontalState.globalSolutionVector[pivotColumnGlobalIndex - 1] =\n accumulatedValue + frontalData.globalResidualVector[pivotGlobalRowIndex - 1];\n\n frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] = 1;\n }\n\n if (frontalState.writeFlag === 1)\n debugLog(`value of frontDataCounter after backsubstitution=${frontDataCounter}`);\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { euclideanNorm } from \"../methods/euclideanNormScript.js\";\nimport { solveLinearSystem } from \"./linearSystemSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\nimport { runFrontalSolver } from \"./frontalSolverScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\n\n/**\n * Function to solve a system of non-linear equations using the Newton-Raphson method\n * @param {function} assembleMat - Matrix assembler based on the physical model\n * @param {object} context - Context object containing simulation data and options\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-4] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\n\nexport function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-4) {\n let errorNorm = 0;\n let converged = false;\n let iterations = 0;\n let deltaX = [];\n let solutionVector = [];\n let jacobianMatrix = [];\n let residualVector = [];\n\n // Calculate system size\n let totalNodes = context.meshData.nodesXCoordinates.length;\n\n // Initialize arrays with proper size\n for (let i = 0; i < totalNodes; i++) {\n deltaX[i] = 0;\n solutionVector[i] = 0;\n }\n\n // Initialize solution from context if available\n if (context.initialSolution && context.initialSolution.length === totalNodes) {\n solutionVector = [...context.initialSolution];\n }\n\n while (iterations < maxIterations && !converged) {\n // Update solution\n for (let i = 0; i < solutionVector.length; i++) {\n solutionVector[i] = Number(solutionVector[i]) + Number(deltaX[i]);\n }\n\n // Check if using frontal solver\n if (context.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleFrontPropagationFront,\n context.meshData,\n context.boundaryConditions,\n { solutionVector, eikonalActivationFlag: context.eikonalActivationFlag }\n );\n deltaX = frontalResult.solutionVector;\n } else {\n // Compute Jacobian and residual matrices\n ({ jacobianMatrix, residualVector } = assembleMat(\n context.meshData,\n context.boundaryConditions,\n solutionVector, // The solution vector is required in the case of a non-linear equation\n context.eikonalActivationFlag // Currently used only in the front propagation solver (TODO refactor in case of a solver not needing it)\n ));\n\n // Solve the linear system based on the specified solver method\n const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);\n deltaX = linearSystemResult.solutionVector;\n }\n\n // Check convergence\n errorNorm = euclideanNorm(deltaX);\n\n // Norm for each iteration\n basicLog(`Newton-Raphson iteration ${iterations + 1}: Error norm = ${errorNorm.toExponential(4)}`);\n\n if (errorNorm <= tolerance) {\n converged = true;\n } else if (errorNorm > 1e2) {\n errorLog(`Solution not converged. Error norm: ${errorNorm}`);\n break;\n }\n\n iterations++;\n }\n\n return {\n solutionVector,\n converged,\n iterations,\n jacobianMatrix,\n residualVector,\n };\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { newtonRaphson } from \"./methods/newtonRaphsonScript.js\";\nimport { solveLinearSystem } from \"./methods/linearSystemSolverScript.js\";\nimport { prepareMesh } from \"./mesh/meshUtilsScript.js\";\nimport { assembleFrontPropagationMat } from \"./solvers/frontPropagationScript.js\";\nimport { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from \"./solvers/generalFormPDEScript.js\";\nimport { assembleHeatConductionMat, assembleHeatConductionFront } from \"./solvers/heatConductionScript.js\";\nimport { runFrontalSolver } from \"./methods/frontalSolverScript.js\";\nimport { basicLog, debugLog, warnLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n this.coefficientFunctions = null; // Add storage for coefficient functions\n warnLog(\n \"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE\"\n );\n basicLog(\"FEAScriptModel instance created\");\n }\n\n /**\n * Sets the solver configuration\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} [options] - Optional additional configuration\n */\n setSolverConfig(solverConfig, options = {}) {\n this.solverConfig = solverConfig;\n\n // Store coefficient functions if provided\n if (options && options.coefficientFunctions) {\n this.coefficientFunctions = options.coefficientFunctions;\n debugLog(\"Coefficient functions set\");\n }\n\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n /**\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let initialSolution = [];\n\n // Prepare the mesh\n basicLog(\"Preparing mesh...\");\n const meshData = prepareMesh(this.meshConfig);\n basicLog(\"Mesh preparation completed\");\n\n // Extract node coordinates from meshData\n const nodesCoordinates = {\n nodesXCoordinates: meshData.nodesXCoordinates,\n nodesYCoordinates: meshData.nodesYCoordinates,\n };\n\n // Select and execute the appropriate solver based on solverConfig\n basicLog(\"Beginning solving process...\");\n console.time(\"totalSolvingTime\");\n if (this.solverConfig === \"heatConductionScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleHeatConductionFront,\n meshData,\n this.boundaryConditions\n );\n solutionVector = frontalResult.solutionVector;\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n } else if (this.solverConfig === \"frontPropagationScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Initialize eikonalActivationFlag\n let eikonalActivationFlag = 0;\n const eikonalExteralIterations = 5; // Number of incremental steps for the eikonal equation\n\n // Create context object with all necessary properties\n const context = {\n meshData: meshData,\n boundaryConditions: this.boundaryConditions,\n eikonalActivationFlag: eikonalActivationFlag,\n solverMethod: this.solverMethod,\n initialSolution,\n };\n\n while (eikonalActivationFlag <= 1) {\n // Update the context object with current eikonalActivationFlag\n context.eikonalActivationFlag = eikonalActivationFlag;\n\n // Pass the previous solution as initial guess\n if (solutionVector.length > 0) {\n context.initialSolution = [...solutionVector];\n }\n\n // Solve the assembled non-linear system\n const newtonRaphsonResult = newtonRaphson(assembleFrontPropagationMat, context, 100, 1e-4);\n\n // Extract results\n jacobianMatrix = newtonRaphsonResult.jacobianMatrix;\n residualVector = newtonRaphsonResult.residualVector;\n solutionVector = newtonRaphsonResult.solutionVector;\n\n // Increment for next iteration\n eikonalActivationFlag += 1 / eikonalExteralIterations;\n }\n } else if (this.solverConfig === \"generalFormPDEScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n errorLog(\n \"Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.\"\n );\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleGeneralFormPDEMat(\n meshData,\n this.boundaryConditions,\n this.coefficientFunctions\n ));\n\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n }\n console.timeEnd(\"totalSolvingTime\");\n basicLog(\"Solving process completed\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { initializeFEA, performIsoparametricMapping1D } from \"../mesh/meshUtilsScript.js\";\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the general form PDE model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} coefficientFunctions - Functions A(x), B(x), C(x), D(x) for the PDE\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleGeneralFormPDEMat(meshData, boundaryConditions, coefficientFunctions) {\n basicLog(\"Starting general form PDE matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Extract coefficient functions\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Convert to 0-based indexing\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n const globalNodeIndex1 = localToGlobalMap[localNodeIndex1];\n\n // Source term contribution to residual vector\n residualVector[globalNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n const globalNodeIndex2 = localToGlobalMap[localNodeIndex2];\n\n // Diffusion term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEMat.\");\n // 2D general form PDE - empty for now\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Apply Dirichlet boundary conditions only\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n\n basicLog(\"General form PDE matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the frontal solver matrix for the general form PDE model\n * @param {object} data - Object containing element data for the frontal solver\n * @returns {object} An object containing local Jacobian matrix and residual vector\n */\nexport function assembleGeneralFormPDEFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n coefficientFunctions,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of local Jacobian matrix and residual vector\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n // Source term contribution to local residual vector\n localResidualVector[localNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Diffusion term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEFront.\");\n // 2D general form PDE - empty for now\n }\n\n return {\n localJacobianMatrix,\n localResidualVector,\n ngl,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n\n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n\n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map((val) => val[0]);\n } else {\n zValues = solutionVector;\n }\n\n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n\n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: \"closest\",\n };\n\n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: \"Solution Field\",\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n name: \"Solution Field\",\n };\n\n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const printVersion = \"0.1.3\";"],"names":["euclideanNorm","vector","norm","i","length","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","solveLinearSystem","solverMethod","jacobianMatrix","residualVector","options","maxIterations","tolerance","solutionVector","converged","iterations","time","jacobianMatrixSparse","math","sparse","luFactorization","slu","solutionMatrix","lusolve","squeeze","valueOf","jacobiSolverResult","initialGuess","n","x","xNew","Array","iteration","sum","j","maxDiff","max","abs","jacobiSolver","fill","timeEnd","BasisFunctions","constructor","meshDimension","elementOrder","this","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","Mesh","numElementsX","maxX","numElementsY","maxY","parsedMesh","boundaryElementsProcessed","parseMeshFromGmsh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","boundaryNodePairs","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","Mesh1D","super","generateMesh","nodesXCoordinates","totalNodesX","deltaX","nodeIndex","generate1DNodalNumbering","findBoundaryElements","nop","elementIndex","columnCounter","sideIndex","Mesh2D","nodesYCoordinates","totalNodesY","deltaY","nodeIndexY","nodeIndexX","nnode","generate2DNodalNumbering","rowCounter","elementIndexX","elementIndexY","nodeIndex1","nodeIndex2","NumericalIntegration","getGaussPointsAndWeights","gaussPoints","gaussWeights","initializeFEA","meshData","totalNodes","colIndex","basisFunctions","gaussPointsAndWeights","localToGlobalMap","numNodes","performIsoparametricMapping1D","params","xCoordinates","ksiDerivX","localNodeIndex","detJacobian","basisFunctionDerivX","performIsoparametricMapping2D","yCoordinates","etaDerivX","ksiDerivY","etaDerivY","basisFunctionDerivY","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","Object","keys","boundaryKey","tempValue","globalNodeIndex","imposeConstantTempBoundaryConditionsFront","nodeConstraintCode","boundaryValues","imposeConvectionBoundaryConditions","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","tangentVectorLength","localNodeIndex2","globalNodeIndex2","gaussPointIndex","imposeConvectionBoundaryConditionsFront","localJacobianMatrix","map","localResidualVector","boundaryElement","find","_","assembleHeatConductionFront","FEAData","ngl","gaussPointIndex1","localNodeIndex1","gaussPointIndex2","globalIndex","GenericBoundaryConditions","imposeDirichletBoundaryConditions","value","imposeConstantValueBoundaryConditionsFront","assembleFrontPropagationMat","eikonalActivationFlag","eikonalViscousTerm","totalElements","mappingResult","solutionDerivX","solutionDerivY","localToGlobalMap1","localToGlobalMap2","assembleFrontPropagationFront","frontalData","frontalState","elementData","currentElementIndex","frontStorage","runFrontalSolver","assembleFront","numElements","globalResidualVector","topologyData","lateralData","writeFlag","transformationFlag","nodesPerElement","determinant","systemSize","globalSolutionVector","frontDataIndex","frontSize","frontWidthEstimate","ceil","estimateFrontSize","frontValues","columnHeaders","pivotRow","pivotData","initializeFrontalArrays","dirichletBoundaryConditionsHandler","currentSolutionVector","thermalBoundaryConditions","pivotColumnGlobalIndex","localDestination","rowDestination","rowHeaders","pivotRowIndices","pivotColumnIndices","modifiedRows","pivotColumn","frontMatrix","rowSwapCount","columnSwapCount","lastAppearanceCheck","frontDataCounter","pivotDataIndex","summedRows","reverseElementIndex","columnCount","rowCount","assembled","numElementNodes","numElementColumns","assembleElementContribution","currentElement","columnIndex","rowIndex","localColumnIndex","frontColumnIndex","localRowIndex","availableColumnCount","constrainedRowCount","availableRowCount","absoluteNodeIndex","constrainedIndex","pivotRowIndex","pivotColumnIndex","pivotValue","testColumnIndex","testRowIndex","testValue","pivotGlobalRowIndex","permutationHelper","rightHandSide","globalRowIndex","eliminationFactor","performBackSubstitution","runFrontalAlgorithm","toExponential","finalNodesX","finalNodesY","slice","nodesCoordinates","boundaryLocalJacobianMatrix","boundaryResidualVector","isOnRobinTypeBoundary","some","result","localNodeI","localNodeJ","iterationIndex","accumulatedValue","newtonRaphson","assembleMat","context","errorNorm","initialSolution","Number","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","floor","random","MAX_SAFE_INTEGER","solverConfig","meshConfig","coefficientFunctions","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","mesh","nodesCoordinatesAndNumbering","prepareMesh","assembleHeatConductionMat","eikonalExteralIterations","newtonRaphsonResult","A","B","C","D","xCoord","a","b","d","globalNodeIndex1","assembleGeneralFormPDEMat","worker","feaWorker","isReady","_initWorker","Worker","URL","document","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar"],"mappings":"AAeO,SAASA,EAAcC,GAC5B,IAAIC,EAAO,EACX,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,IACjCD,GAAQD,EAAOE,GAAKF,EAAOE,GAG7B,OADAD,EAAOG,KAAKC,KAAKJ,GACVA,CACT,wDCXA,IAAIK,EAAkB,QAuBf,SAASC,EAASC,GACC,UAApBF,GACFG,QAAQC,IAAI,aAAeF,EAAS,qCAExC,CAMO,SAASG,EAASH,GACvBC,QAAQC,IAAI,YAAcF,EAAS,qCACrC,CAMO,SAASI,EAASJ,GACvBC,QAAQC,IAAI,aAAeF,EAAS,qCACtC,CC3BO,SAASK,EAAkBC,EAAcC,EAAgBC,EAAgBC,EAAU,CAAA,GACxF,MAAMC,cAAEA,EAAgB,IAAIC,UAAEA,EAAY,MAASF,EAEnD,IAAIG,EAAiB,GACjBC,GAAY,EACZC,EAAa,EAMjB,GAHAX,EAAS,wBAAwBG,QACjCL,QAAQc,KAAK,iBAEQ,YAAjBT,EAA4B,CAE9B,MAAMU,EAAuBC,KAAKC,OAAOX,GACnCY,EAAkBF,KAAKG,IAAIJ,EAAsB,EAAG,GAC1D,IA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,MAAO,CAAEH,MAAO,KAChBI,OAAQ,CAAEC,EAAG,GAAI5I,EAAG,GAAI6I,EAAG,GAAIlG,EAAG,IAClC8G,UAAW,WAGb,GAAIR,EAAc,CAEhB,MAAMS,EAAYR,EACZS,EAAYN,EAGS5gB,KAAKmhB,QAAQtgB,MAAMqe,KAAK7Z,GAAoB,CAAC4b,EAAWC,IACnF,IAAIE,EAAuBphB,KAAKmhB,QAAQtgB,MAAMqe,KAAKlZ,GAAoB,CAACib,EAAWC,IAG/EG,EAAmBrhB,KAAKmhB,QAAQtgB,MAAMqe,KAAKvf,GAAiB,CAACshB,EAAWC,IAGxEI,EAAqBthB,KAAKuhB,UAAUF,GAGpCG,EAAmB,GACvB,IAAK,IAAI/iB,EAAI,EAAGA,EAAIwiB,EAAYC,EAAWziB,GAAKyiB,EAAW,CACzD,IAAIO,EAASpc,EAAkB5G,GAC/B+iB,EAAiB5d,KAAK6d,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHjN,KAAM,UACNuN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETnf,EAAG6gB,EACHlD,EAAG8C,EAAqB,GACxB3c,KAAM,kBAIR4b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChB/gB,EAAG0E,EACHiZ,EAAGtY,EACH2b,EAAGd,EACHxM,KAAM,UACNuN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETrb,KAAM,kBAIR4b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,uBCrJ4B"} \ No newline at end of file diff --git a/dist/feascript.umd.js b/dist/feascript.umd.js index 1c05c40..10e9091 100644 --- a/dist/feascript.umd.js +++ b/dist/feascript.umd.js @@ -1,8 +1,8 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FEAScript={})}(this,(function(e){"use strict";function t(e){let t=0;for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],s=t[1];o(`Processing boundary node pair: [${n}, ${s}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0],2:[2]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((n=>{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0,3,6],1:[0,1,2],2:[2,5,8],3:[6,7,8]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}}))}imposeConvectionBoundaryConditions(e,t,n,s,i,r,a){let l=[],d=[];Object.keys(this.boundaryConditions).forEach((e=>{const t=this.boundaryConditions[e];"convection"===t[0]&&(l[e]=t[1],d[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const s=l[n],i=d[n];o(`Boundary ${n}: Applying convection with heat transfer coefficient h=${s} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;o(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-s*i,t[l][l]+=s}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((u=>{if("convection"===this.boundaryConditions[u][0]){const c=l[u],m=d[u];o(`Boundary ${u}: Applying convection with heat transfer coefficient h=${c} W/(m²·K) and external temperature T∞=${m} K`),this.boundaryElements[u].forEach((([l,d])=>{if("linear"===this.elementOrder){let u,h,f,p,b;0===d?(u=n[0],h=0,f=0,p=3,b=2):1===d?(u=0,h=n[0],f=0,p=2,b=1):2===d?(u=n[0],h=1,f=1,p=4,b=2):3===d&&(u=1,h=n[0],f=2,p=4,b=1);let y=a.getBasisFunctions(u,h),g=y.basisFunction,E=y.basisFunctionDerivKsi,v=y.basisFunctionDerivEta,M=0,C=0,F=0,D=0;const $=this.nop[l].length;for(let e=0;e<$;e++){const t=this.nop[l][e]-1;0===d||2===d?(M+=i[t]*E[e],C+=r[t]*E[e]):1!==d&&3!==d||(F+=i[t]*v[e],D+=r[t]*v[e])}let A;A=0===d||2===d?Math.sqrt(M**2+C**2):Math.sqrt(F**2+D**2);for(let n=f;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(a[e]=t[1],l[e]=t[2])}));const d=this.nop[e].length,u=Array(d).fill().map((()=>Array(d).fill(0))),c=Array(d).fill(0);for(const m in this.boundaryElements)if("convection"===this.boundaryConditions[m]?.[0]){const h=a[m],f=l[m];o(`Boundary ${m}: Applying convection with heat transfer coefficient h=${h} W/(m²·K) and external temperature T∞=${f} K`);const p=this.boundaryElements[m].find((([t,n])=>t===e));if(p){const a=p[1];if("1D"===this.meshDimension){let t;"linear"===this.elementOrder?t=0===a?0:1:"quadratic"===this.elementOrder&&(t=0===a?0:2),o(` - Applied convection boundary condition to node ${t+1} (element ${e+1}, local node ${t+1})`),c[t]+=-h*f,u[t][t]+=h}else if("2D"===this.meshDimension)if("linear"===this.elementOrder){let o,l,m,p,b;0===a?(o=s[0],l=0,m=0,p=3,b=2):1===a?(o=0,l=s[0],m=0,p=2,b=1):2===a?(o=s[0],l=1,m=1,p=4,b=2):3===a&&(o=1,l=s[0],m=2,p=4,b=1);const y=r.getBasisFunctions(o,l),g=y.basisFunction,E=y.basisFunctionDerivKsi,v=y.basisFunctionDerivEta;let M,C=0,F=0,D=0,$=0;for(let o=0;oArray(a).fill(0))),m=Array(a).fill(0),p=Array(a),b=Array(a);for(let n=0;ne-1)),{detJacobian:h,basisFunctionDerivX:b,basisFunctionDerivY:y}=f({basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:u,nodesXCoordinates:l,nodesYCoordinates:d,localToGlobalMap:m,numNodes:a});for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0],2:[2]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((n=>{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0,3,6],1:[0,1,2],2:[2,5,8],3:[6,7,8]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}}))}}function g(e,t,n,i){s("Starting front propagation matrix assembly...");let r=1-i+.01;o(`eikonalViscousTerm: ${r}`),o(`eikonalActivationFlag: ${i}`);const{nodesXCoordinates:a,nodesYCoordinates:l,nop:d,boundaryElements:u,totalElements:c,meshDimension:p,elementOrder:b}=e,g=m(e),{residualVector:E,jacobianMatrix:v,localToGlobalMap:M,basisFunctions:C,gaussPoints:F,gaussWeights:D,numNodes:$}=g;for(let e=0;eArray(d).fill(0))),y=Array(d).fill(0),g=Array(d),E=Array(d);for(let n=0;nArray(e).fill(0))),v.nodeConstraintCode=Array(e).fill(0),v.boundaryValues=Array(e).fill(0),v.globalResidualVector=Array(e).fill(0),v.solutionVector=Array(e).fill(0),v.topologyData=Array(t).fill(0),v.lateralData=Array(t).fill(0),M.writeFlag=0,M.totalNodes=e,M.transformationFlag=0,M.nodesPerElement=Array(t).fill(0),M.determinant=1;const n=Math.max(e,2e3);M.globalSolutionVector=Array(n).fill(0),M.frontDataIndex=0,C.localJacobianMatrix=Array(e).fill().map((()=>Array(e).fill(0))),C.currentElementIndex=0;const o=function(e,t){const n=Math.max(Math.ceil(Math.sqrt(t))*e,2*e);return n*t}(e,t);F.frontValues=Array(o).fill(0),F.columnHeaders=Array(n).fill(0),F.pivotRow=Array(n).fill(0),F.pivotData=Array(o).fill(0)}(l.numNodes,u),s("Solving system using frontal..."),console.time("systemSolving"),D=new a({meshDimension:t.meshDimension,elementOrder:t.elementOrder});for(let e=0;eArray(l).fill(0))),g=Array(a).fill(0),E=Array(a).fill(0),D=Array(a).fill(0),$=1;M.writeFlag++;let N=1,w=1;C.currentElementIndex=0;for(let e=0;el||O>l)return void i("Error: systemSize not large enough");for(let e=0;e0)for(let e=0;ew||C.currentElementIndexMath.abs(n)&&(n=r,t=s,e=i)}}}let s=Math.abs(m[e-1]);d=Math.abs(F.columnHeaders[t-1]);let a=s+d+g[s-1]+E[d-1];M.determinant=M.determinant*n*(-1)**a/Math.abs(n);for(let e=0;e=s&&g[e]--,e>=d&&E[e]--;if(Math.abs(n)<1e-10&&i(`Matrix singular or ill-conditioned, currentElementIndex=${C.currentElementIndex}, pivotGlobalRowIndex=${s}, pivotColumnGlobalIndex=${d}, pivotValue=${n}`),0===n)return;for(let t=0;t1)for(let n=0;n1&&0!==o)for(let e=0;e1)for(let e=0;e1||C.currentElementIndex=e.totalElements)return i(`Skipping out-of-range elementIndex=${s} (totalElements=${e.totalElements})`),!1;const{localJacobianMatrix:r,localResidualVector:a,ngl:l}=o({elementIndex:s,nop:v.nodalNumbering,meshData:e,basisFunctions:D,FEAData:t,solutionVector:M.currentSolutionVector,eikonalActivationFlag:M.eikonalActivationFlag});let d=Array(t.numNodes).fill().map((()=>Array(t.numNodes).fill(0))),u=Array(t.numNodes).fill(0);if(o===b){let o=!1;for(const t in e.boundaryElements)if("convection"===n.boundaryConditions[t]?.[0]&&e.boundaryElements[t].some((([e,t])=>e===s))){o=!0;break}if(o){const{gaussPoints:o,gaussWeights:i}=t,r=n.imposeConvectionBoundaryConditionsFront(s,e.nodesXCoordinates,e.nodesYCoordinates,o,i,D);d=r.localJacobianMatrix,u=r.localResidualVector}}for(let e=0;e0)continue;let r=0;F.pivotRow[s-1]=0;for(let e=0;e100){i(`Solution not converged. Error norm: ${l}`);break}u++}return{solutionVector:m,converged:d,iterations:u,jacobianMatrix:h,residualVector:f}} +function _loadWasmModule(e,t,n){for(var o=t.length,s="="==t[o-2]?2:"="==t[o-1]?1:0,i=new Uint8Array(3*o/4-s),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=new Uint8Array(130),l=0;l<64;l++)a[r.charCodeAt(l)]=l;for(var d=0,u=0;d>4,i[u++]=(15&c)<<4|m>>2,i[u++]=(3&m)<<6|63&a[t.charCodeAt(d+3)]}if(n&&!e)return WebAssembly.instantiate(i,n);if(n||e){var h=new WebAssembly.Module(i);return n?new WebAssembly.Instance(h,n):h}return WebAssembly.compile(i)}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FEAScript={})}(this,(function(e){"use strict";function t(e){let t=0;for(let n=0;n0&&void 0===this.parsedMesh.boundaryElements[0]){const e=[];for(let t=1;t{if(1===e.dimension){const t=this.parsedMesh.boundaryNodePairs[e.tag]||[];t.length>0&&(this.parsedMesh.boundaryElements[e.tag]||(this.parsedMesh.boundaryElements[e.tag]=[]),t.forEach((t=>{const n=t[0],s=t[1];o(`Processing boundary node pair: [${n}, ${s}] for boundary ${e.tag} (${e.name||"unnamed"})`);let r=!1;for(let t=0;t0&&void 0===this.parsedMesh.boundaryElements[0])){const e=[];for(let t=1;t{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0],2:[2]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((n=>{if("constantTemp"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant temperature of ${s} K (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0,3,6],1:[0,1,2],2:[2,5,8],3:[6,7,8]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant temperature to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}}))}imposeConvectionBoundaryConditions(e,t,n,s,i,r,a){let l=[],d=[];Object.keys(this.boundaryConditions).forEach((e=>{const t=this.boundaryConditions[e];"convection"===t[0]&&(l[e]=t[1],d[e]=t[2])})),"1D"===this.meshDimension?Object.keys(this.boundaryConditions).forEach((n=>{if("convection"===this.boundaryConditions[n][0]){const s=l[n],i=d[n];o(`Boundary ${n}: Applying convection with heat transfer coefficient h=${s} W/(m²·K) and external temperature T∞=${i} K`),this.boundaryElements[n].forEach((([n,r])=>{let a;"linear"===this.elementOrder?a=0===r?0:1:"quadratic"===this.elementOrder&&(a=0===r?0:2);const l=this.nop[n][a]-1;o(` - Applied convection boundary condition to node ${l+1} (element ${n+1}, local node ${a+1})`),e[l]+=-s*i,t[l][l]+=s}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((u=>{if("convection"===this.boundaryConditions[u][0]){const c=l[u],m=d[u];o(`Boundary ${u}: Applying convection with heat transfer coefficient h=${c} W/(m²·K) and external temperature T∞=${m} K`),this.boundaryElements[u].forEach((([l,d])=>{if("linear"===this.elementOrder){let u,h,f,p,b;0===d?(u=n[0],h=0,f=0,p=3,b=2):1===d?(u=0,h=n[0],f=0,p=2,b=1):2===d?(u=n[0],h=1,f=1,p=4,b=2):3===d&&(u=1,h=n[0],f=2,p=4,b=1);let y=a.getBasisFunctions(u,h),g=y.basisFunction,E=y.basisFunctionDerivKsi,v=y.basisFunctionDerivEta,C=0,M=0,F=0,D=0;const $=this.nop[l].length;for(let e=0;e<$;e++){const t=this.nop[l][e]-1;0===d||2===d?(C+=i[t]*E[e],M+=r[t]*E[e]):1!==d&&3!==d||(F+=i[t]*v[e],D+=r[t]*v[e])}let A;A=0===d||2===d?Math.sqrt(C**2+M**2):Math.sqrt(F**2+D**2);for(let n=f;n{const t=this.boundaryConditions[e];"convection"===t[0]&&(a[e]=t[1],l[e]=t[2])}));const d=this.nop[e].length,u=Array(d).fill().map((()=>Array(d).fill(0))),c=Array(d).fill(0);for(const m in this.boundaryElements)if("convection"===this.boundaryConditions[m]?.[0]){const h=a[m],f=l[m];o(`Boundary ${m}: Applying convection with heat transfer coefficient h=${h} W/(m²·K) and external temperature T∞=${f} K`);const p=this.boundaryElements[m].find((([t,n])=>t===e));if(p){const a=p[1];if("1D"===this.meshDimension){let t;"linear"===this.elementOrder?t=0===a?0:1:"quadratic"===this.elementOrder&&(t=0===a?0:2),o(` - Applied convection boundary condition to node ${t+1} (element ${e+1}, local node ${t+1})`),c[t]+=-h*f,u[t][t]+=h}else if("2D"===this.meshDimension)if("linear"===this.elementOrder){let o,l,m,p,b;0===a?(o=s[0],l=0,m=0,p=3,b=2):1===a?(o=0,l=s[0],m=0,p=2,b=1):2===a?(o=s[0],l=1,m=1,p=4,b=2):3===a&&(o=1,l=s[0],m=2,p=4,b=1);const y=r.getBasisFunctions(o,l),g=y.basisFunction,E=y.basisFunctionDerivKsi,v=y.basisFunctionDerivEta;let C,M=0,F=0,D=0,$=0;for(let o=0;oArray(a).fill(0))),m=Array(a).fill(0),p=Array(a),b=Array(a);for(let n=0;ne-1)),{detJacobian:h,basisFunctionDerivX:b,basisFunctionDerivY:y}=f({basisFunction:n,basisFunctionDerivKsi:s,basisFunctionDerivEta:u,nodesXCoordinates:l,nodesYCoordinates:d,localToGlobalMap:m,numNodes:a});for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=s;for(let n=0;n{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0],1:[1]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0],2:[2]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}})):"2D"===this.meshDimension&&Object.keys(this.boundaryConditions).forEach((n=>{if("constantValue"===this.boundaryConditions[n][0]){const s=this.boundaryConditions[n][1];o(`Boundary ${n}: Applying constant value of ${s} (Dirichlet condition)`),this.boundaryElements[n].forEach((([n,i])=>{if("linear"===this.elementOrder){({0:[0,2],1:[0,1],2:[1,3],3:[2,3]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}else if("quadratic"===this.elementOrder){({0:[0,3,6],1:[0,1,2],2:[2,5,8],3:[6,7,8]})[i].forEach((i=>{const r=this.nop[n][i]-1;o(` - Applied constant value to node ${r+1} (element ${n+1}, local node ${i+1})`),e[r]=1,t[r]=s}))}}))}}))}}function g(e,t,n,i){s("Starting front propagation matrix assembly...");let r=1-i+.01;o(`eikonalViscousTerm: ${r}`),o(`eikonalActivationFlag: ${i}`);const{nodesXCoordinates:a,nodesYCoordinates:l,nop:d,boundaryElements:u,totalElements:c,meshDimension:p,elementOrder:b}=e,g=m(e),{residualVector:E,jacobianMatrix:v,localToGlobalMap:C,basisFunctions:M,gaussPoints:F,gaussWeights:D,numNodes:$}=g;for(let e=0;eArray(d).fill(0))),y=Array(d).fill(0),g=Array(d),E=Array(d);for(let n=0;nArray(e).fill(0))),v.nodeConstraintCode=Array(e).fill(0),v.boundaryValues=Array(e).fill(0),v.globalResidualVector=Array(e).fill(0),v.solutionVector=Array(e).fill(0),v.topologyData=Array(t).fill(0),v.lateralData=Array(t).fill(0),C.writeFlag=0,C.totalNodes=e,C.transformationFlag=0,C.nodesPerElement=Array(t).fill(0),C.determinant=1;const n=Math.max(e,2e3);C.globalSolutionVector=Array(n).fill(0),C.frontDataIndex=0,M.localJacobianMatrix=Array(e).fill().map((()=>Array(e).fill(0))),M.currentElementIndex=0;const o=function(e,t){const n=Math.max(Math.ceil(Math.sqrt(t))*e,2*e);return n*t}(e,t);F.frontValues=Array(o).fill(0),F.columnHeaders=Array(n).fill(0),F.pivotRow=Array(n).fill(0),F.pivotData=Array(o).fill(0)}(l.numNodes,u),s("Solving system using frontal..."),console.time("systemSolving"),D=new a({meshDimension:t.meshDimension,elementOrder:t.elementOrder});for(let e=0;eArray(l).fill(0))),g=Array(a).fill(0),E=Array(a).fill(0),D=Array(a).fill(0),$=1;C.writeFlag++;let N=1,w=1;M.currentElementIndex=0;for(let e=0;el||O>l)return void i("Error: systemSize not large enough");for(let e=0;e0)for(let e=0;ew||M.currentElementIndexMath.abs(n)&&(n=r,t=s,e=i)}}}let s=Math.abs(m[e-1]);d=Math.abs(F.columnHeaders[t-1]);let a=s+d+g[s-1]+E[d-1];C.determinant=C.determinant*n*(-1)**a/Math.abs(n);for(let e=0;e=s&&g[e]--,e>=d&&E[e]--;if(Math.abs(n)<1e-10&&i(`Matrix singular or ill-conditioned, currentElementIndex=${M.currentElementIndex}, pivotGlobalRowIndex=${s}, pivotColumnGlobalIndex=${d}, pivotValue=${n}`),0===n)return;for(let t=0;t1)for(let n=0;n1&&0!==o)for(let e=0;e1)for(let e=0;e1||M.currentElementIndex=e.totalElements)return i(`Skipping out-of-range elementIndex=${s} (totalElements=${e.totalElements})`),!1;const{localJacobianMatrix:r,localResidualVector:a,ngl:l}=o({elementIndex:s,nop:v.nodalNumbering,meshData:e,basisFunctions:D,FEAData:t,solutionVector:C.currentSolutionVector,eikonalActivationFlag:C.eikonalActivationFlag});let d=Array(t.numNodes).fill().map((()=>Array(t.numNodes).fill(0))),u=Array(t.numNodes).fill(0);if(o===b){let o=!1;for(const t in e.boundaryElements)if("convection"===n.boundaryConditions[t]?.[0]&&e.boundaryElements[t].some((([e,t])=>e===s))){o=!0;break}if(o){const{gaussPoints:o,gaussWeights:i}=t,r=n.imposeConvectionBoundaryConditionsFront(s,e.nodesXCoordinates,e.nodesYCoordinates,o,i,D);d=r.localJacobianMatrix,u=r.localResidualVector}}for(let e=0;e0)continue;let r=0;F.pivotRow[s-1]=0;for(let e=0;e100){i(`Solution not converged. Error norm: ${l}`);break}u++}return{solutionVector:m,converged:d,iterations:u,jacobianMatrix:h,residualVector:f}} /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -const w=Symbol("Comlink.proxy"),O=Symbol("Comlink.endpoint"),S=Symbol("Comlink.releaseProxy"),X=Symbol("Comlink.finalizer"),V=Symbol("Comlink.thrown"),T=e=>"object"==typeof e&&null!==e||"function"==typeof e,k=new Map([["proxy",{canHandle:e=>T(e)&&e[w],serialize(e){const{port1:t,port2:n}=new MessageChannel;return R(e,t),[n,[n]]},deserialize:e=>(e.start(),Y(e))}],["throw",{canHandle:e=>T(e)&&V in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function R(e,t=globalThis,n=["*"]){t.addEventListener("message",(function o(s){if(!s||!s.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},s.data),l=(s.data.argumentList||[]).map(H);let d;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":d=n;break;case"SET":t[a.slice(-1)[0]]=H(s.data.value),d=!0;break;case"APPLY":d=n.apply(t,l);break;case"CONSTRUCT":d=function(e){return Object.assign(e,{[w]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;R(e,n),d=function(e,t){return K.set(e,t),e}(t,[t])}break;case"RELEASE":d=void 0;break;default:return}}catch(e){d={value:e,[V]:0}}Promise.resolve(d).catch((e=>({value:e,[V]:0}))).then((n=>{const[s,a]=J(n);t.postMessage(Object.assign(Object.assign({},s),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",o),P(t),X in e&&"function"==typeof e[X]&&e[X]())})).catch((e=>{const[n,o]=J({value:new TypeError("Unserializable return value"),[V]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),o)}))})),t.start&&t.start()}function P(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Y(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const o=n.get(t.id);if(o)try{o(t)}finally{n.delete(t.id)}})),W(e,n,[],t)}function I(e){if(e)throw new Error("Proxy has been released and is not useable")}function B(e){return L(e,new Map,{type:"RELEASE"}).then((()=>{P(e)}))}const q=new WeakMap,j="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(q.get(e)||0)-1;q.set(e,t),0===t&&B(e)}));function W(e,t,n=[],o=function(){}){let s=!1;const i=new Proxy(o,{get(o,r){if(I(s),r===S)return()=>{!function(e){j&&j.unregister(e)}(i),B(e),t.clear(),s=!0};if("then"===r){if(0===n.length)return{then:()=>i};const o=L(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(H);return o.then.bind(o)}return W(e,t,[...n,r])},set(o,i,r){I(s);const[a,l]=J(r);return L(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(H)},apply(o,i,r){I(s);const a=n[n.length-1];if(a===O)return L(e,t,{type:"ENDPOINT"}).then(H);if("bind"===a)return W(e,t,n.slice(0,-1));const[l,d]=G(r);return L(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(H)},construct(o,i){I(s);const[r,a]=G(i);return L(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(H)}});return function(e,t){const n=(q.get(t)||0)+1;q.set(t,n),j&&j.register(e,t,e)}(i,e),i}function G(e){const t=e.map(J);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const K=new WeakMap;function J(e){for(const[t,n]of k)if(n.canHandle(e)){const[o,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},s]}return[{type:"RAW",value:e},K.get(e)||[]]}function H(e){switch(e.type){case"HANDLER":return k.get(e.name).deserialize(e.value);case"RAW":return e.value}}function L(e,t,n,o){return new Promise((s=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,s),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),o)}))}e.FEAScriptModel=class{constructor(){var e;this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",this.coefficientFunctions=null,e="FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE",console.log("%c[WARN] "+e,"color: #FF9800; font-weight: bold;"),s("FEAScriptModel instance created")}setSolverConfig(e,t={}){this.solverConfig=e,t&&t.coefficientFunctions&&(this.coefficientFunctions=t.coefficientFunctions,o("Coefficient functions set")),o(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,o(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,o(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,o(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let e=[],t=[],n=[],a=[];s("Preparing mesh...");const l=function(e){const{meshDimension:t,numElementsX:n,numElementsY:s,maxX:r,maxY:a,elementOrder:l,parsedMesh:c}=e;let m;"1D"===t?m=new d({numElementsX:n,maxX:r,elementOrder:l,parsedMesh:c}):"2D"===t?m=new u({numElementsX:n,maxX:r,numElementsY:s,maxY:a,elementOrder:l,parsedMesh:c}):i("Mesh dimension must be either '1D' or '2D'.");const h=m.boundaryElementsProcessed?m.parsedMesh:m.generateMesh();let f,p,b=h.nodesXCoordinates,y=h.nodesYCoordinates,g=h.totalNodesX,E=h.totalNodesY,v=h.nodalNumbering,M=h.boundaryElements;return null!=c?(f=v.length,p=b.length,o(`Using parsed mesh with ${f} elements and ${p} nodes`)):(f=n*("2D"===t?s:1),p=g*("2D"===t?E:1),o(`Using mesh generated from geometry with ${f} elements and ${p} nodes`)),{nodesXCoordinates:b,nodesYCoordinates:y,totalNodesX:g,totalNodesY:E,nop:v,boundaryElements:M,totalElements:f,totalNodes:p,meshDimension:t,elementOrder:l}}(this.meshConfig);s("Mesh preparation completed");const c={nodesXCoordinates:l.nodesXCoordinates,nodesYCoordinates:l.nodesYCoordinates};if(s("Beginning solving process..."),console.time("totalSolvingTime"),"heatConductionScript"===this.solverConfig)if(s(`Using solver: ${this.solverConfig}`),"frontal"===this.solverMethod){n=$(b,l,this.boundaryConditions).solutionVector}else{({jacobianMatrix:e,residualVector:t}=function(e,t){s("Starting solid heat transfer matrix assembly...");const{nodesXCoordinates:n,nodesYCoordinates:o,nop:i,boundaryElements:r,totalElements:a,meshDimension:l,elementOrder:d}=e,u=m(e),{residualVector:c,jacobianMatrix:b,localToGlobalMap:y,basisFunctions:g,gaussPoints:E,gaussWeights:v,numNodes:M}=u;for(let e=0;e0&&(r.initialSolution=[...n]);const s=N(g,r,100,1e-4);e=s.jacobianMatrix,t=s.residualVector,n=s.solutionVector,o+=1/i}}else if("generalFormPDEScript"===this.solverConfig)if(s(`Using solver: ${this.solverConfig}`),"frontal"===this.solverMethod)i("Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.");else{({jacobianMatrix:e,residualVector:t}=function(e,t,n){s("Starting general form PDE matrix assembly...");const{nodesXCoordinates:o,nodesYCoordinates:r,nop:a,boundaryElements:l,totalElements:d,meshDimension:u,elementOrder:c}=e,{A:f,B:p,C:b,D:g}=n,E=m(e),{residualVector:v,jacobianMatrix:M,localToGlobalMap:C,basisFunctions:F,gaussPoints:D,gaussWeights:$,numNodes:A}=E;if("1D"===u)for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=Y(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const o=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(o,1e3)};o()}))}async setSolverConfig(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),s("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),s(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),s("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return s(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},e.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),s="",i=0,r=0,a=0,l=0,d={numNodes:0},u=0,c=[],m=0,h=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},b=0,y={};for(;i""!==e));if("meshFormat"===s)t.gmshV=parseFloat(o[0]),t.ascii="0"===o[1],t.fltBytes=o[2];else if("physicalNames"===s){if(o.length>=3){if(!/^\d+$/.test(o[0])){i++;continue}const e=parseInt(o[0],10),n=parseInt(o[1],10);let s=o.slice(2).join(" ");s=s.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:s})}}else if("nodes"===s){if(0===r){r=parseInt(o[0],10),a=parseInt(o[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;y[n]||(y[n]=[]),y[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);b++,b===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=y[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),o(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},e.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),n="basic"):(n=e,s(`Log level set to: ${e}`))},e.plotSolution=function(e,t,n,o,s,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===o&&"line"===s){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let o=Array.from(a),s={x:o,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...o),d=r/l,u={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[s],u,{responsive:!0})}else if("2D"===o&&"contour"===s){const t="structured"===r,o=new Set(a).size,d=new Set(l).size;let u;u=Array.isArray(e[0])?e.map((e=>e[0])):e;let c=Math.min(window.innerWidth,700),m=Math.max(...a),h=Math.max(...l)/m,f=Math.min(c,600),p={title:`${s} plot - ${n}`,width:f,height:f*h*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=o,n=d;math.reshape(Array.from(a),[t,n]);let s=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),u=math.transpose(r),c=[];for(let e=0;e"object"==typeof e&&null!==e||"function"==typeof e,k=new Map([["proxy",{canHandle:e=>T(e)&&e[w],serialize(e){const{port1:t,port2:n}=new MessageChannel;return R(e,t),[n,[n]]},deserialize:e=>(e.start(),Y(e))}],["throw",{canHandle:e=>T(e)&&V in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function R(e,t=globalThis,n=["*"]){t.addEventListener("message",(function o(s){if(!s||!s.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(n,s.origin))return void console.warn(`Invalid origin '${s.origin}' for comlink proxy`);const{id:i,type:r,path:a}=Object.assign({path:[]},s.data),l=(s.data.argumentList||[]).map(H);let d;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),n=a.reduce(((e,t)=>e[t]),e);switch(r){case"GET":d=n;break;case"SET":t[a.slice(-1)[0]]=H(s.data.value),d=!0;break;case"APPLY":d=n.apply(t,l);break;case"CONSTRUCT":d=function(e){return Object.assign(e,{[w]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;R(e,n),d=function(e,t){return K.set(e,t),e}(t,[t])}break;case"RELEASE":d=void 0;break;default:return}}catch(e){d={value:e,[V]:0}}Promise.resolve(d).catch((e=>({value:e,[V]:0}))).then((n=>{const[s,a]=J(n);t.postMessage(Object.assign(Object.assign({},s),{id:i}),a),"RELEASE"===r&&(t.removeEventListener("message",o),P(t),X in e&&"function"==typeof e[X]&&e[X]())})).catch((e=>{const[n,o]=J({value:new TypeError("Unserializable return value"),[V]:0});t.postMessage(Object.assign(Object.assign({},n),{id:i}),o)}))})),t.start&&t.start()}function P(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function Y(e,t){const n=new Map;return e.addEventListener("message",(function(e){const{data:t}=e;if(!t||!t.id)return;const o=n.get(t.id);if(o)try{o(t)}finally{n.delete(t.id)}})),j(e,n,[],t)}function I(e){if(e)throw new Error("Proxy has been released and is not useable")}function B(e){return L(e,new Map,{type:"RELEASE"}).then((()=>{P(e)}))}const W=new WeakMap,q="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(W.get(e)||0)-1;W.set(e,t),0===t&&B(e)}));function j(e,t,n=[],o=function(){}){let s=!1;const i=new Proxy(o,{get(o,r){if(I(s),r===S)return()=>{!function(e){q&&q.unregister(e)}(i),B(e),t.clear(),s=!0};if("then"===r){if(0===n.length)return{then:()=>i};const o=L(e,t,{type:"GET",path:n.map((e=>e.toString()))}).then(H);return o.then.bind(o)}return j(e,t,[...n,r])},set(o,i,r){I(s);const[a,l]=J(r);return L(e,t,{type:"SET",path:[...n,i].map((e=>e.toString())),value:a},l).then(H)},apply(o,i,r){I(s);const a=n[n.length-1];if(a===O)return L(e,t,{type:"ENDPOINT"}).then(H);if("bind"===a)return j(e,t,n.slice(0,-1));const[l,d]=G(r);return L(e,t,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:l},d).then(H)},construct(o,i){I(s);const[r,a]=G(i);return L(e,t,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:r},a).then(H)}});return function(e,t){const n=(W.get(t)||0)+1;W.set(t,n),q&&q.register(e,t,e)}(i,e),i}function G(e){const t=e.map(J);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const K=new WeakMap;function J(e){for(const[t,n]of k)if(n.canHandle(e)){const[o,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},s]}return[{type:"RAW",value:e},K.get(e)||[]]}function H(e){switch(e.type){case"HANDLER":return k.get(e.name).deserialize(e.value);case"RAW":return e.value}}function L(e,t,n,o){return new Promise((s=>{const i=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.set(i,s),e.start&&e.start(),e.postMessage(Object.assign({id:i},n),o)}))}e.FEAScriptModel=class{constructor(){var e;this.solverConfig=null,this.meshConfig={},this.boundaryConditions={},this.solverMethod="lusolve",this.coefficientFunctions=null,e="FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE",console.log("%c[WARN] "+e,"color: #FF9800; font-weight: bold;"),s("FEAScriptModel instance created")}setSolverConfig(e,t={}){this.solverConfig=e,t&&t.coefficientFunctions&&(this.coefficientFunctions=t.coefficientFunctions,o("Coefficient functions set")),o(`Solver config set to: ${e}`)}setMeshConfig(e){this.meshConfig=e,o(`Mesh config set with dimensions: ${e.meshDimension}`)}addBoundaryCondition(e,t){this.boundaryConditions[e]=t,o(`Boundary condition added for boundary: ${e}, type: ${t[0]}`)}setSolverMethod(e){this.solverMethod=e,o(`Solver method set to: ${e}`)}solve(){if(!this.solverConfig||!this.meshConfig||!this.boundaryConditions){const e="Solver config, mesh config, and boundary conditions must be set before solving.";throw console.error(e),new Error(e)}let e=[],t=[],n=[],a=[];s("Preparing mesh...");const l=function(e){const{meshDimension:t,numElementsX:n,numElementsY:s,maxX:r,maxY:a,elementOrder:l,parsedMesh:c}=e;let m;"1D"===t?m=new d({numElementsX:n,maxX:r,elementOrder:l,parsedMesh:c}):"2D"===t?m=new u({numElementsX:n,maxX:r,numElementsY:s,maxY:a,elementOrder:l,parsedMesh:c}):i("Mesh dimension must be either '1D' or '2D'.");const h=m.boundaryElementsProcessed?m.parsedMesh:m.generateMesh();let f,p,b=h.nodesXCoordinates,y=h.nodesYCoordinates,g=h.totalNodesX,E=h.totalNodesY,v=h.nodalNumbering,C=h.boundaryElements;return null!=c?(f=v.length,p=b.length,o(`Using parsed mesh with ${f} elements and ${p} nodes`)):(f=n*("2D"===t?s:1),p=g*("2D"===t?E:1),o(`Using mesh generated from geometry with ${f} elements and ${p} nodes`)),{nodesXCoordinates:b,nodesYCoordinates:y,totalNodesX:g,totalNodesY:E,nop:v,boundaryElements:C,totalElements:f,totalNodes:p,meshDimension:t,elementOrder:l}}(this.meshConfig);s("Mesh preparation completed");const c={nodesXCoordinates:l.nodesXCoordinates,nodesYCoordinates:l.nodesYCoordinates};if(s("Beginning solving process..."),console.time("totalSolvingTime"),"heatConductionScript"===this.solverConfig)if(s(`Using solver: ${this.solverConfig}`),"frontal"===this.solverMethod){n=$(b,l,this.boundaryConditions).solutionVector}else{({jacobianMatrix:e,residualVector:t}=function(e,t){s("Starting solid heat transfer matrix assembly...");const{nodesXCoordinates:n,nodesYCoordinates:o,nop:i,boundaryElements:r,totalElements:a,meshDimension:l,elementOrder:d}=e,u=m(e),{residualVector:c,jacobianMatrix:b,localToGlobalMap:y,basisFunctions:g,gaussPoints:E,gaussWeights:v,numNodes:C}=u;for(let e=0;e0&&(r.initialSolution=[...n]);const s=N(g,r,100,1e-4);e=s.jacobianMatrix,t=s.residualVector,n=s.solutionVector,o+=1/i}}else if("generalFormPDEScript"===this.solverConfig)if(s(`Using solver: ${this.solverConfig}`),"frontal"===this.solverMethod)i("Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.");else{({jacobianMatrix:e,residualVector:t}=function(e,t,n){s("Starting general form PDE matrix assembly...");const{nodesXCoordinates:o,nodesYCoordinates:r,nop:a,boundaryElements:l,totalElements:d,meshDimension:u,elementOrder:c}=e,{A:f,B:p,C:b,D:g}=n,E=m(e),{residualVector:v,jacobianMatrix:C,localToGlobalMap:M,basisFunctions:F,gaussPoints:D,gaussWeights:$,numNodes:A}=E;if("1D"===u)for(let e=0;e{console.error("FEAScriptWorker: Worker error:",e)};const e=Y(this.worker);this.feaWorker=await new e,this.isReady=!0}catch(e){throw console.error("Failed to initialize worker",e),e}}async _ensureReady(){return this.isReady?Promise.resolve():new Promise(((e,t)=>{let n=0;const o=()=>{n++,this.isReady?e():n>=50?t(new Error("Timeout waiting for worker to be ready")):setTimeout(o,1e3)};o()}))}async setSolverConfig(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver config to: ${e}`),this.feaWorker.setSolverConfig(e)}async setMeshConfig(e){return await this._ensureReady(),s("FEAScriptWorker: Setting mesh config"),this.feaWorker.setMeshConfig(e)}async addBoundaryCondition(e,t){return await this._ensureReady(),s(`FEAScriptWorker: Adding boundary condition for boundary: ${e}`),this.feaWorker.addBoundaryCondition(e,t)}async setSolverMethod(e){return await this._ensureReady(),s(`FEAScriptWorker: Setting solver method to: ${e}`),this.feaWorker.setSolverMethod(e)}async solve(){await this._ensureReady(),s("FEAScriptWorker: Requesting solution from worker...");const e=performance.now(),t=await this.feaWorker.solve();return s(`FEAScriptWorker: Solution completed in ${((performance.now()-e)/1e3).toFixed(2)}s`),t}async getModelInfo(){return await this._ensureReady(),this.feaWorker.getModelInfo()}async ping(){return await this._ensureReady(),this.feaWorker.ping()}terminate(){this.worker&&(this.worker.terminate(),this.worker=null,this.feaWorker=null,this.isReady=!1)}},e.importGmshQuadTri=async e=>{let t={nodesXCoordinates:[],nodesYCoordinates:[],nodalNumbering:{quadElements:[],triangleElements:[]},boundaryElements:[],boundaryConditions:[],boundaryNodePairs:{},gmshV:0,ascii:!1,fltBytes:"8",totalNodesX:0,totalNodesY:0,physicalPropMap:[],elementTypes:{}},n=(await e.text()).split("\n").map((e=>e.trim())).filter((e=>""!==e&&" "!==e)),s="",i=0,r=0,a=0,l=0,d={numNodes:0},u=0,c=[],m=0,h=0,f=0,p={dim:0,tag:0,elementType:0,numElements:0},b=0,y={};for(;i""!==e));if("meshFormat"===s)t.gmshV=parseFloat(o[0]),t.ascii="0"===o[1],t.fltBytes=o[2];else if("physicalNames"===s){if(o.length>=3){if(!/^\d+$/.test(o[0])){i++;continue}const e=parseInt(o[0],10),n=parseInt(o[1],10);let s=o.slice(2).join(" ");s=s.replace(/^"|"$/g,""),t.physicalPropMap.push({tag:n,dimension:e,name:s})}}else if("nodes"===s){if(0===r){r=parseInt(o[0],10),a=parseInt(o[1],10),t.nodesXCoordinates=new Array(a).fill(0),t.nodesYCoordinates=new Array(a).fill(0),i++;continue}if(lparseInt(e,10)));if(1===p.elementType||8===p.elementType){const n=p.tag;y[n]||(y[n]=[]),y[n].push(e),t.boundaryNodePairs[n]||(t.boundaryNodePairs[n]=[]),t.boundaryNodePairs[n].push(e)}else 2===p.elementType?t.nodalNumbering.triangleElements.push(e):(3===p.elementType||10===p.elementType)&&t.nodalNumbering.quadElements.push(e);b++,b===p.numElements&&(f++,p={numElements:0})}}i++}return t.physicalPropMap.forEach((e=>{if(1===e.dimension){const n=y[e.tag]||[];n.length>0&&t.boundaryConditions.push({name:e.name,tag:e.tag,nodes:n})}})),o(`Parsed boundary node pairs by physical tag: ${JSON.stringify(t.boundaryNodePairs)}. These pairs will be used to identify boundary elements in the mesh.`),t},e.logSystem=function(e){"basic"!==e&&"debug"!==e?(console.log("%c[WARN] Invalid log level: "+e+". Using basic instead.","color: #FFC107; font-weight: bold;"),n="basic"):(n=e,s(`Log level set to: ${e}`))},e.plotSolution=function(e,t,n,o,s,i,r="structured"){const{nodesXCoordinates:a,nodesYCoordinates:l}=t;if("1D"===o&&"line"===s){let t;t=e.length>0&&Array.isArray(e[0])?e.map((e=>e[0])):e;let o=Array.from(a),s={x:o,y:t,mode:"lines",type:"scatter",line:{color:"rgb(219, 64, 82)",width:2},name:"Solution"},r=Math.min(window.innerWidth,700),l=Math.max(...o),d=r/l,u={title:`line plot - ${n}`,width:Math.max(d*l,400),height:350,xaxis:{title:"x"},yaxis:{title:"Solution"},margin:{l:70,r:40,t:50,b:50}};Plotly.newPlot(i,[s],u,{responsive:!0})}else if("2D"===o&&"contour"===s){const t="structured"===r,o=new Set(a).size,d=new Set(l).size;let u;u=Array.isArray(e[0])?e.map((e=>e[0])):e;let c=Math.min(window.innerWidth,700),m=Math.max(...a),h=Math.max(...l)/m,f=Math.min(c,600),p={title:`${s} plot - ${n}`,width:f,height:f*h*.8,xaxis:{title:"x"},yaxis:{title:"y"},margin:{l:50,r:50,t:50,b:50},hovermode:"closest"};if(t){const t=o,n=d;math.reshape(Array.from(a),[t,n]);let s=math.reshape(Array.from(l),[t,n]),r=math.reshape(Array.from(e),[t,n]),u=math.transpose(r),c=[];for(let e=0;e | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n errorLog(\"Element type is neither triangle nor quad; mapping for this type is not implemented yet.\");\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n // TODO: Transform into dictionaries for better readability\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n\n return this.parsedMesh;\n }\n}\n\nexport class Mesh1D extends Mesh {\n /**\n * Constructor to initialize the 1D mesh\n * @param {object} config - Configuration object for the 1D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({ numElementsX = null, maxX = null, elementOrder = \"linear\", parsedMesh = null }) {\n super({\n numElementsX,\n maxX,\n numElementsY: 1,\n maxY: 0,\n meshDimension: \"1D\",\n elementOrder,\n parsedMesh,\n });\n\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n const xStart = 0;\n let totalNodesX, deltaX;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate1DNodalNumbering(this.numElementsX, totalNodesX, this.elementOrder);\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate1DNodalNumbering(numElementsX, totalNodesX, elementOrder) {\n // TODO: The totalNodesX is not used in the original function. Verify if\n // there is a multiple calculation on the totalNodes.\n\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 2; // For 1D, we only have two sides (left and right)\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n\nexport class Mesh2D extends Mesh {\n /**\n * Constructor to initialize the 2D mesh\n * @param {object} config - Configuration object for the 2D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY] - Number of elements along the y-axis (required for geometry-based mesh)\n * @param {number} [config.maxY] - Maximum y-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n super({\n numElementsX,\n maxX,\n numElementsY,\n maxY,\n meshDimension: \"2D\",\n elementOrder,\n parsedMesh,\n });\n\n // Validate geometry parameters (when not using a parsed mesh)\n if (\n !parsedMesh &&\n (this.numElementsX === null || this.maxX === null || this.numElementsY === null || this.maxY === null)\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate2DNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesY,\n this.elementOrder\n );\n\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return statement\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate2DNodalNumbering(numElementsX, numElementsY, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 4; // For 2D, we have four sides (left, right, bottom, top)\n\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // TODO: Why to loop through all elements? Is it not better to loop over only the\n // elements that are on the boundary? eg: [0, this.numElementsX - 1] on x and\n // [0, this.numElementsY - 1] on y\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class NumericalIntegration {\n /**\n * Constructor to initialize the NumericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport { BasisFunctions } from \"./basisFunctionsScript.js\";\nimport { Mesh1D, Mesh2D } from \"./meshGenerationScript.js\";\nimport { NumericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to prepare the mesh for finite element analysis\n * @param {object} meshConfig - Object containing computational mesh details\n * @returns {object} An object containing all mesh-related data\n */\nexport function prepareMesh(meshConfig) {\n const { meshDimension, numElementsX, numElementsY, maxX, maxY, elementOrder, parsedMesh } = meshConfig;\n\n // Create a new instance of the Mesh class\n let mesh;\n if (meshDimension === \"1D\") {\n mesh = new Mesh1D({ numElementsX, maxX, elementOrder, parsedMesh });\n } else if (meshDimension === \"2D\") {\n mesh = new Mesh2D({ numElementsX, maxX, numElementsY, maxY, elementOrder, parsedMesh });\n } else {\n errorLog(\"Mesh dimension must be either '1D' or '2D'.\");\n }\n\n // Use the parsed mesh in case it was already passed with Gmsh format\n const nodesCoordinatesAndNumbering = mesh.boundaryElementsProcessed ? mesh.parsedMesh : mesh.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nop,\n boundaryElements,\n totalElements,\n totalNodes,\n meshDimension,\n elementOrder,\n };\n}\n\n/**\n * Function to initialize the FEA matrices and numerical tools\n * @param {object} meshData - Object containing mesh data from prepareMesh()\n * @returns {object} An object containing initialized matrices and numerical tools\n */\nexport function initializeFEA(meshData) {\n const { totalNodes, nop, meshDimension, elementOrder } = meshData;\n\n // Initialize variables for matrix assembly\n let residualVector = [];\n let jacobianMatrix = [];\n let localToGlobalMap = [];\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the BasisFunctions class\n const basisFunctions = new BasisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the NumericalIntegration class\n const numericalIntegration = new NumericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numericalIntegration.getGaussPointsAndWeights();\n let gaussPoints = gaussPointsAndWeights.gaussPoints;\n let gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n return {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 1D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping1D(params) {\n const { basisFunction, basisFunctionDerivKsi, nodesXCoordinates, localToGlobalMap, numNodes } = params;\n\n let xCoordinates = 0;\n let ksiDerivX = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n }\n let detJacobian = ksiDerivX;\n\n // Compute x-derivative of basis functions\n let basisFunctionDerivX = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian;\n }\n\n return {\n xCoordinates,\n detJacobian,\n basisFunctionDerivX,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 2D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping2D(params) {\n const {\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n } = params;\n\n let xCoordinates = 0;\n let yCoordinates = 0;\n let ksiDerivX = 0;\n let etaDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivY = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n }\n let detJacobian = ksiDerivX * etaDerivY - etaDerivX * ksiDerivY;\n\n // Compute x-derivative and y-derivative of basis functions\n let basisFunctionDerivX = [];\n let basisFunctionDerivY = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // The x-derivative of the n basis function\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian;\n // The y-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian;\n }\n\n return {\n xCoordinates,\n yCoordinates,\n detJacobian,\n basisFunctionDerivX,\n basisFunctionDerivY,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant temperature boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantTempBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions for the frontal solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix with convection contributions\n * - localResidualVector: Residual vector with convection contributions\n */\n imposeConvectionBoundaryConditionsFront(\n elementIndex,\n nodesXCoordinates,\n nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n // Initialize local Jacobian matrix and local residual vector\n const numNodes = this.nop[elementIndex].length;\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Check if this element is on a convection boundary\n for (const boundaryKey in this.boundaryElements) {\n if (this.boundaryConditions[boundaryKey]?.[0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n\n // Find if this element is on this boundary and which side\n const boundaryElement = this.boundaryElements[boundaryKey].find(\n ([elemIdx, _]) => elemIdx === elementIndex\n );\n\n if (boundaryElement) {\n const side = boundaryElement[1];\n\n if (this.meshDimension === \"1D\") {\n // Handle 1D case\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n nodeIndex = side === 0 ? 0 : 1;\n } else if (this.elementOrder === \"quadratic\") {\n nodeIndex = side === 0 ? 0 : 2;\n }\n\n // Add contribution to local Jacobian matrix and local residual vector\n debugLog(\n ` - Applied convection boundary condition to node ${nodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n localResidualVector[nodeIndex] += -convectionCoeff * extTemp;\n localJacobianMatrix[nodeIndex][nodeIndex] += convectionCoeff;\n } else if (this.meshDimension === \"2D\") {\n // Handle 2D case\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n // Get basis functions\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n const basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n const basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n // Calculate tangent vector components\n let ksiDerivX = 0,\n ksiDerivY = 0,\n etaDerivX = 0,\n etaDerivY = 0;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n } else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute tangent vector length\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n // Handle quadratic elements (similar pattern but with more Gauss points)\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the solid heat transfer model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\nexport function assembleHeatConductionMat(meshData, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n // 2D solid heat transfer\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n );\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the solid heat transfer model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - localResidualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n if (meshDimension === \"1D\") {\n // 1D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n // 2D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Create mapping from local element space to global mesh (convert to 0-based indexing)\n const localToGlobalMap = ngl.map((globalIndex) => globalIndex - 1);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle generic boundary conditions application\n */\nexport class GenericBoundaryConditions {\n /**\n * Constructor to initialize the GenericBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose Dirichlet boundary conditions\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeDirichletBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant value (Dirichlet) boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantValueBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n// Base viscous term that remains when eikonal equation is fully activated\nconst baseEikonalViscousTerm = 1e-2;\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the front propagation model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleFrontPropagationMat(\n meshData,\n boundaryConditions,\n solutionVector,\n eikonalActivationFlag\n) {\n basicLog(\"Starting front propagation matrix assembly...\");\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n debugLog(`eikonalViscousTerm: ${eikonalViscousTerm}`);\n debugLog(`eikonalActivationFlag: ${eikonalActivationFlag}`);\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // jacobianMatrix\n // TODO jacobianMatrix calculation here\n }\n }\n }\n // 2D front propagation (eikonal) equation\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n\n // residualVector: Viscous term contribution (to stabilize the solution)\n residualVector[localToGlobalMap1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // residualVector: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n residualVector[localToGlobalMap1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n\n // jacobianMatrix: Viscous term contribution\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // jacobianMatrix: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Dirichlet boundary conditions\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Front propagation matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the front propagation model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - residualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleFrontPropagationFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n solutionVector,\n eikonalActivationFlag,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // localJacobianMatrix\n // TODO localJacobianMatrix calculation here\n }\n }\n // 2D front propagation (eikonal) equation\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // Viscous term contribution\n localResidualVector[localNodeIndex1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localResidualVector[localNodeIndex1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Viscous term contribution\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { BasisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { initializeFEA } from \"../mesh/meshUtilsScript.js\";\nimport { assembleHeatConductionFront } from \"../solvers/heatConductionScript.js\";\nimport { ThermalBoundaryConditions } from \"../solvers/thermalBoundaryConditionsScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\nimport { GenericBoundaryConditions } from \"../solvers/genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n// Create object templates\nconst frontalData = {};\nconst frontalState = {};\nconst elementData = { currentElementIndex: 0 };\nconst frontStorage = {};\nlet basisFunctions;\n\n/**\n * Function to run the frontal solver and obtain results for plotting\n * @param {function} assembleFront - Matrix assembler based on the physical model\n * @param {object} meshData - Object containing mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} [options] - Additional options for the solver\n * @returns {object} An object containing the solution vector and node coordinates\n */\nexport function runFrontalSolver(assembleFront, meshData, boundaryConditions, options = {}) {\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const totalNodes = meshData.nodesXCoordinates.length;\n const numElements = meshData.totalElements;\n const numNodes = FEAData.numNodes;\n\n // Calculate required array sizes\n initializeFrontalArrays(numNodes, numElements);\n\n // Start timing for system solving (frontal algorithm)\n basicLog(\"Solving system using frontal...\");\n console.time(\"systemSolving\");\n\n // Initialize basis functions\n basisFunctions = new BasisFunctions({\n meshDimension: meshData.meshDimension,\n elementOrder: meshData.elementOrder,\n });\n\n // Copy node connectivity array into frontalData storage\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n for (let nodeIndex = 0; nodeIndex < FEAData.numNodes; nodeIndex++) {\n frontalData.nodalNumbering[elementIndex][nodeIndex] = meshData.nop[elementIndex][nodeIndex];\n }\n }\n\n // Apply Dirichlet-type boundary conditions\n // Initialize all nodes with no boundary condition\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.nodeConstraintCode[nodeIndex] = 0;\n frontalData.boundaryValues[nodeIndex] = 0;\n }\n\n // Handle Dirichlet-type boundary conditions differently based on which solver is being used\n let dirichletBoundaryConditionsHandler;\n // Solid heat transfer model (heatConductionScript solver)\n if (assembleFront === assembleHeatConductionFront) {\n dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantTempBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n // Front propagation model (frontPropagationScript solver)\n } else if (assembleFront === assembleFrontPropagationFront) {\n dirichletBoundaryConditionsHandler = new GenericBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantValueBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n }\n // Initialize global residual vector\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.globalResidualVector[nodeIndex] = 0;\n }\n\n frontalState.totalNodes = meshData.nodesXCoordinates.length;\n frontalState.writeFlag = 0;\n frontalState.transformationFlag = 1;\n frontalState.determinant = 1;\n\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n frontalState.nodesPerElement[elementIndex] = FEAData.numNodes;\n }\n\n // Parameters for non-linear assemblers\n frontalState.currentSolutionVector = options.solutionVector;\n frontalState.eikonalActivationFlag = options.eikonalActivationFlag;\n\n // Pass assembleFront and dirichletBoundaryConditionsHandler to runFrontalAlgorithm\n runFrontalAlgorithm(meshData, FEAData, dirichletBoundaryConditionsHandler, assembleFront);\n\n // Copy solution\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.solutionVector[nodeIndex] = frontalState.globalSolutionVector[nodeIndex];\n }\n\n // Output results to console for debugging\n const { nodesXCoordinates, nodesYCoordinates } = meshData;\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n if (meshData.meshDimension === \"1D\") {\n // 1D case - only output X coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${frontalData.solutionVector[\n nodeIndex\n ].toExponential(5)}`\n );\n } else {\n // 2D case - output X, Y coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${nodesYCoordinates[nodeIndex].toExponential(\n 5\n )} ${frontalData.solutionVector[nodeIndex].toExponential(5)}`\n );\n }\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n const { nodesXCoordinates: finalNodesX, nodesYCoordinates: finalNodesY } = meshData;\n return {\n solutionVector: frontalData.solutionVector.slice(0, totalNodes),\n nodesCoordinates: {\n nodesXCoordinates: finalNodesX,\n nodesYCoordinates: finalNodesY,\n },\n };\n}\n\n/**\n * Function to initialize arrays dynamically based on problem size\n * @param {number} numNodes - Number of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n */\nfunction initializeFrontalArrays(numNodes, numElements) {\n // Use the actual number of elements from the mesh\n frontalData.nodalNumbering = Array(numElements)\n .fill()\n .map(() => Array(numNodes).fill(0));\n frontalData.nodeConstraintCode = Array(numNodes).fill(0);\n frontalData.boundaryValues = Array(numNodes).fill(0);\n frontalData.globalResidualVector = Array(numNodes).fill(0);\n frontalData.solutionVector = Array(numNodes).fill(0);\n frontalData.topologyData = Array(numElements).fill(0);\n frontalData.lateralData = Array(numElements).fill(0);\n\n // Initialize frontalState arrays\n frontalState.writeFlag = 0;\n frontalState.totalNodes = numNodes;\n frontalState.transformationFlag = 0;\n frontalState.nodesPerElement = Array(numElements).fill(0);\n frontalState.determinant = 1;\n\n // For matrix operations, estimate required size based on problem complexity\n const systemSize = Math.max(numNodes, 2000);\n frontalState.globalSolutionVector = Array(systemSize).fill(0);\n frontalState.frontDataIndex = 0;\n\n // Initialize elementData arrays\n elementData.localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n elementData.currentElementIndex = 0;\n\n // Initialize frontStorage arrays\n const frontSize = estimateFrontSize(numNodes, numElements);\n frontStorage.frontValues = Array(frontSize).fill(0);\n frontStorage.columnHeaders = Array(systemSize).fill(0);\n frontStorage.pivotRow = Array(systemSize).fill(0);\n frontStorage.pivotData = Array(frontSize).fill(0);\n}\n\n/**\n * Function to estimate the required front size\n * @param {number} numNodes - Number of of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n * @returns {number} Estimated front size\n */\nfunction estimateFrontSize(numNodes, numElements) {\n const frontWidthEstimate = Math.max(Math.ceil(Math.sqrt(numElements)) * numNodes, numNodes * 2);\n return frontWidthEstimate * numElements;\n}\n// Old function to estimate the required front size\n// function estimateFrontSize(numNodes, numElements, numNodes) {\n// const frontWidthEstimate = Math.ceil(Math.sqrt(numElements) * numNodes * 2);\n// const frontSize = frontWidthEstimate * numNodes * 4;\n// return Math.max(frontSize, 10000);\n// }\n\n/**\n * Function to compute local Jacobian matrix and local residual vector\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n const elementIndex = elementData.currentElementIndex - 1;\n\n // Guard against out-of-range indices\n if (elementIndex < 0 || elementIndex >= meshData.totalElements) {\n errorLog(`Skipping out-of-range elementIndex=${elementIndex} (totalElements=${meshData.totalElements})`);\n return false;\n }\n\n // Domain terms\n const { localJacobianMatrix, localResidualVector, ngl } = assembleFront({\n elementIndex,\n nop: frontalData.nodalNumbering,\n meshData,\n basisFunctions: basisFunctions,\n FEAData,\n // These are ignored by linear assemblers\n solutionVector: frontalState.currentSolutionVector,\n eikonalActivationFlag: frontalState.eikonalActivationFlag,\n });\n\n // Handle Robin-type boundary conditions differently based on which solver is being used\n let boundaryLocalJacobianMatrix = Array(FEAData.numNodes)\n .fill()\n .map(() => Array(FEAData.numNodes).fill(0));\n let boundaryResidualVector = Array(FEAData.numNodes).fill(0);\n\n // heatConductionScript solver\n if (assembleFront === assembleHeatConductionFront) {\n // Check if this element is on a Robin-type boundary\n let isOnRobinTypeBoundary = false;\n for (const boundaryKey in meshData.boundaryElements) {\n if (\n thermalBoundaryConditions.boundaryConditions[boundaryKey]?.[0] === \"convection\" &&\n meshData.boundaryElements[boundaryKey].some(([elemIdx, _]) => elemIdx === elementIndex)\n ) {\n isOnRobinTypeBoundary = true;\n break;\n }\n }\n\n // Only calculate Robin-type for elements when required\n if (isOnRobinTypeBoundary) {\n const { gaussPoints, gaussWeights } = FEAData;\n const result = thermalBoundaryConditions.imposeConvectionBoundaryConditionsFront(\n elementIndex,\n meshData.nodesXCoordinates,\n meshData.nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n );\n boundaryLocalJacobianMatrix = result.localJacobianMatrix;\n boundaryResidualVector = result.localResidualVector;\n }\n } else if (assembleFront === assembleFrontPropagationFront) {\n // For now, no Robin-type boundary conditions exist for any other solver\n }\n\n // Combine domain and boundary contributions\n for (let localNodeI = 0; localNodeI < FEAData.numNodes; localNodeI++) {\n for (let localNodeJ = 0; localNodeJ < FEAData.numNodes; localNodeJ++) {\n elementData.localJacobianMatrix[localNodeI][localNodeJ] =\n localJacobianMatrix[localNodeI][localNodeJ] + boundaryLocalJacobianMatrix[localNodeI][localNodeJ];\n }\n }\n\n // Assemble local element residual\n for (let localNodeIndex = 0; localNodeIndex < FEAData.numNodes; localNodeIndex++) {\n const globalNodeIndex = ngl[localNodeIndex] - 1;\n frontalData.globalResidualVector[globalNodeIndex] +=\n localResidualVector[localNodeIndex] + boundaryResidualVector[localNodeIndex];\n }\n\n return true;\n}\n\n/**\n * Function to implement the frontal solver algorithm\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction runFrontalAlgorithm(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n // Allocate local arrays dynamically\n const totalElements = meshData.totalElements;\n const numNodes = meshData.nodesXCoordinates.length;\n const systemSize = Math.max(numNodes, frontalState.globalSolutionVector.length);\n let localDestination = Array(FEAData.numNodes).fill(0);\n let rowDestination = Array(FEAData.numNodes).fill(0);\n let rowHeaders = Array(systemSize).fill(0);\n let pivotRowIndices = Array(systemSize).fill(0);\n let pivotColumnIndices = Array(systemSize).fill(0);\n let modifiedRows = Array(systemSize).fill(0);\n let pivotColumn = Array(systemSize).fill(0);\n let frontMatrix = Array(systemSize)\n .fill()\n .map(() => Array(systemSize).fill(0));\n let rowSwapCount = Array(numNodes).fill(0);\n let columnSwapCount = Array(numNodes).fill(0);\n let lastAppearanceCheck = Array(numNodes).fill(0);\n let pivotColumnGlobalIndex; // Pivot column global index\n\n let frontDataCounter = 1;\n frontalState.writeFlag++;\n let pivotDataIndex = 1;\n let summedRows = 1;\n elementData.currentElementIndex = 0;\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n rowSwapCount[nodeIndex] = 0;\n columnSwapCount[nodeIndex] = 0;\n }\n\n if (frontalState.transformationFlag !== 0) {\n // Prefront: find last appearance of each node\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n lastAppearanceCheck[nodeIndex] = 0;\n }\n\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n let reverseElementIndex = totalElements - elementIndex - 1;\n for (\n let localNodeIndex = 0;\n localNodeIndex < frontalState.nodesPerElement[reverseElementIndex];\n localNodeIndex++\n ) {\n let globalNodeIndex = frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n if (lastAppearanceCheck[globalNodeIndex - 1] === 0) {\n lastAppearanceCheck[globalNodeIndex - 1] = 1;\n frontalData.nodalNumbering[reverseElementIndex][localNodeIndex] =\n -frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n }\n }\n }\n }\n\n frontalState.transformationFlag = 0;\n let columnCount = 0;\n let rowCount = 0;\n\n for (let i = 0; i < systemSize; i++) {\n for (let j = 0; j < systemSize; j++) {\n frontMatrix[j][i] = 0;\n }\n }\n\n while (true) {\n // Assemble a new element only while we still have elements\n let assembled = false;\n let numElementNodes = 0;\n let numElementColumns = 0;\n\n if (elementData.currentElementIndex < totalElements) {\n elementData.currentElementIndex++;\n assembled = assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront);\n }\n\n if (assembled) {\n const currentElement = elementData.currentElementIndex;\n numElementNodes = frontalState.nodesPerElement[currentElement - 1];\n numElementColumns = frontalState.nodesPerElement[currentElement - 1];\n\n for (let localNodeIndex = 0; localNodeIndex < numElementColumns; localNodeIndex++) {\n let globalNodeIndex = frontalData.nodalNumbering[currentElement - 1][localNodeIndex];\n let columnIndex;\n\n if (columnCount === 0) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n for (columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(frontStorage.columnHeaders[columnIndex])) break;\n }\n\n if (columnIndex === columnCount) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n localDestination[localNodeIndex] = columnIndex + 1;\n frontStorage.columnHeaders[columnIndex] = globalNodeIndex;\n }\n }\n\n let rowIndex;\n if (rowCount === 0) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(rowHeaders[rowIndex])) break;\n }\n\n if (rowIndex === rowCount) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n rowDestination[localNodeIndex] = rowIndex + 1;\n rowHeaders[rowIndex] = globalNodeIndex;\n }\n }\n }\n\n if (rowCount > systemSize || columnCount > systemSize) {\n errorLog(\"Error: systemSize not large enough\");\n return;\n }\n\n for (let localColumnIndex = 0; localColumnIndex < numElementColumns; localColumnIndex++) {\n let frontColumnIndex = localDestination[localColumnIndex];\n for (let localRowIndex = 0; localRowIndex < numElementNodes; localRowIndex++) {\n let frontRowIndex = rowDestination[localRowIndex];\n frontMatrix[frontRowIndex - 1][frontColumnIndex - 1] +=\n elementData.localJacobianMatrix[localRowIndex][localColumnIndex];\n }\n }\n }\n\n // Pivoting/elimination continues whether or not a new element was assembled\n let availableColumnCount = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (frontStorage.columnHeaders[columnIndex] < 0) {\n pivotColumnIndices[availableColumnCount] = columnIndex + 1;\n availableColumnCount++;\n }\n }\n\n let constrainedRowCount = 0;\n let availableRowCount = 0;\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n let globalNodeIndex = rowHeaders[rowIndex];\n if (globalNodeIndex < 0) {\n pivotRowIndices[availableRowCount] = rowIndex + 1;\n availableRowCount++;\n let absoluteNodeIndex = Math.abs(globalNodeIndex);\n if (frontalData.nodeConstraintCode[absoluteNodeIndex - 1] === 1) {\n modifiedRows[constrainedRowCount] = rowIndex + 1;\n constrainedRowCount++;\n frontalData.nodeConstraintCode[absoluteNodeIndex - 1] = 2;\n frontalData.globalResidualVector[absoluteNodeIndex - 1] =\n frontalData.boundaryValues[absoluteNodeIndex - 1];\n }\n }\n }\n\n if (constrainedRowCount > 0) {\n for (let constrainedIndex = 0; constrainedIndex < constrainedRowCount; constrainedIndex++) {\n let rowIndex = modifiedRows[constrainedIndex] - 1;\n let globalNodeIndex = Math.abs(rowHeaders[rowIndex]);\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] = 0;\n let columnGlobalIndex = Math.abs(frontStorage.columnHeaders[columnIndex]);\n if (columnGlobalIndex === globalNodeIndex) frontMatrix[rowIndex][columnIndex] = 1;\n }\n }\n }\n\n if (availableColumnCount > summedRows || elementData.currentElementIndex < totalElements) {\n if (availableColumnCount === 0) {\n errorLog(\"Error: no more rows fully summed\");\n return;\n }\n\n let pivotRowIndex = pivotRowIndices[0];\n let pivotColumnIndex = pivotColumnIndices[0];\n let pivotValue = frontMatrix[pivotRowIndex - 1][pivotColumnIndex - 1];\n\n if (Math.abs(pivotValue) < 1e-4) {\n pivotValue = 0;\n for (let columnIndex = 0; columnIndex < availableColumnCount; columnIndex++) {\n let testColumnIndex = pivotColumnIndices[columnIndex];\n for (let rowIndex = 0; rowIndex < availableRowCount; rowIndex++) {\n let testRowIndex = pivotRowIndices[rowIndex];\n let testValue = frontMatrix[testRowIndex - 1][testColumnIndex - 1];\n if (Math.abs(testValue) > Math.abs(pivotValue)) {\n pivotValue = testValue;\n pivotColumnIndex = testColumnIndex;\n pivotRowIndex = testRowIndex;\n }\n }\n }\n }\n\n let pivotGlobalRowIndex = Math.abs(rowHeaders[pivotRowIndex - 1]);\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]); // Assign, don't declare\n let permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n if (nodeIndex >= pivotGlobalRowIndex) rowSwapCount[nodeIndex]--;\n if (nodeIndex >= pivotColumnGlobalIndex) columnSwapCount[nodeIndex]--;\n }\n\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontMatrix[pivotRowIndex - 1][columnIndex] / pivotValue;\n }\n\n let rightHandSide = frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] = rightHandSide;\n pivotColumn[pivotRowIndex - 1] = pivotValue;\n\n if (pivotRowIndex > 1) {\n for (let rowIndex = 0; rowIndex < pivotRowIndex - 1; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1 && eliminationFactor !== 0) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] -= eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n if (pivotRowIndex < rowCount) {\n for (let rowIndex = pivotRowIndex; rowIndex < rowCount; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = pivotColumn[i];\n }\n pivotDataIndex += rowCount;\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = rowHeaders[i];\n }\n pivotDataIndex += rowCount;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.pivotRow[i];\n }\n frontDataCounter += columnCount;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.columnHeaders[i];\n }\n frontDataCounter += columnCount;\n\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n frontMatrix[rowIndex][columnCount - 1] = 0;\n }\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowCount - 1][columnIndex] = 0;\n }\n\n columnCount--;\n if (pivotColumnIndex < columnCount + 1) {\n for (let columnIndex = pivotColumnIndex - 1; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] = frontStorage.columnHeaders[columnIndex + 1];\n }\n }\n\n rowCount--;\n if (pivotRowIndex < rowCount + 1) {\n for (let rowIndex = pivotRowIndex - 1; rowIndex < rowCount; rowIndex++) {\n rowHeaders[rowIndex] = rowHeaders[rowIndex + 1];\n }\n }\n\n if (rowCount > 1 || elementData.currentElementIndex < totalElements) continue;\n\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[0]); // Assign, don't declare\n pivotRowIndex = 1;\n pivotValue = frontMatrix[0][0];\n pivotGlobalRowIndex = Math.abs(rowHeaders[0]);\n pivotColumnIndex = 1;\n permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n frontStorage.pivotRow[0] = 1;\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] =\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.pivotRow[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.columnHeaders[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotColumn[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = rowHeaders[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n frontalState.frontDataIndex = frontDataCounter;\n if (frontalState.writeFlag === 1)\n debugLog(`total ecs transfer in matrix reduction=${frontDataCounter}`);\n\n // Back substitution\n performBackSubstitution(frontDataCounter);\n break;\n }\n }\n}\n\n/**\n * Function to perform back substitution for the frontal solver\n * @param {number} frontDataCounter - Index counter for the element contributions\n */\nfunction performBackSubstitution(frontDataCounter) {\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n frontalState.globalSolutionVector[nodeIndex] = frontalData.boundaryValues[nodeIndex];\n }\n\n for (let iterationIndex = 1; iterationIndex <= frontalState.totalNodes; iterationIndex++) {\n frontDataCounter -= 4;\n let pivotGlobalRowIndex = frontStorage.frontValues[frontDataCounter - 1];\n let columnCount = frontStorage.frontValues[frontDataCounter];\n let pivotColumnIndex = frontStorage.frontValues[frontDataCounter + 1];\n let pivotValue = frontStorage.frontValues[frontDataCounter + 2];\n\n if (iterationIndex === 1) {\n frontDataCounter--;\n frontStorage.columnHeaders[0] = frontStorage.frontValues[frontDataCounter - 1];\n frontDataCounter--;\n frontStorage.pivotRow[0] = frontStorage.frontValues[frontDataCounter - 1];\n } else {\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] =\n frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n }\n\n let pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]);\n if (frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] > 0) continue;\n\n let accumulatedValue = 0;\n frontStorage.pivotRow[pivotColumnIndex - 1] = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n accumulatedValue -=\n frontStorage.pivotRow[columnIndex] *\n frontalState.globalSolutionVector[Math.abs(frontStorage.columnHeaders[columnIndex]) - 1];\n }\n\n frontalState.globalSolutionVector[pivotColumnGlobalIndex - 1] =\n accumulatedValue + frontalData.globalResidualVector[pivotGlobalRowIndex - 1];\n\n frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] = 1;\n }\n\n if (frontalState.writeFlag === 1)\n debugLog(`value of frontDataCounter after backsubstitution=${frontDataCounter}`);\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { euclideanNorm } from \"../methods/euclideanNormScript.js\";\nimport { solveLinearSystem } from \"./linearSystemSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\nimport { runFrontalSolver } from \"./frontalSolverScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\n\n/**\n * Function to solve a system of non-linear equations using the Newton-Raphson method\n * @param {function} assembleMat - Matrix assembler based on the physical model\n * @param {object} context - Context object containing simulation data and options\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-4] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\n\nexport function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-4) {\n let errorNorm = 0;\n let converged = false;\n let iterations = 0;\n let deltaX = [];\n let solutionVector = [];\n let jacobianMatrix = [];\n let residualVector = [];\n\n // Calculate system size\n let totalNodes = context.meshData.nodesXCoordinates.length;\n\n // Initialize arrays with proper size\n for (let i = 0; i < totalNodes; i++) {\n deltaX[i] = 0;\n solutionVector[i] = 0;\n }\n\n // Initialize solution from context if available\n if (context.initialSolution && context.initialSolution.length === totalNodes) {\n solutionVector = [...context.initialSolution];\n }\n\n while (iterations < maxIterations && !converged) {\n // Update solution\n for (let i = 0; i < solutionVector.length; i++) {\n solutionVector[i] = Number(solutionVector[i]) + Number(deltaX[i]);\n }\n\n // Check if using frontal solver\n if (context.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleFrontPropagationFront,\n context.meshData,\n context.boundaryConditions,\n { solutionVector, eikonalActivationFlag: context.eikonalActivationFlag }\n );\n deltaX = frontalResult.solutionVector;\n } else {\n // Compute Jacobian and residual matrices\n ({ jacobianMatrix, residualVector } = assembleMat(\n context.meshData,\n context.boundaryConditions,\n solutionVector, // The solution vector is required in the case of a non-linear equation\n context.eikonalActivationFlag // Currently used only in the front propagation solver (TODO refactor in case of a solver not needing it)\n ));\n\n // Solve the linear system based on the specified solver method\n const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);\n deltaX = linearSystemResult.solutionVector;\n }\n\n // Check convergence\n errorNorm = euclideanNorm(deltaX);\n\n // Norm for each iteration\n basicLog(`Newton-Raphson iteration ${iterations + 1}: Error norm = ${errorNorm.toExponential(4)}`);\n\n if (errorNorm <= tolerance) {\n converged = true;\n } else if (errorNorm > 1e2) {\n errorLog(`Solution not converged. Error norm: ${errorNorm}`);\n break;\n }\n\n iterations++;\n }\n\n return {\n solutionVector,\n converged,\n iterations,\n jacobianMatrix,\n residualVector,\n };\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { newtonRaphson } from \"./methods/newtonRaphsonScript.js\";\nimport { solveLinearSystem } from \"./methods/linearSystemSolverScript.js\";\nimport { prepareMesh } from \"./mesh/meshUtilsScript.js\";\nimport { assembleFrontPropagationMat } from \"./solvers/frontPropagationScript.js\";\nimport { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from \"./solvers/generalFormPDEScript.js\";\nimport { assembleHeatConductionMat, assembleHeatConductionFront } from \"./solvers/heatConductionScript.js\";\nimport { runFrontalSolver } from \"./methods/frontalSolverScript.js\";\nimport { basicLog, debugLog, warnLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n this.coefficientFunctions = null; // Add storage for coefficient functions\n warnLog(\n \"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE\"\n );\n basicLog(\"FEAScriptModel instance created\");\n }\n\n /**\n * Sets the solver configuration\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} [options] - Optional additional configuration\n */\n setSolverConfig(solverConfig, options = {}) {\n this.solverConfig = solverConfig;\n\n // Store coefficient functions if provided\n if (options && options.coefficientFunctions) {\n this.coefficientFunctions = options.coefficientFunctions;\n debugLog(\"Coefficient functions set\");\n }\n\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n /**\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let initialSolution = [];\n\n // Prepare the mesh\n basicLog(\"Preparing mesh...\");\n const meshData = prepareMesh(this.meshConfig);\n basicLog(\"Mesh preparation completed\");\n\n // Extract node coordinates from meshData\n const nodesCoordinates = {\n nodesXCoordinates: meshData.nodesXCoordinates,\n nodesYCoordinates: meshData.nodesYCoordinates,\n };\n\n // Select and execute the appropriate solver based on solverConfig\n basicLog(\"Beginning solving process...\");\n console.time(\"totalSolvingTime\");\n if (this.solverConfig === \"heatConductionScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleHeatConductionFront,\n meshData,\n this.boundaryConditions\n );\n solutionVector = frontalResult.solutionVector;\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n } else if (this.solverConfig === \"frontPropagationScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Initialize eikonalActivationFlag\n let eikonalActivationFlag = 0;\n const eikonalExteralIterations = 5; // Number of incremental steps for the eikonal equation\n\n // Create context object with all necessary properties\n const context = {\n meshData: meshData,\n boundaryConditions: this.boundaryConditions,\n eikonalActivationFlag: eikonalActivationFlag,\n solverMethod: this.solverMethod,\n initialSolution,\n };\n\n while (eikonalActivationFlag <= 1) {\n // Update the context object with current eikonalActivationFlag\n context.eikonalActivationFlag = eikonalActivationFlag;\n\n // Pass the previous solution as initial guess\n if (solutionVector.length > 0) {\n context.initialSolution = [...solutionVector];\n }\n\n // Solve the assembled non-linear system\n const newtonRaphsonResult = newtonRaphson(assembleFrontPropagationMat, context, 100, 1e-4);\n\n // Extract results\n jacobianMatrix = newtonRaphsonResult.jacobianMatrix;\n residualVector = newtonRaphsonResult.residualVector;\n solutionVector = newtonRaphsonResult.solutionVector;\n\n // Increment for next iteration\n eikonalActivationFlag += 1 / eikonalExteralIterations;\n }\n } else if (this.solverConfig === \"generalFormPDEScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n errorLog(\n \"Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.\"\n );\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleGeneralFormPDEMat(\n meshData,\n this.boundaryConditions,\n this.coefficientFunctions\n ));\n\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n }\n console.timeEnd(\"totalSolvingTime\");\n basicLog(\"Solving process completed\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { initializeFEA, performIsoparametricMapping1D } from \"../mesh/meshUtilsScript.js\";\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the general form PDE model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} coefficientFunctions - Functions A(x), B(x), C(x), D(x) for the PDE\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleGeneralFormPDEMat(meshData, boundaryConditions, coefficientFunctions) {\n basicLog(\"Starting general form PDE matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Extract coefficient functions\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Convert to 0-based indexing\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n const globalNodeIndex1 = localToGlobalMap[localNodeIndex1];\n\n // Source term contribution to residual vector\n residualVector[globalNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n const globalNodeIndex2 = localToGlobalMap[localNodeIndex2];\n\n // Diffusion term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEMat.\");\n // 2D general form PDE - empty for now\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Apply Dirichlet boundary conditions only\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n\n basicLog(\"General form PDE matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the frontal solver matrix for the general form PDE model\n * @param {object} data - Object containing element data for the frontal solver\n * @returns {object} An object containing local Jacobian matrix and residual vector\n */\nexport function assembleGeneralFormPDEFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n coefficientFunctions,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of local Jacobian matrix and residual vector\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n // Source term contribution to local residual vector\n localResidualVector[localNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Diffusion term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEFront.\");\n // 2D general form PDE - empty for now\n }\n\n return {\n localJacobianMatrix,\n localResidualVector,\n ngl,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n\n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n\n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map((val) => val[0]);\n } else {\n zValues = solutionVector;\n }\n\n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n\n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: \"closest\",\n };\n\n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: \"Solution Field\",\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n name: \"Solution Field\",\n };\n\n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const printVersion = \"0.1.3\";"],"names":["euclideanNorm","vector","norm","i","length","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","solveLinearSystem","solverMethod","jacobianMatrix","residualVector","options","maxIterations","tolerance","solutionVector","converged","iterations","time","jacobianMatrixSparse","math","sparse","luFactorization","slu","solutionMatrix","lusolve","squeeze","valueOf","jacobiSolverResult","initialGuess","n","x","xNew","Array","iteration","sum","j","maxDiff","max","abs","jacobiSolver","fill","timeEnd","BasisFunctions","constructor","meshDimension","elementOrder","this","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","Mesh","numElementsX","maxX","numElementsY","maxY","parsedMesh","boundaryElementsProcessed","parseMeshFromGmsh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","boundaryNodePairs","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","Mesh1D","super","generateMesh","nodesXCoordinates","totalNodesX","deltaX","nodeIndex","generate1DNodalNumbering","findBoundaryElements","nop","elementIndex","columnCounter","sideIndex","Mesh2D","nodesYCoordinates","totalNodesY","deltaY","nodeIndexY","nodeIndexX","nnode","generate2DNodalNumbering","rowCounter","elementIndexX","elementIndexY","nodeIndex1","nodeIndex2","NumericalIntegration","getGaussPointsAndWeights","gaussPoints","gaussWeights","initializeFEA","meshData","totalNodes","colIndex","basisFunctions","gaussPointsAndWeights","localToGlobalMap","numNodes","performIsoparametricMapping1D","params","xCoordinates","ksiDerivX","localNodeIndex","detJacobian","basisFunctionDerivX","performIsoparametricMapping2D","yCoordinates","etaDerivX","ksiDerivY","etaDerivY","basisFunctionDerivY","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","Object","keys","boundaryKey","tempValue","globalNodeIndex","imposeConstantTempBoundaryConditionsFront","nodeConstraintCode","boundaryValues","imposeConvectionBoundaryConditions","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","tangentVectorLength","localNodeIndex2","globalNodeIndex2","gaussPointIndex","imposeConvectionBoundaryConditionsFront","localJacobianMatrix","map","localResidualVector","boundaryElement","find","_","assembleHeatConductionFront","FEAData","ngl","gaussPointIndex1","localNodeIndex1","gaussPointIndex2","globalIndex","GenericBoundaryConditions","imposeDirichletBoundaryConditions","value","imposeConstantValueBoundaryConditionsFront","assembleFrontPropagationMat","eikonalActivationFlag","eikonalViscousTerm","totalElements","mappingResult","solutionDerivX","solutionDerivY","localToGlobalMap1","localToGlobalMap2","assembleFrontPropagationFront","frontalData","frontalState","elementData","currentElementIndex","frontStorage","runFrontalSolver","assembleFront","numElements","globalResidualVector","topologyData","lateralData","writeFlag","transformationFlag","nodesPerElement","determinant","systemSize","globalSolutionVector","frontDataIndex","frontSize","frontWidthEstimate","ceil","estimateFrontSize","frontValues","columnHeaders","pivotRow","pivotData","initializeFrontalArrays","dirichletBoundaryConditionsHandler","currentSolutionVector","thermalBoundaryConditions","pivotColumnGlobalIndex","localDestination","rowDestination","rowHeaders","pivotRowIndices","pivotColumnIndices","modifiedRows","pivotColumn","frontMatrix","rowSwapCount","columnSwapCount","lastAppearanceCheck","frontDataCounter","pivotDataIndex","summedRows","reverseElementIndex","columnCount","rowCount","assembled","numElementNodes","numElementColumns","assembleElementContribution","currentElement","columnIndex","rowIndex","localColumnIndex","frontColumnIndex","localRowIndex","availableColumnCount","constrainedRowCount","availableRowCount","absoluteNodeIndex","constrainedIndex","pivotRowIndex","pivotColumnIndex","pivotValue","testColumnIndex","testRowIndex","testValue","pivotGlobalRowIndex","permutationHelper","rightHandSide","globalRowIndex","eliminationFactor","performBackSubstitution","runFrontalAlgorithm","toExponential","finalNodesX","finalNodesY","slice","nodesCoordinates","boundaryLocalJacobianMatrix","boundaryResidualVector","isOnRobinTypeBoundary","some","result","localNodeI","localNodeJ","iterationIndex","accumulatedValue","newtonRaphson","assembleMat","context","errorNorm","initialSolution","Number","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","floor","random","MAX_SAFE_INTEGER","solverConfig","meshConfig","coefficientFunctions","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","mesh","nodesCoordinatesAndNumbering","prepareMesh","assembleHeatConductionMat","eikonalExteralIterations","newtonRaphsonResult","A","B","C","D","xCoord","a","b","d","globalNodeIndex1","assembleGeneralFormPDEMat","worker","feaWorker","isReady","_initWorker","Worker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar"],"mappings":"iPAeO,SAASA,EAAcC,GAC5B,IAAIC,EAAO,EACX,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,IACjCD,GAAQD,EAAOE,GAAKF,EAAOE,GAG7B,OADAD,EAAOG,KAAKC,KAAKJ,GACVA,CACT,CCXA,IAAIK,EAAkB,QAuBf,SAASC,EAASC,GACC,UAApBF,GACFG,QAAQC,IAAI,aAAeF,EAAS,qCAExC,CAMO,SAASG,EAASH,GACvBC,QAAQC,IAAI,YAAcF,EAAS,qCACrC,CAMO,SAASI,EAASJ,GACvBC,QAAQC,IAAI,aAAeF,EAAS,qCACtC,CC3BO,SAASK,EAAkBC,EAAcC,EAAgBC,EAAgBC,EAAU,CAAA,GACxF,MAAMC,cAAEA,EAAgB,IAAIC,UAAEA,EAAY,MAASF,EAEnD,IAAIG,EAAiB,GACjBC,GAAY,EACZC,EAAa,EAMjB,GAHAX,EAAS,wBAAwBG,QACjCL,QAAQc,KAAK,iBAEQ,YAAjBT,EAA4B,CAE9B,MAAMU,EAAuBC,KAAKC,OAAOX,GACnCY,EAAkBF,KAAKG,IAAIJ,EAAsB,EAAG,GAC1D,IAAIK,EAAiBJ,KAAKK,QAAQH,EAAiBX,GACnDI,EAAiBK,KAAKM,QAAQF,GAAgBG,SAElD,MAA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AEC,EAAG,GAAI7I,EAAG,GAAI8I,EAAG,GAAInG,EAAG,IAClC+G,UAAW,WAGb,GAAIR,EAAc,CAEhB,MAAMS,EAAYR,EACZS,EAAYN,EAGS7gB,KAAKohB,QAAQvgB,MAAMse,KAAK9Z,GAAoB,CAAC6b,EAAWC,IACnF,IAAIE,EAAuBrhB,KAAKohB,QAAQvgB,MAAMse,KAAKnZ,GAAoB,CAACkb,EAAWC,IAG/EG,EAAmBthB,KAAKohB,QAAQvgB,MAAMse,KAAKxf,GAAiB,CAACuhB,EAAWC,IAGxEI,EAAqBvhB,KAAKwhB,UAAUF,GAGpCG,EAAmB,GACvB,IAAK,IAAIhjB,EAAI,EAAGA,EAAIyiB,EAAYC,EAAW1iB,GAAK0iB,EAAW,CACzD,IAAIO,EAASrc,EAAkB5G,GAC/BgjB,EAAiB7d,KAAK8d,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHlN,KAAM,UACNwN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETpf,EAAG8gB,EACHlD,EAAG8C,EAAqB,GACxB5c,KAAM,kBAIR6b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBhhB,EAAG0E,EACHkZ,EAAGvY,EACH4b,EAAGd,EACHzM,KAAM,UACNwN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETtb,KAAM,kBAIR6b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,iBCrJ4B"} \ No newline at end of file +{"version":3,"file":"feascript.umd.js","sources":["../src/methods/euclideanNormScript.js","../src/utilities/loggingScript.js","../src/methods/linearSystemSolverScript.js","../src/methods/jacobiSolverScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/methods/numericalIntegrationScript.js","../src/mesh/meshUtilsScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/solvers/heatConductionScript.js","../src/solvers/genericBoundaryConditionsScript.js","../src/solvers/frontPropagationScript.js","../src/methods/frontalSolverScript.js","../src/methods/newtonRaphsonScript.js","../src/vendor/comlink.mjs","../src/FEAScript.js","../src/solvers/generalFormPDEScript.js","../src/workers/workerScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/index.js"],"sourcesContent":["// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to calculate the Euclidean norm of a vector\n * @param {array} vector - The input vector\n * @returns {number} The Euclidean norm of the vector\n */\nexport function euclideanNorm(vector) {\n let norm = 0;\n for (let i = 0; i < vector.length; i++) {\n norm += vector[i] * vector[i];\n }\n norm = Math.sqrt(norm);\n return norm;\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\");\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\");\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\");\n}\n\n/**\n * Function to log warning messages\n * @param {string} message - Message to log\n */\nexport function warnLog(message) {\n console.log(\"%c[WARN] \" + message, \"color: #FF9800; font-weight: bold;\");\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersionInformation() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiSolver } from \"./jacobiSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to solve a system of linear equations using different solver methods\n * @param {string} solverMethod - The solver method to use (\"lusolve\" or \"jacobi\")\n * @param {Array} jacobianMatrix - The coefficient matrix\n * @param {Array} residualVector - The right-hand side vector\n * @param {object} [options] - Additional options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - converged: Boolean indicating whether the method converged (for iterative methods)\n * - iterations: Number of iterations performed (for iterative methods)\n */\nexport function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n\n let solutionVector = [];\n let converged = true;\n let iterations = 0;\n\n // Solve the linear system based on the specified solver method\n basicLog(`Solving system using ${solverMethod}...`);\n console.time(\"systemSolving\");\n\n if (solverMethod === \"lusolve\") {\n // Use LU decomposition method\n const jacobianMatrixSparse = math.sparse(jacobianMatrix);\n const luFactorization = math.slu(jacobianMatrixSparse, 1, 1); // order=1, threshold=1 for pivoting\n let solutionMatrix = math.lusolve(luFactorization, residualVector);\n solutionVector = math.squeeze(solutionMatrix).valueOf();\n //solutionVector = math.lusolve(jacobianMatrix, residualVector); // In the case of a dense matrix\n } else if (solverMethod === \"jacobi\") {\n // Use Jacobi method\n const initialGuess = new Array(residualVector.length).fill(0);\n const jacobiSolverResult = jacobiSolver(jacobianMatrix, residualVector, initialGuess, {\n maxIterations,\n tolerance,\n });\n\n // Log convergence information\n if (jacobiSolverResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiSolverResult.iterations} iterations`);\n } else {\n errorLog(`Jacobi method did not converge after ${jacobiSolverResult.iterations} iterations`);\n }\n\n solutionVector = jacobiSolverResult.solutionVector;\n converged = jacobiSolverResult.converged;\n iterations = jacobiSolverResult.iterations;\n } else {\n errorLog(`Unknown solver method: ${solverMethod}`);\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, converged, iterations };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * @param {array} jacobianMatrix - The coefficient matrix (must be square)\n * @param {array} residualVector - The right-hand side vector\n * @param {array} initialGuess - Initial guess for solution vector\n * @param {object} [options] - Options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum number of iterations\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport function jacobiSolver(jacobianMatrix, residualVector, initialGuess, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n const n = jacobianMatrix.length; // Size of the square matrix\n let x = [...initialGuess]; // Current solution (starts with initial guess)\n let xNew = new Array(n); // Next iteration's solution\n\n for (let iteration = 0; iteration < maxIterations; iteration++) {\n // Perform one iteration\n for (let i = 0; i < n; i++) {\n let sum = 0;\n // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠ i\n for (let j = 0; j < n; j++) {\n if (j !== i) {\n sum += jacobianMatrix[i][j] * x[j];\n }\n }\n // Update xNew[i] using the Jacobi formula\n xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i];\n }\n\n // Check convergence\n let maxDiff = 0;\n for (let i = 0; i < n; i++) {\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\n }\n\n // Update x for next iteration\n x = [...xNew];\n\n // Successfully converged if maxDiff is less than tolerance\n if (maxDiff < tolerance) {\n return {\n solutionVector: x,\n iterations: iteration + 1,\n converged: true,\n };\n }\n }\n\n // maxIterations were reached without convergence\n return {\n solutionVector: x,\n iterations: maxIterations,\n converged: false,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class BasisFunctions {\n /**\n * Constructor to initialize the BasisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Basic structure for the mesh\n */\nexport class Mesh {\n /**\n * Constructor to initialize the Mesh class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n\n this.boundaryElementsProcessed = false;\n\n if (this.parsedMesh) {\n basicLog(\"Using pre-parsed mesh from gmshReader data for mesh generation.\");\n this.parseMeshFromGmsh();\n }\n }\n\n /**\n * Method to parse the mesh from the GMSH format to the FEAScript format\n */\n parseMeshFromGmsh() {\n if (!this.parsedMesh.nodalNumbering) {\n errorLog(\"No valid nodal numbering found in the parsed mesh.\");\n }\n\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n errorLog(\"Element type is neither triangle nor quad; mapping for this type is not implemented yet.\");\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n // TODO: Transform into dictionaries for better readability\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n\n return this.parsedMesh;\n }\n}\n\nexport class Mesh1D extends Mesh {\n /**\n * Constructor to initialize the 1D mesh\n * @param {object} config - Configuration object for the 1D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({ numElementsX = null, maxX = null, elementOrder = \"linear\", parsedMesh = null }) {\n super({\n numElementsX,\n maxX,\n numElementsY: 1,\n maxY: 0,\n meshDimension: \"1D\",\n elementOrder,\n parsedMesh,\n });\n\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n const xStart = 0;\n let totalNodesX, deltaX;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate1DNodalNumbering(this.numElementsX, totalNodesX, this.elementOrder);\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate1DNodalNumbering(numElementsX, totalNodesX, elementOrder) {\n // TODO: The totalNodesX is not used in the original function. Verify if\n // there is a multiple calculation on the totalNodes.\n\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 2; // For 1D, we only have two sides (left and right)\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n\nexport class Mesh2D extends Mesh {\n /**\n * Constructor to initialize the 2D mesh\n * @param {object} config - Configuration object for the 2D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY] - Number of elements along the y-axis (required for geometry-based mesh)\n * @param {number} [config.maxY] - Maximum y-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n super({\n numElementsX,\n maxX,\n numElementsY,\n maxY,\n meshDimension: \"2D\",\n elementOrder,\n parsedMesh,\n });\n\n // Validate geometry parameters (when not using a parsed mesh)\n if (\n !parsedMesh &&\n (this.numElementsX === null || this.maxX === null || this.numElementsY === null || this.maxY === null)\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate2DNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesY,\n this.elementOrder\n );\n\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return statement\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate2DNodalNumbering(numElementsX, numElementsY, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 4; // For 2D, we have four sides (left, right, bottom, top)\n\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // TODO: Why to loop through all elements? Is it not better to loop over only the\n // elements that are on the boundary? eg: [0, this.numElementsX - 1] on x and\n // [0, this.numElementsY - 1] on y\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class NumericalIntegration {\n /**\n * Constructor to initialize the NumericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport { BasisFunctions } from \"./basisFunctionsScript.js\";\nimport { Mesh1D, Mesh2D } from \"./meshGenerationScript.js\";\nimport { NumericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to prepare the mesh for finite element analysis\n * @param {object} meshConfig - Object containing computational mesh details\n * @returns {object} An object containing all mesh-related data\n */\nexport function prepareMesh(meshConfig) {\n const { meshDimension, numElementsX, numElementsY, maxX, maxY, elementOrder, parsedMesh } = meshConfig;\n\n // Create a new instance of the Mesh class\n let mesh;\n if (meshDimension === \"1D\") {\n mesh = new Mesh1D({ numElementsX, maxX, elementOrder, parsedMesh });\n } else if (meshDimension === \"2D\") {\n mesh = new Mesh2D({ numElementsX, maxX, numElementsY, maxY, elementOrder, parsedMesh });\n } else {\n errorLog(\"Mesh dimension must be either '1D' or '2D'.\");\n }\n\n // Use the parsed mesh in case it was already passed with Gmsh format\n const nodesCoordinatesAndNumbering = mesh.boundaryElementsProcessed ? mesh.parsedMesh : mesh.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nop,\n boundaryElements,\n totalElements,\n totalNodes,\n meshDimension,\n elementOrder,\n };\n}\n\n/**\n * Function to initialize the FEA matrices and numerical tools\n * @param {object} meshData - Object containing mesh data from prepareMesh()\n * @returns {object} An object containing initialized matrices and numerical tools\n */\nexport function initializeFEA(meshData) {\n const { totalNodes, nop, meshDimension, elementOrder } = meshData;\n\n // Initialize variables for matrix assembly\n let residualVector = [];\n let jacobianMatrix = [];\n let localToGlobalMap = [];\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the BasisFunctions class\n const basisFunctions = new BasisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the NumericalIntegration class\n const numericalIntegration = new NumericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numericalIntegration.getGaussPointsAndWeights();\n let gaussPoints = gaussPointsAndWeights.gaussPoints;\n let gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n return {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 1D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping1D(params) {\n const { basisFunction, basisFunctionDerivKsi, nodesXCoordinates, localToGlobalMap, numNodes } = params;\n\n let xCoordinates = 0;\n let ksiDerivX = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n }\n let detJacobian = ksiDerivX;\n\n // Compute x-derivative of basis functions\n let basisFunctionDerivX = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian;\n }\n\n return {\n xCoordinates,\n detJacobian,\n basisFunctionDerivX,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 2D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping2D(params) {\n const {\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n } = params;\n\n let xCoordinates = 0;\n let yCoordinates = 0;\n let ksiDerivX = 0;\n let etaDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivY = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n }\n let detJacobian = ksiDerivX * etaDerivY - etaDerivX * ksiDerivY;\n\n // Compute x-derivative and y-derivative of basis functions\n let basisFunctionDerivX = [];\n let basisFunctionDerivY = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // The x-derivative of the n basis function\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian;\n // The y-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian;\n }\n\n return {\n xCoordinates,\n yCoordinates,\n detJacobian,\n basisFunctionDerivX,\n basisFunctionDerivY,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant temperature boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantTempBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions for the frontal solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix with convection contributions\n * - localResidualVector: Residual vector with convection contributions\n */\n imposeConvectionBoundaryConditionsFront(\n elementIndex,\n nodesXCoordinates,\n nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n // Initialize local Jacobian matrix and local residual vector\n const numNodes = this.nop[elementIndex].length;\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Check if this element is on a convection boundary\n for (const boundaryKey in this.boundaryElements) {\n if (this.boundaryConditions[boundaryKey]?.[0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n\n // Find if this element is on this boundary and which side\n const boundaryElement = this.boundaryElements[boundaryKey].find(\n ([elemIdx, _]) => elemIdx === elementIndex\n );\n\n if (boundaryElement) {\n const side = boundaryElement[1];\n\n if (this.meshDimension === \"1D\") {\n // Handle 1D case\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n nodeIndex = side === 0 ? 0 : 1;\n } else if (this.elementOrder === \"quadratic\") {\n nodeIndex = side === 0 ? 0 : 2;\n }\n\n // Add contribution to local Jacobian matrix and local residual vector\n debugLog(\n ` - Applied convection boundary condition to node ${nodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n localResidualVector[nodeIndex] += -convectionCoeff * extTemp;\n localJacobianMatrix[nodeIndex][nodeIndex] += convectionCoeff;\n } else if (this.meshDimension === \"2D\") {\n // Handle 2D case\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n // Get basis functions\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n const basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n const basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n // Calculate tangent vector components\n let ksiDerivX = 0,\n ksiDerivY = 0,\n etaDerivX = 0,\n etaDerivY = 0;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n } else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute tangent vector length\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n // Handle quadratic elements (similar pattern but with more Gauss points)\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the solid heat transfer model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\nexport function assembleHeatConductionMat(meshData, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n // 2D solid heat transfer\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n );\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the solid heat transfer model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - localResidualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n if (meshDimension === \"1D\") {\n // 1D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n // 2D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Create mapping from local element space to global mesh (convert to 0-based indexing)\n const localToGlobalMap = ngl.map((globalIndex) => globalIndex - 1);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle generic boundary conditions application\n */\nexport class GenericBoundaryConditions {\n /**\n * Constructor to initialize the GenericBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose Dirichlet boundary conditions\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeDirichletBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant value (Dirichlet) boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantValueBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n// Base viscous term that remains when eikonal equation is fully activated\nconst baseEikonalViscousTerm = 1e-2;\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the front propagation model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleFrontPropagationMat(\n meshData,\n boundaryConditions,\n solutionVector,\n eikonalActivationFlag\n) {\n basicLog(\"Starting front propagation matrix assembly...\");\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n debugLog(`eikonalViscousTerm: ${eikonalViscousTerm}`);\n debugLog(`eikonalActivationFlag: ${eikonalActivationFlag}`);\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // jacobianMatrix\n // TODO jacobianMatrix calculation here\n }\n }\n }\n // 2D front propagation (eikonal) equation\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n\n // residualVector: Viscous term contribution (to stabilize the solution)\n residualVector[localToGlobalMap1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // residualVector: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n residualVector[localToGlobalMap1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n\n // jacobianMatrix: Viscous term contribution\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // jacobianMatrix: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Dirichlet boundary conditions\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Front propagation matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the front propagation model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - residualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleFrontPropagationFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n solutionVector,\n eikonalActivationFlag,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // localJacobianMatrix\n // TODO localJacobianMatrix calculation here\n }\n }\n // 2D front propagation (eikonal) equation\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // Viscous term contribution\n localResidualVector[localNodeIndex1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localResidualVector[localNodeIndex1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Viscous term contribution\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { BasisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { initializeFEA } from \"../mesh/meshUtilsScript.js\";\nimport { assembleHeatConductionFront } from \"../solvers/heatConductionScript.js\";\nimport { ThermalBoundaryConditions } from \"../solvers/thermalBoundaryConditionsScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\nimport { GenericBoundaryConditions } from \"../solvers/genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n// Create object templates\nconst frontalData = {};\nconst frontalState = {};\nconst elementData = { currentElementIndex: 0 };\nconst frontStorage = {};\nlet basisFunctions;\n\n/**\n * Function to run the frontal solver and obtain results for plotting\n * @param {function} assembleFront - Matrix assembler based on the physical model\n * @param {object} meshData - Object containing mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} [options] - Additional options for the solver\n * @returns {object} An object containing the solution vector and node coordinates\n */\nexport function runFrontalSolver(assembleFront, meshData, boundaryConditions, options = {}) {\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const totalNodes = meshData.nodesXCoordinates.length;\n const numElements = meshData.totalElements;\n const numNodes = FEAData.numNodes;\n\n // Calculate required array sizes\n initializeFrontalArrays(numNodes, numElements);\n\n // Start timing for system solving (frontal algorithm)\n basicLog(\"Solving system using frontal...\");\n console.time(\"systemSolving\");\n\n // Initialize basis functions\n basisFunctions = new BasisFunctions({\n meshDimension: meshData.meshDimension,\n elementOrder: meshData.elementOrder,\n });\n\n // Copy node connectivity array into frontalData storage\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n for (let nodeIndex = 0; nodeIndex < FEAData.numNodes; nodeIndex++) {\n frontalData.nodalNumbering[elementIndex][nodeIndex] = meshData.nop[elementIndex][nodeIndex];\n }\n }\n\n // Apply Dirichlet-type boundary conditions\n // Initialize all nodes with no boundary condition\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.nodeConstraintCode[nodeIndex] = 0;\n frontalData.boundaryValues[nodeIndex] = 0;\n }\n\n // Handle Dirichlet-type boundary conditions differently based on which solver is being used\n let dirichletBoundaryConditionsHandler;\n // Solid heat transfer model (heatConductionScript solver)\n if (assembleFront === assembleHeatConductionFront) {\n dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantTempBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n // Front propagation model (frontPropagationScript solver)\n } else if (assembleFront === assembleFrontPropagationFront) {\n dirichletBoundaryConditionsHandler = new GenericBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantValueBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n }\n // Initialize global residual vector\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.globalResidualVector[nodeIndex] = 0;\n }\n\n frontalState.totalNodes = meshData.nodesXCoordinates.length;\n frontalState.writeFlag = 0;\n frontalState.transformationFlag = 1;\n frontalState.determinant = 1;\n\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n frontalState.nodesPerElement[elementIndex] = FEAData.numNodes;\n }\n\n // Parameters for non-linear assemblers\n frontalState.currentSolutionVector = options.solutionVector;\n frontalState.eikonalActivationFlag = options.eikonalActivationFlag;\n\n // Pass assembleFront and dirichletBoundaryConditionsHandler to runFrontalAlgorithm\n runFrontalAlgorithm(meshData, FEAData, dirichletBoundaryConditionsHandler, assembleFront);\n\n // Copy solution\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.solutionVector[nodeIndex] = frontalState.globalSolutionVector[nodeIndex];\n }\n\n // Output results to console for debugging\n const { nodesXCoordinates, nodesYCoordinates } = meshData;\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n if (meshData.meshDimension === \"1D\") {\n // 1D case - only output X coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${frontalData.solutionVector[\n nodeIndex\n ].toExponential(5)}`\n );\n } else {\n // 2D case - output X, Y coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${nodesYCoordinates[nodeIndex].toExponential(\n 5\n )} ${frontalData.solutionVector[nodeIndex].toExponential(5)}`\n );\n }\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n const { nodesXCoordinates: finalNodesX, nodesYCoordinates: finalNodesY } = meshData;\n return {\n solutionVector: frontalData.solutionVector.slice(0, totalNodes),\n nodesCoordinates: {\n nodesXCoordinates: finalNodesX,\n nodesYCoordinates: finalNodesY,\n },\n };\n}\n\n/**\n * Function to initialize arrays dynamically based on problem size\n * @param {number} numNodes - Number of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n */\nfunction initializeFrontalArrays(numNodes, numElements) {\n // Use the actual number of elements from the mesh\n frontalData.nodalNumbering = Array(numElements)\n .fill()\n .map(() => Array(numNodes).fill(0));\n frontalData.nodeConstraintCode = Array(numNodes).fill(0);\n frontalData.boundaryValues = Array(numNodes).fill(0);\n frontalData.globalResidualVector = Array(numNodes).fill(0);\n frontalData.solutionVector = Array(numNodes).fill(0);\n frontalData.topologyData = Array(numElements).fill(0);\n frontalData.lateralData = Array(numElements).fill(0);\n\n // Initialize frontalState arrays\n frontalState.writeFlag = 0;\n frontalState.totalNodes = numNodes;\n frontalState.transformationFlag = 0;\n frontalState.nodesPerElement = Array(numElements).fill(0);\n frontalState.determinant = 1;\n\n // For matrix operations, estimate required size based on problem complexity\n const systemSize = Math.max(numNodes, 2000);\n frontalState.globalSolutionVector = Array(systemSize).fill(0);\n frontalState.frontDataIndex = 0;\n\n // Initialize elementData arrays\n elementData.localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n elementData.currentElementIndex = 0;\n\n // Initialize frontStorage arrays\n const frontSize = estimateFrontSize(numNodes, numElements);\n frontStorage.frontValues = Array(frontSize).fill(0);\n frontStorage.columnHeaders = Array(systemSize).fill(0);\n frontStorage.pivotRow = Array(systemSize).fill(0);\n frontStorage.pivotData = Array(frontSize).fill(0);\n}\n\n/**\n * Function to estimate the required front size\n * @param {number} numNodes - Number of of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n * @returns {number} Estimated front size\n */\nfunction estimateFrontSize(numNodes, numElements) {\n const frontWidthEstimate = Math.max(Math.ceil(Math.sqrt(numElements)) * numNodes, numNodes * 2);\n return frontWidthEstimate * numElements;\n}\n// Old function to estimate the required front size\n// function estimateFrontSize(numNodes, numElements, numNodes) {\n// const frontWidthEstimate = Math.ceil(Math.sqrt(numElements) * numNodes * 2);\n// const frontSize = frontWidthEstimate * numNodes * 4;\n// return Math.max(frontSize, 10000);\n// }\n\n/**\n * Function to compute local Jacobian matrix and local residual vector\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n const elementIndex = elementData.currentElementIndex - 1;\n\n // Guard against out-of-range indices\n if (elementIndex < 0 || elementIndex >= meshData.totalElements) {\n errorLog(`Skipping out-of-range elementIndex=${elementIndex} (totalElements=${meshData.totalElements})`);\n return false;\n }\n\n // Domain terms\n const { localJacobianMatrix, localResidualVector, ngl } = assembleFront({\n elementIndex,\n nop: frontalData.nodalNumbering,\n meshData,\n basisFunctions: basisFunctions,\n FEAData,\n // These are ignored by linear assemblers\n solutionVector: frontalState.currentSolutionVector,\n eikonalActivationFlag: frontalState.eikonalActivationFlag,\n });\n\n // Handle Robin-type boundary conditions differently based on which solver is being used\n let boundaryLocalJacobianMatrix = Array(FEAData.numNodes)\n .fill()\n .map(() => Array(FEAData.numNodes).fill(0));\n let boundaryResidualVector = Array(FEAData.numNodes).fill(0);\n\n // heatConductionScript solver\n if (assembleFront === assembleHeatConductionFront) {\n // Check if this element is on a Robin-type boundary\n let isOnRobinTypeBoundary = false;\n for (const boundaryKey in meshData.boundaryElements) {\n if (\n thermalBoundaryConditions.boundaryConditions[boundaryKey]?.[0] === \"convection\" &&\n meshData.boundaryElements[boundaryKey].some(([elemIdx, _]) => elemIdx === elementIndex)\n ) {\n isOnRobinTypeBoundary = true;\n break;\n }\n }\n\n // Only calculate Robin-type for elements when required\n if (isOnRobinTypeBoundary) {\n const { gaussPoints, gaussWeights } = FEAData;\n const result = thermalBoundaryConditions.imposeConvectionBoundaryConditionsFront(\n elementIndex,\n meshData.nodesXCoordinates,\n meshData.nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n );\n boundaryLocalJacobianMatrix = result.localJacobianMatrix;\n boundaryResidualVector = result.localResidualVector;\n }\n } else if (assembleFront === assembleFrontPropagationFront) {\n // For now, no Robin-type boundary conditions exist for any other solver\n }\n\n // Combine domain and boundary contributions\n for (let localNodeI = 0; localNodeI < FEAData.numNodes; localNodeI++) {\n for (let localNodeJ = 0; localNodeJ < FEAData.numNodes; localNodeJ++) {\n elementData.localJacobianMatrix[localNodeI][localNodeJ] =\n localJacobianMatrix[localNodeI][localNodeJ] + boundaryLocalJacobianMatrix[localNodeI][localNodeJ];\n }\n }\n\n // Assemble local element residual\n for (let localNodeIndex = 0; localNodeIndex < FEAData.numNodes; localNodeIndex++) {\n const globalNodeIndex = ngl[localNodeIndex] - 1;\n frontalData.globalResidualVector[globalNodeIndex] +=\n localResidualVector[localNodeIndex] + boundaryResidualVector[localNodeIndex];\n }\n\n return true;\n}\n\n/**\n * Function to implement the frontal solver algorithm\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction runFrontalAlgorithm(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n // Allocate local arrays dynamically\n const totalElements = meshData.totalElements;\n const numNodes = meshData.nodesXCoordinates.length;\n const systemSize = Math.max(numNodes, frontalState.globalSolutionVector.length);\n let localDestination = Array(FEAData.numNodes).fill(0);\n let rowDestination = Array(FEAData.numNodes).fill(0);\n let rowHeaders = Array(systemSize).fill(0);\n let pivotRowIndices = Array(systemSize).fill(0);\n let pivotColumnIndices = Array(systemSize).fill(0);\n let modifiedRows = Array(systemSize).fill(0);\n let pivotColumn = Array(systemSize).fill(0);\n let frontMatrix = Array(systemSize)\n .fill()\n .map(() => Array(systemSize).fill(0));\n let rowSwapCount = Array(numNodes).fill(0);\n let columnSwapCount = Array(numNodes).fill(0);\n let lastAppearanceCheck = Array(numNodes).fill(0);\n let pivotColumnGlobalIndex; // Pivot column global index\n\n let frontDataCounter = 1;\n frontalState.writeFlag++;\n let pivotDataIndex = 1;\n let summedRows = 1;\n elementData.currentElementIndex = 0;\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n rowSwapCount[nodeIndex] = 0;\n columnSwapCount[nodeIndex] = 0;\n }\n\n if (frontalState.transformationFlag !== 0) {\n // Prefront: find last appearance of each node\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n lastAppearanceCheck[nodeIndex] = 0;\n }\n\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n let reverseElementIndex = totalElements - elementIndex - 1;\n for (\n let localNodeIndex = 0;\n localNodeIndex < frontalState.nodesPerElement[reverseElementIndex];\n localNodeIndex++\n ) {\n let globalNodeIndex = frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n if (lastAppearanceCheck[globalNodeIndex - 1] === 0) {\n lastAppearanceCheck[globalNodeIndex - 1] = 1;\n frontalData.nodalNumbering[reverseElementIndex][localNodeIndex] =\n -frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n }\n }\n }\n }\n\n frontalState.transformationFlag = 0;\n let columnCount = 0;\n let rowCount = 0;\n\n for (let i = 0; i < systemSize; i++) {\n for (let j = 0; j < systemSize; j++) {\n frontMatrix[j][i] = 0;\n }\n }\n\n while (true) {\n // Assemble a new element only while we still have elements\n let assembled = false;\n let numElementNodes = 0;\n let numElementColumns = 0;\n\n if (elementData.currentElementIndex < totalElements) {\n elementData.currentElementIndex++;\n assembled = assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront);\n }\n\n if (assembled) {\n const currentElement = elementData.currentElementIndex;\n numElementNodes = frontalState.nodesPerElement[currentElement - 1];\n numElementColumns = frontalState.nodesPerElement[currentElement - 1];\n\n for (let localNodeIndex = 0; localNodeIndex < numElementColumns; localNodeIndex++) {\n let globalNodeIndex = frontalData.nodalNumbering[currentElement - 1][localNodeIndex];\n let columnIndex;\n\n if (columnCount === 0) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n for (columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(frontStorage.columnHeaders[columnIndex])) break;\n }\n\n if (columnIndex === columnCount) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n localDestination[localNodeIndex] = columnIndex + 1;\n frontStorage.columnHeaders[columnIndex] = globalNodeIndex;\n }\n }\n\n let rowIndex;\n if (rowCount === 0) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(rowHeaders[rowIndex])) break;\n }\n\n if (rowIndex === rowCount) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n rowDestination[localNodeIndex] = rowIndex + 1;\n rowHeaders[rowIndex] = globalNodeIndex;\n }\n }\n }\n\n if (rowCount > systemSize || columnCount > systemSize) {\n errorLog(\"Error: systemSize not large enough\");\n return;\n }\n\n for (let localColumnIndex = 0; localColumnIndex < numElementColumns; localColumnIndex++) {\n let frontColumnIndex = localDestination[localColumnIndex];\n for (let localRowIndex = 0; localRowIndex < numElementNodes; localRowIndex++) {\n let frontRowIndex = rowDestination[localRowIndex];\n frontMatrix[frontRowIndex - 1][frontColumnIndex - 1] +=\n elementData.localJacobianMatrix[localRowIndex][localColumnIndex];\n }\n }\n }\n\n // Pivoting/elimination continues whether or not a new element was assembled\n let availableColumnCount = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (frontStorage.columnHeaders[columnIndex] < 0) {\n pivotColumnIndices[availableColumnCount] = columnIndex + 1;\n availableColumnCount++;\n }\n }\n\n let constrainedRowCount = 0;\n let availableRowCount = 0;\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n let globalNodeIndex = rowHeaders[rowIndex];\n if (globalNodeIndex < 0) {\n pivotRowIndices[availableRowCount] = rowIndex + 1;\n availableRowCount++;\n let absoluteNodeIndex = Math.abs(globalNodeIndex);\n if (frontalData.nodeConstraintCode[absoluteNodeIndex - 1] === 1) {\n modifiedRows[constrainedRowCount] = rowIndex + 1;\n constrainedRowCount++;\n frontalData.nodeConstraintCode[absoluteNodeIndex - 1] = 2;\n frontalData.globalResidualVector[absoluteNodeIndex - 1] =\n frontalData.boundaryValues[absoluteNodeIndex - 1];\n }\n }\n }\n\n if (constrainedRowCount > 0) {\n for (let constrainedIndex = 0; constrainedIndex < constrainedRowCount; constrainedIndex++) {\n let rowIndex = modifiedRows[constrainedIndex] - 1;\n let globalNodeIndex = Math.abs(rowHeaders[rowIndex]);\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] = 0;\n let columnGlobalIndex = Math.abs(frontStorage.columnHeaders[columnIndex]);\n if (columnGlobalIndex === globalNodeIndex) frontMatrix[rowIndex][columnIndex] = 1;\n }\n }\n }\n\n if (availableColumnCount > summedRows || elementData.currentElementIndex < totalElements) {\n if (availableColumnCount === 0) {\n errorLog(\"Error: no more rows fully summed\");\n return;\n }\n\n let pivotRowIndex = pivotRowIndices[0];\n let pivotColumnIndex = pivotColumnIndices[0];\n let pivotValue = frontMatrix[pivotRowIndex - 1][pivotColumnIndex - 1];\n\n if (Math.abs(pivotValue) < 1e-4) {\n pivotValue = 0;\n for (let columnIndex = 0; columnIndex < availableColumnCount; columnIndex++) {\n let testColumnIndex = pivotColumnIndices[columnIndex];\n for (let rowIndex = 0; rowIndex < availableRowCount; rowIndex++) {\n let testRowIndex = pivotRowIndices[rowIndex];\n let testValue = frontMatrix[testRowIndex - 1][testColumnIndex - 1];\n if (Math.abs(testValue) > Math.abs(pivotValue)) {\n pivotValue = testValue;\n pivotColumnIndex = testColumnIndex;\n pivotRowIndex = testRowIndex;\n }\n }\n }\n }\n\n let pivotGlobalRowIndex = Math.abs(rowHeaders[pivotRowIndex - 1]);\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]); // Assign, don't declare\n let permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n if (nodeIndex >= pivotGlobalRowIndex) rowSwapCount[nodeIndex]--;\n if (nodeIndex >= pivotColumnGlobalIndex) columnSwapCount[nodeIndex]--;\n }\n\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontMatrix[pivotRowIndex - 1][columnIndex] / pivotValue;\n }\n\n let rightHandSide = frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] = rightHandSide;\n pivotColumn[pivotRowIndex - 1] = pivotValue;\n\n if (pivotRowIndex > 1) {\n for (let rowIndex = 0; rowIndex < pivotRowIndex - 1; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1 && eliminationFactor !== 0) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] -= eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n if (pivotRowIndex < rowCount) {\n for (let rowIndex = pivotRowIndex; rowIndex < rowCount; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = pivotColumn[i];\n }\n pivotDataIndex += rowCount;\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = rowHeaders[i];\n }\n pivotDataIndex += rowCount;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.pivotRow[i];\n }\n frontDataCounter += columnCount;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.columnHeaders[i];\n }\n frontDataCounter += columnCount;\n\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n frontMatrix[rowIndex][columnCount - 1] = 0;\n }\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowCount - 1][columnIndex] = 0;\n }\n\n columnCount--;\n if (pivotColumnIndex < columnCount + 1) {\n for (let columnIndex = pivotColumnIndex - 1; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] = frontStorage.columnHeaders[columnIndex + 1];\n }\n }\n\n rowCount--;\n if (pivotRowIndex < rowCount + 1) {\n for (let rowIndex = pivotRowIndex - 1; rowIndex < rowCount; rowIndex++) {\n rowHeaders[rowIndex] = rowHeaders[rowIndex + 1];\n }\n }\n\n if (rowCount > 1 || elementData.currentElementIndex < totalElements) continue;\n\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[0]); // Assign, don't declare\n pivotRowIndex = 1;\n pivotValue = frontMatrix[0][0];\n pivotGlobalRowIndex = Math.abs(rowHeaders[0]);\n pivotColumnIndex = 1;\n permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n frontStorage.pivotRow[0] = 1;\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] =\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.pivotRow[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.columnHeaders[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotColumn[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = rowHeaders[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n frontalState.frontDataIndex = frontDataCounter;\n if (frontalState.writeFlag === 1)\n debugLog(`total ecs transfer in matrix reduction=${frontDataCounter}`);\n\n // Back substitution\n performBackSubstitution(frontDataCounter);\n break;\n }\n }\n}\n\n/**\n * Function to perform back substitution for the frontal solver\n * @param {number} frontDataCounter - Index counter for the element contributions\n */\nfunction performBackSubstitution(frontDataCounter) {\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n frontalState.globalSolutionVector[nodeIndex] = frontalData.boundaryValues[nodeIndex];\n }\n\n for (let iterationIndex = 1; iterationIndex <= frontalState.totalNodes; iterationIndex++) {\n frontDataCounter -= 4;\n let pivotGlobalRowIndex = frontStorage.frontValues[frontDataCounter - 1];\n let columnCount = frontStorage.frontValues[frontDataCounter];\n let pivotColumnIndex = frontStorage.frontValues[frontDataCounter + 1];\n let pivotValue = frontStorage.frontValues[frontDataCounter + 2];\n\n if (iterationIndex === 1) {\n frontDataCounter--;\n frontStorage.columnHeaders[0] = frontStorage.frontValues[frontDataCounter - 1];\n frontDataCounter--;\n frontStorage.pivotRow[0] = frontStorage.frontValues[frontDataCounter - 1];\n } else {\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] =\n frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n }\n\n let pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]);\n if (frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] > 0) continue;\n\n let accumulatedValue = 0;\n frontStorage.pivotRow[pivotColumnIndex - 1] = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n accumulatedValue -=\n frontStorage.pivotRow[columnIndex] *\n frontalState.globalSolutionVector[Math.abs(frontStorage.columnHeaders[columnIndex]) - 1];\n }\n\n frontalState.globalSolutionVector[pivotColumnGlobalIndex - 1] =\n accumulatedValue + frontalData.globalResidualVector[pivotGlobalRowIndex - 1];\n\n frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] = 1;\n }\n\n if (frontalState.writeFlag === 1)\n debugLog(`value of frontDataCounter after backsubstitution=${frontDataCounter}`);\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { euclideanNorm } from \"../methods/euclideanNormScript.js\";\nimport { solveLinearSystem } from \"./linearSystemSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\nimport { runFrontalSolver } from \"./frontalSolverScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\n\n/**\n * Function to solve a system of non-linear equations using the Newton-Raphson method\n * @param {function} assembleMat - Matrix assembler based on the physical model\n * @param {object} context - Context object containing simulation data and options\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-4] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\n\nexport function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-4) {\n let errorNorm = 0;\n let converged = false;\n let iterations = 0;\n let deltaX = [];\n let solutionVector = [];\n let jacobianMatrix = [];\n let residualVector = [];\n\n // Calculate system size\n let totalNodes = context.meshData.nodesXCoordinates.length;\n\n // Initialize arrays with proper size\n for (let i = 0; i < totalNodes; i++) {\n deltaX[i] = 0;\n solutionVector[i] = 0;\n }\n\n // Initialize solution from context if available\n if (context.initialSolution && context.initialSolution.length === totalNodes) {\n solutionVector = [...context.initialSolution];\n }\n\n while (iterations < maxIterations && !converged) {\n // Update solution\n for (let i = 0; i < solutionVector.length; i++) {\n solutionVector[i] = Number(solutionVector[i]) + Number(deltaX[i]);\n }\n\n // Check if using frontal solver\n if (context.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleFrontPropagationFront,\n context.meshData,\n context.boundaryConditions,\n { solutionVector, eikonalActivationFlag: context.eikonalActivationFlag }\n );\n deltaX = frontalResult.solutionVector;\n } else {\n // Compute Jacobian and residual matrices\n ({ jacobianMatrix, residualVector } = assembleMat(\n context.meshData,\n context.boundaryConditions,\n solutionVector, // The solution vector is required in the case of a non-linear equation\n context.eikonalActivationFlag // Currently used only in the front propagation solver (TODO refactor in case of a solver not needing it)\n ));\n\n // Solve the linear system based on the specified solver method\n const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);\n deltaX = linearSystemResult.solutionVector;\n }\n\n // Check convergence\n errorNorm = euclideanNorm(deltaX);\n\n // Norm for each iteration\n basicLog(`Newton-Raphson iteration ${iterations + 1}: Error norm = ${errorNorm.toExponential(4)}`);\n\n if (errorNorm <= tolerance) {\n converged = true;\n } else if (errorNorm > 1e2) {\n errorLog(`Solution not converged. Error norm: ${errorNorm}`);\n break;\n }\n\n iterations++;\n }\n\n return {\n solutionVector,\n converged,\n iterations,\n jacobianMatrix,\n residualVector,\n };\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { newtonRaphson } from \"./methods/newtonRaphsonScript.js\";\nimport { solveLinearSystem } from \"./methods/linearSystemSolverScript.js\";\nimport { prepareMesh } from \"./mesh/meshUtilsScript.js\";\nimport { assembleFrontPropagationMat } from \"./solvers/frontPropagationScript.js\";\nimport { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from \"./solvers/generalFormPDEScript.js\";\nimport { assembleHeatConductionMat, assembleHeatConductionFront } from \"./solvers/heatConductionScript.js\";\nimport { runFrontalSolver } from \"./methods/frontalSolverScript.js\";\nimport { basicLog, debugLog, warnLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n this.coefficientFunctions = null; // Add storage for coefficient functions\n warnLog(\n \"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE\"\n );\n basicLog(\"FEAScriptModel instance created\");\n }\n\n /**\n * Sets the solver configuration\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} [options] - Optional additional configuration\n */\n setSolverConfig(solverConfig, options = {}) {\n this.solverConfig = solverConfig;\n\n // Store coefficient functions if provided\n if (options && options.coefficientFunctions) {\n this.coefficientFunctions = options.coefficientFunctions;\n debugLog(\"Coefficient functions set\");\n }\n\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n /**\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let initialSolution = [];\n\n // Prepare the mesh\n basicLog(\"Preparing mesh...\");\n const meshData = prepareMesh(this.meshConfig);\n basicLog(\"Mesh preparation completed\");\n\n // Extract node coordinates from meshData\n const nodesCoordinates = {\n nodesXCoordinates: meshData.nodesXCoordinates,\n nodesYCoordinates: meshData.nodesYCoordinates,\n };\n\n // Select and execute the appropriate solver based on solverConfig\n basicLog(\"Beginning solving process...\");\n console.time(\"totalSolvingTime\");\n if (this.solverConfig === \"heatConductionScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleHeatConductionFront,\n meshData,\n this.boundaryConditions\n );\n solutionVector = frontalResult.solutionVector;\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n } else if (this.solverConfig === \"frontPropagationScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Initialize eikonalActivationFlag\n let eikonalActivationFlag = 0;\n const eikonalExteralIterations = 5; // Number of incremental steps for the eikonal equation\n\n // Create context object with all necessary properties\n const context = {\n meshData: meshData,\n boundaryConditions: this.boundaryConditions,\n eikonalActivationFlag: eikonalActivationFlag,\n solverMethod: this.solverMethod,\n initialSolution,\n };\n\n while (eikonalActivationFlag <= 1) {\n // Update the context object with current eikonalActivationFlag\n context.eikonalActivationFlag = eikonalActivationFlag;\n\n // Pass the previous solution as initial guess\n if (solutionVector.length > 0) {\n context.initialSolution = [...solutionVector];\n }\n\n // Solve the assembled non-linear system\n const newtonRaphsonResult = newtonRaphson(assembleFrontPropagationMat, context, 100, 1e-4);\n\n // Extract results\n jacobianMatrix = newtonRaphsonResult.jacobianMatrix;\n residualVector = newtonRaphsonResult.residualVector;\n solutionVector = newtonRaphsonResult.solutionVector;\n\n // Increment for next iteration\n eikonalActivationFlag += 1 / eikonalExteralIterations;\n }\n } else if (this.solverConfig === \"generalFormPDEScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n errorLog(\n \"Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.\"\n );\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleGeneralFormPDEMat(\n meshData,\n this.boundaryConditions,\n this.coefficientFunctions\n ));\n\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n }\n console.timeEnd(\"totalSolvingTime\");\n basicLog(\"Solving process completed\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { initializeFEA, performIsoparametricMapping1D } from \"../mesh/meshUtilsScript.js\";\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the general form PDE model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} coefficientFunctions - Functions A(x), B(x), C(x), D(x) for the PDE\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleGeneralFormPDEMat(meshData, boundaryConditions, coefficientFunctions) {\n basicLog(\"Starting general form PDE matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Extract coefficient functions\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Convert to 0-based indexing\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n const globalNodeIndex1 = localToGlobalMap[localNodeIndex1];\n\n // Source term contribution to residual vector\n residualVector[globalNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n const globalNodeIndex2 = localToGlobalMap[localNodeIndex2];\n\n // Diffusion term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEMat.\");\n // 2D general form PDE - empty for now\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Apply Dirichlet boundary conditions only\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n\n basicLog(\"General form PDE matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the frontal solver matrix for the general form PDE model\n * @param {object} data - Object containing element data for the frontal solver\n * @returns {object} An object containing local Jacobian matrix and residual vector\n */\nexport function assembleGeneralFormPDEFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n coefficientFunctions,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of local Jacobian matrix and residual vector\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n // Source term contribution to local residual vector\n localResidualVector[localNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Diffusion term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEFront.\");\n // 2D general form PDE - empty for now\n }\n\n return {\n localJacobianMatrix,\n localResidualVector,\n ngl,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n\n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n\n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map((val) => val[0]);\n } else {\n zValues = solutionVector;\n }\n\n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n\n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: \"closest\",\n };\n\n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: \"Solution Field\",\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n name: \"Solution Field\",\n };\n\n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const printVersion = \"0.1.3\";"],"names":["euclideanNorm","vector","norm","i","length","Math","sqrt","currentLogLevel","debugLog","message","console","log","basicLog","errorLog","solveLinearSystem","solverMethod","jacobianMatrix","residualVector","options","maxIterations","tolerance","solutionVector","converged","iterations","time","jacobianMatrixSparse","math","sparse","luFactorization","slu","solutionMatrix","lusolve","squeeze","valueOf","jacobiSolverResult","initialGuess","n","x","xNew","Array","iteration","sum","j","maxDiff","max","abs","jacobiSolver","fill","timeEnd","BasisFunctions","constructor","meshDimension","elementOrder","this","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","Mesh","numElementsX","maxX","numElementsY","maxY","parsedMesh","boundaryElementsProcessed","parseMeshFromGmsh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","boundaryNodePairs","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","Mesh1D","super","generateMesh","nodesXCoordinates","totalNodesX","deltaX","nodeIndex","generate1DNodalNumbering","findBoundaryElements","nop","elementIndex","columnCounter","sideIndex","Mesh2D","nodesYCoordinates","totalNodesY","deltaY","nodeIndexY","nodeIndexX","nnode","generate2DNodalNumbering","rowCounter","elementIndexX","elementIndexY","nodeIndex1","nodeIndex2","NumericalIntegration","getGaussPointsAndWeights","gaussPoints","gaussWeights","initializeFEA","meshData","totalNodes","colIndex","basisFunctions","gaussPointsAndWeights","localToGlobalMap","numNodes","performIsoparametricMapping1D","params","xCoordinates","ksiDerivX","localNodeIndex","detJacobian","basisFunctionDerivX","performIsoparametricMapping2D","yCoordinates","etaDerivX","ksiDerivY","etaDerivY","basisFunctionDerivY","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","Object","keys","boundaryKey","tempValue","globalNodeIndex","imposeConstantTempBoundaryConditionsFront","nodeConstraintCode","boundaryValues","imposeConvectionBoundaryConditions","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","tangentVectorLength","localNodeIndex2","globalNodeIndex2","gaussPointIndex","imposeConvectionBoundaryConditionsFront","localJacobianMatrix","map","localResidualVector","boundaryElement","find","_","assembleHeatConductionFront","FEAData","ngl","gaussPointIndex1","localNodeIndex1","gaussPointIndex2","globalIndex","GenericBoundaryConditions","imposeDirichletBoundaryConditions","value","imposeConstantValueBoundaryConditionsFront","assembleFrontPropagationMat","eikonalActivationFlag","eikonalViscousTerm","totalElements","mappingResult","solutionDerivX","solutionDerivY","localToGlobalMap1","localToGlobalMap2","assembleFrontPropagationFront","frontalData","frontalState","elementData","currentElementIndex","frontStorage","runFrontalSolver","assembleFront","numElements","globalResidualVector","topologyData","lateralData","writeFlag","transformationFlag","nodesPerElement","determinant","systemSize","globalSolutionVector","frontDataIndex","frontSize","frontWidthEstimate","ceil","estimateFrontSize","frontValues","columnHeaders","pivotRow","pivotData","initializeFrontalArrays","dirichletBoundaryConditionsHandler","currentSolutionVector","thermalBoundaryConditions","pivotColumnGlobalIndex","localDestination","rowDestination","rowHeaders","pivotRowIndices","pivotColumnIndices","modifiedRows","pivotColumn","frontMatrix","rowSwapCount","columnSwapCount","lastAppearanceCheck","frontDataCounter","pivotDataIndex","summedRows","reverseElementIndex","columnCount","rowCount","assembled","numElementNodes","numElementColumns","assembleElementContribution","currentElement","columnIndex","rowIndex","localColumnIndex","frontColumnIndex","localRowIndex","availableColumnCount","constrainedRowCount","availableRowCount","absoluteNodeIndex","constrainedIndex","pivotRowIndex","pivotColumnIndex","pivotValue","testColumnIndex","testRowIndex","testValue","pivotGlobalRowIndex","permutationHelper","rightHandSide","globalRowIndex","eliminationFactor","performBackSubstitution","runFrontalAlgorithm","toExponential","finalNodesX","finalNodesY","slice","nodesCoordinates","boundaryLocalJacobianMatrix","boundaryResidualVector","isOnRobinTypeBoundary","some","result","localNodeI","localNodeJ","iterationIndex","accumulatedValue","newtonRaphson","assembleMat","context","errorNorm","initialSolution","Number","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","serialized","Error","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","test","isAllowedOrigin","warn","id","type","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","error","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","r","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","arr","prototype","concat","handler","serializedValue","msg","floor","random","MAX_SAFE_INTEGER","solverConfig","meshConfig","coefficientFunctions","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","mesh","nodesCoordinatesAndNumbering","prepareMesh","assembleHeatConductionMat","eikonalExteralIterations","newtonRaphsonResult","A","B","C","D","xCoord","a","b","d","globalNodeIndex1","assembleGeneralFormPDEMat","worker","feaWorker","isReady","_initWorker","Worker","URL","document","location","require","__filename","href","currentScript","tagName","toUpperCase","src","baseURI","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","level","plotType","plotDivId","meshType","yData","xData","from","lineData","mode","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedX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G,EAAmB,GACvB,IAAK,IAAIhjB,EAAI,EAAGA,EAAIyiB,EAAYC,EAAW1iB,GAAK0iB,EAAW,CACzD,IAAIO,EAASrc,EAAkB5G,GAC/BgjB,EAAiB7d,KAAK8d,EACvB,CAGD,IAAIC,EAAc,CAChBC,EAAGL,EACHlN,KAAM,UACNwN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETpf,EAAG8gB,EACHlD,EAAG8C,EAAqB,GACxB5c,KAAM,kBAIR6b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GACrE,KAAW,CAEL,IAAImB,EAAc,CAChBhhB,EAAG0E,EACHkZ,EAAGvY,EACH4b,EAAGd,EACHzM,KAAM,UACNwN,SAAU,CACRC,SAAU,UACVC,YAAY,GAGdC,SAAU,CACRjC,MAAO,YAETtb,KAAM,kBAIR6b,OAAOC,QAAQxB,EAAW,CAAC4C,GAAc7B,EAAQ,CAAEU,YAAY,GAChE,CACF,CACH,iBCrJ4B"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8105cd3..05ecadb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,23 +1,21 @@ { "name": "feascript", - "version": "0.1.3", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "feascript", - "version": "0.1.3", - "license": "MIT", + "version": "1.0.0", + "license": "AGPLv3", "devDependencies": { "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", - "mathjs": "^11.12.0", "rollup": "^2.79.2", - "rollup-plugin-terser": "^7.0.2" - }, - "peerDependencies": { - "mathjs": "^11.12.0", - "plotly.js": "^2.35.3" + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-typescript2": "^0.36.0", + "rollup-plugin-wasm": "^3.0.0", + "typescript": "^5.8.3" } }, "node_modules/@babel/code-frame": { @@ -45,33 +43,11 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/runtime": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", - "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@choojs/findup": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", - "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", - "license": "MIT", - "peer": true, - "dependencies": { - "commander": "^2.15.1" - }, - "bin": { - "findup": "bin/findup.js" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", @@ -86,6 +62,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -95,6 +72,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -104,6 +82,7 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -114,219 +93,20 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@mapbox/geojson-rewind": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", - "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", - "license": "ISC", - "peer": true, - "dependencies": { - "get-stream": "^6.0.1", - "minimist": "^1.2.6" - }, - "bin": { - "geojson-rewind": "geojson-rewind" - } - }, - "node_modules/@mapbox/geojson-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz", - "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw==", - "license": "ISC", - "peer": true - }, - "node_modules/@mapbox/jsonlint-lines-primitives": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", - "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", - "peer": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@mapbox/mapbox-gl-supported": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz", - "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==", - "license": "BSD-3-Clause", - "peer": true, - "peerDependencies": { - "mapbox-gl": ">=0.32.1 <2.0.0" - } - }, - "node_modules/@mapbox/point-geometry": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", - "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", - "license": "ISC", - "peer": true - }, - "node_modules/@mapbox/tiny-sdf": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz", - "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/@mapbox/unitbezier": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", - "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/@mapbox/vector-tile": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", - "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "@mapbox/point-geometry": "~0.1.0" - } - }, - "node_modules/@mapbox/whoots-js": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", - "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", - "license": "ISC", - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "20.4.0", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", - "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", - "license": "ISC", - "peer": true, - "dependencies": { - "@mapbox/jsonlint-lines-primitives": "~2.0.2", - "@mapbox/unitbezier": "^0.0.1", - "json-stringify-pretty-compact": "^4.0.0", - "minimist": "^1.2.8", - "quickselect": "^2.0.0", - "rw": "^1.3.3", - "tinyqueue": "^3.0.0" - }, - "bin": { - "gl-style-format": "dist/gl-style-format.mjs", - "gl-style-migrate": "dist/gl-style-migrate.mjs", - "gl-style-validate": "dist/gl-style-validate.mjs" - } - }, - "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", - "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", - "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", - "license": "ISC", - "peer": true - }, - "node_modules/@plotly/d3": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/@plotly/d3/-/d3-3.8.2.tgz", - "integrity": "sha512-wvsNmh1GYjyJfyEBPKJLTMzgf2c2bEbSIL50lmqVUi+o1NHaLPi1Lb4v7VxXXJn043BhNyrxUrWI85Q+zmjOVA==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/@plotly/d3-sankey": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@plotly/d3-sankey/-/d3-sankey-0.7.2.tgz", - "integrity": "sha512-2jdVos1N3mMp3QW0k2q1ph7Gd6j5PY1YihBrwpkFnKqO+cqtZq3AdEYUeSGXMeLsBDQYiqTVcihYfk8vr5tqhw==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "d3-array": "1", - "d3-collection": "1", - "d3-shape": "^1.2.0" - } - }, - "node_modules/@plotly/d3-sankey-circular": { - "version": "0.33.1", - "resolved": "https://registry.npmjs.org/@plotly/d3-sankey-circular/-/d3-sankey-circular-0.33.1.tgz", - "integrity": "sha512-FgBV1HEvCr3DV7RHhDsPXyryknucxtfnLwPtCKKxdolKyTFYoLX/ibEfX39iFYIL7DYbVeRtP43dbFcrHNE+KQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "d3-array": "^1.2.1", - "d3-collection": "^1.0.4", - "d3-shape": "^1.2.0", - "elementary-circuits-directed-graph": "^1.0.4" - } - }, - "node_modules/@plotly/mapbox-gl": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/@plotly/mapbox-gl/-/mapbox-gl-1.13.4.tgz", - "integrity": "sha512-sR3/Pe5LqT/fhYgp4rT4aSFf1rTsxMbGiH6Hojc7PH36ny5Bn17iVFUjpzycafETURuFbLZUfjODO8LvSI+5zQ==", - "license": "SEE LICENSE IN LICENSE.txt", - "peer": true, - "dependencies": { - "@mapbox/geojson-rewind": "^0.5.2", - "@mapbox/geojson-types": "^1.0.2", - "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^1.5.0", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^1.1.1", - "@mapbox/unitbezier": "^0.0.0", - "@mapbox/vector-tile": "^1.3.1", - "@mapbox/whoots-js": "^3.1.0", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.2", - "geojson-vt": "^3.2.1", - "gl-matrix": "^3.2.1", - "grid-index": "^1.1.0", - "murmurhash-js": "^1.0.0", - "pbf": "^3.2.1", - "potpack": "^1.0.1", - "quickselect": "^2.0.0", - "rw": "^1.3.3", - "supercluster": "^7.1.0", - "tinyqueue": "^2.0.3", - "vt-pbf": "^3.1.1" - }, - "engines": { - "node": ">=6.4.0" - } - }, - "node_modules/@plotly/point-cluster": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz", - "integrity": "sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==", - "license": "MIT", - "peer": true, - "dependencies": { - "array-bounds": "^1.0.1", - "binary-search-bounds": "^2.0.4", - "clamp": "^1.0.1", - "defined": "^1.0.0", - "dtype": "^2.0.0", - "flatten-vertex-data": "^1.0.2", - "is-obj": "^1.0.1", - "math-log2": "^1.0.1", - "parse-rect": "^1.2.0", - "pick-by-alias": "^1.2.0" - } - }, "node_modules/@rollup/plugin-commonjs": { "version": "28.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz", @@ -402,169 +182,23 @@ } } }, - "node_modules/@turf/area": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-7.2.0.tgz", - "integrity": "sha512-zuTTdQ4eoTI9nSSjerIy4QwgvxqwJVciQJ8tOPuMHbXJ9N/dNjI7bU8tasjhxas/Cx3NE9NxVHtNpYHL0FSzoA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@turf/helpers": "^7.2.0", - "@turf/meta": "^7.2.0", - "@types/geojson": "^7946.0.10", - "tslib": "^2.8.1" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-7.2.0.tgz", - "integrity": "sha512-wzHEjCXlYZiDludDbXkpBSmv8Zu6tPGLmJ1sXQ6qDwpLE1Ew3mcWqt8AaxfTP5QwDNQa3sf2vvgTEzNbPQkCiA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@turf/helpers": "^7.2.0", - "@turf/meta": "^7.2.0", - "@types/geojson": "^7946.0.10", - "tslib": "^2.8.1" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/centroid": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-7.2.0.tgz", - "integrity": "sha512-yJqDSw25T7P48au5KjvYqbDVZ7qVnipziVfZ9aSo7P2/jTE7d4BP21w0/XLi3T/9bry/t9PR1GDDDQljN4KfDw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@turf/helpers": "^7.2.0", - "@turf/meta": "^7.2.0", - "@types/geojson": "^7946.0.10", - "tslib": "^2.8.1" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/helpers": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.2.0.tgz", - "integrity": "sha512-cXo7bKNZoa7aC7ydLmUR02oB3IgDe7MxiPuRz3cCtYQHn+BJ6h1tihmamYDWWUlPHgSNF0i3ATc4WmDECZafKw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/geojson": "^7946.0.10", - "tslib": "^2.8.1" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/meta": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.2.0.tgz", - "integrity": "sha512-igzTdHsQc8TV1RhPuOLVo74Px/hyPrVgVOTgjWQZzt3J9BVseCdpfY/0cJBdlSRI4S/yTmmHl7gAqjhpYH5Yaw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@turf/helpers": "^7.2.0", - "@types/geojson": "^7946.0.10" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@types/eslint": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", - "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, "license": "MIT" }, - "node_modules/@types/geojson": { - "version": "7946.0.16", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", - "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/geojson-vt": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", - "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/geojson": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/mapbox__point-geometry": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", - "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/mapbox__vector-tile": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", - "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/geojson": "*", - "@types/mapbox__point-geometry": "*", - "@types/pbf": "*" - } - }, "node_modules/@types/node": { "version": "22.15.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, - "node_modules/@types/pbf": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", - "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", - "license": "MIT", - "peer": true - }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", @@ -572,1759 +206,166 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/supercluster": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", - "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/geojson": "*" - } - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", - "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/helper-numbers": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", - "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", - "license": "MIT", - "peer": true + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", - "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", - "license": "MIT", - "peer": true + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "license": "MIT" }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", - "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", - "license": "MIT", - "peer": true + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" }, - "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", - "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.13.2", - "@webassemblyjs/helper-api-error": "1.13.2", - "@xtuc/long": "4.2.2" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", - "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", - "license": "MIT", - "peer": true + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", - "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/wasm-gen": "1.14.1" + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", - "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", - "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", - "license": "Apache-2.0", - "peer": true, "dependencies": { - "@xtuc/long": "4.2.2" + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", - "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", - "license": "MIT", - "peer": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", - "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/helper-wasm-section": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-opt": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1", - "@webassemblyjs/wast-printer": "1.14.1" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", - "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" } }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", - "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-buffer": "1.14.1", - "@webassemblyjs/wasm-gen": "1.14.1", - "@webassemblyjs/wasm-parser": "1.14.1" + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", - "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@webassemblyjs/helper-api-error": "1.13.2", - "@webassemblyjs/helper-wasm-bytecode": "1.13.2", - "@webassemblyjs/ieee754": "1.13.2", - "@webassemblyjs/leb128": "1.13.2", - "@webassemblyjs/utf8": "1.13.2" - } - }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", - "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@webassemblyjs/ast": "1.14.1", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "license": "Apache-2.0", - "peer": true - }, - "node_modules/abs-svg-path": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz", - "integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA==", - "license": "MIT", - "peer": true - }, - "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "license": "MIT", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", - "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "license": "MIT", - "peer": true, - "dependencies": { - "ajv": "^8.0.0" - }, - "peerDependencies": { - "ajv": "^8.0.0" - }, - "peerDependenciesMeta": { - "ajv": { - "optional": true - } - } - }, - "node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "license": "MIT", - "peer": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/almost-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/almost-equal/-/almost-equal-1.1.0.tgz", - "integrity": "sha512-0V/PkoculFl5+0Lp47JoxUcO0xSxhIBvm+BxHdD/OgXNmdRpRHCFnKVuUoWyS9EzQP+otSGv0m9Lb4yVkQBn2A==", - "license": "MIT", - "peer": true - }, - "node_modules/array-bounds": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-bounds/-/array-bounds-1.0.1.tgz", - "integrity": "sha512-8wdW3ZGk6UjMPJx/glyEt0sLzzwAE1bhToPsO1W2pbpR2gULyxe3BjSiuJFheP50T/GgODVPz2fuMUmIywt8cQ==", - "license": "MIT", - "peer": true - }, - "node_modules/array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/array-normalize": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/array-normalize/-/array-normalize-1.1.4.tgz", - "integrity": "sha512-fCp0wKFLjvSPmCn4F5Tiw4M3lpMZoHlCjfcs7nNzuj3vqQQ1/a8cgB9DXcpDSn18c+coLnaW7rqfcYCvKbyJXg==", - "license": "MIT", - "peer": true, - "dependencies": { - "array-bounds": "^1.0.0" - } - }, - "node_modules/array-range": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-range/-/array-range-1.0.1.tgz", - "integrity": "sha512-shdaI1zT3CVNL2hnx9c0JMc0ZogGaxDs5e85akgHWKYa0yVbIyp06Ind3dVkTj/uuFrzaHBOyqFzo+VV6aXgtA==", - "license": "MIT", - "peer": true - }, - "node_modules/array-rearrange": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", - "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==", - "license": "MIT", - "peer": true - }, - "node_modules/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/binary-search-bounds": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.5.tgz", - "integrity": "sha512-H0ea4Fd3lS1+sTEB2TgcLoK21lLhwEJzlQv3IN47pJS976Gx4zoWe0ak3q+uYh60ppQxg9F16Ri4tS1sfD4+jA==", - "license": "MIT", - "peer": true - }, - "node_modules/bit-twiddle": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", - "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==", - "license": "MIT", - "peer": true - }, - "node_modules/bitmap-sdf": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", - "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", - "license": "MIT", - "peer": true - }, - "node_modules/bl": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", - "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", - "license": "MIT", - "peer": true, - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/browserslist": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", - "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "caniuse-lite": "^1.0.30001716", - "electron-to-chromium": "^1.5.149", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "license": "MIT" - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001718", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", - "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "CC-BY-4.0", - "peer": true - }, - "node_modules/canvas-fit": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/canvas-fit/-/canvas-fit-1.5.0.tgz", - "integrity": "sha512-onIcjRpz69/Hx5bB5HGbYKUF2uC6QT6Gp+pfpGm3A7mPfcluSLV5v4Zu+oflDUwLdUw0rLIBhUbi0v8hM4FJQQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "element-size": "^1.1.1" - } - }, - "node_modules/chrome-trace-event": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", - "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/clamp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", - "integrity": "sha512-kgMuFyE78OC6Dyu3Dy7vcx4uy97EIbVxJB/B0eJ3bUNAkwdNcxYzgKltnyADiYwsR7SEqkkUPsEUT//OVS6XMA==", - "license": "MIT", - "peer": true - }, - "node_modules/color-alpha": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/color-alpha/-/color-alpha-1.0.4.tgz", - "integrity": "sha512-lr8/t5NPozTSqli+duAN+x+no/2WaKTeWvxhHGN+aXT6AJ8vPlzLa7UriyjWak0pSC2jHol9JgjBYnnHsGha9A==", - "license": "MIT", - "peer": true, - "dependencies": { - "color-parse": "^1.3.8" - } - }, - "node_modules/color-alpha/node_modules/color-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", - "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", - "license": "MIT", - "peer": true, - "dependencies": { - "color-name": "^1.0.0" - } - }, - "node_modules/color-id": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/color-id/-/color-id-1.1.0.tgz", - "integrity": "sha512-2iRtAn6dC/6/G7bBIo0uupVrIne1NsQJvJxZOBCzQOfk7jRq97feaDZ3RdzuHakRXXnHGNwglto3pqtRx1sX0g==", - "license": "MIT", - "peer": true, - "dependencies": { - "clamp": "^1.0.1" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT", - "peer": true - }, - "node_modules/color-normalize": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/color-normalize/-/color-normalize-1.5.0.tgz", - "integrity": "sha512-rUT/HDXMr6RFffrR53oX3HGWkDOP9goSAQGBkUaAYKjOE2JxozccdGyufageWDlInRAjm/jYPrf/Y38oa+7obw==", - "license": "MIT", - "peer": true, - "dependencies": { - "clamp": "^1.0.1", - "color-rgba": "^2.1.1", - "dtype": "^2.0.0" - } - }, - "node_modules/color-parse": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", - "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", - "license": "MIT", - "peer": true, - "dependencies": { - "color-name": "^1.0.0" - } - }, - "node_modules/color-rgba": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.1.1.tgz", - "integrity": "sha512-VaX97wsqrMwLSOR6H7rU1Doa2zyVdmShabKrPEIFywLlHoibgD3QW9Dw6fSqM4+H/LfjprDNAUUW31qEQcGzNw==", - "license": "MIT", - "peer": true, - "dependencies": { - "clamp": "^1.0.1", - "color-parse": "^1.3.8", - "color-space": "^1.14.6" - } - }, - "node_modules/color-rgba/node_modules/color-parse": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", - "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", - "license": "MIT", - "peer": true, - "dependencies": { - "color-name": "^1.0.0" - } - }, - "node_modules/color-space": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/color-space/-/color-space-1.16.0.tgz", - "integrity": "sha512-A6WMiFzunQ8KEPFmj02OnnoUnqhmSaHaZ/0LVFcPTdlvm8+3aMJ5x1HRHy3bDHPkovkf4sS0f4wsVvwk71fKkg==", - "license": "MIT", - "peer": true, - "dependencies": { - "hsluv": "^0.0.3", - "mumath": "^3.3.4" - } - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "license": "MIT" - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, - "license": "MIT" - }, - "node_modules/complex.js": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.2.tgz", - "integrity": "sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/rawify" - } - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "license": "MIT", - "peer": true, - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT", - "peer": true - }, - "node_modules/country-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/country-regex/-/country-regex-1.1.0.tgz", - "integrity": "sha512-iSPlClZP8vX7MC3/u6s3lrDuoQyhQukh5LyABJ3hvfzbQ3Yyayd4fp04zjLnfi267B/B2FkumcWWgrbban7sSA==", - "license": "MIT", - "peer": true - }, - "node_modules/css-font": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-font/-/css-font-1.2.0.tgz", - "integrity": "sha512-V4U4Wps4dPDACJ4WpgofJ2RT5Yqwe1lEH6wlOOaIxMi0gTjdIijsc5FmxQlZ7ZZyKQkkutqqvULOp07l9c7ssA==", - "license": "MIT", - "peer": true, - "dependencies": { - "css-font-size-keywords": "^1.0.0", - "css-font-stretch-keywords": "^1.0.1", - "css-font-style-keywords": "^1.0.1", - "css-font-weight-keywords": "^1.0.0", - "css-global-keywords": "^1.0.1", - "css-system-font-keywords": "^1.0.0", - "pick-by-alias": "^1.2.0", - "string-split-by": "^1.0.0", - "unquote": "^1.1.0" - } - }, - "node_modules/css-font-size-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-font-size-keywords/-/css-font-size-keywords-1.0.0.tgz", - "integrity": "sha512-Q+svMDbMlelgCfH/RVDKtTDaf5021O486ZThQPIpahnIjUkMUslC+WuOQSWTgGSrNCH08Y7tYNEmmy0hkfMI8Q==", - "license": "MIT", - "peer": true - }, - "node_modules/css-font-stretch-keywords": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/css-font-stretch-keywords/-/css-font-stretch-keywords-1.0.1.tgz", - "integrity": "sha512-KmugPO2BNqoyp9zmBIUGwt58UQSfyk1X5DbOlkb2pckDXFSAfjsD5wenb88fNrD6fvS+vu90a/tsPpb9vb0SLg==", - "license": "MIT", - "peer": true - }, - "node_modules/css-font-style-keywords": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/css-font-style-keywords/-/css-font-style-keywords-1.0.1.tgz", - "integrity": "sha512-0Fn0aTpcDktnR1RzaBYorIxQily85M2KXRpzmxQPgh8pxUN9Fcn00I8u9I3grNr1QXVgCl9T5Imx0ZwKU973Vg==", - "license": "MIT", - "peer": true - }, - "node_modules/css-font-weight-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-font-weight-keywords/-/css-font-weight-keywords-1.0.0.tgz", - "integrity": "sha512-5So8/NH+oDD+EzsnF4iaG4ZFHQ3vaViePkL1ZbZ5iC/KrsCY+WHq/lvOgrtmuOQ9pBBZ1ADGpaf+A4lj1Z9eYA==", - "license": "MIT", - "peer": true - }, - "node_modules/css-global-keywords": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/css-global-keywords/-/css-global-keywords-1.0.1.tgz", - "integrity": "sha512-X1xgQhkZ9n94WDwntqst5D/FKkmiU0GlJSFZSV3kLvyJ1WC5VeyoXDOuleUD+SIuH9C7W05is++0Woh0CGfKjQ==", - "license": "MIT", - "peer": true - }, - "node_modules/css-loader": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", - "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", - "license": "MIT", - "peer": true, - "dependencies": { - "icss-utils": "^5.1.0", - "postcss": "^8.4.33", - "postcss-modules-extract-imports": "^3.1.0", - "postcss-modules-local-by-default": "^4.0.5", - "postcss-modules-scope": "^3.2.0", - "postcss-modules-values": "^4.0.0", - "postcss-value-parser": "^4.2.0", - "semver": "^7.5.4" - }, - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "@rspack/core": "0.x || 1.x", - "webpack": "^5.27.0" - }, - "peerDependenciesMeta": { - "@rspack/core": { - "optional": true - }, - "webpack": { - "optional": true - } - } - }, - "node_modules/css-system-font-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-system-font-keywords/-/css-system-font-keywords-1.0.0.tgz", - "integrity": "sha512-1umTtVd/fXS25ftfjB71eASCrYhilmEsvDEI6wG/QplnmlfmVM5HkZ/ZX46DT5K3eblFPgLUHt5BRCb0YXkSFA==", - "license": "MIT", - "peer": true - }, - "node_modules/csscolorparser": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", - "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==", - "license": "MIT", - "peer": true - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "license": "MIT", - "peer": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/d": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", - "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", - "license": "ISC", - "peer": true, - "dependencies": { - "es5-ext": "^0.10.64", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-collection": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", - "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", - "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", - "license": "ISC", - "peer": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-dispatch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", - "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-force": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", - "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "d3-collection": "1", - "d3-dispatch": "1", - "d3-quadtree": "1", - "d3-timer": "1" - } - }, - "node_modules/d3-format": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", - "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-geo": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", - "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "d3-array": "1" - } - }, - "node_modules/d3-geo-projection": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.9.0.tgz", - "integrity": "sha512-ZULvK/zBn87of5rWAfFMc9mJOipeSo57O+BBitsKIXmU4rTVAnX1kSsJkE0R+TxY8pGNoM1nbyRRE7GYHhdOEQ==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "commander": "2", - "d3-array": "1", - "d3-geo": "^1.12.0", - "resolve": "^1.1.10" - }, - "bin": { - "geo2svg": "bin/geo2svg", - "geograticule": "bin/geograticule", - "geoproject": "bin/geoproject", - "geoquantize": "bin/geoquantize", - "geostitch": "bin/geostitch" - } - }, - "node_modules/d3-hierarchy": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", - "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", - "license": "ISC", - "peer": true, - "dependencies": { - "d3-color": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-path": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", - "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-quadtree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", - "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-shape": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", - "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "d3-path": "1" - } - }, - "node_modules/d3-time": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", - "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/d3-time-format": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", - "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "d3-time": "1" - } - }, - "node_modules/d3-timer": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", - "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/decimal.js": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.5.0.tgz", - "integrity": "sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==", - "dev": true, - "license": "MIT" - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/defined": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", - "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", - "license": "MIT", - "peer": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/detect-kerning": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-kerning/-/detect-kerning-2.1.2.tgz", - "integrity": "sha512-I3JIbrnKPAntNLl1I6TpSQQdQ4AutYzv/sKMFKbepawV/hlH0GmYKhUoOEMd4xqaUHT+Bm0f4127lh5qs1m1tw==", - "license": "MIT", - "peer": true - }, - "node_modules/draw-svg-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/draw-svg-path/-/draw-svg-path-1.0.0.tgz", - "integrity": "sha512-P8j3IHxcgRMcY6sDzr0QvJDLzBnJJqpTG33UZ2Pvp8rw0apCHhJCWqYprqrXjrgHnJ6tuhP1iTJSAodPDHxwkg==", - "license": "MIT", - "peer": true, - "dependencies": { - "abs-svg-path": "~0.1.1", - "normalize-svg-path": "~0.1.0" - } - }, - "node_modules/dtype": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dtype/-/dtype-2.0.0.tgz", - "integrity": "sha512-s2YVcLKdFGS0hpFqJaTwscsyt0E8nNFdmo73Ocd81xNPj4URI4rj6D60A+vFMIw7BXWlb4yRkEwfBqcZzPGiZg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/dup": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dup/-/dup-1.0.0.tgz", - "integrity": "sha512-Bz5jxMMC0wgp23Zm15ip1x8IhYRqJvF3nFC0UInJUDkN1z4uNPk9jTnfCUJXbOGiQ1JbXLQsiV41Fb+HXcj5BA==", - "license": "MIT", - "peer": true - }, - "node_modules/duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "license": "MIT", - "peer": true, - "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/earcut": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", - "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==", - "license": "ISC", - "peer": true - }, - "node_modules/electron-to-chromium": { - "version": "1.5.155", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.155.tgz", - "integrity": "sha512-ps5KcGGmwL8VaeJlvlDlu4fORQpv3+GIcF5I3f9tUKUlJ/wsysh6HU8P5L1XWRYeXfA0oJd4PyM8ds8zTFf6Ng==", - "license": "ISC", - "peer": true - }, - "node_modules/element-size": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/element-size/-/element-size-1.1.1.tgz", - "integrity": "sha512-eaN+GMOq/Q+BIWy0ybsgpcYImjGIdNLyjLFJU4XsLHXYQao5jCNb36GyN6C2qwmDDYSfIBmKpPpr4VnBdLCsPQ==", - "license": "MIT", - "peer": true - }, - "node_modules/elementary-circuits-directed-graph": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/elementary-circuits-directed-graph/-/elementary-circuits-directed-graph-1.3.1.tgz", - "integrity": "sha512-ZEiB5qkn2adYmpXGnJKkxT8uJHlW/mxmBpmeqawEHzPxh9HkLD4/1mFYX5l0On+f6rcPIt8/EWlRU2Vo3fX6dQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "strongly-connected-components": "^1.0.1" - } - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/enhanced-resolve": { - "version": "5.18.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", - "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", - "license": "MIT", - "peer": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", - "license": "MIT", - "peer": true - }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "hasInstallScript": true, - "license": "ISC", - "peer": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "license": "MIT", - "peer": true, - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", - "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", - "license": "ISC", - "peer": true, - "dependencies": { - "d": "^1.0.2", - "ext": "^1.7.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/es6-weak-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "license": "ISC", - "peer": true, - "dependencies": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-latex": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", - "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", - "dev": true, - "license": "MIT" - }, - "node_modules/escodegen": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", - "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "license": "ISC", - "peer": true, - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "license": "BSD-2-Clause", - "peer": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "license": "MIT", - "peer": true, - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "license": "ISC", - "peer": true, - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/falafel": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.5.tgz", - "integrity": "sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "acorn": "^7.1.1", - "isarray": "^2.0.1" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/falafel/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "license": "MIT", - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT", - "peer": true - }, - "node_modules/fast-isnumeric": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/fast-isnumeric/-/fast-isnumeric-1.1.4.tgz", - "integrity": "sha512-1mM8qOr2LYz8zGaUdmiqRDiuue00Dxjgcb1NQR7TnhLVh6sQyngP9xvLo7Sl7LZpP/sk5eb+bcyWXw530NTBZw==", - "license": "MIT", - "peer": true, - "dependencies": { - "is-string-blank": "^1.0.1" - } - }, - "node_modules/fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/flatten-vertex-data": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz", - "integrity": "sha512-BvCBFK2NZqerFTdMDgqfHBwxYWnxeCkwONsw6PvBMcUXqo8U/KDWwmXhqx1x2kLIg7DqIsJfOaJFOmlua3Lxuw==", - "license": "MIT", - "peer": true, - "dependencies": { - "dtype": "^2.0.0" - } - }, - "node_modules/font-atlas": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/font-atlas/-/font-atlas-2.1.0.tgz", - "integrity": "sha512-kP3AmvX+HJpW4w3d+PiPR2X6E1yvsBXt2yhuCw+yReO9F1WYhvZwx3c95DGZGwg9xYzDGrgJYa885xmVA+28Cg==", - "license": "MIT", - "peer": true, - "dependencies": { - "css-font": "^1.0.0" - } - }, - "node_modules/font-measure": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/font-measure/-/font-measure-1.2.2.tgz", - "integrity": "sha512-mRLEpdrWzKe9hbfaF3Qpr06TAjquuBVP5cHy4b3hyeNdjc9i0PO6HniGsX5vjL5OWv7+Bd++NiooNpT/s8BvIA==", - "license": "MIT", - "peer": true, - "dependencies": { - "css-font": "^1.2.0" - } - }, - "node_modules/fraction.js": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.4.tgz", - "integrity": "sha512-pwiTgt0Q7t+GHZA4yaLjObx4vXmmdcS0iSJ19o8d/goUGgItX9UZWKWNnLHehxviD8wU2IWRsnR8cD5+yOJP2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - }, - "funding": { - "type": "patreon", - "url": "https://github.com/sponsors/rawify" - } - }, - "node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", - "license": "MIT", - "peer": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/geojson-vt": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", - "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==", - "license": "ISC", - "peer": true - }, - "node_modules/get-canvas-context": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-canvas-context/-/get-canvas-context-1.0.2.tgz", - "integrity": "sha512-LnpfLf/TNzr9zVOGiIY6aKCz8EKuXmlYNV7CM2pUjBa/B+c2I15tS7KLySep75+FuerJdmArvJLcsAXWEy2H0A==", - "license": "MIT", - "peer": true - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gl-mat4": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gl-mat4/-/gl-mat4-1.2.0.tgz", - "integrity": "sha512-sT5C0pwB1/e9G9AvAoLsoaJtbMGjfd/jfxo8jMCKqYYEnjZuFvqV5rehqar0538EmssjdDeiEWnKyBSTw7quoA==", - "license": "Zlib", - "peer": true - }, - "node_modules/gl-matrix": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", - "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", - "license": "MIT", - "peer": true - }, - "node_modules/gl-text": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gl-text/-/gl-text-1.4.0.tgz", - "integrity": "sha512-o47+XBqLCj1efmuNyCHt7/UEJmB9l66ql7pnobD6p+sgmBUdzfMZXIF0zD2+KRfpd99DJN+QXdvTFAGCKCVSmQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "bit-twiddle": "^1.0.2", - "color-normalize": "^1.5.0", - "css-font": "^1.2.0", - "detect-kerning": "^2.1.2", - "es6-weak-map": "^2.0.3", - "flatten-vertex-data": "^1.0.2", - "font-atlas": "^2.1.0", - "font-measure": "^1.2.2", - "gl-util": "^3.1.2", - "is-plain-obj": "^1.1.0", - "object-assign": "^4.1.1", - "parse-rect": "^1.2.0", - "parse-unit": "^1.0.1", - "pick-by-alias": "^1.2.0", - "regl": "^2.0.0", - "to-px": "^1.0.1", - "typedarray-pool": "^1.1.0" - } - }, - "node_modules/gl-util": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/gl-util/-/gl-util-3.1.3.tgz", - "integrity": "sha512-dvRTggw5MSkJnCbh74jZzSoTOGnVYK+Bt+Ckqm39CVcl6+zSsxqWk4lr5NKhkqXHL6qvZAU9h17ZF8mIskY9mA==", - "license": "MIT", - "peer": true, - "dependencies": { - "is-browser": "^2.0.1", - "is-firefox": "^1.0.3", - "is-plain-obj": "^1.1.0", - "number-is-integer": "^1.0.1", - "object-assign": "^4.1.0", - "pick-by-alias": "^1.2.0", - "weak-map": "^1.0.5" - } - }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/global-prefix": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", - "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", - "license": "MIT", - "peer": true, - "dependencies": { - "ini": "^4.1.3", - "kind-of": "^6.0.3", - "which": "^4.0.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/glsl-inject-defines": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz", - "integrity": "sha512-W49jIhuDtF6w+7wCMcClk27a2hq8znvHtlGnrYkSWEr8tHe9eA2dcnohlcAmxLYBSpSSdzOkRdyPTrx9fw49+A==", - "license": "MIT", - "peer": true, - "dependencies": { - "glsl-token-inject-block": "^1.0.0", - "glsl-token-string": "^1.0.1", - "glsl-tokenizer": "^2.0.2" - } - }, - "node_modules/glsl-resolve": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/glsl-resolve/-/glsl-resolve-0.0.1.tgz", - "integrity": "sha512-xxFNsfnhZTK9NBhzJjSBGX6IOqYpvBHxxmo+4vapiljyGNCY0Bekzn0firQkQrazK59c1hYxMDxYS8MDlhw4gA==", - "license": "MIT", - "peer": true, - "dependencies": { - "resolve": "^0.6.1", - "xtend": "^2.1.2" - } - }, - "node_modules/glsl-resolve/node_modules/resolve": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", - "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-resolve/node_modules/xtend": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.2.0.tgz", - "integrity": "sha512-SLt5uylT+4aoXxXuwtQp5ZnMMzhDb1Xkg4pEqc00WUJCQifPfV9Ub1VrNhp9kXkrjZD2I2Hl8WnjP37jzZLPZw==", - "peer": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/glsl-token-assignments": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz", - "integrity": "sha512-OwXrxixCyHzzA0U2g4btSNAyB2Dx8XrztY5aVUCjRSh4/D0WoJn8Qdps7Xub3sz6zE73W3szLrmWtQ7QMpeHEQ==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-defines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz", - "integrity": "sha512-Vb5QMVeLjmOwvvOJuPNg3vnRlffscq2/qvIuTpMzuO/7s5kT+63iL6Dfo2FYLWbzuiycWpbC0/KV0biqFwHxaQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "glsl-tokenizer": "^2.0.0" - } - }, - "node_modules/glsl-token-depth": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz", - "integrity": "sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-descope": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz", - "integrity": "sha512-kS2PTWkvi/YOeicVjXGgX5j7+8N7e56srNDEHDTVZ1dcESmbmpmgrnpjPcjxJjMxh56mSXYoFdZqb90gXkGjQw==", - "license": "MIT", - "peer": true, - "dependencies": { - "glsl-token-assignments": "^2.0.0", - "glsl-token-depth": "^1.1.0", - "glsl-token-properties": "^1.0.0", - "glsl-token-scope": "^1.1.0" - } - }, - "node_modules/glsl-token-inject-block": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz", - "integrity": "sha512-q/m+ukdUBuHCOtLhSr0uFb/qYQr4/oKrPSdIK2C4TD+qLaJvqM9wfXIF/OOBjuSA3pUoYHurVRNao6LTVVUPWA==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-properties": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz", - "integrity": "sha512-dSeW1cOIzbuUoYH0y+nxzwK9S9O3wsjttkq5ij9ZGw0OS41BirKJzzH48VLm8qLg+au6b0sINxGC0IrGwtQUcA==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-scope": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz", - "integrity": "sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-string": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/glsl-token-string/-/glsl-token-string-1.0.1.tgz", - "integrity": "sha512-1mtQ47Uxd47wrovl+T6RshKGkRRCYWhnELmkEcUAPALWGTFe2XZpH3r45XAwL2B6v+l0KNsCnoaZCSnhzKEksg==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-token-whitespace-trim": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz", - "integrity": "sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-tokenizer": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", - "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", - "license": "MIT", - "peer": true, - "dependencies": { - "through2": "^0.6.3" - } - }, - "node_modules/glsl-tokenizer/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-tokenizer/node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "license": "MIT", - "peer": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/glsl-tokenizer/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "license": "MIT", - "peer": true - }, - "node_modules/glsl-tokenizer/node_modules/through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", - "license": "MIT", - "peer": true, - "dependencies": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - }, - "node_modules/glslify": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glslify/-/glslify-7.1.1.tgz", - "integrity": "sha512-bud98CJ6kGZcP9Yxcsi7Iz647wuDz3oN+IZsjCRi5X1PI7t/xPKeL0mOwXJjo+CRZMqvq0CkSJiywCcY7kVYog==", - "license": "MIT", - "peer": true, - "dependencies": { - "bl": "^2.2.1", - "concat-stream": "^1.5.2", - "duplexify": "^3.4.5", - "falafel": "^2.1.0", - "from2": "^2.3.0", - "glsl-resolve": "0.0.1", - "glsl-token-whitespace-trim": "^1.0.0", - "glslify-bundle": "^5.0.0", - "glslify-deps": "^1.2.5", - "minimist": "^1.2.5", - "resolve": "^1.1.5", - "stack-trace": "0.0.9", - "static-eval": "^2.0.5", - "through2": "^2.0.1", - "xtend": "^4.0.0" - }, - "bin": { - "glslify": "bin.js" - } - }, - "node_modules/glslify-bundle": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glslify-bundle/-/glslify-bundle-5.1.1.tgz", - "integrity": "sha512-plaAOQPv62M1r3OsWf2UbjN0hUYAB7Aph5bfH58VxJZJhloRNbxOL9tl/7H71K7OLJoSJ2ZqWOKk3ttQ6wy24A==", - "license": "MIT", - "peer": true, - "dependencies": { - "glsl-inject-defines": "^1.0.1", - "glsl-token-defines": "^1.0.0", - "glsl-token-depth": "^1.1.1", - "glsl-token-descope": "^1.0.2", - "glsl-token-scope": "^1.1.1", - "glsl-token-string": "^1.0.1", - "glsl-token-whitespace-trim": "^1.0.0", - "glsl-tokenizer": "^2.0.2", - "murmurhash-js": "^1.0.0", - "shallow-copy": "0.0.1" - } - }, - "node_modules/glslify-deps": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/glslify-deps/-/glslify-deps-1.3.2.tgz", - "integrity": "sha512-7S7IkHWygJRjcawveXQjRXLO2FTjijPDYC7QfZyAQanY+yGLCFHYnPtsGT9bdyHiwPTw/5a1m1M9hamT2aBpag==", - "license": "ISC", - "peer": true, - "dependencies": { - "@choojs/findup": "^0.2.0", - "events": "^3.2.0", - "glsl-resolve": "0.0.1", - "glsl-tokenizer": "^2.0.0", - "graceful-fs": "^4.1.2", - "inherits": "^2.0.1", - "map-limit": "0.0.1", - "resolve": "^1.0.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC", - "peer": true - }, - "node_modules/grid-index": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", - "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==", - "license": "ISC", - "peer": true + "dev": true, + "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/has-hover": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-hover/-/has-hover-1.0.1.tgz", - "integrity": "sha512-0G6w7LnlcpyDzpeGUTuT0CEw05+QlMuGVk1IHNAlHrGJITGodjZu3x8BNDUMfKJSZXNB2ZAclqc1bvrd+uUpfg==", - "license": "MIT", - "peer": true, - "dependencies": { - "is-browser": "^2.0.1" - } - }, - "node_modules/has-passive-events": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-passive-events/-/has-passive-events-1.0.0.tgz", - "integrity": "sha512-2vSj6IeIsgvsRMyeQ0JaCX5Q3lX4zMn5HpoVc7MEhQ6pv8Iq9rsXjsp+E5ZwaT7T0xhMT0KmU8gtt1EFVdbJiw==", - "license": "MIT", - "peer": true, - "dependencies": { - "is-browser": "^2.0.1" - } - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -2333,88 +374,11 @@ "node": ">= 0.4" } }, - "node_modules/hsluv": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/hsluv/-/hsluv-0.0.3.tgz", - "integrity": "sha512-08iL2VyCRbkQKBySkSh6m8zMUa3sADAxGVWs3Z1aPcUkTJeK0ETG4Fc27tEmQBGUAXZjIsXOZqBvacuVNSC/fQ==", - "license": "MIT", - "peer": true - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "peer": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/icss-utils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "license": "ISC", - "peer": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause", - "peer": true - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC", - "peer": true - }, - "node_modules/ini": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", - "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", - "license": "ISC", - "peer": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/is-browser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-browser/-/is-browser-2.1.0.tgz", - "integrity": "sha512-F5rTJxDQ2sW81fcfOR1GnCXT6sVJC104fCyfj+mjpwNEwaPYSn5fte5jiHmBg3DHsIoL/l8Kvw5VN5SsTRcRFQ==", - "license": "MIT", - "peer": true - }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.2" @@ -2426,46 +390,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-firefox": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-firefox/-/is-firefox-1.0.3.tgz", - "integrity": "sha512-6Q9ITjvWIm0Xdqv+5U12wgOKEM2KoBw4Y926m0OFkvlCxnbG94HKAsVz8w3fWcfAS5YA2fJORXX1dLrkprCCxA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-iexplorer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-iexplorer/-/is-iexplorer-1.0.0.tgz", - "integrity": "sha512-YeLzceuwg3K6O0MLM3UyUUjKAlyULetwryFp1mHy1I5PfArK0AEqlfa+MR4gkJjcbuJXoDJCvXbyqZVf5CR2Sg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-mobile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-4.0.0.tgz", - "integrity": "sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==", - "license": "MIT", - "peer": true - }, "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -2473,26 +397,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -2503,44 +407,6 @@ "@types/estree": "*" } }, - "node_modules/is-string-blank": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-string-blank/-/is-string-blank-1.0.1.tgz", - "integrity": "sha512-9H+ZBCVs3L9OYqv8nuUAzpcT9OTgMD1yAWrG7ihlnibdkbtB850heAmYWxHuXc4CHy4lKeK69tN+ny1K7gBIrw==", - "license": "MIT", - "peer": true - }, - "node_modules/is-svg-path": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-svg-path/-/is-svg-path-1.0.2.tgz", - "integrity": "sha512-Lj4vePmqpPR1ZnRctHv8ltSh1OrSxHkhUkd7wi+VQdcdP15/KvQFyk7LhNuM7ZW0EVbJz8kZLVmL9quLrfq4Kg==", - "license": "MIT", - "peer": true - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "license": "MIT", - "peer": true - }, - "node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", - "license": "ISC", - "peer": true, - "engines": { - "node": ">=16" - } - }, - "node_modules/javascript-natural-sort": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", - "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", - "dev": true, - "license": "MIT" - }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -2563,534 +429,136 @@ "dev": true, "license": "MIT" }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "license": "MIT", - "peer": true - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "license": "MIT", - "peer": true - }, - "node_modules/json-stringify-pretty-compact": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", - "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", - "license": "MIT", - "peer": true - }, - "node_modules/kdbush": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", - "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", - "license": "ISC", - "peer": true - }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/loader-runner": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", - "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6.11.5" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "license": "MIT", - "peer": true - }, - "node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, - "node_modules/map-limit": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", - "integrity": "sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==", - "license": "MIT", - "peer": true, - "dependencies": { - "once": "~1.3.0" - } - }, - "node_modules/map-limit/node_modules/once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==", - "license": "ISC", - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/mapbox-gl": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.3.tgz", - "integrity": "sha512-p8lJFEiqmEQlyv+DQxFAOG/XPWN0Wp7j/Psq93Zywz7qt9CcUKFYDBOoOEKzqe6gudHVJY8/Bhqw6VDpX2lSBg==", - "license": "SEE LICENSE IN LICENSE.txt", - "peer": true, - "dependencies": { - "@mapbox/geojson-rewind": "^0.5.2", - "@mapbox/geojson-types": "^1.0.2", - "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/mapbox-gl-supported": "^1.5.0", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^1.1.1", - "@mapbox/unitbezier": "^0.0.0", - "@mapbox/vector-tile": "^1.3.1", - "@mapbox/whoots-js": "^3.1.0", - "csscolorparser": "~1.0.3", - "earcut": "^2.2.2", - "geojson-vt": "^3.2.1", - "gl-matrix": "^3.2.1", - "grid-index": "^1.1.0", - "murmurhash-js": "^1.0.0", - "pbf": "^3.2.1", - "potpack": "^1.0.1", - "quickselect": "^2.0.0", - "rw": "^1.3.3", - "supercluster": "^7.1.0", - "tinyqueue": "^2.0.3", - "vt-pbf": "^3.1.1" - }, - "engines": { - "node": ">=6.4.0" - } - }, - "node_modules/maplibre-gl": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", - "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "@mapbox/geojson-rewind": "^0.5.2", - "@mapbox/jsonlint-lines-primitives": "^2.0.2", - "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.6", - "@mapbox/unitbezier": "^0.0.1", - "@mapbox/vector-tile": "^1.3.1", - "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^20.3.1", - "@types/geojson": "^7946.0.14", - "@types/geojson-vt": "3.2.5", - "@types/mapbox__point-geometry": "^0.1.4", - "@types/mapbox__vector-tile": "^1.3.4", - "@types/pbf": "^3.0.5", - "@types/supercluster": "^7.1.3", - "earcut": "^3.0.0", - "geojson-vt": "^4.0.2", - "gl-matrix": "^3.4.3", - "global-prefix": "^4.0.0", - "kdbush": "^4.0.2", - "murmurhash-js": "^1.0.0", - "pbf": "^3.3.0", - "potpack": "^2.0.0", - "quickselect": "^3.0.0", - "supercluster": "^8.0.1", - "tinyqueue": "^3.0.0", - "vt-pbf": "^3.1.3" - }, - "engines": { - "node": ">=16.14.0", - "npm": ">=8.1.0" - }, - "funding": { - "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" - } - }, - "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", - "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", - "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", - "license": "BSD-2-Clause", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/earcut": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.1.tgz", - "integrity": "sha512-0l1/0gOjESMeQyYaK5IDiPNvFeu93Z/cO0TjZh9eZ1vyCtZnA7KMZ8rQggpsJHIbGSdrqYq9OhuveadOVHCshw==", - "license": "ISC", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/geojson-vt": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", - "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", - "license": "ISC", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/potpack": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", - "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==", - "license": "ISC", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/quickselect": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", - "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", - "license": "ISC", - "peer": true - }, - "node_modules/maplibre-gl/node_modules/supercluster": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", - "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", - "license": "ISC", - "peer": true, - "dependencies": { - "kdbush": "^4.0.2" - } - }, - "node_modules/maplibre-gl/node_modules/tinyqueue": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", - "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", - "license": "ISC", - "peer": true - }, - "node_modules/math-log2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", - "integrity": "sha512-9W0yGtkaMAkf74XGYVy4Dqw3YUMnTNB2eeiw9aQbUl4A3KmuCEHTt2DgAB07ENzOYAjsYSAYufkAq0Zd+jU7zA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mathjs": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-11.12.0.tgz", - "integrity": "sha512-UGhVw8rS1AyedyI55DGz9q1qZ0p98kyKPyc9vherBkoueLntPfKtPBh14x+V4cdUWK0NZV2TBwqRFlvadscSuw==", + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.23.2", - "complex.js": "^2.1.1", - "decimal.js": "^10.4.3", - "escape-latex": "^1.2.0", - "fraction.js": "4.3.4", - "javascript-natural-sort": "^0.7.1", - "seedrandom": "^3.0.5", - "tiny-emitter": "^2.1.0", - "typed-function": "^4.1.1" - }, - "bin": { - "mathjs": "bin/cli.js" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "license": "MIT" - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", - "peer": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "peer": true, "dependencies": { - "mime-db": "1.52.0" + "universalify": "^2.0.0" }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "peer": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mouse-change": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mouse-change/-/mouse-change-1.4.0.tgz", - "integrity": "sha512-vpN0s+zLL2ykyyUDh+fayu9Xkor5v/zRD9jhSqjRS1cJTGS0+oakVZzNm5n19JvvEj0you+MXlYTpNxUDQUjkQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "mouse-event": "^1.0.0" - } - }, - "node_modules/mouse-event": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mouse-event/-/mouse-event-1.0.5.tgz", - "integrity": "sha512-ItUxtL2IkeSKSp9cyaX2JLUuKk2uMoxBg4bbOWVd29+CskYJR9BGsUqtXenNzKbnDshvupjUewDIYVrOB6NmGw==", - "license": "MIT", - "peer": true - }, - "node_modules/mouse-event-offset": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mouse-event-offset/-/mouse-event-offset-3.0.2.tgz", - "integrity": "sha512-s9sqOs5B1Ykox3Xo8b3Ss2IQju4UwlW6LSR+Q5FXWpprJ5fzMLefIIItr3PH8RwzfGy6gxs/4GAmiNuZScE25w==", - "license": "MIT", - "peer": true - }, - "node_modules/mouse-wheel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mouse-wheel/-/mouse-wheel-1.2.0.tgz", - "integrity": "sha512-+OfYBiUOCTWcTECES49neZwL5AoGkXE+lFjIvzwNCnYRlso+EnfvovcBxGoyQ0yQt806eSPjS675K0EwWknXmw==", - "license": "MIT", - "peer": true, - "dependencies": { - "right-now": "^1.0.0", - "signum": "^1.0.0", - "to-px": "^1.0.1" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT", - "peer": true - }, - "node_modules/mumath": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/mumath/-/mumath-3.3.4.tgz", - "integrity": "sha512-VAFIOG6rsxoc7q/IaY3jdjmrsuX9f15KlRLYTHmixASBZkZEKC1IFqE2BC5CdhXmK6WLM1Re33z//AGmeRI6FA==", - "deprecated": "Redundant dependency in your project.", - "license": "Unlicense", - "peer": true, - "dependencies": { - "almost-equal": "^1.1.0" - } - }, - "node_modules/murmurhash-js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", - "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", - "license": "MIT", - "peer": true + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "license": "MIT", - "peer": true, - "bin": { - "nanoid": "bin/nanoid.cjs" + "dependencies": { + "p-locate": "^4.1.0" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=8" } }, - "node_modules/native-promise-only": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", - "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, "license": "MIT", - "peer": true + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } }, - "node_modules/needle": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", - "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "bin": { - "needle": "bin/needle" + "semver": "^6.0.0" }, "engines": { - "node": ">= 4.4.x" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "license": "MIT", - "peer": true - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "license": "ISC", - "peer": true - }, - "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", - "license": "MIT", - "peer": true + "bin": { + "semver": "bin/semver.js" + } }, - "node_modules/normalize-svg-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-0.1.0.tgz", - "integrity": "sha512-1/kmYej2iedi5+ROxkRESL/pI02pkg0OBnaR4hJkSIX6+ORzepwbuUXfrdZaPjysTsJInj0Rj5NuX027+dMBvA==", - "license": "MIT", - "peer": true + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" }, - "node_modules/number-is-integer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-integer/-/number-is-integer-1.0.1.tgz", - "integrity": "sha512-Dq3iuiFBkrbmuQjGFFF3zckXNCQoSD37/SdSbgcBailUx6knDvDwb5CympBgcoWHy36sfS12u74MHYkXyHq6bg==", + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "is-finite": "^1.0.1" + "p-try": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "peer": true, "dependencies": { - "wrappy": "1" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/parenthesis": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz", - "integrity": "sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw==", - "license": "MIT", - "peer": true - }, - "node_modules/parse-rect": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.2.0.tgz", - "integrity": "sha512-4QZ6KYbnE6RTwg9E0HpLchUM9EZt6DnDxajFZZDSV4p/12ZJEvPO702DZpGvRYEPo00yKDys7jASi+/w7aO8LA==", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, "license": "MIT", - "peer": true, - "dependencies": { - "pick-by-alias": "^1.2.0" + "engines": { + "node": ">=6" } }, - "node_modules/parse-svg-path": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/parse-svg-path/-/parse-svg-path-0.1.2.tgz", - "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==", - "license": "MIT", - "peer": true - }, - "node_modules/parse-unit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-unit/-/parse-unit-1.0.1.tgz", - "integrity": "sha512-hrqldJHokR3Qj88EIlV/kAyAi/G5R2+R56TBANxNMy0uPlYcttx0jnMW6Yx5KsKPSbC3KddM/7qQm3+0wEXKxg==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "license": "MIT", - "peer": true + "engines": { + "node": ">=8" + } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, "license": "MIT" }, - "node_modules/pbf": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", - "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "ieee754": "^1.1.12", - "resolve-protobuf-schema": "^2.1.0" - }, - "bin": { - "pbf": "bin/pbf" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "license": "MIT", - "peer": true - }, - "node_modules/pick-by-alias": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pick-by-alias/-/pick-by-alias-1.2.0.tgz", - "integrity": "sha512-ESj2+eBxhGrcA1azgHs7lARG5+5iLakc/6nlfbpjcLl00HuuUOIuORhYXN4D1HfvMSKuVtFQjAlnwi1JHEeDIw==", - "license": "MIT", - "peer": true - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -3106,382 +574,34 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/plotly.js": { - "version": "2.35.3", - "resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-2.35.3.tgz", - "integrity": "sha512-7RaC6FxmCUhpD6H4MpD+QLUu3hCn76I11rotRefrh3m1iDvWqGnVqVk9dSaKmRAhFD3vsNsYea0OxnR1rc2IzQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@plotly/d3": "3.8.2", - "@plotly/d3-sankey": "0.7.2", - "@plotly/d3-sankey-circular": "0.33.1", - "@plotly/mapbox-gl": "1.13.4", - "@turf/area": "^7.1.0", - "@turf/bbox": "^7.1.0", - "@turf/centroid": "^7.1.0", - "base64-arraybuffer": "^1.0.2", - "canvas-fit": "^1.5.0", - "color-alpha": "1.0.4", - "color-normalize": "1.5.0", - "color-parse": "2.0.0", - "color-rgba": "2.1.1", - "country-regex": "^1.1.0", - "css-loader": "^7.1.2", - "d3-force": "^1.2.1", - "d3-format": "^1.4.5", - "d3-geo": "^1.12.1", - "d3-geo-projection": "^2.9.0", - "d3-hierarchy": "^1.1.9", - "d3-interpolate": "^3.0.1", - "d3-time": "^1.1.0", - "d3-time-format": "^2.2.3", - "fast-isnumeric": "^1.1.4", - "gl-mat4": "^1.2.0", - "gl-text": "^1.4.0", - "has-hover": "^1.0.1", - "has-passive-events": "^1.0.0", - "is-mobile": "^4.0.0", - "maplibre-gl": "^4.5.2", - "mouse-change": "^1.4.0", - "mouse-event-offset": "^3.0.2", - "mouse-wheel": "^1.2.0", - "native-promise-only": "^0.8.1", - "parse-svg-path": "^0.1.2", - "point-in-polygon": "^1.1.0", - "polybooljs": "^1.2.2", - "probe-image-size": "^7.2.3", - "regl": "npm:@plotly/regl@^2.1.2", - "regl-error2d": "^2.0.12", - "regl-line2d": "^3.1.3", - "regl-scatter2d": "^3.3.1", - "regl-splom": "^1.0.14", - "strongly-connected-components": "^1.0.1", - "style-loader": "^4.0.0", - "superscript-text": "^1.0.0", - "svg-path-sdf": "^1.1.3", - "tinycolor2": "^1.4.2", - "to-px": "1.0.1", - "topojson-client": "^3.1.0", - "webgl-context": "^2.2.0", - "world-calendars": "^1.0.3" - } - }, - "node_modules/point-in-polygon": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", - "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==", - "license": "MIT", - "peer": true - }, - "node_modules/polybooljs": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.2.tgz", - "integrity": "sha512-ziHW/02J0XuNuUtmidBc6GXE8YohYydp3DWPWXYsd7O721TjcmN+k6ezjdwkDqep+gnWnFY+yqZHvzElra2oCg==", - "license": "MIT", - "peer": true - }, - "node_modules/postcss": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", - "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "nanoid": "^3.3.8", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-modules-extract-imports": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", - "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", - "license": "ISC", - "peer": true, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-local-by-default": { + "node_modules/pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", - "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", - "license": "MIT", - "peer": true, - "dependencies": { - "icss-utils": "^5.0.0", - "postcss-selector-parser": "^7.0.0", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-scope": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", - "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", - "license": "ISC", - "peer": true, - "dependencies": { - "postcss-selector-parser": "^7.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-modules-values": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", - "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", - "license": "ISC", - "peer": true, - "dependencies": { - "icss-utils": "^5.0.0" - }, - "engines": { - "node": "^10 || ^12 || >= 14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-selector-parser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", - "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" + "find-up": "^4.0.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "license": "MIT", - "peer": true - }, - "node_modules/potpack": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", - "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", - "license": "ISC", - "peer": true - }, - "node_modules/probe-image-size": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", - "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", - "license": "MIT", - "peer": true, - "dependencies": { - "lodash.merge": "^4.6.2", - "needle": "^2.5.2", - "stream-parser": "~0.3.1" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT", - "peer": true - }, - "node_modules/protocol-buffers-schema": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", - "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", - "license": "MIT", - "peer": true - }, - "node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", - "license": "ISC", - "peer": true - }, - "node_modules/raf": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", - "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", - "license": "MIT", - "peer": true, - "dependencies": { - "performance-now": "^2.1.0" + "node": ">=8" } }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "license": "MIT", - "peer": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "license": "MIT", - "peer": true - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT", - "peer": true - }, - "node_modules/regl": { - "name": "@plotly/regl", - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@plotly/regl/-/regl-2.1.2.tgz", - "integrity": "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==", - "license": "MIT", - "peer": true - }, - "node_modules/regl-error2d": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/regl-error2d/-/regl-error2d-2.0.12.tgz", - "integrity": "sha512-r7BUprZoPO9AbyqM5qlJesrSRkl+hZnVKWKsVp7YhOl/3RIpi4UDGASGJY0puQ96u5fBYw/OlqV24IGcgJ0McA==", - "license": "MIT", - "peer": true, - "dependencies": { - "array-bounds": "^1.0.1", - "color-normalize": "^1.5.0", - "flatten-vertex-data": "^1.0.2", - "object-assign": "^4.1.1", - "pick-by-alias": "^1.2.0", - "to-float32": "^1.1.0", - "update-diff": "^1.1.0" - } - }, - "node_modules/regl-line2d": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/regl-line2d/-/regl-line2d-3.1.3.tgz", - "integrity": "sha512-fkgzW+tTn4QUQLpFKsUIE0sgWdCmXAM3ctXcCgoGBZTSX5FE2A0M7aynz7nrZT5baaftLrk9te54B+MEq4QcSA==", - "license": "MIT", - "peer": true, - "dependencies": { - "array-bounds": "^1.0.1", - "array-find-index": "^1.0.2", - "array-normalize": "^1.1.4", - "color-normalize": "^1.5.0", - "earcut": "^2.1.5", - "es6-weak-map": "^2.0.3", - "flatten-vertex-data": "^1.0.2", - "object-assign": "^4.1.1", - "parse-rect": "^1.2.0", - "pick-by-alias": "^1.2.0", - "to-float32": "^1.1.0" - } - }, - "node_modules/regl-scatter2d": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.3.1.tgz", - "integrity": "sha512-seOmMIVwaCwemSYz/y4WE0dbSO9svNFSqtTh5RE57I7PjGo3tcUYKtH0MTSoshcAsreoqN8HoCtnn8wfHXXfKQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@plotly/point-cluster": "^3.1.9", - "array-range": "^1.0.1", - "array-rearrange": "^2.2.2", - "clamp": "^1.0.1", - "color-id": "^1.1.0", - "color-normalize": "^1.5.0", - "color-rgba": "^2.1.1", - "flatten-vertex-data": "^1.0.2", - "glslify": "^7.0.0", - "is-iexplorer": "^1.0.0", - "object-assign": "^4.1.1", - "parse-rect": "^1.2.0", - "pick-by-alias": "^1.2.0", - "to-float32": "^1.1.0", - "update-diff": "^1.1.0" - } - }, - "node_modules/regl-splom": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/regl-splom/-/regl-splom-1.0.14.tgz", - "integrity": "sha512-OiLqjmPRYbd7kDlHC6/zDf6L8lxgDC65BhC8JirhP4ykrK4x22ZyS+BnY8EUinXKDeMgmpRwCvUmk7BK4Nweuw==", - "license": "MIT", - "peer": true, - "dependencies": { - "array-bounds": "^1.0.1", - "array-range": "^1.0.1", - "color-alpha": "^1.0.4", - "flatten-vertex-data": "^1.0.2", - "parse-rect": "^1.2.0", - "pick-by-alias": "^1.2.0", - "raf": "^3.4.1", - "regl-scatter2d": "^3.2.3" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, "license": "MIT", "dependencies": { "is-core-module": "^2.16.0", @@ -3498,23 +618,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-protobuf-schema": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", - "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "protocol-buffers-schema": "^3.3.1" - } - }, - "node_modules/right-now": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/right-now/-/right-now-1.0.0.tgz", - "integrity": "sha512-DA8+YS+sMIVpbsuKgy+Z67L9Lxb1p05mNxRpDPNksPDEFir4vmBlUtuN9jkTGn9YMMdlBuK7XQgFiz6ws+yhSg==", - "license": "MIT", - "peer": true - }, "node_modules/rollup": { "version": "2.79.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", @@ -3548,17 +651,64 @@ "rollup": "^2.0.0" } }, - "node_modules/rw": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", - "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", - "license": "BSD-3-Clause", - "peer": true + "node_modules/rollup-plugin-typescript2": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", + "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^4.1.2", + "find-cache-dir": "^3.3.2", + "fs-extra": "^10.0.0", + "semver": "^7.5.4", + "tslib": "^2.6.2" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", + "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/rollup-plugin-wasm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-wasm/-/rollup-plugin-wasm-3.0.0.tgz", + "integrity": "sha512-ySzhd2MtHbORJdRmpID0j1N59QpjyQ27qxo6XfEH2Pv2ckhLLiD8E1QuhLQDIIw7dXZhQYMyLRGJsiZCewTK7g==", + "deprecated": "This module has moved and is now available at @rollup/plugin-wasm. Please update your dependencies. This version is no longer maintained.", + "dev": true, + "license": "MIT" }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -3569,59 +719,18 @@ "url": "https://www.patreon.com/feross" }, { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT", - "peer": true - }, - "node_modules/sax": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "license": "ISC", - "peer": true - }, - "node_modules/schema-utils": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.2.tgz", - "integrity": "sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/seedrandom": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", - "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", - "dev": true, + "type": "consulting", + "url": "https://feross.org/support" + } + ], "license": "MIT" }, "node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -3639,177 +748,27 @@ "randombytes": "^2.1.0" } }, - "node_modules/shallow-copy": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", - "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==", - "license": "MIT", - "peer": true - }, - "node_modules/signum": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/signum/-/signum-1.0.0.tgz", - "integrity": "sha512-yodFGwcyt59XRh7w5W3jPcIQb3Bwi21suEfT7MAWnBX3iCdklJpgDgvGT9o04UonglZN5SNMfJFkHIR/jO8GHw==", - "license": "MIT", - "peer": true - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "license": "BSD-3-Clause", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, - "node_modules/stack-trace": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", - "integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==", - "peer": true, - "engines": { - "node": "*" - } - }, - "node_modules/static-eval": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", - "integrity": "sha512-MgWpQ/ZjGieSVB3eOJVs4OA2LT/q1vx98KPCTTQPzq/aLr0YUXTsgryTXr4SLfR0ZfUUCiedM9n/ABeDIyy4mA==", - "license": "MIT", - "peer": true, - "dependencies": { - "escodegen": "^2.1.0" - } - }, - "node_modules/stream-parser": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", - "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "debug": "2" - } - }, - "node_modules/stream-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "peer": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/stream-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT", - "peer": true - }, - "node_modules/stream-shift": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", - "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", - "license": "MIT", - "peer": true - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "peer": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT", - "peer": true - }, - "node_modules/string-split-by": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string-split-by/-/string-split-by-1.0.0.tgz", - "integrity": "sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==", - "license": "MIT", - "peer": true, - "dependencies": { - "parenthesis": "^3.1.5" - } - }, - "node_modules/strongly-connected-components": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", - "integrity": "sha512-i0TFx4wPcO0FwX+4RkLJi1MxmcTv90jNZgxMu9XRnMXMeFUY1VJlIoXpZunPUvUUqbCT1pg5PEkFqqpcaElNaA==", - "license": "MIT", - "peer": true - }, - "node_modules/style-loader": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", - "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 18.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.27.0" - } - }, - "node_modules/supercluster": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", - "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", - "license": "ISC", - "peer": true, - "dependencies": { - "kdbush": "^3.0.0" - } - }, - "node_modules/supercluster/node_modules/kdbush": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", - "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==", - "license": "ISC", - "peer": true - }, - "node_modules/superscript-text": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/superscript-text/-/superscript-text-1.0.0.tgz", - "integrity": "sha512-gwu8l5MtRZ6koO0icVTlmN5pm7Dhh1+Xpe9O4x6ObMAsW+3jPbW14d1DsBq1F4wiI+WOFjXF35pslgec/G8yCQ==", - "license": "MIT", - "peer": true - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3827,6 +786,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3835,64 +795,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/svg-arc-to-cubic-bezier": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz", - "integrity": "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==", - "license": "ISC", - "peer": true - }, - "node_modules/svg-path-bounds": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/svg-path-bounds/-/svg-path-bounds-1.0.2.tgz", - "integrity": "sha512-H4/uAgLWrppIC0kHsb2/dWUYSmb4GE5UqH06uqWBcg6LBjX2fu0A8+JrO2/FJPZiSsNOKZAhyFFgsLTdYUvSqQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "abs-svg-path": "^0.1.1", - "is-svg-path": "^1.0.1", - "normalize-svg-path": "^1.0.0", - "parse-svg-path": "^0.1.2" - } - }, - "node_modules/svg-path-bounds/node_modules/normalize-svg-path": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-1.1.0.tgz", - "integrity": "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg==", - "license": "MIT", - "peer": true, - "dependencies": { - "svg-arc-to-cubic-bezier": "^3.0.0" - } - }, - "node_modules/svg-path-sdf": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/svg-path-sdf/-/svg-path-sdf-1.1.3.tgz", - "integrity": "sha512-vJJjVq/R5lSr2KLfVXVAStktfcfa1pNFjFOgyJnzZFXlO/fDZ5DmM8FpnSKKzLPfEYTVeXuVBTHF296TpxuJVg==", - "license": "MIT", - "peer": true, - "dependencies": { - "bitmap-sdf": "^1.0.0", - "draw-svg-path": "^1.0.0", - "is-svg-path": "^1.0.1", - "parse-svg-path": "^0.1.2", - "svg-path-bounds": "^1.0.1" - } - }, - "node_modules/tapable": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", - "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, "node_modules/terser": { "version": "5.39.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", "integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -3907,388 +814,42 @@ "node": ">=10" } }, - "node_modules/terser-webpack-plugin": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz", - "integrity": "sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==", - "license": "MIT", - "peer": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.25", - "jest-worker": "^27.4.5", - "schema-utils": "^4.3.0", - "serialize-javascript": "^6.0.2", - "terser": "^5.31.1" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "uglify-js": { - "optional": true - } - } - }, - "node_modules/terser-webpack-plugin/node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "license": "BSD-3-Clause", - "peer": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinycolor2": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", - "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", - "license": "MIT", - "peer": true - }, - "node_modules/tinyqueue": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", - "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==", - "license": "ISC", - "peer": true - }, - "node_modules/to-float32": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/to-float32/-/to-float32-1.1.0.tgz", - "integrity": "sha512-keDnAusn/vc+R3iEiSDw8TOF7gPiTLdK1ArvWtYbJQiVfmRg6i/CAvbKq3uIS0vWroAC7ZecN3DjQKw3aSklUg==", - "license": "MIT", - "peer": true - }, - "node_modules/to-px": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-px/-/to-px-1.0.1.tgz", - "integrity": "sha512-2y3LjBeIZYL19e5gczp14/uRWFDtDUErJPVN3VU9a7SJO+RjGRtYR47aMN2bZgGlxvW4ZcEz2ddUPVHXcMfuXw==", - "license": "MIT", - "peer": true, - "dependencies": { - "parse-unit": "^1.0.1" - } - }, - "node_modules/topojson-client": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", - "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", - "license": "ISC", - "peer": true, - "dependencies": { - "commander": "2" - }, - "bin": { - "topo2geo": "bin/topo2geo", - "topomerge": "bin/topomerge", - "topoquantize": "bin/topoquantize" - } - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true - }, - "node_modules/type": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", - "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", - "license": "ISC", - "peer": true + "dev": true, + "license": "0BSD" }, - "node_modules/typed-function": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz", - "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==", + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, "engines": { - "node": ">= 18" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "license": "MIT", - "peer": true - }, - "node_modules/typedarray-pool": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.2.0.tgz", - "integrity": "sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "bit-twiddle": "^1.0.0", - "dup": "^1.0.0" + "node": ">=14.17" } }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, "license": "MIT" }, - "node_modules/unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==", - "license": "MIT", - "peer": true - }, - "node_modules/update-browserslist-db": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", - "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/update-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-diff/-/update-diff-1.1.0.tgz", - "integrity": "sha512-rCiBPiHxZwT4+sBhEbChzpO5hYHjm91kScWgdHf4Qeafs6Ba7MBl+d9GlGv72bcTZQO0sLmtQS1pHSWoCLtN/A==", - "license": "MIT", - "peer": true - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "license": "MIT", - "peer": true - }, - "node_modules/vt-pbf": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", - "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@mapbox/point-geometry": "0.1.0", - "@mapbox/vector-tile": "^1.3.1", - "pbf": "^3.2.1" - } - }, - "node_modules/watchpack": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", - "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", - "license": "MIT", - "peer": true, - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/weak-map": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.8.tgz", - "integrity": "sha512-lNR9aAefbGPpHO7AEnY0hCFjz1eTkWCXYvkTRrTHs9qv8zJp+SkVYpzfLIFXQQiG3tVvbNFQgVg2bQS8YGgxyw==", - "license": "Apache-2.0", - "peer": true - }, - "node_modules/webgl-context": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/webgl-context/-/webgl-context-2.2.0.tgz", - "integrity": "sha512-q/fGIivtqTT7PEoF07axFIlHNk/XCPaYpq64btnepopSWvKNFkoORlQYgqDigBIuGA1ExnFd/GnSUnBNEPQY7Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "get-canvas-context": "^1.0.1" - } - }, - "node_modules/webpack": { - "version": "5.99.9", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.99.9.tgz", - "integrity": "sha512-brOPwM3JnmOa+7kd3NsmOUOwbDAj8FT9xDsG3IW0MgbN9yZV7Oi/s/+MNQ/EcSMqw7qfoRyXPoeEWT8zLVdVGg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/eslint-scope": "^3.7.7", - "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", - "@webassemblyjs/ast": "^1.14.1", - "@webassemblyjs/wasm-edit": "^1.14.1", - "@webassemblyjs/wasm-parser": "^1.14.1", - "acorn": "^8.14.0", - "browserslist": "^4.24.0", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^4.3.2", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.11", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - } - } - }, - "node_modules/webpack-sources": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", - "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/which": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", - "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", - "license": "ISC", - "peer": true, - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^16.13.0 || >=18.0.0" - } - }, - "node_modules/world-calendars": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/world-calendars/-/world-calendars-1.0.3.tgz", - "integrity": "sha512-sAjLZkBnsbHkHWVhrsCU5Sa/EVuf9QqgvrN8zyJ2L/F9FR9Oc6CvVK0674+PGAtmmmYQMH98tCUSO4QLQv3/TQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "object-assign": "^4.1.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC", - "peer": true - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, "license": "MIT", - "peer": true, "engines": { - "node": ">=0.4" + "node": ">= 10.0.0" } } } diff --git a/rollup.config.js b/rollup.config.js index 445e8b3..5b61ecf 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,8 @@ +import typescript from "rollup-plugin-typescript2"; import resolve from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import { terser } from "rollup-plugin-terser"; +import wasm from "rollup-plugin-wasm"; export default { input: "src/index.js", @@ -9,7 +11,6 @@ export default { file: "dist/feascript.cjs.js", format: "cjs", sourcemap: true, - }, { file: "dist/feascript.esm.js", @@ -21,10 +22,6 @@ export default { format: "umd", name: "FEAScript", sourcemap: true, - globals: { - mathjs: "math", - "plotly.js": "Plotly" - }, }, ], plugins: [ @@ -33,7 +30,14 @@ export default { preferBuiltins: false, }), commonjs(), + wasm({ + maxFileSize: 14000000, + }), + typescript({ + useTsconfigDeclarationDir: true, + clean: true, + }), terser(), ], - external: ["mathjs", "plotly.js"], + external: [], }; From 682991d6f5759a37ab59d07d6a65c0ef9b36d256 Mon Sep 17 00:00:00 2001 From: "Sridhar.Mani" Date: Thu, 22 May 2025 12:40:04 +0530 Subject: [PATCH 05/12] Add Taichi.js support to Jacobi method for accelerated computation; update package.json and package-lock.json to include taichi.js dependency --- package-lock.json | 230 +++++++++++++++++++++++++++++- src/methods/jacobiSolverScript.js | 159 +++++++++++++++------ 2 files changed, 341 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index 05ecadb..db3e1dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "feascript", "version": "1.0.0", "license": "AGPLv3", + "dependencies": { + "taichi.js": "^0.0.36" + }, "devDependencies": { "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", @@ -43,6 +46,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", + "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", @@ -107,6 +119,141 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@loaders.gl/core": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-3.4.15.tgz", + "integrity": "sha512-rPOOTuusWlRRNMWg7hymZBoFmPCXWThsA5ZYRfqqXnsgVeQIi8hzcAhJ7zDUIFAd/OSR8ravtqb0SH+3k6MOFQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "@probe.gl/log": "^3.5.0" + } + }, + "node_modules/@loaders.gl/draco": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/draco/-/draco-3.4.15.tgz", + "integrity": "sha512-SStmyP0ZnS4JbWZb2NhrfiHW65uy3pVTTzQDTgXfkR5cD9oDAEu4nCaHbQ8x38/m39FHliCPgS9b1xWvLKQo8w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/schema": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "draco3d": "1.5.5" + } + }, + "node_modules/@loaders.gl/gltf": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/gltf/-/gltf-3.4.15.tgz", + "integrity": "sha512-Y6kMNPLiHQPr6aWQw/4BMTxgPHWx3fcib4LPpZCbhyfM8PRn6pOqATVngUXdoOf5XY0QtdKVld6N1kxlr4pJtw==", + "license": "MIT", + "dependencies": { + "@loaders.gl/draco": "3.4.15", + "@loaders.gl/images": "3.4.15", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/textures": "3.4.15", + "@math.gl/core": "^3.5.1" + } + }, + "node_modules/@loaders.gl/images": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-3.4.15.tgz", + "integrity": "sha512-QpjYhEetHabY/z9mWZYJXZZp4XJAxa38f9Ii/DjPlnJErepzY5GLBUTDHMu4oZ6n99gGImtuGFicDnFV6mb60g==", + "license": "MIT", + "dependencies": { + "@loaders.gl/loader-utils": "3.4.15" + } + }, + "node_modules/@loaders.gl/loader-utils": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-3.4.15.tgz", + "integrity": "sha512-uUx6tCaky6QgCRkqCNuuXiUfpTzKV+ZlJOf6C9bKp62lpvFOv9AwqoXmL23j8nfsENdlzsX3vPhc3en6QQyksA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1", + "@loaders.gl/worker-utils": "3.4.15", + "@probe.gl/stats": "^3.5.0" + } + }, + "node_modules/@loaders.gl/schema": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-3.4.15.tgz", + "integrity": "sha512-8oRtstz0IsqES7eZd2jQbmCnmExCMtL8T6jWd1+BfmnuyZnQ0B6TNccy++NHtffHdYuzEoQgSELwcdmhSApYew==", + "license": "MIT", + "dependencies": { + "@types/geojson": "^7946.0.7" + } + }, + "node_modules/@loaders.gl/textures": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/textures/-/textures-3.4.15.tgz", + "integrity": "sha512-QHnmxBYtLvTdG1uMz2KWcxVY8KPb1+XyPJUoZV9GMcQkulz+CwFB8BaX8nROfMDz9KKYoPfksCzjig0LZ0WBJQ==", + "license": "MIT", + "dependencies": { + "@loaders.gl/images": "3.4.15", + "@loaders.gl/loader-utils": "3.4.15", + "@loaders.gl/schema": "3.4.15", + "@loaders.gl/worker-utils": "3.4.15", + "ktx-parse": "^0.0.4", + "texture-compressor": "^1.0.2" + } + }, + "node_modules/@loaders.gl/worker-utils": { + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-3.4.15.tgz", + "integrity": "sha512-zUUepOYRYmcYIcr/c4Mchox9h5fBFNkD81rsGnLlZyq19QvyHzN+93SVxrLc078gw93t2RKrVcOOZY13zT3t1w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.3.1" + } + }, + "node_modules/@math.gl/core": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-3.6.3.tgz", + "integrity": "sha512-jBABmDkj5uuuE0dTDmwwss7Cup5ZwQ6Qb7h1pgvtkEutTrhkcv8SuItQNXmF45494yIHeoGue08NlyeY6wxq2A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.0", + "@math.gl/types": "3.6.3", + "gl-matrix": "^3.4.0" + } + }, + "node_modules/@math.gl/types": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-3.6.3.tgz", + "integrity": "sha512-3uWLVXHY3jQxsXCr/UCNPSc2BG0hNUljhmOBt9l+lNFDp7zHgm0cK2Tw4kj2XfkJy4TgwZTBGwRDQgWEbLbdTA==", + "license": "MIT" + }, + "node_modules/@probe.gl/env": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-3.6.0.tgz", + "integrity": "sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0" + } + }, + "node_modules/@probe.gl/log": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-3.6.0.tgz", + "integrity": "sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0", + "@probe.gl/env": "3.6.0" + } + }, + "node_modules/@probe.gl/stats": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.6.0.tgz", + "integrity": "sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.0.0" + } + }, "node_modules/@rollup/plugin-commonjs": { "version": "28.0.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.3.tgz", @@ -189,6 +336,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.15.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", @@ -206,6 +359,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@webgpu/types": { + "version": "0.1.60", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.60.tgz", + "integrity": "sha512-8B/tdfRFKdrnejqmvq95ogp8tf52oZ51p3f4QD5m5Paey/qlX4Rhhy5Y8tgFMi7Ms70HzcMMw3EQjH/jdhTwlA==", + "license": "BSD-3-Clause" + }, "node_modules/acorn": { "version": "8.14.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", @@ -219,6 +378,15 @@ "node": ">=0.4.0" } }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -250,6 +418,12 @@ "node": ">=0.10.0" } }, + "node_modules/draco3d": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.5.tgz", + "integrity": "sha512-JVuNV0EJzD3LBYhGyIXJLeBID/EVtmFO1ZNhAYflTgiMiAJlbhXQmRRda/azjc8MRVMHh0gqGhiqHUo5dIXM8Q==", + "license": "Apache-2.0" + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -344,6 +518,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", + "license": "MIT" + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -374,6 +554,18 @@ "node": ">= 0.4" } }, + "node_modules/image-size": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz", + "integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==", + "license": "MIT", + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", @@ -442,6 +634,12 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/ktx-parse": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-0.0.4.tgz", + "integrity": "sha512-LY3nrmfXl+wZZdPxgJ3ZmLvG+wkOZZP3/dr4RbQj1Pk3Qwz44esOOSFFVQJcNWpXAtiNIC66WgXufX/SYgYz6A==", + "license": "MIT" + }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -769,6 +967,12 @@ "source-map": "^0.6.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -795,6 +999,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/taichi.js": { + "version": "0.0.36", + "resolved": "https://registry.npmjs.org/taichi.js/-/taichi.js-0.0.36.tgz", + "integrity": "sha512-JPVI5SSXEOHSAw2YXcL2Y4jKdvBaOyzolCyB5iN/Mhj+vM8hDvi5xzR5YFogZQyuETb53v7/RErvI9BHiyUHRQ==", + "dependencies": { + "@loaders.gl/core": "^3.1.8", + "@loaders.gl/gltf": "^3.1.8", + "@webgpu/types": "^0.1.20", + "gl-matrix": "^3.4.3", + "tslib": "^2.4.0" + } + }, "node_modules/terser": { "version": "5.39.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", @@ -814,11 +1030,23 @@ "node": ">=10" } }, + "node_modules/texture-compressor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/texture-compressor/-/texture-compressor-1.0.2.tgz", + "integrity": "sha512-dStVgoaQ11mA5htJ+RzZ51ZxIZqNOgWKAIvtjLrW1AliQQLCmrDqNzQZ8Jh91YealQ95DXt4MEduLzJmbs6lig==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.10", + "image-size": "^0.7.4" + }, + "bin": { + "texture-compressor": "bin/texture-compressor.js" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, "license": "0BSD" }, "node_modules/typescript": { diff --git a/src/methods/jacobiSolverScript.js b/src/methods/jacobiSolverScript.js index 1e85de5..c0459b9 100644 --- a/src/methods/jacobiSolverScript.js +++ b/src/methods/jacobiSolverScript.js @@ -10,60 +10,125 @@ /** * Function to solve a system of linear equations using the Jacobi iterative method - * @param {array} jacobianMatrix - The coefficient matrix (must be square) - * @param {array} residualVector - The right-hand side vector - * @param {array} initialGuess - Initial guess for solution vector - * @param {object} [options] - Options for the solver - * @param {number} [options.maxIterations=1000] - Maximum number of iterations - * @param {number} [options.tolerance=1e-6] - Convergence tolerance + * This version uses Taichi.js to accelerate the core computation + * @param {array} A - The coefficient matrix (must be square) + * @param {array} b - The right-hand side vector + * @param {array} x0 - Initial guess for solution vector + * @param {number} [maxIterations=100] - Maximum number of iterations + * @param {number} [tolerance=1e-7] - Convergence tolerance * @returns {object} An object containing: * - solutionVector: The solution vector * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ -export function jacobiSolver(jacobianMatrix, residualVector, initialGuess, options = {}) { - const { maxIterations = 1000, tolerance = 1e-6 } = options; - const n = jacobianMatrix.length; // Size of the square matrix - let x = [...initialGuess]; // Current solution (starts with initial guess) - let xNew = new Array(n); // Next iteration's solution - - for (let iteration = 0; iteration < maxIterations; iteration++) { - // Perform one iteration - for (let i = 0; i < n; i++) { - let sum = 0; - // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠ i - for (let j = 0; j < n; j++) { - if (j !== i) { - sum += jacobianMatrix[i][j] * x[j]; +export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { + // Initialize Taichi for each call to ensure clean state + const taichi = await import('taichi.js'); + await taichi.init(); + + const n = A.length; + + // Choose appropriate float type based on precision parameter + const FloatArray = useFloat64 ? Float64Array : Float32Array; + + // Declare fields outside try block so they can be referenced in finally + let fieldA, fieldB, fieldCurrent, fieldNext, fieldMaxDiff; + + try { + // Create fields with appropriate precision + fieldA = taichi.field(FloatArray, [n, n]); + fieldB = taichi.field(FloatArray, [n]); + fieldCurrent = taichi.field(FloatArray, [n]); + fieldNext = taichi.field(FloatArray, [n]); + fieldMaxDiff = taichi.field(FloatArray, [1]); + + // Set initial values + fieldA.set(A.flat()); + fieldB.set(b); + fieldCurrent.set(x0); + + // Create kernels inline (no caching to prevent memory issues) + const updateKernel = taichi.kernel(function(A, b, current, next, n) { + for (let i = 0; i < n; i++) { + let sum = 0; + for (let j = 0; j < n; j++) { + if (j !== i) { + sum += A[i][j] * current[j]; + } } + next[i] = (b[i] - sum) / A[i][i]; + } + }); + + const diffKernel = taichi.kernel(function(current, next, maxDiff, n) { + maxDiff[0] = 0; + for (let i = 0; i < n; i++) { + const diff = Math.abs(next[i] - current[i]); + if (diff > maxDiff[0]) { + maxDiff[0] = diff; + } + } + }); + + const copyKernel = taichi.kernel(function(src, dst, n) { + for (let i = 0; i < n; i++) { + dst[i] = src[i]; + } + }); + + // Store solution here so we can return it after cleanup + let solution; + let iterationsCompleted; + let hasConverged = false; + + // Main iteration loop + for (let iteration = 0; iteration < maxIterations; iteration++) { + // Compute next iteration values + updateKernel(fieldA, fieldB, fieldCurrent, fieldNext, n); + + // Compute max difference directly in Taichi + diffKernel(fieldCurrent, fieldNext, fieldMaxDiff, n); + const maxDiff = fieldMaxDiff.get()[0]; + + // Copy next values to current using Taichi + copyKernel(fieldNext, fieldCurrent, n); + + // Check for convergence + if (maxDiff < tolerance) { + solution = Array.from(fieldCurrent.get()); + iterationsCompleted = iteration + 1; + hasConverged = true; + break; + } + + // If we're approaching maximum iterations, get the current solution + if (iteration === maxIterations - 1) { + solution = Array.from(fieldCurrent.get()); + iterationsCompleted = maxIterations; } - // Update xNew[i] using the Jacobi formula - xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i]; - } - - // Check convergence - let maxDiff = 0; - for (let i = 0; i < n; i++) { - maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i])); } - - // Update x for next iteration - x = [...xNew]; - - // Successfully converged if maxDiff is less than tolerance - if (maxDiff < tolerance) { - return { - solutionVector: x, - iterations: iteration + 1, - converged: true, - }; + + return { + solution: solution, + iterations: iterationsCompleted, + converged: hasConverged, + }; + } catch (error) { + console.error("Error in Jacobi method:", error); + throw error; + } finally { + // Aggressive cleanup - destroy all fields and reset Taichi completely + try { + if (fieldA) fieldA.destroy(); + if (fieldB) fieldB.destroy(); + if (fieldCurrent) fieldCurrent.destroy(); + if (fieldNext) fieldNext.destroy(); + if (fieldMaxDiff) fieldMaxDiff.destroy(); + + // Reset Taichi completely + taichi.reset(); + } catch (cleanupError) { + console.error("Error during cleanup:", cleanupError); } } - - // maxIterations were reached without convergence - return { - solutionVector: x, - iterations: maxIterations, - converged: false, - }; -} +} \ No newline at end of file From bd50688f5aaa64101dc8449ecb6a1551f950091a Mon Sep 17 00:00:00 2001 From: sridhar <2019309038@student.annauniv.edu> Date: Tue, 21 Oct 2025 09:57:11 +0000 Subject: [PATCH 06/12] Add WebGPU compute and Jacobi workers with comprehensive testing suite - Implemented WebGPUComputeWorker for various linear algebra operations including vector addition, matrix-vector multiplication, dot product, normalization, and more. - Created WebGPUJacobiWorker for solving linear systems using the Jacobi method. - Developed a test HTML page to validate the functionality of the compute engine with multiple test cases for each operation. - Included error handling and success messages for better user feedback during tests. - Ensured compatibility with Comlink for worker communication. --- .../HeatConduction2DFinCG.html | 96 + package-lock.json | 3690 +++++++++++++++-- package.json | 3 +- src/FEAScript.js | 48 + src/methods/jacobiSolverScript.js | 118 +- src/utilities/webgpuComputeEngine.js | 836 ++++ src/vendor/taichi.esm.js | 16 + src/visualization/plotSolutionScript.js | 3 + src/workers/webgpuComputeWorker.js | 188 + src/workers/webgpuJacobiWorker.js | 109 + testWebGPU.html | 651 +++ 11 files changed, 5375 insertions(+), 383 deletions(-) create mode 100644 examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html create mode 100644 src/utilities/webgpuComputeEngine.js create mode 100644 src/vendor/taichi.esm.js create mode 100644 src/workers/webgpuComputeWorker.js create mode 100644 src/workers/webgpuJacobiWorker.js create mode 100644 testWebGPU.html diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html new file mode 100644 index 0000000..cde12b3 --- /dev/null +++ b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html @@ -0,0 +1,96 @@ + + + + + + Heat Conduction 2D Fin - CG Solver + + + + + +

Heat Conduction in 2D Fin - Conjugate Gradient Solver

+
+
+ + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index db3e1dc..b94871a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,24 @@ { "name": "feascript", - "version": "1.0.0", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "feascript", - "version": "1.0.0", - "license": "AGPLv3", - "dependencies": { - "taichi.js": "^0.0.36" - }, + "version": "0.1.3", + "license": "MIT", "devDependencies": { "@rollup/plugin-commonjs": "^28.0.3", "@rollup/plugin-node-resolve": "^16.0.1", + "mathjs": "^11.12.0", "rollup": "^2.79.2", "rollup-plugin-terser": "^7.0.2", - "rollup-plugin-typescript2": "^0.36.0", - "rollup-plugin-wasm": "^3.0.0", - "typescript": "^5.8.3" + "taichi.js": "^0.0.36" + }, + "peerDependencies": { + "mathjs": "^11.12.0", + "plotly.js": "^2.35.3" } }, "node_modules/@babel/code-frame": { @@ -50,16 +50,28 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", + "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, + "node_modules/@choojs/findup": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@choojs/findup/-/findup-0.2.1.tgz", + "integrity": "sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==", + "peer": true, + "dependencies": { + "commander": "^2.15.1" + }, + "bin": { + "findup": "bin/findup.js" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", @@ -74,7 +86,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -84,7 +95,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -94,7 +104,6 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -105,14 +114,12 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -123,6 +130,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-3.4.15.tgz", "integrity": "sha512-rPOOTuusWlRRNMWg7hymZBoFmPCXWThsA5ZYRfqqXnsgVeQIi8hzcAhJ7zDUIFAd/OSR8ravtqb0SH+3k6MOFQ==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1", @@ -135,6 +143,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/draco/-/draco-3.4.15.tgz", "integrity": "sha512-SStmyP0ZnS4JbWZb2NhrfiHW65uy3pVTTzQDTgXfkR5cD9oDAEu4nCaHbQ8x38/m39FHliCPgS9b1xWvLKQo8w==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1", @@ -148,6 +157,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/gltf/-/gltf-3.4.15.tgz", "integrity": "sha512-Y6kMNPLiHQPr6aWQw/4BMTxgPHWx3fcib4LPpZCbhyfM8PRn6pOqATVngUXdoOf5XY0QtdKVld6N1kxlr4pJtw==", + "dev": true, "license": "MIT", "dependencies": { "@loaders.gl/draco": "3.4.15", @@ -161,6 +171,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-3.4.15.tgz", "integrity": "sha512-QpjYhEetHabY/z9mWZYJXZZp4XJAxa38f9Ii/DjPlnJErepzY5GLBUTDHMu4oZ6n99gGImtuGFicDnFV6mb60g==", + "dev": true, "license": "MIT", "dependencies": { "@loaders.gl/loader-utils": "3.4.15" @@ -170,6 +181,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-3.4.15.tgz", "integrity": "sha512-uUx6tCaky6QgCRkqCNuuXiUfpTzKV+ZlJOf6C9bKp62lpvFOv9AwqoXmL23j8nfsENdlzsX3vPhc3en6QQyksA==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1", @@ -181,6 +193,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-3.4.15.tgz", "integrity": "sha512-8oRtstz0IsqES7eZd2jQbmCnmExCMtL8T6jWd1+BfmnuyZnQ0B6TNccy++NHtffHdYuzEoQgSELwcdmhSApYew==", + "dev": true, "license": "MIT", "dependencies": { "@types/geojson": "^7946.0.7" @@ -190,6 +203,7 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/textures/-/textures-3.4.15.tgz", "integrity": "sha512-QHnmxBYtLvTdG1uMz2KWcxVY8KPb1+XyPJUoZV9GMcQkulz+CwFB8BaX8nROfMDz9KKYoPfksCzjig0LZ0WBJQ==", + "dev": true, "license": "MIT", "dependencies": { "@loaders.gl/images": "3.4.15", @@ -204,15 +218,122 @@ "version": "3.4.15", "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-3.4.15.tgz", "integrity": "sha512-zUUepOYRYmcYIcr/c4Mchox9h5fBFNkD81rsGnLlZyq19QvyHzN+93SVxrLc078gw93t2RKrVcOOZY13zT3t1w==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1" } }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "peer": true, + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/geojson-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz", + "integrity": "sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw==", + "peer": true + }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", + "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@mapbox/mapbox-gl-supported": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.5.0.tgz", + "integrity": "sha512-/PT1P6DNf7vjEEiPkVIRJkvibbqWtqnyGaBz3nfRdcxclNSnSdaLU5tfAgcD7I8Yt5i+L19s406YLl1koLnLbg==", + "peer": true, + "peerDependencies": { + "mapbox-gl": ">=0.32.1 <2.0.0" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==", + "peer": true + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-1.2.5.tgz", + "integrity": "sha512-cD8A/zJlm6fdJOk6DqPUV8mcpyJkRz2x2R+/fYcWDYG3oWbG7/L7Yl/WqQ1VZCjnL9OTIMAn6c+BC5Eru4sQEw==", + "peer": true + }, + "node_modules/@mapbox/unitbezier": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.0.tgz", + "integrity": "sha512-HPnRdYO0WjFjRTSwO3frz1wKaU649OBFPX3Zo/2WZvuRi6zMiRGui8SnPQiQABgqCf8YikDe5t3HViTVw1WUzA==", + "peer": true + }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", + "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", + "peer": true, + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^4.0.0", + "minimist": "^1.2.8", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "tinyqueue": "^3.0.0" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "peer": true + }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "peer": true + }, "node_modules/@math.gl/core": { "version": "3.6.3", "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-3.6.3.tgz", "integrity": "sha512-jBABmDkj5uuuE0dTDmwwss7Cup5ZwQ6Qb7h1pgvtkEutTrhkcv8SuItQNXmF45494yIHeoGue08NlyeY6wxq2A==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.0", @@ -224,12 +345,94 @@ "version": "3.6.3", "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-3.6.3.tgz", "integrity": "sha512-3uWLVXHY3jQxsXCr/UCNPSc2BG0hNUljhmOBt9l+lNFDp7zHgm0cK2Tw4kj2XfkJy4TgwZTBGwRDQgWEbLbdTA==", + "dev": true, "license": "MIT" }, + "node_modules/@plotly/d3": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@plotly/d3/-/d3-3.8.2.tgz", + "integrity": "sha512-wvsNmh1GYjyJfyEBPKJLTMzgf2c2bEbSIL50lmqVUi+o1NHaLPi1Lb4v7VxXXJn043BhNyrxUrWI85Q+zmjOVA==", + "peer": true + }, + "node_modules/@plotly/d3-sankey": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey/-/d3-sankey-0.7.2.tgz", + "integrity": "sha512-2jdVos1N3mMp3QW0k2q1ph7Gd6j5PY1YihBrwpkFnKqO+cqtZq3AdEYUeSGXMeLsBDQYiqTVcihYfk8vr5tqhw==", + "peer": true, + "dependencies": { + "d3-array": "1", + "d3-collection": "1", + "d3-shape": "^1.2.0" + } + }, + "node_modules/@plotly/d3-sankey-circular": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@plotly/d3-sankey-circular/-/d3-sankey-circular-0.33.1.tgz", + "integrity": "sha512-FgBV1HEvCr3DV7RHhDsPXyryknucxtfnLwPtCKKxdolKyTFYoLX/ibEfX39iFYIL7DYbVeRtP43dbFcrHNE+KQ==", + "peer": true, + "dependencies": { + "d3-array": "^1.2.1", + "d3-collection": "^1.0.4", + "d3-shape": "^1.2.0", + "elementary-circuits-directed-graph": "^1.0.4" + } + }, + "node_modules/@plotly/mapbox-gl": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/@plotly/mapbox-gl/-/mapbox-gl-1.13.4.tgz", + "integrity": "sha512-sR3/Pe5LqT/fhYgp4rT4aSFf1rTsxMbGiH6Hojc7PH36ny5Bn17iVFUjpzycafETURuFbLZUfjODO8LvSI+5zQ==", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/@plotly/point-cluster": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@plotly/point-cluster/-/point-cluster-3.1.9.tgz", + "integrity": "sha512-MwaI6g9scKf68Orpr1pHZ597pYx9uP8UEFXLPbsCmuw3a84obwz6pnMXGc90VhgDNeNiLEdlmuK7CPo+5PIxXw==", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "binary-search-bounds": "^2.0.4", + "clamp": "^1.0.1", + "defined": "^1.0.0", + "dtype": "^2.0.0", + "flatten-vertex-data": "^1.0.2", + "is-obj": "^1.0.1", + "math-log2": "^1.0.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0" + } + }, "node_modules/@probe.gl/env": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-3.6.0.tgz", "integrity": "sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0" @@ -239,6 +442,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-3.6.0.tgz", "integrity": "sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0", @@ -249,6 +453,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.6.0.tgz", "integrity": "sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==", + "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.0.0" @@ -329,12 +534,101 @@ } } }, + "node_modules/@turf/area": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@turf/area/-/area-7.2.0.tgz", + "integrity": "sha512-zuTTdQ4eoTI9nSSjerIy4QwgvxqwJVciQJ8tOPuMHbXJ9N/dNjI7bU8tasjhxas/Cx3NE9NxVHtNpYHL0FSzoA==", + "peer": true, + "dependencies": { + "@turf/helpers": "^7.2.0", + "@turf/meta": "^7.2.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/bbox": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-7.2.0.tgz", + "integrity": "sha512-wzHEjCXlYZiDludDbXkpBSmv8Zu6tPGLmJ1sXQ6qDwpLE1Ew3mcWqt8AaxfTP5QwDNQa3sf2vvgTEzNbPQkCiA==", + "peer": true, + "dependencies": { + "@turf/helpers": "^7.2.0", + "@turf/meta": "^7.2.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/centroid": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-7.2.0.tgz", + "integrity": "sha512-yJqDSw25T7P48au5KjvYqbDVZ7qVnipziVfZ9aSo7P2/jTE7d4BP21w0/XLi3T/9bry/t9PR1GDDDQljN4KfDw==", + "peer": true, + "dependencies": { + "@turf/helpers": "^7.2.0", + "@turf/meta": "^7.2.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/helpers": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.2.0.tgz", + "integrity": "sha512-cXo7bKNZoa7aC7ydLmUR02oB3IgDe7MxiPuRz3cCtYQHn+BJ6h1tihmamYDWWUlPHgSNF0i3ATc4WmDECZafKw==", + "peer": true, + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.8.1" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/meta": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.2.0.tgz", + "integrity": "sha512-igzTdHsQc8TV1RhPuOLVo74Px/hyPrVgVOTgjWQZzt3J9BVseCdpfY/0cJBdlSRI4S/yTmmHl7gAqjhpYH5Yaw==", + "peer": true, + "dependencies": { + "@turf/helpers": "^7.2.0", + "@types/geojson": "^7946.0.10" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", - "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", - "dev": true, - "license": "MIT" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==" }, "node_modules/@types/geojson": { "version": "7946.0.16", @@ -342,16 +636,53 @@ "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", "license": "MIT" }, + "node_modules/@types/geojson-vt": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@types/geojson-vt/-/geojson-vt-3.2.5.tgz", + "integrity": "sha512-qDO7wqtprzlpe8FfQ//ClPV9xiuoh2nkIgiouIptON9w5jvD/fA4szvP9GBlDVdJ5dldAl0kX/sy3URbWwLx0g==", + "peer": true, + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "peer": true + }, + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==", + "peer": true + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "peer": true, + "dependencies": { + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" + } + }, "node_modules/@types/node": { "version": "22.15.21", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.21.tgz", "integrity": "sha512-EV/37Td6c+MgKAbkcLG6vqZ2zEYHD7bvSrzqqs2RIhbA6w3x+Dqz8MZM3sP6kGTeLrdoOgKZe+Xja7tUB2DNkQ==", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, + "node_modules/@types/pbf": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==", + "peer": true + }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", @@ -359,18 +690,190 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/supercluster": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "peer": true, + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "peer": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "peer": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "peer": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "peer": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "peer": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "peer": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, "node_modules/@webgpu/types": { "version": "0.1.60", "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.60.tgz", "integrity": "sha512-8B/tdfRFKdrnejqmvq95ogp8tf52oZ51p3f4QD5m5Paey/qlX4Rhhy5Y8tgFMi7Ms70HzcMMw3EQjH/jdhTwlA==", + "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "peer": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "peer": true + }, + "node_modules/abs-svg-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz", + "integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA==", + "peer": true + }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", - "dev": true, - "license": "MIT", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "bin": { "acorn": "bin/acorn" }, @@ -378,119 +881,1093 @@ "node": ">=0.4.0" } }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, - "license": "MIT" - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", + "node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" + }, + "peerDependencies": { + "acorn": "^8.14.0" } }, - "node_modules/draco3d": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.5.tgz", - "integrity": "sha512-JVuNV0EJzD3LBYhGyIXJLeBID/EVtmFO1ZNhAYflTgiMiAJlbhXQmRRda/azjc8MRVMHh0gqGhiqHUo5dIXM8Q==", - "license": "Apache-2.0" - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } }, - "node_modules/fdir": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", - "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", - "dev": true, - "license": "MIT", + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "peer": true, + "dependencies": { + "ajv": "^8.0.0" + }, "peerDependencies": { - "picomatch": "^3 || ^4" + "ajv": "^8.0.0" }, "peerDependenciesMeta": { - "picomatch": { + "ajv": { "optional": true } } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "license": "MIT", + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "peer": true, "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "fast-deep-equal": "^3.1.3" }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "peerDependencies": { + "ajv": "^8.8.2" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/almost-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/almost-equal/-/almost-equal-1.1.0.tgz", + "integrity": "sha512-0V/PkoculFl5+0Lp47JoxUcO0xSxhIBvm+BxHdD/OgXNmdRpRHCFnKVuUoWyS9EzQP+otSGv0m9Lb4yVkQBn2A==", + "peer": true + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-bounds": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-bounds/-/array-bounds-1.0.1.tgz", + "integrity": "sha512-8wdW3ZGk6UjMPJx/glyEt0sLzzwAE1bhToPsO1W2pbpR2gULyxe3BjSiuJFheP50T/GgODVPz2fuMUmIywt8cQ==", + "peer": true + }, + "node_modules/array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-normalize": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array-normalize/-/array-normalize-1.1.4.tgz", + "integrity": "sha512-fCp0wKFLjvSPmCn4F5Tiw4M3lpMZoHlCjfcs7nNzuj3vqQQ1/a8cgB9DXcpDSn18c+coLnaW7rqfcYCvKbyJXg==", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.0" + } + }, + "node_modules/array-range": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-range/-/array-range-1.0.1.tgz", + "integrity": "sha512-shdaI1zT3CVNL2hnx9c0JMc0ZogGaxDs5e85akgHWKYa0yVbIyp06Ind3dVkTj/uuFrzaHBOyqFzo+VV6aXgtA==", + "peer": true + }, + "node_modules/array-rearrange": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/array-rearrange/-/array-rearrange-2.2.2.tgz", + "integrity": "sha512-UfobP5N12Qm4Qu4fwLDIi2v6+wZsSf6snYSxAMeKhrh37YGnNWZPRmVEKc/2wfms53TLQnzfpG8wCx2Y/6NG1w==", + "peer": true + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "peer": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.18", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.18.tgz", + "integrity": "sha512-UYmTpOBwgPScZpS4A+YbapwWuBwasxvO/2IOHArSsAhL/+ZdmATBXTex3t+l2hXwLVYK382ibr/nKoY9GKe86w==", + "peer": true, + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/binary-search-bounds": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/binary-search-bounds/-/binary-search-bounds-2.0.5.tgz", + "integrity": "sha512-H0ea4Fd3lS1+sTEB2TgcLoK21lLhwEJzlQv3IN47pJS976Gx4zoWe0ak3q+uYh60ppQxg9F16Ri4tS1sfD4+jA==", + "peer": true + }, + "node_modules/bit-twiddle": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", + "integrity": "sha512-B9UhK0DKFZhoTFcfvAzhqsjStvGJp9vYWf3+6SNTtdSQnvIgfkHbgHrg/e4+TH71N2GDu8tpmCVoyfrL1d7ntA==", + "peer": true + }, + "node_modules/bitmap-sdf": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", + "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", + "peer": true + }, + "node_modules/bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "peer": true, + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/browserslist": { + "version": "4.26.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.3.tgz", + "integrity": "sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.8.9", + "caniuse-lite": "^1.0.30001746", + "electron-to-chromium": "^1.5.227", + "node-releases": "^2.0.21", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001751", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz", + "integrity": "sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true + }, + "node_modules/canvas-fit": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/canvas-fit/-/canvas-fit-1.5.0.tgz", + "integrity": "sha512-onIcjRpz69/Hx5bB5HGbYKUF2uC6QT6Gp+pfpGm3A7mPfcluSLV5v4Zu+oflDUwLdUw0rLIBhUbi0v8hM4FJQQ==", + "peer": true, + "dependencies": { + "element-size": "^1.1.1" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "peer": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clamp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", + "integrity": "sha512-kgMuFyE78OC6Dyu3Dy7vcx4uy97EIbVxJB/B0eJ3bUNAkwdNcxYzgKltnyADiYwsR7SEqkkUPsEUT//OVS6XMA==", + "peer": true + }, + "node_modules/color-alpha": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/color-alpha/-/color-alpha-1.0.4.tgz", + "integrity": "sha512-lr8/t5NPozTSqli+duAN+x+no/2WaKTeWvxhHGN+aXT6AJ8vPlzLa7UriyjWak0pSC2jHol9JgjBYnnHsGha9A==", + "peer": true, + "dependencies": { + "color-parse": "^1.3.8" + } + }, + "node_modules/color-alpha/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-id": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/color-id/-/color-id-1.1.0.tgz", + "integrity": "sha512-2iRtAn6dC/6/G7bBIo0uupVrIne1NsQJvJxZOBCzQOfk7jRq97feaDZ3RdzuHakRXXnHGNwglto3pqtRx1sX0g==", + "peer": true, + "dependencies": { + "clamp": "^1.0.1" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "peer": true + }, + "node_modules/color-normalize": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/color-normalize/-/color-normalize-1.5.0.tgz", + "integrity": "sha512-rUT/HDXMr6RFffrR53oX3HGWkDOP9goSAQGBkUaAYKjOE2JxozccdGyufageWDlInRAjm/jYPrf/Y38oa+7obw==", + "peer": true, + "dependencies": { + "clamp": "^1.0.1", + "color-rgba": "^2.1.1", + "dtype": "^2.0.0" + } + }, + "node_modules/color-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.0.tgz", + "integrity": "sha512-g2Z+QnWsdHLppAbrpcFWo629kLOnOPtpxYV69GCqm92gqSgyXbzlfyN3MXs0412fPBkFmiuS+rXposgBgBa6Kg==", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-rgba": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-2.1.1.tgz", + "integrity": "sha512-VaX97wsqrMwLSOR6H7rU1Doa2zyVdmShabKrPEIFywLlHoibgD3QW9Dw6fSqM4+H/LfjprDNAUUW31qEQcGzNw==", + "peer": true, + "dependencies": { + "clamp": "^1.0.1", + "color-parse": "^1.3.8", + "color-space": "^1.14.6" + } + }, + "node_modules/color-rgba/node_modules/color-parse": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/color-parse/-/color-parse-1.4.3.tgz", + "integrity": "sha512-BADfVl/FHkQkyo8sRBwMYBqemqsgnu7JZAwUgvBvuwwuNUZAhSvLTbsEErS5bQXzOjDR0dWzJ4vXN2Q+QoPx0A==", + "peer": true, + "dependencies": { + "color-name": "^1.0.0" + } + }, + "node_modules/color-space": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/color-space/-/color-space-1.16.0.tgz", + "integrity": "sha512-A6WMiFzunQ8KEPFmj02OnnoUnqhmSaHaZ/0LVFcPTdlvm8+3aMJ5x1HRHy3bDHPkovkf4sS0f4wsVvwk71fKkg==", + "peer": true, + "dependencies": { + "hsluv": "^0.0.3", + "mumath": "^3.3.4" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/complex.js": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.2.tgz", + "integrity": "sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "peer": true + }, + "node_modules/country-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/country-regex/-/country-regex-1.1.0.tgz", + "integrity": "sha512-iSPlClZP8vX7MC3/u6s3lrDuoQyhQukh5LyABJ3hvfzbQ3Yyayd4fp04zjLnfi267B/B2FkumcWWgrbban7sSA==", + "peer": true + }, + "node_modules/css-font": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-font/-/css-font-1.2.0.tgz", + "integrity": "sha512-V4U4Wps4dPDACJ4WpgofJ2RT5Yqwe1lEH6wlOOaIxMi0gTjdIijsc5FmxQlZ7ZZyKQkkutqqvULOp07l9c7ssA==", + "peer": true, + "dependencies": { + "css-font-size-keywords": "^1.0.0", + "css-font-stretch-keywords": "^1.0.1", + "css-font-style-keywords": "^1.0.1", + "css-font-weight-keywords": "^1.0.0", + "css-global-keywords": "^1.0.1", + "css-system-font-keywords": "^1.0.0", + "pick-by-alias": "^1.2.0", + "string-split-by": "^1.0.0", + "unquote": "^1.1.0" + } + }, + "node_modules/css-font-size-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-size-keywords/-/css-font-size-keywords-1.0.0.tgz", + "integrity": "sha512-Q+svMDbMlelgCfH/RVDKtTDaf5021O486ZThQPIpahnIjUkMUslC+WuOQSWTgGSrNCH08Y7tYNEmmy0hkfMI8Q==", + "peer": true + }, + "node_modules/css-font-stretch-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-stretch-keywords/-/css-font-stretch-keywords-1.0.1.tgz", + "integrity": "sha512-KmugPO2BNqoyp9zmBIUGwt58UQSfyk1X5DbOlkb2pckDXFSAfjsD5wenb88fNrD6fvS+vu90a/tsPpb9vb0SLg==", + "peer": true + }, + "node_modules/css-font-style-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-font-style-keywords/-/css-font-style-keywords-1.0.1.tgz", + "integrity": "sha512-0Fn0aTpcDktnR1RzaBYorIxQily85M2KXRpzmxQPgh8pxUN9Fcn00I8u9I3grNr1QXVgCl9T5Imx0ZwKU973Vg==", + "peer": true + }, + "node_modules/css-font-weight-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-font-weight-keywords/-/css-font-weight-keywords-1.0.0.tgz", + "integrity": "sha512-5So8/NH+oDD+EzsnF4iaG4ZFHQ3vaViePkL1ZbZ5iC/KrsCY+WHq/lvOgrtmuOQ9pBBZ1ADGpaf+A4lj1Z9eYA==", + "peer": true + }, + "node_modules/css-global-keywords": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/css-global-keywords/-/css-global-keywords-1.0.1.tgz", + "integrity": "sha512-X1xgQhkZ9n94WDwntqst5D/FKkmiU0GlJSFZSV3kLvyJ1WC5VeyoXDOuleUD+SIuH9C7W05is++0Woh0CGfKjQ==", + "peer": true + }, + "node_modules/css-loader": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", + "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", + "peer": true, + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/css-system-font-keywords": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-system-font-keywords/-/css-system-font-keywords-1.0.0.tgz", + "integrity": "sha512-1umTtVd/fXS25ftfjB71eASCrYhilmEsvDEI6wG/QplnmlfmVM5HkZ/ZX46DT5K3eblFPgLUHt5BRCb0YXkSFA==", + "peer": true + }, + "node_modules/csscolorparser": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/csscolorparser/-/csscolorparser-1.0.3.tgz", + "integrity": "sha512-umPSgYwZkdFoUrH5hIq5kf0wPSXiro51nPw0j2K/c83KflkPSTBGMz6NJvMB+07VlL0y7VPo6QJcDjcgKTTm3w==", + "peer": true + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "peer": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/d": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz", + "integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==", + "peer": true, + "dependencies": { + "es5-ext": "^0.10.64", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/d3-array": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", + "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==", + "peer": true + }, + "node_modules/d3-collection": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-collection/-/d3-collection-1.0.7.tgz", + "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==", + "peer": true + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==", + "peer": true + }, + "node_modules/d3-force": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", + "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", + "peer": true, + "dependencies": { + "d3-collection": "1", + "d3-dispatch": "1", + "d3-quadtree": "1", + "d3-timer": "1" + } + }, + "node_modules/d3-format": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", + "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==", + "peer": true + }, + "node_modules/d3-geo": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", + "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", + "peer": true, + "dependencies": { + "d3-array": "1" + } + }, + "node_modules/d3-geo-projection": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.9.0.tgz", + "integrity": "sha512-ZULvK/zBn87of5rWAfFMc9mJOipeSo57O+BBitsKIXmU4rTVAnX1kSsJkE0R+TxY8pGNoM1nbyRRE7GYHhdOEQ==", + "peer": true, + "dependencies": { + "commander": "2", + "d3-array": "1", + "d3-geo": "^1.12.0", + "resolve": "^1.1.10" + }, + "bin": { + "geo2svg": "bin/geo2svg", + "geograticule": "bin/geograticule", + "geoproject": "bin/geoproject", + "geoquantize": "bin/geoquantize", + "geostitch": "bin/geostitch" + } + }, + "node_modules/d3-hierarchy": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", + "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==", + "peer": true + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "peer": true, + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "peer": true + }, + "node_modules/d3-quadtree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", + "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==", + "peer": true + }, + "node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "peer": true, + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-time": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", + "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==", + "peer": true + }, + "node_modules/d3-time-format": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", + "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", + "peer": true, + "dependencies": { + "d3-time": "1" + } + }, + "node_modules/d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==", + "peer": true + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/detect-kerning": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-kerning/-/detect-kerning-2.1.2.tgz", + "integrity": "sha512-I3JIbrnKPAntNLl1I6TpSQQdQ4AutYzv/sKMFKbepawV/hlH0GmYKhUoOEMd4xqaUHT+Bm0f4127lh5qs1m1tw==", + "peer": true + }, + "node_modules/draco3d": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.5.tgz", + "integrity": "sha512-JVuNV0EJzD3LBYhGyIXJLeBID/EVtmFO1ZNhAYflTgiMiAJlbhXQmRRda/azjc8MRVMHh0gqGhiqHUo5dIXM8Q==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/draw-svg-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/draw-svg-path/-/draw-svg-path-1.0.0.tgz", + "integrity": "sha512-P8j3IHxcgRMcY6sDzr0QvJDLzBnJJqpTG33UZ2Pvp8rw0apCHhJCWqYprqrXjrgHnJ6tuhP1iTJSAodPDHxwkg==", + "peer": true, + "dependencies": { + "abs-svg-path": "~0.1.1", + "normalize-svg-path": "~0.1.0" + } + }, + "node_modules/dtype": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dtype/-/dtype-2.0.0.tgz", + "integrity": "sha512-s2YVcLKdFGS0hpFqJaTwscsyt0E8nNFdmo73Ocd81xNPj4URI4rj6D60A+vFMIw7BXWlb4yRkEwfBqcZzPGiZg==", + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/dup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dup/-/dup-1.0.0.tgz", + "integrity": "sha512-Bz5jxMMC0wgp23Zm15ip1x8IhYRqJvF3nFC0UInJUDkN1z4uNPk9jTnfCUJXbOGiQ1JbXLQsiV41Fb+HXcj5BA==", + "peer": true + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "peer": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==", + "peer": true + }, + "node_modules/electron-to-chromium": { + "version": "1.5.237", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.237.tgz", + "integrity": "sha512-icUt1NvfhGLar5lSWH3tHNzablaA5js3HVHacQimfP8ViEBOQv+L7DKEuHdbTZ0SKCO1ogTJTIL1Gwk9S6Qvcg==", + "peer": true + }, + "node_modules/element-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/element-size/-/element-size-1.1.1.tgz", + "integrity": "sha512-eaN+GMOq/Q+BIWy0ybsgpcYImjGIdNLyjLFJU4XsLHXYQao5jCNb36GyN6C2qwmDDYSfIBmKpPpr4VnBdLCsPQ==", + "peer": true + }, + "node_modules/elementary-circuits-directed-graph": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/elementary-circuits-directed-graph/-/elementary-circuits-directed-graph-1.3.1.tgz", + "integrity": "sha512-ZEiB5qkn2adYmpXGnJKkxT8uJHlW/mxmBpmeqawEHzPxh9HkLD4/1mFYX5l0On+f6rcPIt8/EWlRU2Vo3fX6dQ==", + "peer": true, + "dependencies": { + "strongly-connected-components": "^1.0.1" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "peer": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "peer": true + }, + "node_modules/es5-ext": { + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", + "hasInstallScript": true, + "peer": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz", + "integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==", + "peer": true, + "dependencies": { + "d": "^1.0.2", + "ext": "^1.7.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-latex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz", + "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==", + "dev": true + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "peer": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "peer": true, + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" } }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true, - "license": "MIT", + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "peer": true, + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "peer": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "peer": true, + "dependencies": { + "type": "^2.7.2" + } + }, + "node_modules/falafel": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.5.tgz", + "integrity": "sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==", + "peer": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "acorn": "^7.1.1", + "isarray": "^2.0.1" }, "engines": { - "node": ">=12" + "node": ">=0.4.0" + } + }, + "node_modules/falafel/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "peer": true + }, + "node_modules/fast-isnumeric": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-isnumeric/-/fast-isnumeric-1.1.4.tgz", + "integrity": "sha512-1mM8qOr2LYz8zGaUdmiqRDiuue00Dxjgcb1NQR7TnhLVh6sQyngP9xvLo7Sl7LZpP/sk5eb+bcyWXw530NTBZw==", + "peer": true, + "dependencies": { + "is-string-blank": "^1.0.1" + } + }, + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "peer": true + }, + "node_modules/fdir": { + "version": "6.4.4", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", + "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/flatten-vertex-data": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz", + "integrity": "sha512-BvCBFK2NZqerFTdMDgqfHBwxYWnxeCkwONsw6PvBMcUXqo8U/KDWwmXhqx1x2kLIg7DqIsJfOaJFOmlua3Lxuw==", + "peer": true, + "dependencies": { + "dtype": "^2.0.0" + } + }, + "node_modules/font-atlas": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/font-atlas/-/font-atlas-2.1.0.tgz", + "integrity": "sha512-kP3AmvX+HJpW4w3d+PiPR2X6E1yvsBXt2yhuCw+yReO9F1WYhvZwx3c95DGZGwg9xYzDGrgJYa885xmVA+28Cg==", + "peer": true, + "dependencies": { + "css-font": "^1.0.0" + } + }, + "node_modules/font-measure": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/font-measure/-/font-measure-1.2.2.tgz", + "integrity": "sha512-mRLEpdrWzKe9hbfaF3Qpr06TAjquuBVP5cHy4b3hyeNdjc9i0PO6HniGsX5vjL5OWv7+Bd++NiooNpT/s8BvIA==", + "peer": true, + "dependencies": { + "css-font": "^1.2.0" + } + }, + "node_modules/fraction.js": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.4.tgz", + "integrity": "sha512-pwiTgt0Q7t+GHZA4yaLjObx4vXmmdcS0iSJ19o8d/goUGgItX9UZWKWNnLHehxviD8wU2IWRsnR8cD5+yOJP2Q==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "peer": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, "node_modules/fsevents": { @@ -512,40 +1989,353 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/geojson-vt": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", + "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==", + "peer": true + }, + "node_modules/get-canvas-context": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-canvas-context/-/get-canvas-context-1.0.2.tgz", + "integrity": "sha512-LnpfLf/TNzr9zVOGiIY6aKCz8EKuXmlYNV7CM2pUjBa/B+c2I15tS7KLySep75+FuerJdmArvJLcsAXWEy2H0A==", + "peer": true + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gl-mat4": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gl-mat4/-/gl-mat4-1.2.0.tgz", + "integrity": "sha512-sT5C0pwB1/e9G9AvAoLsoaJtbMGjfd/jfxo8jMCKqYYEnjZuFvqV5rehqar0538EmssjdDeiEWnKyBSTw7quoA==", + "peer": true + }, "node_modules/gl-matrix": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==", "license": "MIT" }, + "node_modules/gl-text": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gl-text/-/gl-text-1.4.0.tgz", + "integrity": "sha512-o47+XBqLCj1efmuNyCHt7/UEJmB9l66ql7pnobD6p+sgmBUdzfMZXIF0zD2+KRfpd99DJN+QXdvTFAGCKCVSmQ==", + "peer": true, + "dependencies": { + "bit-twiddle": "^1.0.2", + "color-normalize": "^1.5.0", + "css-font": "^1.2.0", + "detect-kerning": "^2.1.2", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "font-atlas": "^2.1.0", + "font-measure": "^1.2.2", + "gl-util": "^3.1.2", + "is-plain-obj": "^1.1.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "parse-unit": "^1.0.1", + "pick-by-alias": "^1.2.0", + "regl": "^2.0.0", + "to-px": "^1.0.1", + "typedarray-pool": "^1.1.0" + } + }, + "node_modules/gl-util": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/gl-util/-/gl-util-3.1.3.tgz", + "integrity": "sha512-dvRTggw5MSkJnCbh74jZzSoTOGnVYK+Bt+Ckqm39CVcl6+zSsxqWk4lr5NKhkqXHL6qvZAU9h17ZF8mIskY9mA==", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1", + "is-firefox": "^1.0.3", + "is-plain-obj": "^1.1.0", + "number-is-integer": "^1.0.1", + "object-assign": "^4.1.0", + "pick-by-alias": "^1.2.0", + "weak-map": "^1.0.5" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "peer": true + }, + "node_modules/global-prefix": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-4.0.0.tgz", + "integrity": "sha512-w0Uf9Y9/nyHinEk5vMJKRie+wa4kR5hmDbEhGGds/kG1PwGLLHKRoNMeJOyCQjjBkANlnScqgzcFwGHgmgLkVA==", + "peer": true, + "dependencies": { + "ini": "^4.1.3", + "kind-of": "^6.0.3", + "which": "^4.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/glsl-inject-defines": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz", + "integrity": "sha512-W49jIhuDtF6w+7wCMcClk27a2hq8znvHtlGnrYkSWEr8tHe9eA2dcnohlcAmxLYBSpSSdzOkRdyPTrx9fw49+A==", + "peer": true, + "dependencies": { + "glsl-token-inject-block": "^1.0.0", + "glsl-token-string": "^1.0.1", + "glsl-tokenizer": "^2.0.2" + } + }, + "node_modules/glsl-resolve": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/glsl-resolve/-/glsl-resolve-0.0.1.tgz", + "integrity": "sha512-xxFNsfnhZTK9NBhzJjSBGX6IOqYpvBHxxmo+4vapiljyGNCY0Bekzn0firQkQrazK59c1hYxMDxYS8MDlhw4gA==", + "peer": true, + "dependencies": { + "resolve": "^0.6.1", + "xtend": "^2.1.2" + } + }, + "node_modules/glsl-resolve/node_modules/resolve": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz", + "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==", + "peer": true + }, + "node_modules/glsl-resolve/node_modules/xtend": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.2.0.tgz", + "integrity": "sha512-SLt5uylT+4aoXxXuwtQp5ZnMMzhDb1Xkg4pEqc00WUJCQifPfV9Ub1VrNhp9kXkrjZD2I2Hl8WnjP37jzZLPZw==", + "peer": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/glsl-token-assignments": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz", + "integrity": "sha512-OwXrxixCyHzzA0U2g4btSNAyB2Dx8XrztY5aVUCjRSh4/D0WoJn8Qdps7Xub3sz6zE73W3szLrmWtQ7QMpeHEQ==", + "peer": true + }, + "node_modules/glsl-token-defines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz", + "integrity": "sha512-Vb5QMVeLjmOwvvOJuPNg3vnRlffscq2/qvIuTpMzuO/7s5kT+63iL6Dfo2FYLWbzuiycWpbC0/KV0biqFwHxaQ==", + "peer": true, + "dependencies": { + "glsl-tokenizer": "^2.0.0" + } + }, + "node_modules/glsl-token-depth": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz", + "integrity": "sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==", + "peer": true + }, + "node_modules/glsl-token-descope": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz", + "integrity": "sha512-kS2PTWkvi/YOeicVjXGgX5j7+8N7e56srNDEHDTVZ1dcESmbmpmgrnpjPcjxJjMxh56mSXYoFdZqb90gXkGjQw==", + "peer": true, + "dependencies": { + "glsl-token-assignments": "^2.0.0", + "glsl-token-depth": "^1.1.0", + "glsl-token-properties": "^1.0.0", + "glsl-token-scope": "^1.1.0" + } + }, + "node_modules/glsl-token-inject-block": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz", + "integrity": "sha512-q/m+ukdUBuHCOtLhSr0uFb/qYQr4/oKrPSdIK2C4TD+qLaJvqM9wfXIF/OOBjuSA3pUoYHurVRNao6LTVVUPWA==", + "peer": true + }, + "node_modules/glsl-token-properties": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz", + "integrity": "sha512-dSeW1cOIzbuUoYH0y+nxzwK9S9O3wsjttkq5ij9ZGw0OS41BirKJzzH48VLm8qLg+au6b0sINxGC0IrGwtQUcA==", + "peer": true + }, + "node_modules/glsl-token-scope": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz", + "integrity": "sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==", + "peer": true + }, + "node_modules/glsl-token-string": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/glsl-token-string/-/glsl-token-string-1.0.1.tgz", + "integrity": "sha512-1mtQ47Uxd47wrovl+T6RshKGkRRCYWhnELmkEcUAPALWGTFe2XZpH3r45XAwL2B6v+l0KNsCnoaZCSnhzKEksg==", + "peer": true + }, + "node_modules/glsl-token-whitespace-trim": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz", + "integrity": "sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==", + "peer": true + }, + "node_modules/glsl-tokenizer": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", + "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", + "peer": true, + "dependencies": { + "through2": "^0.6.3" + } + }, + "node_modules/glsl-tokenizer/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "peer": true + }, + "node_modules/glsl-tokenizer/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/glsl-tokenizer/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "peer": true + }, + "node_modules/glsl-tokenizer/node_modules/through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", + "peer": true, + "dependencies": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + }, + "node_modules/glslify": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glslify/-/glslify-7.1.1.tgz", + "integrity": "sha512-bud98CJ6kGZcP9Yxcsi7Iz647wuDz3oN+IZsjCRi5X1PI7t/xPKeL0mOwXJjo+CRZMqvq0CkSJiywCcY7kVYog==", + "peer": true, + "dependencies": { + "bl": "^2.2.1", + "concat-stream": "^1.5.2", + "duplexify": "^3.4.5", + "falafel": "^2.1.0", + "from2": "^2.3.0", + "glsl-resolve": "0.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glslify-bundle": "^5.0.0", + "glslify-deps": "^1.2.5", + "minimist": "^1.2.5", + "resolve": "^1.1.5", + "stack-trace": "0.0.9", + "static-eval": "^2.0.5", + "through2": "^2.0.1", + "xtend": "^4.0.0" + }, + "bin": { + "glslify": "bin.js" + } + }, + "node_modules/glslify-bundle": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glslify-bundle/-/glslify-bundle-5.1.1.tgz", + "integrity": "sha512-plaAOQPv62M1r3OsWf2UbjN0hUYAB7Aph5bfH58VxJZJhloRNbxOL9tl/7H71K7OLJoSJ2ZqWOKk3ttQ6wy24A==", + "peer": true, + "dependencies": { + "glsl-inject-defines": "^1.0.1", + "glsl-token-defines": "^1.0.0", + "glsl-token-depth": "^1.1.1", + "glsl-token-descope": "^1.0.2", + "glsl-token-scope": "^1.1.1", + "glsl-token-string": "^1.0.1", + "glsl-token-whitespace-trim": "^1.0.0", + "glsl-tokenizer": "^2.0.2", + "murmurhash-js": "^1.0.0", + "shallow-copy": "0.0.1" + } + }, + "node_modules/glslify-deps": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/glslify-deps/-/glslify-deps-1.3.2.tgz", + "integrity": "sha512-7S7IkHWygJRjcawveXQjRXLO2FTjijPDYC7QfZyAQanY+yGLCFHYnPtsGT9bdyHiwPTw/5a1m1M9hamT2aBpag==", + "peer": true, + "dependencies": { + "@choojs/findup": "^0.2.0", + "events": "^3.2.0", + "glsl-resolve": "0.0.1", + "glsl-tokenizer": "^2.0.0", + "graceful-fs": "^4.1.2", + "inherits": "^2.0.1", + "map-limit": "0.0.1", + "resolve": "^1.0.0" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true + }, + "node_modules/grid-index": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grid-index/-/grid-index-1.1.0.tgz", + "integrity": "sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==", + "peer": true }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/has-hover": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-hover/-/has-hover-1.0.1.tgz", + "integrity": "sha512-0G6w7LnlcpyDzpeGUTuT0CEw05+QlMuGVk1IHNAlHrGJITGodjZu3x8BNDUMfKJSZXNB2ZAclqc1bvrd+uUpfg==", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1" + } + }, + "node_modules/has-passive-events": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-passive-events/-/has-passive-events-1.0.0.tgz", + "integrity": "sha512-2vSj6IeIsgvsRMyeQ0JaCX5Q3lX4zMn5HpoVc7MEhQ6pv8Iq9rsXjsp+E5ZwaT7T0xhMT0KmU8gtt1EFVdbJiw==", + "peer": true, + "dependencies": { + "is-browser": "^2.0.1" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -554,10 +2344,61 @@ "node": ">= 0.4" } }, + "node_modules/hsluv": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/hsluv/-/hsluv-0.0.3.tgz", + "integrity": "sha512-08iL2VyCRbkQKBySkSh6m8zMUa3sADAxGVWs3Z1aPcUkTJeK0ETG4Fc27tEmQBGUAXZjIsXOZqBvacuVNSC/fQ==", + "peer": true + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "peer": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "peer": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true + }, "node_modules/image-size": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz", "integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==", + "dev": true, "license": "MIT", "bin": { "image-size": "bin/image-size.js" @@ -566,11 +2407,31 @@ "node": ">=6.9.0" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "peer": true + }, + "node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "peer": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/is-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-browser/-/is-browser-2.1.0.tgz", + "integrity": "sha512-F5rTJxDQ2sW81fcfOR1GnCXT6sVJC104fCyfj+mjpwNEwaPYSn5fte5jiHmBg3DHsIoL/l8Kvw5VN5SsTRcRFQ==", + "peer": true + }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.2" @@ -582,6 +2443,42 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "peer": true, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-firefox": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-firefox/-/is-firefox-1.0.3.tgz", + "integrity": "sha512-6Q9ITjvWIm0Xdqv+5U12wgOKEM2KoBw4Y926m0OFkvlCxnbG94HKAsVz8w3fWcfAS5YA2fJORXX1dLrkprCCxA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-iexplorer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-iexplorer/-/is-iexplorer-1.0.0.tgz", + "integrity": "sha512-YeLzceuwg3K6O0MLM3UyUUjKAlyULetwryFp1mHy1I5PfArK0AEqlfa+MR4gkJjcbuJXoDJCvXbyqZVf5CR2Sg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-mobile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-4.0.0.tgz", + "integrity": "sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==", + "peer": true + }, "node_modules/is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", @@ -589,6 +2486,24 @@ "dev": true, "license": "MIT" }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -599,6 +2514,39 @@ "@types/estree": "*" } }, + "node_modules/is-string-blank": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-string-blank/-/is-string-blank-1.0.1.tgz", + "integrity": "sha512-9H+ZBCVs3L9OYqv8nuUAzpcT9OTgMD1yAWrG7ihlnibdkbtB850heAmYWxHuXc4CHy4lKeK69tN+ny1K7gBIrw==", + "peer": true + }, + "node_modules/is-svg-path": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-svg-path/-/is-svg-path-1.0.2.tgz", + "integrity": "sha512-Lj4vePmqpPR1ZnRctHv8ltSh1OrSxHkhUkd7wi+VQdcdP15/KvQFyk7LhNuM7ZW0EVbJz8kZLVmL9quLrfq4Kg==", + "peer": true + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "peer": true + }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "peer": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/javascript-natural-sort": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", + "dev": true + }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -621,38 +2569,65 @@ "dev": true, "license": "MIT" }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "peer": true + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "peer": true + }, + "node_modules/json-stringify-pretty-compact": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz", + "integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==", + "peer": true + }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==", + "peer": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "peer": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/ktx-parse": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-0.0.4.tgz", "integrity": "sha512-LY3nrmfXl+wZZdPxgJ3ZmLvG+wkOZZP3/dr4RbQj1Pk3Qwz44esOOSFFVQJcNWpXAtiNIC66WgXufX/SYgYz6A==", + "dev": true, "license": "MIT" }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^4.1.0" - }, + "node_modules/loader-runner": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz", + "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==", + "peer": true, "engines": { - "node": ">=8" + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "peer": true + }, "node_modules/magic-string": { "version": "0.30.17", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", @@ -663,100 +2638,428 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "license": "MIT", + "node_modules/map-limit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "integrity": "sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==", + "peer": true, + "dependencies": { + "once": "~1.3.0" + } + }, + "node_modules/map-limit/node_modules/once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/mapbox-gl": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-1.13.3.tgz", + "integrity": "sha512-p8lJFEiqmEQlyv+DQxFAOG/XPWN0Wp7j/Psq93Zywz7qt9CcUKFYDBOoOEKzqe6gudHVJY8/Bhqw6VDpX2lSBg==", + "peer": true, "dependencies": { - "semver": "^6.0.0" + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/geojson-types": "^1.0.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/mapbox-gl-supported": "^1.5.0", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^1.1.1", + "@mapbox/unitbezier": "^0.0.0", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "csscolorparser": "~1.0.3", + "earcut": "^2.2.2", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.2.1", + "grid-index": "^1.1.0", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^1.0.1", + "quickselect": "^2.0.0", + "rw": "^1.3.3", + "supercluster": "^7.1.0", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.1" }, "engines": { - "node": ">=8" + "node": ">=6.4.0" + } + }, + "node_modules/maplibre-gl": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", + "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "peer": true, + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "@maplibre/maplibre-gl-style-spec": "^20.3.1", + "@types/geojson": "^7946.0.14", + "@types/geojson-vt": "3.2.5", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", + "earcut": "^3.0.0", + "geojson-vt": "^4.0.2", + "gl-matrix": "^3.4.3", + "global-prefix": "^4.0.0", + "kdbush": "^4.0.2", + "murmurhash-js": "^1.0.0", + "pbf": "^3.3.0", + "potpack": "^2.0.0", + "quickselect": "^3.0.0", + "supercluster": "^8.0.1", + "tinyqueue": "^3.0.0", + "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, + "node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.7.tgz", + "integrity": "sha512-25gQLQMcpivjOSA40g3gO6qgiFPDpWRoMfd+G/GoppPIeP6JDaMMkMrEJnMZhKyyS6iKwVt5YKu02vCUyJM3Ug==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/earcut": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/geojson-vt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/potpack": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.1.0.tgz", + "integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "peer": true + }, + "node_modules/maplibre-gl/node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "peer": true, + "dependencies": { + "kdbush": "^4.0.2" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/maplibre-gl/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==", + "peer": true + }, + "node_modules/math-log2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", + "integrity": "sha512-9W0yGtkaMAkf74XGYVy4Dqw3YUMnTNB2eeiw9aQbUl4A3KmuCEHTt2DgAB07ENzOYAjsYSAYufkAq0Zd+jU7zA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mathjs": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-11.12.0.tgz", + "integrity": "sha512-UGhVw8rS1AyedyI55DGz9q1qZ0p98kyKPyc9vherBkoueLntPfKtPBh14x+V4cdUWK0NZV2TBwqRFlvadscSuw==", "dev": true, - "license": "ISC", + "dependencies": { + "@babel/runtime": "^7.23.2", + "complex.js": "^2.1.1", + "decimal.js": "^10.4.3", + "escape-latex": "^1.2.0", + "fraction.js": "4.3.4", + "javascript-natural-sort": "^0.7.1", + "seedrandom": "^3.0.5", + "tiny-emitter": "^2.1.0", + "typed-function": "^4.1.1" + }, "bin": { - "semver": "bin/semver.js" + "mathjs": "bin/cli.js" + }, + "engines": { + "node": ">= 14" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, "license": "MIT" }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "license": "MIT", + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "peer": true, "dependencies": { - "p-try": "^2.0.0" + "mime-db": "1.52.0" }, "engines": { - "node": ">=6" - }, + "node": ">= 0.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "peer": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "license": "MIT", + "node_modules/mouse-change": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/mouse-change/-/mouse-change-1.4.0.tgz", + "integrity": "sha512-vpN0s+zLL2ykyyUDh+fayu9Xkor5v/zRD9jhSqjRS1cJTGS0+oakVZzNm5n19JvvEj0you+MXlYTpNxUDQUjkQ==", + "peer": true, + "dependencies": { + "mouse-event": "^1.0.0" + } + }, + "node_modules/mouse-event": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/mouse-event/-/mouse-event-1.0.5.tgz", + "integrity": "sha512-ItUxtL2IkeSKSp9cyaX2JLUuKk2uMoxBg4bbOWVd29+CskYJR9BGsUqtXenNzKbnDshvupjUewDIYVrOB6NmGw==", + "peer": true + }, + "node_modules/mouse-event-offset": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mouse-event-offset/-/mouse-event-offset-3.0.2.tgz", + "integrity": "sha512-s9sqOs5B1Ykox3Xo8b3Ss2IQju4UwlW6LSR+Q5FXWpprJ5fzMLefIIItr3PH8RwzfGy6gxs/4GAmiNuZScE25w==", + "peer": true + }, + "node_modules/mouse-wheel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mouse-wheel/-/mouse-wheel-1.2.0.tgz", + "integrity": "sha512-+OfYBiUOCTWcTECES49neZwL5AoGkXE+lFjIvzwNCnYRlso+EnfvovcBxGoyQ0yQt806eSPjS675K0EwWknXmw==", + "peer": true, + "dependencies": { + "right-now": "^1.0.0", + "signum": "^1.0.0", + "to-px": "^1.0.1" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "peer": true + }, + "node_modules/mumath": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/mumath/-/mumath-3.3.4.tgz", + "integrity": "sha512-VAFIOG6rsxoc7q/IaY3jdjmrsuX9f15KlRLYTHmixASBZkZEKC1IFqE2BC5CdhXmK6WLM1Re33z//AGmeRI6FA==", + "deprecated": "Redundant dependency in your project.", + "peer": true, "dependencies": { - "p-limit": "^2.2.0" + "almost-equal": "^1.1.0" + } + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==", + "peer": true + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": ">=8" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "license": "MIT", + "node_modules/native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", + "peer": true + }, + "node_modules/needle": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", + "peer": true, + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, "engines": { - "node": ">=6" + "node": ">= 4.4.x" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "peer": true + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", + "peer": true + }, + "node_modules/node-releases": { + "version": "2.0.25", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz", + "integrity": "sha512-4auku8B/vw5psvTiiN9j1dAOsXvMoGqJuKJcR+dTdqiXEK20mMTk1UEo3HS16LeGQsVG6+qKTPM9u/qQ2LqATA==", + "peer": true + }, + "node_modules/normalize-svg-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-0.1.0.tgz", + "integrity": "sha512-1/kmYej2iedi5+ROxkRESL/pI02pkg0OBnaR4hJkSIX6+ORzepwbuUXfrdZaPjysTsJInj0Rj5NuX027+dMBvA==", + "peer": true + }, + "node_modules/number-is-integer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-integer/-/number-is-integer-1.0.1.tgz", + "integrity": "sha512-Dq3iuiFBkrbmuQjGFFF3zckXNCQoSD37/SdSbgcBailUx6knDvDwb5CympBgcoWHy36sfS12u74MHYkXyHq6bg==", + "peer": true, + "dependencies": { + "is-finite": "^1.0.1" + }, "engines": { - "node": ">=8" + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parenthesis": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/parenthesis/-/parenthesis-3.1.8.tgz", + "integrity": "sha512-KF/U8tk54BgQewkJPvB4s/US3VQY68BRDpH638+7O/n58TpnwiwnOtGIOsT2/i+M78s61BBpeC83STB88d8sqw==", + "peer": true + }, + "node_modules/parse-rect": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parse-rect/-/parse-rect-1.2.0.tgz", + "integrity": "sha512-4QZ6KYbnE6RTwg9E0HpLchUM9EZt6DnDxajFZZDSV4p/12ZJEvPO702DZpGvRYEPo00yKDys7jASi+/w7aO8LA==", + "peer": true, + "dependencies": { + "pick-by-alias": "^1.2.0" } }, + "node_modules/parse-svg-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/parse-svg-path/-/parse-svg-path-0.1.2.tgz", + "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==", + "peer": true + }, + "node_modules/parse-unit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-unit/-/parse-unit-1.0.1.tgz", + "integrity": "sha512-hrqldJHokR3Qj88EIlV/kAyAi/G5R2+R56TBANxNMy0uPlYcttx0jnMW6Yx5KsKPSbC3KddM/7qQm3+0wEXKxg==", + "peer": true + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, "license": "MIT" }, + "node_modules/pbf": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", + "peer": true, + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "peer": true + }, + "node_modules/pick-by-alias": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pick-by-alias/-/pick-by-alias-1.2.0.tgz", + "integrity": "sha512-ESj2+eBxhGrcA1azgHs7lARG5+5iLakc/6nlfbpjcLl00HuuUOIuORhYXN4D1HfvMSKuVtFQjAlnwi1JHEeDIw==", + "peer": true + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -772,34 +3075,357 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-dir": { + "node_modules/plotly.js": { + "version": "2.35.3", + "resolved": "https://registry.npmjs.org/plotly.js/-/plotly.js-2.35.3.tgz", + "integrity": "sha512-7RaC6FxmCUhpD6H4MpD+QLUu3hCn76I11rotRefrh3m1iDvWqGnVqVk9dSaKmRAhFD3vsNsYea0OxnR1rc2IzQ==", + "peer": true, + "dependencies": { + "@plotly/d3": "3.8.2", + "@plotly/d3-sankey": "0.7.2", + "@plotly/d3-sankey-circular": "0.33.1", + "@plotly/mapbox-gl": "1.13.4", + "@turf/area": "^7.1.0", + "@turf/bbox": "^7.1.0", + "@turf/centroid": "^7.1.0", + "base64-arraybuffer": "^1.0.2", + "canvas-fit": "^1.5.0", + "color-alpha": "1.0.4", + "color-normalize": "1.5.0", + "color-parse": "2.0.0", + "color-rgba": "2.1.1", + "country-regex": "^1.1.0", + "css-loader": "^7.1.2", + "d3-force": "^1.2.1", + "d3-format": "^1.4.5", + "d3-geo": "^1.12.1", + "d3-geo-projection": "^2.9.0", + "d3-hierarchy": "^1.1.9", + "d3-interpolate": "^3.0.1", + "d3-time": "^1.1.0", + "d3-time-format": "^2.2.3", + "fast-isnumeric": "^1.1.4", + "gl-mat4": "^1.2.0", + "gl-text": "^1.4.0", + "has-hover": "^1.0.1", + "has-passive-events": "^1.0.0", + "is-mobile": "^4.0.0", + "maplibre-gl": "^4.5.2", + "mouse-change": "^1.4.0", + "mouse-event-offset": "^3.0.2", + "mouse-wheel": "^1.2.0", + "native-promise-only": "^0.8.1", + "parse-svg-path": "^0.1.2", + "point-in-polygon": "^1.1.0", + "polybooljs": "^1.2.2", + "probe-image-size": "^7.2.3", + "regl": "npm:@plotly/regl@^2.1.2", + "regl-error2d": "^2.0.12", + "regl-line2d": "^3.1.3", + "regl-scatter2d": "^3.3.1", + "regl-splom": "^1.0.14", + "strongly-connected-components": "^1.0.1", + "style-loader": "^4.0.0", + "superscript-text": "^1.0.0", + "svg-path-sdf": "^1.1.3", + "tinycolor2": "^1.4.2", + "to-px": "1.0.1", + "topojson-client": "^3.1.0", + "webgl-context": "^2.2.0", + "world-calendars": "^1.0.3" + } + }, + "node_modules/point-in-polygon": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", + "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==", + "peer": true + }, + "node_modules/polybooljs": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/polybooljs/-/polybooljs-1.2.2.tgz", + "integrity": "sha512-ziHW/02J0XuNuUtmidBc6GXE8YohYydp3DWPWXYsd7O721TjcmN+k6ezjdwkDqep+gnWnFY+yqZHvzElra2oCg==", + "peer": true + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "peer": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", + "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", + "peer": true, "dependencies": { - "find-up": "^4.0.0" + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^7.0.0", + "postcss-value-parser": "^4.1.0" }, "engines": { - "node": ">=8" + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", + "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", + "peer": true, + "dependencies": { + "postcss-selector-parser": "^7.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "peer": true, + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", + "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", + "peer": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "peer": true + }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", + "peer": true + }, + "node_modules/probe-image-size": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/probe-image-size/-/probe-image-size-7.2.3.tgz", + "integrity": "sha512-HubhG4Rb2UH8YtV4ba0Vp5bQ7L78RTONYu/ujmCu5nBI8wGv24s4E9xSKBi0N1MowRpxk76pFCpJtW0KPzOK0w==", + "peer": true, + "dependencies": { + "lodash.merge": "^4.6.2", + "needle": "^2.5.2", + "stream-parser": "~0.3.1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "peer": true + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "peer": true + }, + "node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==", + "peer": true + }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "peer": true, + "dependencies": { + "performance-now": "^2.1.0" } }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "peer": true + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "peer": true + }, + "node_modules/regl": { + "name": "@plotly/regl", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@plotly/regl/-/regl-2.1.2.tgz", + "integrity": "sha512-Mdk+vUACbQvjd0m/1JJjOOafmkp/EpmHjISsopEz5Av44CBq7rPC05HHNbYGKVyNUF2zmEoBS/TT0pd0SPFFyw==", + "peer": true + }, + "node_modules/regl-error2d": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/regl-error2d/-/regl-error2d-2.0.12.tgz", + "integrity": "sha512-r7BUprZoPO9AbyqM5qlJesrSRkl+hZnVKWKsVp7YhOl/3RIpi4UDGASGJY0puQ96u5fBYw/OlqV24IGcgJ0McA==", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "color-normalize": "^1.5.0", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-line2d": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/regl-line2d/-/regl-line2d-3.1.3.tgz", + "integrity": "sha512-fkgzW+tTn4QUQLpFKsUIE0sgWdCmXAM3ctXcCgoGBZTSX5FE2A0M7aynz7nrZT5baaftLrk9te54B+MEq4QcSA==", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "array-find-index": "^1.0.2", + "array-normalize": "^1.1.4", + "color-normalize": "^1.5.0", + "earcut": "^2.1.5", + "es6-weak-map": "^2.0.3", + "flatten-vertex-data": "^1.0.2", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0" + } + }, + "node_modules/regl-scatter2d": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/regl-scatter2d/-/regl-scatter2d-3.3.1.tgz", + "integrity": "sha512-seOmMIVwaCwemSYz/y4WE0dbSO9svNFSqtTh5RE57I7PjGo3tcUYKtH0MTSoshcAsreoqN8HoCtnn8wfHXXfKQ==", + "peer": true, + "dependencies": { + "@plotly/point-cluster": "^3.1.9", + "array-range": "^1.0.1", + "array-rearrange": "^2.2.2", + "clamp": "^1.0.1", + "color-id": "^1.1.0", + "color-normalize": "^1.5.0", + "color-rgba": "^2.1.1", + "flatten-vertex-data": "^1.0.2", + "glslify": "^7.0.0", + "is-iexplorer": "^1.0.0", + "object-assign": "^4.1.1", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "to-float32": "^1.1.0", + "update-diff": "^1.1.0" + } + }, + "node_modules/regl-splom": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/regl-splom/-/regl-splom-1.0.14.tgz", + "integrity": "sha512-OiLqjmPRYbd7kDlHC6/zDf6L8lxgDC65BhC8JirhP4ykrK4x22ZyS+BnY8EUinXKDeMgmpRwCvUmk7BK4Nweuw==", + "peer": true, + "dependencies": { + "array-bounds": "^1.0.1", + "array-range": "^1.0.1", + "color-alpha": "^1.0.4", + "flatten-vertex-data": "^1.0.2", + "parse-rect": "^1.2.0", + "pick-by-alias": "^1.2.0", + "raf": "^3.4.1", + "regl-scatter2d": "^3.2.3" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", - "dev": true, "license": "MIT", "dependencies": { "is-core-module": "^2.16.0", @@ -816,6 +3442,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "peer": true, + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/right-now": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/right-now/-/right-now-1.0.0.tgz", + "integrity": "sha512-DA8+YS+sMIVpbsuKgy+Z67L9Lxb1p05mNxRpDPNksPDEFir4vmBlUtuN9jkTGn9YMMdlBuK7XQgFiz6ws+yhSg==", + "peer": true + }, "node_modules/rollup": { "version": "2.79.2", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", @@ -849,64 +3490,16 @@ "rollup": "^2.0.0" } }, - "node_modules/rollup-plugin-typescript2": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.36.0.tgz", - "integrity": "sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^4.1.2", - "find-cache-dir": "^3.3.2", - "fs-extra": "^10.0.0", - "semver": "^7.5.4", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "rollup": ">=1.26.3", - "typescript": ">=2.4.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", - "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/rollup-plugin-typescript2/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/rollup-plugin-wasm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-wasm/-/rollup-plugin-wasm-3.0.0.tgz", - "integrity": "sha512-ySzhd2MtHbORJdRmpID0j1N59QpjyQ27qxo6XfEH2Pv2ckhLLiD8E1QuhLQDIIw7dXZhQYMyLRGJsiZCewTK7g==", - "deprecated": "This module has moved and is now available at @rollup/plugin-wasm. Please update your dependencies. This version is no longer maintained.", - "dev": true, - "license": "MIT" + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "peer": true }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -923,12 +3516,49 @@ ], "license": "MIT" }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "peer": true + }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", + "peer": true + }, + "node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", + "dev": true + }, "node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", - "dev": true, "license": "ISC", + "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -946,21 +3576,40 @@ "randombytes": "^2.1.0" } }, + "node_modules/shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==", + "peer": true + }, + "node_modules/signum": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/signum/-/signum-1.0.0.tgz", + "integrity": "sha512-yodFGwcyt59XRh7w5W3jPcIQb3Bwi21suEfT7MAWnBX3iCdklJpgDgvGT9o04UonglZN5SNMfJFkHIR/jO8GHw==", + "peer": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -971,8 +3620,124 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, "license": "BSD-3-Clause" }, + "node_modules/stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/static-eval": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", + "integrity": "sha512-MgWpQ/ZjGieSVB3eOJVs4OA2LT/q1vx98KPCTTQPzq/aLr0YUXTsgryTXr4SLfR0ZfUUCiedM9n/ABeDIyy4mA==", + "peer": true, + "dependencies": { + "escodegen": "^2.1.0" + } + }, + "node_modules/stream-parser": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz", + "integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==", + "peer": true, + "dependencies": { + "debug": "2" + } + }, + "node_modules/stream-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "peer": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/stream-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "peer": true + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "peer": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "peer": true + }, + "node_modules/string-split-by": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string-split-by/-/string-split-by-1.0.0.tgz", + "integrity": "sha512-KaJKY+hfpzNyet/emP81PJA9hTVSfxNLS9SFTWxdCnnW1/zOOwiV248+EfoX7IQFcBaOp4G5YE6xTJMF+pLg6A==", + "peer": true, + "dependencies": { + "parenthesis": "^3.1.5" + } + }, + "node_modules/strongly-connected-components": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strongly-connected-components/-/strongly-connected-components-1.0.1.tgz", + "integrity": "sha512-i0TFx4wPcO0FwX+4RkLJi1MxmcTv90jNZgxMu9XRnMXMeFUY1VJlIoXpZunPUvUUqbCT1pg5PEkFqqpcaElNaA==", + "peer": true + }, + "node_modules/style-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", + "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", + "peer": true, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.27.0" + } + }, + "node_modules/supercluster": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-7.1.5.tgz", + "integrity": "sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==", + "peer": true, + "dependencies": { + "kdbush": "^3.0.0" + } + }, + "node_modules/supercluster/node_modules/kdbush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-3.0.0.tgz", + "integrity": "sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==", + "peer": true + }, + "node_modules/superscript-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/superscript-text/-/superscript-text-1.0.0.tgz", + "integrity": "sha512-gwu8l5MtRZ6koO0icVTlmN5pm7Dhh1+Xpe9O4x6ObMAsW+3jPbW14d1DsBq1F4wiI+WOFjXF35pslgec/G8yCQ==", + "peer": true + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -990,7 +3755,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -999,10 +3763,51 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/svg-arc-to-cubic-bezier": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz", + "integrity": "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g==", + "peer": true + }, + "node_modules/svg-path-bounds": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/svg-path-bounds/-/svg-path-bounds-1.0.2.tgz", + "integrity": "sha512-H4/uAgLWrppIC0kHsb2/dWUYSmb4GE5UqH06uqWBcg6LBjX2fu0A8+JrO2/FJPZiSsNOKZAhyFFgsLTdYUvSqQ==", + "peer": true, + "dependencies": { + "abs-svg-path": "^0.1.1", + "is-svg-path": "^1.0.1", + "normalize-svg-path": "^1.0.0", + "parse-svg-path": "^0.1.2" + } + }, + "node_modules/svg-path-bounds/node_modules/normalize-svg-path": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-1.1.0.tgz", + "integrity": "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg==", + "peer": true, + "dependencies": { + "svg-arc-to-cubic-bezier": "^3.0.0" + } + }, + "node_modules/svg-path-sdf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/svg-path-sdf/-/svg-path-sdf-1.1.3.tgz", + "integrity": "sha512-vJJjVq/R5lSr2KLfVXVAStktfcfa1pNFjFOgyJnzZFXlO/fDZ5DmM8FpnSKKzLPfEYTVeXuVBTHF296TpxuJVg==", + "peer": true, + "dependencies": { + "bitmap-sdf": "^1.0.0", + "draw-svg-path": "^1.0.0", + "is-svg-path": "^1.0.1", + "parse-svg-path": "^0.1.2", + "svg-path-bounds": "^1.0.1" + } + }, "node_modules/taichi.js": { "version": "0.0.36", "resolved": "https://registry.npmjs.org/taichi.js/-/taichi.js-0.0.36.tgz", "integrity": "sha512-JPVI5SSXEOHSAw2YXcL2Y4jKdvBaOyzolCyB5iN/Mhj+vM8hDvi5xzR5YFogZQyuETb53v7/RErvI9BHiyUHRQ==", + "dev": true, "dependencies": { "@loaders.gl/core": "^3.1.8", "@loaders.gl/gltf": "^3.1.8", @@ -1011,11 +3816,23 @@ "tslib": "^2.4.0" } }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/terser": { "version": "5.39.2", "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.2.tgz", "integrity": "sha512-yEPUmWve+VA78bI71BW70Dh0TuV4HHd+I5SHOAfS1+QBOmvmCiiffgjR8ryyEd3KIfvPGFqoADt8LdQ6XpXIvg==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -1030,10 +3847,83 @@ "node": ">=10" } }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.14", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz", + "integrity": "sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/terser-webpack-plugin/node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/texture-compressor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/texture-compressor/-/texture-compressor-1.0.2.tgz", "integrity": "sha512-dStVgoaQ11mA5htJ+RzZ51ZxIZqNOgWKAIvtjLrW1AliQQLCmrDqNzQZ8Jh91YealQ95DXt4MEduLzJmbs6lig==", + "dev": true, "license": "MIT", "dependencies": { "argparse": "^1.0.10", @@ -1043,41 +3933,287 @@ "texture-compressor": "bin/texture-compressor.js" } }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "peer": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "dev": true + }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "peer": true + }, + "node_modules/tinyqueue": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", + "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==", + "peer": true + }, + "node_modules/to-float32": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/to-float32/-/to-float32-1.1.0.tgz", + "integrity": "sha512-keDnAusn/vc+R3iEiSDw8TOF7gPiTLdK1ArvWtYbJQiVfmRg6i/CAvbKq3uIS0vWroAC7ZecN3DjQKw3aSklUg==", + "peer": true + }, + "node_modules/to-px": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-px/-/to-px-1.0.1.tgz", + "integrity": "sha512-2y3LjBeIZYL19e5gczp14/uRWFDtDUErJPVN3VU9a7SJO+RjGRtYR47aMN2bZgGlxvW4ZcEz2ddUPVHXcMfuXw==", + "peer": true, + "dependencies": { + "parse-unit": "^1.0.1" + } + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "peer": true, + "dependencies": { + "commander": "2" + }, + "bin": { + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "node_modules/type": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", + "integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==", + "peer": true + }, + "node_modules/typed-function": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz", + "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, "engines": { - "node": ">=14.17" + "node": ">= 18" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "peer": true + }, + "node_modules/typedarray-pool": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.2.0.tgz", + "integrity": "sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==", + "peer": true, + "dependencies": { + "bit-twiddle": "^1.0.0", + "dup": "^1.0.0" } }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", + "node_modules/unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==", + "peer": true + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/update-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-diff/-/update-diff-1.1.0.tgz", + "integrity": "sha512-rCiBPiHxZwT4+sBhEbChzpO5hYHjm91kScWgdHf4Qeafs6Ba7MBl+d9GlGv72bcTZQO0sLmtQS1pHSWoCLtN/A==", + "peer": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "peer": true + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "peer": true, + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/watchpack": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.4.tgz", + "integrity": "sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA==", + "peer": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/weak-map": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.8.tgz", + "integrity": "sha512-lNR9aAefbGPpHO7AEnY0hCFjz1eTkWCXYvkTRrTHs9qv8zJp+SkVYpzfLIFXQQiG3tVvbNFQgVg2bQS8YGgxyw==", + "peer": true + }, + "node_modules/webgl-context": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webgl-context/-/webgl-context-2.2.0.tgz", + "integrity": "sha512-q/fGIivtqTT7PEoF07axFIlHNk/XCPaYpq64btnepopSWvKNFkoORlQYgqDigBIuGA1ExnFd/GnSUnBNEPQY7Q==", + "peer": true, + "dependencies": { + "get-canvas-context": "^1.0.1" + } + }, + "node_modules/webpack": { + "version": "5.102.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.102.1.tgz", + "integrity": "sha512-7h/weGm9d/ywQ6qzJ+Xy+r9n/3qgp/thalBbpOi5i223dPXKi04IBtqPN9nTd+jBc7QKfvDbaBnFipYp4sJAUQ==", + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.15.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.26.3", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.3", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "terser-webpack-plugin": "^5.3.11", + "watchpack": "^2.4.4", + "webpack-sources": "^3.3.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-sources": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", + "integrity": "sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==", + "peer": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "peer": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/world-calendars": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/world-calendars/-/world-calendars-1.0.4.tgz", + "integrity": "sha512-VGRnLJS+xJmGDPodgJRnGIDwGu0s+Cr9V2HB3EzlDZ5n0qb8h5SJtGUEkjrphZYAglEiXZ6kiXdmk0H/h/uu/w==", + "peer": true, + "dependencies": { + "object-assign": "^4.1.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "peer": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "peer": true, "engines": { - "node": ">= 10.0.0" + "node": ">=0.4" } } } diff --git a/package.json b/package.json index 2dde7b1..951b86a 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@rollup/plugin-node-resolve": "^16.0.1", "mathjs": "^11.12.0", "rollup": "^2.79.2", - "rollup-plugin-terser": "^7.0.2" + "rollup-plugin-terser": "^7.0.2", + "taichi.js": "^0.0.36" } } diff --git a/src/FEAScript.js b/src/FEAScript.js index 5e346d5..ee5fb0f 100644 --- a/src/FEAScript.js +++ b/src/FEAScript.js @@ -70,6 +70,54 @@ export class FEAScriptModel { debugLog(`Solver method set to: ${solverMethod}`); } + async solveWithWebGPU(computeEngine) { + if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { + const error = "Solver config, mesh config, and boundary conditions must be set before solving."; + console.error(error); + throw new Error(error); + } + + let jacobianMatrix = []; + let residualVector = []; + let solutionVector = []; + let nodesCoordinates = {}; + + // Assembly matrices + basicLog("Beginning matrix assembly..."); + console.time("assemblyMatrices"); + if (this.solverConfig === "solidHeatTransferScript") { + basicLog(`Using solver: ${this.solverConfig}`); + ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat( + this.meshConfig, + this.boundaryConditions + )); + } + console.timeEnd("assemblyMatrices"); + basicLog("Matrix assembly completed"); + + // System solving with WebGPU CG + basicLog("Solving system using WebGPU Jacobi..."); + console.time("systemSolving"); + + // Convert matrices to arrays for WebGPU + const A = Array.isArray(jacobianMatrix) ? jacobianMatrix : jacobianMatrix.toArray(); + const b = Array.isArray(residualVector) ? residualVector : residualVector.toArray(); + + // For heat conduction FEM, the matrix might be negative definite + // Use Jacobi method instead of CG for better stability + console.log("Matrix diagonal sample:", A.slice(0, 5).map((row, i) => row[i])); + console.log("RHS sample:", b.slice(0, 5)); + + // Use WebGPU Jacobi method + const initialGuess = new Array(b.length).fill(0); + solutionVector = await computeEngine.jacobiSolve(A, b, initialGuess, 10000, 1e-3); + + console.timeEnd("systemSolving"); + basicLog("System solved successfully with WebGPU Jacobi"); + + return { solutionVector, nodesCoordinates }; + } + solve() { if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { const error = "Solver config, mesh config, and boundary conditions must be set before solving."; diff --git a/src/methods/jacobiSolverScript.js b/src/methods/jacobiSolverScript.js index c0459b9..687d1d8 100644 --- a/src/methods/jacobiSolverScript.js +++ b/src/methods/jacobiSolverScript.js @@ -8,127 +8,35 @@ // |_| | |_ // // Website: https://feascript.com/ \__| // +import * as Comlink from "../vendor/comlink.mjs"; +import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; + /** * Function to solve a system of linear equations using the Jacobi iterative method - * This version uses Taichi.js to accelerate the core computation + * This version uses the WebGPU compute engine for maximum performance and reusability * @param {array} A - The coefficient matrix (must be square) * @param {array} b - The right-hand side vector * @param {array} x0 - Initial guess for solution vector * @param {number} [maxIterations=100] - Maximum number of iterations * @param {number} [tolerance=1e-7] - Convergence tolerance + * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision * @returns {object} An object containing: * - solutionVector: The solution vector * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { - // Initialize Taichi for each call to ensure clean state - const taichi = await import('taichi.js'); - await taichi.init(); - - const n = A.length; - - // Choose appropriate float type based on precision parameter - const FloatArray = useFloat64 ? Float64Array : Float32Array; - - // Declare fields outside try block so they can be referenced in finally - let fieldA, fieldB, fieldCurrent, fieldNext, fieldMaxDiff; - + // Use the dedicated worker file + const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' }); + const jacobiWorker = Comlink.wrap(worker); + try { - // Create fields with appropriate precision - fieldA = taichi.field(FloatArray, [n, n]); - fieldB = taichi.field(FloatArray, [n]); - fieldCurrent = taichi.field(FloatArray, [n]); - fieldNext = taichi.field(FloatArray, [n]); - fieldMaxDiff = taichi.field(FloatArray, [1]); - - // Set initial values - fieldA.set(A.flat()); - fieldB.set(b); - fieldCurrent.set(x0); - - // Create kernels inline (no caching to prevent memory issues) - const updateKernel = taichi.kernel(function(A, b, current, next, n) { - for (let i = 0; i < n; i++) { - let sum = 0; - for (let j = 0; j < n; j++) { - if (j !== i) { - sum += A[i][j] * current[j]; - } - } - next[i] = (b[i] - sum) / A[i][i]; - } - }); - - const diffKernel = taichi.kernel(function(current, next, maxDiff, n) { - maxDiff[0] = 0; - for (let i = 0; i < n; i++) { - const diff = Math.abs(next[i] - current[i]); - if (diff > maxDiff[0]) { - maxDiff[0] = diff; - } - } - }); - - const copyKernel = taichi.kernel(function(src, dst, n) { - for (let i = 0; i < n; i++) { - dst[i] = src[i]; - } - }); - - // Store solution here so we can return it after cleanup - let solution; - let iterationsCompleted; - let hasConverged = false; - - // Main iteration loop - for (let iteration = 0; iteration < maxIterations; iteration++) { - // Compute next iteration values - updateKernel(fieldA, fieldB, fieldCurrent, fieldNext, n); - - // Compute max difference directly in Taichi - diffKernel(fieldCurrent, fieldNext, fieldMaxDiff, n); - const maxDiff = fieldMaxDiff.get()[0]; - - // Copy next values to current using Taichi - copyKernel(fieldNext, fieldCurrent, n); - - // Check for convergence - if (maxDiff < tolerance) { - solution = Array.from(fieldCurrent.get()); - iterationsCompleted = iteration + 1; - hasConverged = true; - break; - } - - // If we're approaching maximum iterations, get the current solution - if (iteration === maxIterations - 1) { - solution = Array.from(fieldCurrent.get()); - iterationsCompleted = maxIterations; - } - } - - return { - solution: solution, - iterations: iterationsCompleted, - converged: hasConverged, - }; + const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64); + return result; } catch (error) { - console.error("Error in Jacobi method:", error); + console.error("Error in WebGPU Jacobi method:", error); throw error; } finally { - // Aggressive cleanup - destroy all fields and reset Taichi completely - try { - if (fieldA) fieldA.destroy(); - if (fieldB) fieldB.destroy(); - if (fieldCurrent) fieldCurrent.destroy(); - if (fieldNext) fieldNext.destroy(); - if (fieldMaxDiff) fieldMaxDiff.destroy(); - - // Reset Taichi completely - taichi.reset(); - } catch (cleanupError) { - console.error("Error during cleanup:", cleanupError); - } + worker.terminate(); } } \ No newline at end of file diff --git a/src/utilities/webgpuComputeEngine.js b/src/utilities/webgpuComputeEngine.js new file mode 100644 index 0000000..99537a9 --- /dev/null +++ b/src/utilities/webgpuComputeEngine.js @@ -0,0 +1,836 @@ +import * as ti from '../vendor/taichi.esm.js'; + +export class WebGPUComputeEngine { + constructor() { + this.initialized = false; + } + + /** + * Initialize Taichi + */ + async initialize() { + if (this.initialized) return; + + await ti.init(); + this.initialized = true; + } + + /** + * Read data from a buffer (compatibility method) + */ + async readBuffer(data, size, type = Float32Array) { + return data; + } + + /** + * Matrix-vector multiplication: y = A * x + */ + async matVecMul(A, x, resultBuffer = null) { + const n = A.length; + const m = A[0].length; + + const matrixField = ti.field(ti.f32, [n * m]); + const vectorField = ti.field(ti.f32, [m]); + const resultField = ti.field(ti.f32, [n]); + + const flatMatrix = A.flat(); + matrixField.fromArray(flatMatrix); + vectorField.fromArray(x); + + ti.addToKernelScope({matrixField, vectorField, resultField}); + + ti.kernel((n, m) => { + for (let i of ti.ndrange(n)) { + let sum = 0.0; + for (let j of ti.ndrange(m)) { + sum += matrixField[ti.i32(i) * ti.i32(m) + ti.i32(j)] * vectorField[j]; + } + resultField[i] = sum; + } + })(n, m); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector addition: result = a + b + */ + async vecAdd(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] + bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector subtraction: result = a - b + */ + async vecSub(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] - bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Element-wise vector multiplication: result = a * b + */ + async vecMul(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] * bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector division: result = a / b + */ + async vecDiv(a, b, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / bField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Find maximum value in vector + */ + async vecMax(vector) { + const n = vector.length; + const vectorField = ti.field(ti.f32, [n]); + const maxField = ti.field(ti.f32, [1]); + + vectorField.fromArray(vector); + maxField.fromArray([-1e10]); + + ti.addToKernelScope({vectorField, maxField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + // For max, we can use a simple approach since atomic_max might not exist + // Use a reduction pattern + } + })(n); + + // For simplicity, since atomic_max may not be available, let's use CPU for now + const result = await vectorField.toArray(); + return Math.max(...result); + } + + /** + * Jacobi update: x_new = D^(-1) * (b - R * x_old) + */ + async jacobiUpdate(A, b, x, omega = 1.0, resultBuffer = null) { + const n = x.length; + const AField = ti.field(ti.f32, [n * n]); + const bField = ti.field(ti.f32, [n]); + const xField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + const flatA = A.flat(); + AField.fromArray(flatA); + bField.fromArray(b); + xField.fromArray(x); + + ti.addToKernelScope({AField, bField, xField, resultField}); + + ti.kernel((n, omega) => { + for (let i = 0; i < n; i++) { + let sum = 0.0; + for (let j = 0; j < n; j++) { + if (i !== j) { + sum += AField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + } + resultField[i] = omega * (bField[i] - sum) / AField[ti.i32(i) * ti.i32(n) + ti.i32(i)] + (1 - omega) * xField[i]; + } + })(n, omega); + + const result = await resultField.toArray(); + return result; + } + + /** + * Element-wise operation on vector: result[i] = op(a[i]) + */ + async elementWiseOp(a, op, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, op) => { + for (let i of ti.ndrange(n)) { + if (op === 'abs') { + resultField[i] = ti.abs(aField[i]); + } else if (op === 'sqrt') { + resultField[i] = ti.sqrt(aField[i]); + } else if (op === 'exp') { + resultField[i] = ti.exp(aField[i]); + } else if (op === 'log') { + resultField[i] = ti.log(aField[i]); + } else if (op === 'sin') { + resultField[i] = ti.sin(aField[i]); + } else if (op === 'cos') { + resultField[i] = ti.cos(aField[i]); + } else if (op === 'tan') { + resultField[i] = ti.tan(aField[i]); + } else { + resultField[i] = aField[i]; + } + } + })(n, op); + + const result = await resultField.toArray(); + return result; + } + + /** + * Scalar operation on vector: result[i] = op(a[i], scalar) + */ + async scalarOp(a, scalar, op, resultBuffer = null) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, scalar, op) => { + for (let i of ti.ndrange(n)) { + if (op === 'add') { + resultField[i] = aField[i] + scalar; + } else if (op === 'mul') { + resultField[i] = aField[i] * scalar; + } else if (op === 'div') { + resultField[i] = aField[i] / scalar; + } else if (op === 'pow') { + resultField[i] = ti.pow(aField[i], scalar); + } else { + resultField[i] = aField[i]; + } + } + })(n, scalar, op); + + const result = await resultField.toArray(); + return result; + } + + /** + * Vector L2 norm: result = ||a||_2 + */ + + /** + * Vector addition: c = a + b + */ + async vecAdd(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const cField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, cField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + cField[i] = aField[i] + bField[i]; + } + })(n); + + const result = await cField.toArray(); + return result; + } + + /** + * Element-wise vector multiplication: c = a .* b + */ + async vecMul(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const cField = ti.field(ti.f32, [n]); + + aField.fromArray(a); + bField.fromArray(b); + + ti.addToKernelScope({aField, bField, cField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + cField[i] = aField[i] * bField[i]; + } + })(n); + + const result = await cField.toArray(); + return result; + } + /** + * Vector dot product: result = a · b + */ + async dotProduct(a, b) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + bField.fromArray(b); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * bField[i]); + } + })(n); + + const result = await resultField.toArray(); + return result[0]; + } + + /** + * Vector L2 norm: result = ||a||_2 + */ + async norm(a) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel(() => { + resultField[0] = ti.sqrt(resultField[0]); + })(); + + const result = await resultField.toArray(); + return result[0]; + } + + async normalize(a) { + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + const tempField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + tempField.fromArray([0]); + + ti.addToKernelScope({aField, resultField, tempField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(tempField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel((n) => { + const normVal = ti.sqrt(tempField[0]); + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / normVal; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + /** + * Matrix-matrix multiplication: C = A * B + */ + /** + * Matrix-vector multiplication: y = A * x + */ + async matVecMul(A, x) { + const m = A.length; + const n = A[0].length; + + const AField = ti.field(ti.f32, [m * n]); + const xField = ti.field(ti.f32, [n]); + const yField = ti.field(ti.f32, [m]); + + const flatA = A.flat(); + AField.fromArray(flatA); + xField.fromArray(x); + + ti.addToKernelScope({AField, xField, yField}); + + ti.kernel((m, n) => { + for (let i of ti.ndrange(m)) { + let sum = 0.0; + for (let j of ti.ndrange(n)) { + sum += AField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + yField[i] = sum; + } + })(m, n); + + const result = await yField.toArray(); + return result; + } + + /** + * Matrix transpose: B = A^T + */ + async transpose(A, resultBuffer = null) { + const m = A.length; + const n = A[0].length; + + const AField = ti.field(ti.f32, [m * n]); + const BField = ti.field(ti.f32, [n * m]); + + const flatA = A.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, BField}); + + ti.kernel((m, n) => { + for (let i of ti.ndrange(m)) { + for (let j of ti.ndrange(n)) { + BField[ti.i32(j) * ti.i32(m) + ti.i32(i)] = AField[ti.i32(i) * ti.i32(n) + ti.i32(j)]; + } + } + })(m, n); + + const result = await BField.toArray(); + // Reshape to n x m + const B = []; + for (let i = 0; i < n; i++) { + B.push(result.slice(i * m, (i + 1) * m)); + } + return B; + } + + /** + * Extract diagonal elements: result = diag(A) + */ + async diagonal(A, resultBuffer = null) { + const n = Math.min(A.length, A[0].length); + + const AField = ti.field(ti.f32, [A.length * A[0].length]); + const resultField = ti.field(ti.f32, [n]); + + const flatA = A.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((n, cols) => { + for (let i of ti.ndrange(n)) { + resultField[i] = AField[ti.i32(i) * ti.i32(cols) + ti.i32(i)]; + } + })(n, A[0].length); + + const result = await resultField.toArray(); + return result; + } + + /** + * Sparse matrix-vector multiplication using CSR format + * sparseMatrix should have: {values, col_indices, row_indices, rows, cols} + */ + async sparseMatVecMul(sparseMatrix, x, resultBuffer = null) { + const { values, col_indices, row_indices, rows, cols } = sparseMatrix; + const nnz = values.length; + + const valuesField = ti.field(ti.f32, [nnz]); + const colIndicesField = ti.field(ti.i32, [nnz]); + const rowIndicesField = ti.field(ti.i32, [nnz]); + const xField = ti.field(ti.f32, [cols]); + const resultField = ti.field(ti.f32, [rows]); + + valuesField.fromArray(values); + colIndicesField.fromArray(col_indices); + rowIndicesField.fromArray(row_indices); + xField.fromArray(x); + resultField.fromArray(new Array(rows).fill(0)); + + ti.addToKernelScope({valuesField, colIndicesField, rowIndicesField, xField, resultField}); + + ti.kernel((nnz) => { + for (let k of ti.ndrange(nnz)) { + ti.atomicAdd(resultField[rowIndicesField[k]], valuesField[k] * xField[colIndicesField[k]]); + } + })(nnz); + + const result = await resultField.toArray(); + return result; + } + + /** + * Deep copy vector or matrix + */ + async copy(data) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const AField = ti.field(ti.f32, [m * n]); + const resultField = ti.field(ti.f32, [m * n]); + + const flatA = data.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((total) => { + for (let i of ti.ndrange(total)) { + resultField[i] = AField[i]; + } + })(m * n); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(data); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i]; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Fill vector or matrix with constant value + */ + async fill(data, value) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const resultField = ti.field(ti.f32, [m * n]); + + ti.addToKernelScope({resultField}); + + ti.kernel((total, value) => { + for (let i of ti.ndrange(total)) { + resultField[i] = value; + } + })(m * n, value); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const resultField = ti.field(ti.f32, [n]); + + ti.addToKernelScope({resultField}); + + ti.kernel((n, value) => { + for (let i of ti.ndrange(n)) { + resultField[i] = value; + } + })(n, value); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Scale vector or matrix by scalar + */ + async scale(data, scalar) { + if (Array.isArray(data[0])) { + // Matrix + const m = data.length; + const n = data[0].length; + const AField = ti.field(ti.f32, [m * n]); + const resultField = ti.field(ti.f32, [m * n]); + + const flatA = data.flat(); + AField.fromArray(flatA); + + ti.addToKernelScope({AField, resultField}); + + ti.kernel((total, scalar) => { + for (let i of ti.ndrange(total)) { + resultField[i] = AField[i] * scalar; + } + })(m * n, scalar); + + const result = await resultField.toArray(); + // Reshape + const C = []; + for (let i = 0; i < m; i++) { + C.push(result.slice(i * n, (i + 1) * n)); + } + return C; + } else { + // Vector + const n = data.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + + aField.fromArray(data); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n, scalar) => { + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] * scalar; + } + })(n, scalar); + + const result = await resultField.toArray(); + return result; + } + } + + /** + * Compute residual vector: r = b - A * x + */ + async residual(A, x, b) { + const Ax = await this.matVecMul(A, x); + return this.vecSub(b, Ax); + } + + /** + * Apply preconditioner: solve M * z = r for z + * type: 'jacobi' or 'ssor' + */ + async preconditioner(A, r, type = 'jacobi', omega = 1.0) { + const n = r.length; + + if (type === 'jacobi') { + // Jacobi: M = diag(A), so z_i = r_i / A_ii + const diag = await this.diagonal(A); + const invDiag = diag.map(d => 1.0 / d); + return this.vecMul(invDiag, r); + } else if (type === 'ssor') { + // SSOR: Simplified Symmetric Successive Over-Relaxation + // This is a basic implementation; full SSOR would require forward/backward sweeps + const diag = await this.diagonal(A); + const invDiag = diag.map(d => omega / d); + + // For simplicity, approximate with Jacobi-like application + // Full SSOR would need iterative application or matrix splitting + return this.vecMul(invDiag, r); + } else { + throw new Error(`Unsupported preconditioner type: ${type}`); + } + } + + /** + * Conjugate Gradient solver: solve A * x = b + * Returns approximate solution x + */ + async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + const n = b.length; + let x = x0 ? await this.copy(x0) : new Array(n).fill(0.0); + + // Initial residual r = b - A*x + let r = await this.residual(A, x, b); + let rr = await this.dotProduct(r, r); + let rnorm0 = Math.sqrt(rr); + + console.log(`CG: Initial residual norm: ${rnorm0}`); + + if (rnorm0 < tol) { + console.log(`CG: Already converged`); + return x; + } + + // Initial search direction + let p = preconditionerType ? await this.preconditioner(A, r, preconditionerType) : await this.copy(r); + + for (let iter = 0; iter < maxIter; iter++) { + // Compute A*p + const Ap = await this.matVecMul(A, p); + + // Compute p·Ap + const pAp = await this.dotProduct(p, Ap); + + if (Math.abs(pAp) < 1e-16) { + console.log(`CG: p^T * A * p is too small (${pAp}), stopping`); + break; + } + + // Compute alpha = (r·r) / (p·Ap) + const alpha = rr / pAp; + + // Update solution: x = x + alpha*p + const alpha_p = await this.scale(p, alpha); + x = await this.vecAdd(x, alpha_p); + + // Update residual: r = r - alpha*A*p + const alpha_Ap = await this.scale(Ap, alpha); + r = await this.vecSub(r, alpha_Ap); + + // Compute new r·r + const rr_new = await this.dotProduct(r, r); + const rnorm = Math.sqrt(rr_new); + + console.log(`CG: Iteration ${iter + 1}, residual norm: ${rnorm}`); + + // Check convergence + if (rnorm < tol * rnorm0) { + console.log(`CG: Converged in ${iter + 1} iterations`); + break; + } + + // Compute beta = (r_new·r_new) / (r_old·r_old) + const beta = rr_new / rr; + + // Update search direction: p = r + beta*p (or z + beta*p if preconditioned) + if (preconditionerType) { + const z = await this.preconditioner(A, r, preconditionerType); + const beta_p = await this.scale(p, beta); + p = await this.vecAdd(z, beta_p); + } else { + const beta_p = await this.scale(p, beta); + p = await this.vecAdd(r, beta_p); + } + + // Update rr for next iteration + rr = rr_new; + } + + return x; + } + + /** + * Jacobi iterative solver: solve A * x = b + * Returns approximate solution x + */ + async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { + const n = b.length; + let x = await this.copy(x0); + let x_new = await this.copy(x0); + + const diag = await this.diagonal(A); + + for (let iter = 0; iter < maxIter; iter++) { + // Compute residual r = b - A*x + const Ax = await this.matVecMul(A, x); + const r = await this.vecSub(b, Ax); + + // Check convergence + const rnorm = await this.norm(r); + console.log(`Jacobi: Iteration ${iter + 1}, residual norm: ${rnorm}`); + + if (rnorm < tol) { + console.log(`Jacobi: Converged in ${iter + 1} iterations`); + return x; + } + + // Jacobi update: x_new[i] = x[i] + r[i] / A[i][i] + for (let i = 0; i < n; i++) { + x_new[i] = x[i] + r[i] / diag[i]; + } + + // Swap references + [x, x_new] = [x_new, x]; + } + + console.log(`Jacobi: Did not converge in ${maxIter} iterations`); + return x; + } + + async destroy() { + if (this.initialized) { + // Clean up Taichi.js resources and WebGPU context + if (typeof ti.destroy === 'function') { + await ti.destroy(); + } + this.initialized = false; + } + } + +} diff --git a/src/vendor/taichi.esm.js b/src/vendor/taichi.esm.js new file mode 100644 index 0000000..2efa091 --- /dev/null +++ b/src/vendor/taichi.esm.js @@ -0,0 +1,16 @@ +var e,t,r,n,i,a=Object.freeze({__proto__:null,get engine(){return Mc},get types(){return Jc},get init(){return ie},get texture(){return Sr},get canvasTexture(){return Dr},get depthTexture(){return Cr},get Texture(){return S},get CubeTexture(){return T},get WrapMode(){return n},get Canvas(){return Er},get Timer(){return kr},get runAllTests(){return Uc},get addToKernelScope(){return cr},get clearKernelScope(){return lr},get template(){return ur},get kernel(){return dr},get classKernel(){return _r},get func(){return pr},get sync(){return fr},get i32(){return mr},get f32(){return gr},get field(){return yr},get Vector(){return hr},get Matrix(){return vr},get Struct(){return br},get materializeFields(){return xr},get range(){return Nr},get ndrange(){return wr},get inputVertices(){return Fr},get inputFragments(){return Pr},get neg(){return Or},get add(){return Mr},get sub(){return Lr},get mul(){return Rr},get div(){return Br},get normSqr(){return Jr},get norm(){return jr},get normalized(){return Ur},get dot(){return Vr},get cross(){return Kr},get matmul(){return zr},get transpose(){return Gr},get inverse(){return qr},get polarDecompose2D(){return Wr},get outputVertex(){return Hr},get outputPosition(){return Qr},get clearColor(){return Xr},get useDepth(){return $r},get outputColor(){return Yr},get outputDepth(){return Zr},get discard(){return en},get textureSample(){return tn},get textureSampleLod(){return rn},get textureSampleCompare(){return nn},get textureLoad(){return an},get textureStore(){return on},get getVertexIndex(){return sn},get getInstanceIndex(){return cn},get getFragCoord(){return ln},get dpdx(){return un},get dpdy(){return dn},get lookAt(){return _n},get perspective(){return pn},get ortho(){return fn},get rotateAxisAngle(){return mn},get translate(){return gn},get scale(){return yn},get mergeStructs(){return hn},get bitcast_i32(){return vn},get bitcast_f32(){return bn},get not(){return xn},get rsqrt(){return Sn},get Static(){return Dn}});function o(...e){console.log(...e)}function s(...e){throw console.error("FATAL ERROR: ",...e),"Taichi JS ERROR "}function c(e,...t){e||s("Assertion failed",t)}!function(e){e.i32="i32",e.f32="f32"}(e||(e={})),function(e){e.Scalar="Scalar",e.Vector="Vector",e.Matrix="Matrix",e.Struct="Struct",e.Pointer="Pointer",e.Void="Void",e.Function="Function",e.HostObjectReference="HostObjectReference"}(t||(t={}));class l{constructor(){}getCategory(){return s("calling getCategory from Type2 base"),t.Scalar}equals(e){return s("calling equals from Type2 base"),!1}getPrimitivesList(){return s("calling getPrimitivesList from Type base"),[]}}class u extends l{constructor(e){super(),this.primitiveType_=e}getCategory(){return t.Scalar}getPrimitiveType(){return this.primitiveType_}getPrimitivesList(){return[this.primitiveType_]}equals(e){return e.getCategory()==this.getCategory()&&this.getPrimitiveType()===e.getPrimitiveType()}}class d extends l{constructor(e,t){super(),this.primitiveType_=e,this.numRows_=t}getCategory(){return t.Vector}getPrimitiveType(){return this.primitiveType_}getNumRows(){return this.numRows_}getPrimitivesList(){let e=[];for(let t=0;t=1,"texture dimensions must be >= 1 and <= 3"),c(1===e||2===e||4===e,"texture dimensions must be 1, 2, or 4"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(t,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!0,1),this.sampleCount>1&&(this.multiSampledRenderTexture=ne.getCurrentProgram().runtime.createGPUTexture(t,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,r)),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView(),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!1,n)}getGPUTextureFormat(){switch(this.numComponents){case 1:return"r16float";case 2:return"rg16float";case 4:return"rgba16float";default:return s("unsupported component count"),"rgba16float"}}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}getTextureDimensionality(){switch(this.dimensions.length){case 2:return r.Dim2d;case 3:return r.Dim3d;default:return s("unsupported dimensionality"),r.Dim2d}}async copyFrom(e){c(this.getTextureDimensionality()===e.getTextureDimensionality(),"texture dimensionality mismatch");for(let t=0;t1&&(this.multiSampledRenderTexture=ne.getCurrentProgram().runtime.createGPUTexture(this.dimensions,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,t))}getGPUTextureFormat(){return this.format}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.context.getCurrentTexture()}getGPUTextureView(){return this.context.getCurrentTexture().createView()}getGPUSampler(){return this.sampler}getTextureDimensionality(){return r.Dim2d}}class C extends x{constructor(e,t){super(),this.dimensions=e,c(2===e.length,"depth texture must be 2D"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(e,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,t),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView(),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!0,{}),this.sampleCount=t}getGPUTextureFormat(){return"depth32float"}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getTextureDimensionality(){return r.Dim2d}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}}class T extends x{constructor(e){super(),this.dimensions=e,c(2===e.length,"cube texture must be 2D"),this.texture=ne.getCurrentProgram().runtime.createGPUTexture(e,this.getTextureDimensionality(),this.getGPUTextureFormat(),this.canUseAsRengerTarget(),!1,1),ne.getCurrentProgram().addTexture(this),this.textureView=this.texture.createView({dimension:"cube"}),this.sampler=ne.getCurrentProgram().runtime.createGPUSampler(!1,{}),this.sampleCount=1}getGPUTextureFormat(){return"rgba16float"}canUseAsRengerTarget(){return!0}getGPUTexture(){return this.texture}getTextureDimensionality(){return r.DimCube}getGPUTextureView(){return this.textureView}getGPUSampler(){return this.sampler}static async createFromBitmap(e){for(let t of e)c(t.width===e[0].width&&t.height===e[0].height,"all 6 images in a cube texture must have identical dimensions");let t=[e[0].width,e[0].height],r=new T(t);return await ne.getCurrentProgram().runtime.copyImageBitmapsToCubeTexture(e,r.getGPUTexture()),r}static async createFromHtmlImage(e){let t=[];for(let r of e)t.push(await createImageBitmap(r));return await this.createFromBitmap(t)}static async createFromURL(e){let t=[];for(let r of e){let e=new Image;e.src=r,await e.decode(),t.push(e)}return await this.createFromHtmlImage(t)}}function E(e){return e instanceof S||e instanceof D||e instanceof C||e instanceof T}!function(e){e[e.Root=0]="Root",e[e.RootAtomic=1]="RootAtomic",e[e.GlobalTmps=2]="GlobalTmps",e[e.GlobalTmpsAtomic=3]="GlobalTmpsAtomic",e[e.Args=4]="Args",e[e.RandStates=5]="RandStates",e[e.Rets=6]="Rets",e[e.Texture=7]="Texture",e[e.Sampler=8]="Sampler",e[e.StorageTexture=9]="StorageTexture"}(i||(i={}));class k{constructor(e,t){this.resourceType=e,this.resourceID=t}equals(e){return this.resourceID===e.resourceID&&this.resourceType===e.resourceType}}class A{constructor(e,t){this.info=e,this.binding=t}equals(e){return this.info.equals(e.info)&&this.binding===e.binding}}class N{constructor(e,t,r,n=[]){this.code=e,this.workgroupSize=t,this.numWorkgroups=r,this.bindings=n}}class w{constructor(e="",t=[]){this.code=e,this.bindings=t}}class F{constructor(e="",t=[]){this.code=e,this.bindings=t}}class P{constructor(e,t,r=new f({}),n=null,i=null,a=null){this.vertex=e,this.fragment=t,this.interpolatedType=r,this.vertexBuffer=n,this.indexBuffer=i,this.indirectBuffer=a,this.indirectCount=1,this.bindings=this.getBindings()}getBindings(){let e=[],t=this.vertex.bindings.concat(this.fragment.bindings);for(let r of t){let t=!1;for(let n of e)if(r.equals(n)){t=!0;break}t||e.push(r)}return e}}class I{constructor(e,t,r,n=null){this.tasksParams=e,this.argTypes=t,this.returnType=r,this.renderPassParams=n}}class O{constructor(e,t){this.params=e,this.pipeline=null,this.bindGroup=null,this.createPipeline(t)}createPipeline(e){let t=this.params.code;this.pipeline=e.getGPUComputePipeline({compute:{module:e.getGPUShaderModule(t),entryPoint:"main"},layout:"auto"})}}class M{constructor(e,t,r){this.params=e,this.pipeline=null,this.bindGroup=null,this.createPipeline(r,t)}getGPUVertexBufferStates(){let t=[],r=this.params.vertexBuffer.elementType.getPrimitivesList();for(let i=0;i0?r=t.colorAttachments[0].texture.sampleCount:null!==t.depthAttachment&&(r=t.depthAttachment.texture.sampleCount);for(let e of t.colorAttachments)e.texture.sampleCount!=r&&s("all render target attachments (color or depth) must have the same sample count");null!==t.depthAttachment&&t.depthAttachment.texture.sampleCount!==r&&s("all render target attachments (color or depth) must have the same sample count");let n={vertex:{module:e.getGPUShaderModule(this.params.vertex.code),entryPoint:"main",buffers:[this.getGPUVertexBufferStates()]},fragment:{module:e.getGPUShaderModule(this.params.fragment.code),entryPoint:"main",targets:this.getGPUColorTargetStates(t)},primitive:{topology:"triangle-list",cullMode:"none"},multisample:{count:r},layout:"auto"};if(null!==t.depthAttachment){let e=!0;!1===t.depthAttachment.storeDepth&&(e=!1),n.depthStencil={depthWriteEnabled:e,depthCompare:"less-equal",format:t.depthAttachment.texture.getGPUTextureFormat()}}this.pipeline=e.getGPURenderPipeline(n)}}class L{constructor(e){this.params=e}getGPURenderPassDescriptor(){let e=[];for(let t of this.params.colorAttachments){let r,n=t.texture.getGPUTextureView();if(t.texture.sampleCount>1&&(t.texture instanceof D||t.texture instanceof S)&&(n=t.texture.multiSampledRenderTexture.createView(),r=t.texture.getGPUTextureView()),void 0===t.clearColor)e.push({view:n,resolveTarget:r,clearValue:{r:0,g:0,b:0,a:1},loadOp:"load",storeOp:"store"});else{let i={r:t.clearColor[0],g:t.clearColor[1],b:t.clearColor[2],a:t.clearColor[3]};e.push({view:n,resolveTarget:r,clearValue:i,loadOp:"clear",storeOp:"store"})}}let t=this.params.depthAttachment;return null===t?{colorAttachments:e}:{colorAttachments:e,depthStencilAttachment:{view:t.texture.getGPUTextureView(),depthClearValue:t.clearDepth,depthLoadOp:void 0===t.clearDepth?"load":"clear",depthStoreOp:!0===t.storeDepth?"store":"discard"}}}}class R{constructor(e=[],t=[],r=new m,n=null){this.tasks=e,this.argTypes=t,this.returnType=r,this.renderPassInfo=n}}function B(e,t){return Math.ceil(e/t)}function J(e){let t=0;if(e&&!(e&e-1))return e;for(;0!=e;)e>>=1,t+=1;return 1<1024)return!1;switch(typeof e){case"object":if(!e)return!1;if(Array.isArray(e)){for(let r of e)if(!q(r,t+1))return!1;return!0}for(let r in e)if(!q(e[r],t+1))return!1;return!0;case"number":case"boolean":return!0;default:return!1}}class W{constructor(e,t,r,n,i){this.snodeTree=e,this.offsetBytes=t,this.sizeBytes=r,this.dimensions=n,this.elementType=i}async toArray1D(){if(h.isTensorType(this.elementType)){let t=await ne.getCurrentProgram().runtime.deviceToHost(this);return h.getPrimitiveType(this.elementType)===e.f32?t.floatArray:t.intArray}return s("toArray1D can only be used for scalar/vector/matrix fields"),[]}async toInt32Array(){return(await ne.getCurrentProgram().runtime.deviceToHost(this)).intArray}ensureMaterialized(){ne.getCurrentProgram().materializeCurrentTree()}async toArray(){this.ensureMaterialized();let e=await ne.getCurrentProgram().runtime.deviceToHost(this),t=function(e,t,r){let n=r.getPrimitivesList().length,i=j(e,n),a=j(t,n),o=[];for(let e=0;e0;--e)r=j(r,t[e]);return r}(t,this.dimensions)}async get(e){this.ensureMaterialized(),e.length!==this.dimensions.length&&s(`indices dimensions mismatch, expecting ${this.dimensions.length}, received ${e.length}`);for(let t=0;t=e){t=r;break}return t?(this.buffers.delete(t),t):{buffer:this.device.createBuffer({size:e,usage:this.usage}),size:e}}returnBuffer(e){this.buffers.add(e)}}Q.pools=new Map;class X{constructor(){this.adapter=null,this.device=null,this.kernels=[],this.materializedTrees=[],this.textures=[],this.globalTmpsBuffer=null,this.randStatesBuffer=null,this.pipelineCache=null}async init(){await this.createDevice(),this.createGlobalTmpsBuffer(),this.createRandStatesBuffer()}async createDevice(){let e=()=>{alert("Webgpu not supported. Please ensure that you have Chrome v113+")};navigator.gpu||e();const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"});t||e();const r=[];t.features.has("indirect-first-instance")&&r.push("indirect-first-instance");const n=await t.requestDevice({requiredFeatures:r});n||e(),this.device=n,this.adapter=t,this.pipelineCache=new H(n)}createKernel(e){let t=new R;for(let r of e.tasksParams)if(r instanceof N){let e=new O(r,this);t.tasks.push(e)}else if(r instanceof P){c(null!==e.renderPassParams);let n=new M(r,e.renderPassParams,this);t.tasks.push(n)}return null!==e.renderPassParams&&(t.renderPassInfo=new L(e.renderPassParams)),t.argTypes=e.argTypes,t.returnType=e.returnType,t}async sync(){await this.device.queue.onSubmittedWorkDone()}async launchKernel(e,...r){c(r.length===e.argTypes.length,`Kernel requires ${e.argTypes.length} arguments, but ${r.length} is provided`);let n,a,o,s=!1,l=!1,u=0,d=0;for(let t of e.tasks)for(let e of t.params.bindings)e.info.resourceType===i.Args&&(s=!0),e.info.resourceType===i.Rets&&(l=!0);if(s){let t=0;for(let r of e.argTypes)t+=r.getPrimitivesList().length;let i=new Int32Array(t),a=0;for(let t=0;t{m&&m.end(),m=null,y=new ee},b=()=>{g&&g.end(),g=null,h=new ee},x=new Map;for(let t of e.tasks)if(t instanceof M&&t.params.indirectBuffer&&(1!==t.params.indirectCount||!this.supportsIndirectFirstInstance())){let e=new Z(t.params.indirectBuffer,t.params.indirectCount);await e.fillInfo(),x.set(t,e)}for(let t of e.tasks)if(t.bindGroup=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:this.getGPUBindGroupEntries(t.params.bindings,n,null==a?void 0:a.buffer)}),t instanceof O){b(),m||(m=f.beginComputePass(),y=new ee),y.computePipeline!==t.pipeline&&(m.setPipeline(t.pipeline),y.computePipeline=t.pipeline),m.setBindGroup(0,t.bindGroup),t.params.workgroupSize;let e=t.params.numWorkgroups;m.dispatchWorkgroups(e)}else if(t instanceof M){if(v(),g||(c(null!==e.renderPassInfo,"render pass info is null"),g=f.beginRenderPass(e.renderPassInfo.getGPURenderPassDescriptor()),h=new ee),h.renderPipeline!==t.pipeline&&(g.setPipeline(t.pipeline),h.renderPipeline=t.pipeline),g.setBindGroup(0,t.bindGroup),t.params.vertexBuffer){let e=this.materializedTrees[t.params.vertexBuffer.snodeTree.treeId];g.setVertexBuffer(0,e.rootBuffer,t.params.vertexBuffer.offsetBytes,t.params.vertexBuffer.sizeBytes)}if(t.params.indexBuffer){let e=this.materializedTrees[t.params.indexBuffer.snodeTree.treeId];g.setIndexBuffer(e.rootBuffer,"uint32",t.params.indexBuffer.offsetBytes,t.params.indexBuffer.sizeBytes)}if(t.params.indirectBuffer)if(1===t.params.indirectCount&&this.supportsIndirectFirstInstance()&&t.params.indirectBuffer instanceof W){let e=this.materializedTrees[t.params.indirectBuffer.snodeTree.treeId];g.drawIndexedIndirect(e.rootBuffer,t.params.indirectBuffer.offsetBytes)}else{c(x.has(t));let e=x.get(t);for(let t of e.commands)g.drawIndexed(t.indexCount,t.instanceCount,t.firstIndex,t.baseVertex,t.firstInstance)}else t.params.indexBuffer?g.drawIndexed(t.getVertexCount()):g.draw(t.getVertexCount())}if(v(),b(),this.device.queue.submit([f.finish()]),await this.sync(),n&&this.recycleArgsBuffer(n,u),e.returnType.getCategory()!==t.Void){c(null!==a&&null!==o,"missing rets buffer!");let t=this.device.createCommandEncoder();t.copyBufferToBuffer(a.buffer,0,o.buffer,0,d),this.device.queue.submit([t.finish()]),await this.device.queue.onSubmittedWorkDone(),await o.buffer.mapAsync(GPUMapMode.READ,0,d);let r=function(e,t){let r=new Float32Array(e.buffer);return U(Array.from(e),Array.from(r),t)}(new Int32Array(o.buffer.getMappedRange(0,d)),e.returnType);return o.buffer.unmap(),_.returnBuffer(a),p.returnBuffer(o),r}}addArgsBuffer(e){return this.device.createBuffer({size:e,usage:GPUBufferUsage.STORAGE,mappedAtCreation:!0})}recycleArgsBuffer(e,t){e.destroy()}createGlobalTmpsBuffer(){this.globalTmpsBuffer=this.device.createBuffer({size:65536,usage:GPUBufferUsage.STORAGE})}createRandStatesBuffer(){this.randStatesBuffer=this.device.createBuffer({size:1048576,usage:GPUBufferUsage.STORAGE})}getGPUBindGroupEntries(e,t,r){let n=[];for(let a of e){let e,o,l;switch(a.info.resourceType){case i.Root:case i.RootAtomic:e=this.materializedTrees[a.info.resourceID].rootBuffer;break;case i.GlobalTmps:case i.GlobalTmpsAtomic:e=this.globalTmpsBuffer;break;case i.Args:c(null!==t),e=t;break;case i.Rets:c(null!==r),e=r;break;case i.RandStates:e=this.randStatesBuffer;break;case i.StorageTexture:case i.Texture:o=this.textures[a.info.resourceID].getGPUTextureView();break;case i.Sampler:l=this.textures[a.info.resourceID].getGPUSampler()}e?n.push({binding:a.binding,resource:{buffer:e}}):o?n.push({binding:a.binding,resource:o}):l?n.push({binding:a.binding,resource:l}):s("couldn't identify resource")}return n}materializeTree(e){let t=e.size,r=this.device.createBuffer({size:t,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC|GPUBufferUsage.INDIRECT});e.rootBuffer=r,this.materializedTrees.push(e)}addTexture(e){this.textures.push(e)}createGPUTexture(e,t,n,i,a,o){return this.device.createTexture((()=>{let l=GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING;if(a&&(l|=GPUTextureUsage.STORAGE_BINDING),1===e.length)return s("1d texture not supported yet"),{size:{width:e[0]},dimension:"1d",format:n,usage:l};if(2===e.length){c(t===r.Dim2d||t===r.DimCube),i&&(l|=GPUTextureUsage.RENDER_ATTACHMENT);let a={width:e[0],height:e[1]};return t===r.DimCube&&(a.depthOrArrayLayers=6),{size:a,dimension:"2d",format:n,usage:l,sampleCount:o}}return{size:{width:e[0],height:e[1],depthOrArrayLayers:e[2]},dimension:"3d",format:n,usage:l}})())}createGPUSampler(e,t){let r={addressModeU:t.wrapModeU||"repeat",addressModeV:t.wrapModeV||"repeat",addressModeW:t.wrapModeW||"repeat",minFilter:"linear",magFilter:"linear",mipmapFilter:"linear",maxAnisotropy:16};return e&&(r.compare="less-equal"),this.device.createSampler(r)}createGPUCanvasContext(e){let t=e.getContext("webgpu");null===t&&s("canvas webgpu context is null");let r=navigator.gpu.getPreferredCanvasFormat();return t.configure({device:this.device,format:r,alphaMode:"opaque"}),[t,r]}async deviceToHost(e,t=0,r=0){0===r&&(r=e.sizeBytes);let n=Q.getPool(this.device,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);const i=n.getBuffer(r);let a=this.device.createCommandEncoder();a.copyBufferToBuffer(this.materializedTrees[e.snodeTree.treeId].rootBuffer,e.offsetBytes+t,i.buffer,0,r),this.device.queue.submit([a.finish()]),await this.sync(),await i.buffer.mapAsync(GPUMapMode.READ,0,r);let o=i.buffer.getMappedRange(0,r),s=Array.from(new Int32Array(o)),c=Array.from(new Float32Array(o));return i.buffer.unmap(),n.returnBuffer(i),new $(s,c)}async hostToDevice(e,t,r=0){const n=this.device.createBuffer({size:t.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0});new Int32Array(n.getMappedRange()).set(t),n.unmap();let i=this.device.createCommandEncoder();i.copyBufferToBuffer(n,0,this.materializedTrees[e.snodeTree.treeId].rootBuffer,e.offsetBytes+r,t.byteLength),this.device.queue.submit([i.finish()]),await this.device.queue.onSubmittedWorkDone(),n.destroy()}getRootBuffer(e){return this.materializedTrees[e].rootBuffer}async copyImageBitmapToTexture(e,t){let r={source:e},n={texture:t},i={width:e.width,height:e.height};this.device.queue.copyExternalImageToTexture(r,n,i),await this.device.queue.onSubmittedWorkDone()}async copyImageBitmapsToCubeTexture(e,t){for(let r=0;r<6;++r){let n=e[r],i={source:n},a={texture:t,origin:[0,0,r]},o={width:n.width,height:n.height};this.device.queue.copyExternalImageToTexture(i,a,o)}await this.device.queue.onSubmittedWorkDone()}async copyTextureToTexture(e,t,r){let n=this.device.createCommandEncoder();n.copyTextureToTexture({texture:e},{texture:t},r),this.device.queue.submit([n.finish()]),await this.device.queue.onSubmittedWorkDone()}getGPUShaderModule(e){return this.pipelineCache.getOrCreateShaderModule(e)}getGPUComputePipeline(e){return this.pipelineCache.getOrCreateComputePipeline(e)}getGPURenderPipeline(e){return this.pipelineCache.getOrCreateRenderPipeline(e)}supportsIndirectFirstInstance(){return this.adapter.features.has("indirect-first-instance")}}class ${constructor(e,t){this.intArray=e,this.floatArray=t}}class Y{constructor(e,t,r,n,i){this.indexCount=e,this.instanceCount=t,this.firstIndex=r,this.baseVertex=n,this.firstInstance=i}}class Z{constructor(e,t){this.indirectBuffer=e,this.indirectCount=t,this.commands=[]}async fillInfo(){this.indirectCount instanceof W&&(this.indirectCount=(await this.indirectCount.toInt32Array())[0]);let e=[];e=this.indirectBuffer instanceof W?await this.indirectBuffer.toInt32Array():await this.indirectBuffer,this.commands=[];for(let t=0;tFunction.apply(this.thisObj,[...Object.keys(e),"expr","return eval('expr = undefined;' + expr)"]).apply(this.thisObj,[...Object.values(e),t]);try{return t(this.obj,e)}catch(e){return}}clone(){let e={};for(let t in this.obj)e[t]=this.obj[t];let t=new re;return t.obj=e,t.thisObj=this.thisObj,t}}class ne{constructor(){this.options={printIR:!1,printWGSL:!1},this.runtime=null,this.partialTree=new te,this.partialTree.treeId=0,this.kernelScope=new re}async init(e){e&&void 0!==e.printIR&&(this.options.printIR=e.printIR),e&&void 0!==e.printWGSL&&(this.options.printWGSL=e.printWGSL),await this.materializeRuntime(),this.clearKernelScope()}static getCurrentProgram(){return ne.instance||(ne.instance=new ne),ne.instance}async materializeRuntime(){this.runtime||(this.runtime=new X,await this.runtime.init())}materializeCurrentTree(){if(0===this.partialTree.size)return;null==this.runtime&&this.materializeRuntime(),this.runtime.materializeTree(this.partialTree);let e=this.partialTree.treeId+1;this.partialTree=new te,this.partialTree.treeId=e}addTexture(e){let t=this.runtime.textures.length;e.textureId=t,this.runtime.addTexture(e)}addToKernelScope(e){for(let t in e)this.kernelScope.addStored(t,e[t])}clearKernelScope(){this.kernelScope=new re}}async function ie(e){await ne.getCurrentProgram().init(e)}var ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oe(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function se(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ce={exports:{}},le=Object.freeze({__proto__:null,default:{}}),ue=oe(le); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +!function(e){var t,r=ae&&ae.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0;for(var r=0,n=e;r>1);switch(i(r(e[c],c),t)){case-1:o=c+1;break;case 0:return c;case 1:s=c-1}}return~o}function g(e,t,r,n,i){if(e&&e.length>0){var a=e.length;if(a>0){var o=void 0===n||n<0?0:n,s=void 0===i||o+i>a-1?a-1:o+i,c=void 0;for(arguments.length<=2?(c=e[o],o++):c=r;o<=s;)c=t(c,e[o],o),o++;return c}}return r}e.getIterator=function(t){if(t){if(E(t))return p(t);if(t instanceof e.Map)return t.entries();if(t instanceof e.Set)return t.values();throw new Error("Iteration not supported.")}},e.emptyArray=[],e.emptyMap=new e.Map,e.emptySet=new e.Set,e.length=function(e){return e?e.length:0},e.forEach=function(e,t){if(e)for(var r=0;r=0;r--){var n=t(e[r],r);if(n)return n}},e.firstDefined=function(e,t){if(void 0!==e)for(var r=0;r=0;r--){var n=e[r];if(t(n,r))return n}},e.findIndex=function(e,t,r){for(var n=r||0;n=0;n--)if(t(e[n],n))return n;return-1},e.findMap=function(t,r){for(var n=0;n0&&e.Debug.assertGreaterThanOrEqual(n(r[o],r[o-1]),0);t:for(var s=a;as&&e.Debug.assertGreaterThanOrEqual(n(t[a],t[a-1]),0),n(r[o],t[a])){case-1:i.push(r[o]);continue e;case 0:continue e;case 1:continue t}}return i},e.sum=function(e,t){for(var r=0,n=0,i=e;nt?1:0}function R(e,t){return O(e,t)}e.toFileNameLowerCase=P,e.notImplemented=function(){throw new Error("Not implemented")},e.memoize=function(e){var t;return function(){return e&&(t=e(),e=void 0),t}},e.memoizeOne=function(t){var r=new e.Map;return function(e){var n="".concat(typeof e,":").concat(e),i=r.get(n);return void 0!==i||r.has(n)||(i=t(e),r.set(n,i)),i}},e.compose=function(e,t,r,n,i){if(i){for(var a=[],o=0;o0?1:0}function i(e){var t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant"}).compare;return function(e,r){return n(e,r,t)}}function a(e){return void 0!==e?o():function(e,r){return n(e,r,t)};function t(e,t){return e.localeCompare(t)}}function o(){return function(t,r){return n(t,r,e)};function e(e,r){return t(e.toUpperCase(),r.toUpperCase())||t(e,r)}function t(e,t){return et?1:0}}}();function U(e,t,r){for(var n=new Array(t.length+1),i=new Array(t.length+1),a=r+.01,o=0;o<=t.length;o++)n[o]=o;for(o=1;o<=e.length;o++){var s=e.charCodeAt(o-1),c=Math.ceil(o>r?o-r:1),l=Math.floor(t.length>r+o?r+o:t.length);i[0]=o;for(var u=o,d=1;dr)return;var f=n;n=i,i=f}var m=n[t.length];return m>r?void 0:m}function V(e,t){var r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function K(e,t){for(var r=t;r=r.length+n.length&&q(t,r)&&V(t,n)}function H(e,t,r,n){for(var i=0,a=e[n];i0;r--){var n=e.charCodeAt(r);if(n>=48&&n<=57)do{--r,n=e.charCodeAt(r)}while(r>0&&n>=48&&n<=57);else{if(!(r>4)||110!==n&&78!==n)break;if(--r,105!==(n=e.charCodeAt(r))&&73!==n)break;if(--r,109!==(n=e.charCodeAt(r))&&77!==n)break;--r,n=e.charCodeAt(r)}if(45!==n&&46!==n)break;t=r}return t===e.length?e:e.slice(0,t)},e.orderedRemoveItem=function(e,t){for(var r=0;ri&&(i=c.prefix.length,n=s)}return n},e.startsWith=q,e.removePrefix=function(e,t){return q(e,t)?e.substr(t.length):e},e.tryRemovePrefix=function(e,t,r){return void 0===r&&(r=A),q(r(e),r(t))?e.substring(t.length):void 0},e.and=function(e,t){return function(r){return e(r)&&t(r)}},e.or=function(){for(var e=[],t=0;t=0&&e.isWhiteSpaceLike(t.charCodeAt(r));)r--;return t.slice(0,r+1)},e.trimStringStart=String.prototype.trimStart?function(e){return e.trimStart()}:function(e){return e.replace(/^\s+/g,"")}}(c||(c={})),function(e){var t;!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose"}(t=e.LogLevel||(e.LogLevel={})),function(r){var n,i,a=0;function o(){return null!=n?n:n=new e.Version(e.version)}function s(e){return r.currentLogLevel<=e}function c(e,t){r.loggingHost&&s(e)&&r.loggingHost.log(e,t)}function l(e){c(t.Info,e)}r.currentLogLevel=t.Warning,r.isDebugging=!1,r.getTypeScriptVersion=o,r.shouldLog=s,r.log=l,i=l=r.log||(r.log={}),i.error=function(e){c(t.Error,e)},i.warn=function(e){c(t.Warning,e)},i.log=function(e){c(t.Info,e)},i.trace=function(e){c(t.Verbose,e)};var u={};function d(e){return a>=e}function _(t,n){return!!d(t)||(u[n]={level:t,assertion:r[n]},r[n]=e.noop,!1)}function p(e,t){var r=new Error(e?"Debug Failure. ".concat(e):"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(r,t||p),r}function f(e,t,r,n){e||(t=t?"False expression: ".concat(t):"False expression.",r&&(t+="\r\nVerbose Debug Information: "+("string"==typeof r?r:r())),p(t,n||f))}function m(e,t,r){null==e&&p(t,r||m)}function g(e,t,r){for(var n=0,i=e;n0&&0===i[0][0]?i[0][1]:"0";if(n){for(var a="",o=t,s=0,c=i;st)break;0!==u&&u&t&&(a="".concat(a).concat(a?"|":"").concat(d),o&=~u)}if(0===o)return a}else for(var _=0,p=i;_n)for(var i=0,o=e.getOwnKeys(u);i=c.level&&(r[s]=c,u[s]=void 0)}},r.shouldAssert=d,r.fail=p,r.failBadSyntaxKind=function e(t,r,n){return p("".concat(r||"Unexpected node.","\r\nNode ").concat(v(t.kind)," was unexpected."),n||e)},r.assert=f,r.assertEqual=function e(t,r,n,i,a){if(t!==r){var o=n?i?"".concat(n," ").concat(i):n:"";p("Expected ".concat(t," === ").concat(r,". ").concat(o),a||e)}},r.assertLessThan=function e(t,r,n,i){t>=r&&p("Expected ".concat(t," < ").concat(r,". ").concat(n||""),i||e)},r.assertLessThanOrEqual=function e(t,r,n){t>r&&p("Expected ".concat(t," <= ").concat(r),n||e)},r.assertGreaterThanOrEqual=function e(t,r,n){t= ").concat(r),n||e)},r.assertIsDefined=m,r.checkDefined=function e(t,r,n){return m(t,r,n||e),t},r.assertEachIsDefined=g,r.checkEachDefined=function e(t,r,n){return g(t,r,n||e),t},r.assertNever=function t(r,n,i){void 0===n&&(n="Illegal value:");var a="object"==typeof r&&e.hasProperty(r,"kind")&&e.hasProperty(r,"pos")?"SyntaxKind: "+v(r.kind):JSON.stringify(r);return p("".concat(n," ").concat(a),i||t)},r.assertEachNode=function t(r,n,i,a){_(1,"assertEachNode")&&f(void 0===n||e.every(r,n),i||"Unexpected node.",(function(){return"Node array did not pass test '".concat(y(n),"'.")}),a||t)},r.assertNode=function e(t,r,n,i){_(1,"assertNode")&&f(void 0!==t&&(void 0===r||r(t)),n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," did not pass test '").concat(y(r),"'.")}),i||e)},r.assertNotNode=function e(t,r,n,i){_(1,"assertNotNode")&&f(void 0===t||void 0===r||!r(t),n||"Unexpected node.",(function(){return"Node ".concat(v(t.kind)," should not have passed test '").concat(y(r),"'.")}),i||e)},r.assertOptionalNode=function e(t,r,n,i){_(1,"assertOptionalNode")&&f(void 0===r||void 0===t||r(t),n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," did not pass test '").concat(y(r),"'.")}),i||e)},r.assertOptionalToken=function e(t,r,n,i){_(1,"assertOptionalToken")&&f(void 0===r||void 0===t||t.kind===r,n||"Unexpected node.",(function(){return"Node ".concat(v(null==t?void 0:t.kind)," was not a '").concat(v(r),"' token.")}),i||e)},r.assertMissingNode=function e(t,r,n){_(1,"assertMissingNode")&&f(void 0===t,r||"Unexpected node.",(function(){return"Node ".concat(v(t.kind)," was unexpected'.")}),n||e)},r.type=function(e){},r.getFunctionName=y,r.formatSymbol=function(t){return"{ name: ".concat(e.unescapeLeadingUnderscores(t.escapedName),"; flags: ").concat(C(t.flags),"; declarations: ").concat(e.map(t.declarations,(function(e){return v(e.kind)}))," }")},r.formatEnum=h,r.formatSyntaxKind=v,r.formatSnippetKind=function(t){return h(t,e.SnippetKind,!1)},r.formatNodeFlags=b,r.formatModifierFlags=x,r.formatTransformFlags=S,r.formatEmitFlags=D,r.formatSymbolFlags=C,r.formatTypeFlags=T,r.formatSignatureFlags=E,r.formatObjectFlags=k,r.formatFlowFlags=A;var N,w,F,P=!1;function I(e){return function(){if(L(),!N)throw new Error("Debugging helpers could not be loaded.");return N}().formatControlFlowGraph(e)}function O(t){"__debugFlowFlags"in t||Object.defineProperties(t,{__tsDebuggerDisplay:{value:function(){var e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return"".concat(e).concat(t?" (".concat(A(t),")"):"")}},__debugFlowFlags:{get:function(){return h(this.flags,e.FlowFlags,!0)}},__debugToString:{value:function(){return I(this)}}})}function M(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:function(e){return e=String(e).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),"NodeArray ".concat(e)}}})}function L(){if(!P){var t,r;Object.defineProperties(e.objectAllocator.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=33554432&this.flags?"TransientSymbol":"Symbol",r=-33554433&this.flags;return"".concat(t," '").concat(e.symbolName(this),"'").concat(r?" (".concat(C(r),")"):"")}},__debugFlags:{get:function(){return C(this.flags)}}}),Object.defineProperties(e.objectAllocator.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=98304&this.flags?"NullableType":384&this.flags?"LiteralType ".concat(JSON.stringify(this.value)):2048&this.flags?"LiteralType ".concat(this.value.negative?"-":"").concat(this.value.base10Value,"n"):8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":67359327&this.flags?"IntrinsicType ".concat(this.intrinsicName):1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",r=524288&this.flags?-1344&this.objectFlags:0;return"".concat(t).concat(this.symbol?" '".concat(e.symbolName(this.symbol),"'"):"").concat(r?" (".concat(k(r),")"):"")}},__debugFlags:{get:function(){return T(this.flags)}},__debugObjectFlags:{get:function(){return 524288&this.flags?k(this.objectFlags):""}},__debugTypeToString:{value:function(){var e=(void 0===t&&"function"==typeof WeakMap&&(t=new WeakMap),t),r=null==e?void 0:e.get(this);return void 0===r&&(r=this.checker.typeToString(this),null==e||e.set(this,r)),r}}}),Object.defineProperties(e.objectAllocator.getSignatureConstructor().prototype,{__debugFlags:{get:function(){return E(this.flags)}},__debugSignatureToString:{value:function(){var e;return null===(e=this.checker)||void 0===e?void 0:e.signatureToString(this)}}});for(var n=0,i=[e.objectAllocator.getNodeConstructor(),e.objectAllocator.getIdentifierConstructor(),e.objectAllocator.getTokenConstructor(),e.objectAllocator.getSourceFileConstructor()];n=0;return d?function(e,t,r,n){var i=R(e,!0,t,r,n);return function(){throw new TypeError(i)}}(t,s,u,r.message):_?function(e,t,r,n){var i=!1;return function(){i||(l.warn(R(e,!1,t,r,n)),i=!0)}}(t,s,u,r.message):e.noop}r.printControlFlowGraph=function(e){return console.log(I(e))},r.formatControlFlowGraph=I,r.attachFlowNodeDebugInfo=function(e){P&&("function"==typeof Object.setPrototypeOf?(w||O(w=Object.create(Object.prototype)),Object.setPrototypeOf(e,w)):O(e))},r.attachNodeArrayDebugInfo=function(e){P&&("function"==typeof Object.setPrototypeOf?(F||M(F=Object.create(Array.prototype)),Object.setPrototypeOf(e,F)):M(e))},r.enableDebugInfo=L,r.deprecate=function(e,t){return function(e,t){return function(){return e(),t.apply(this,arguments)}}(B(y(e),t),e)}}(e.Debug||(e.Debug={}))}(c||(c={})),function(e){var t=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,r=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,n=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,i=/^(0|[1-9]\d*)$/,a=function(){function t(t,i,a,s,c){if(void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=""),void 0===c&&(c=""),"string"==typeof t){var l=e.Debug.checkDefined(o(t),"Invalid version");t=l.major,i=l.minor,a=l.patch,s=l.prerelease,c=l.build}e.Debug.assert(t>=0,"Invalid argument: major"),e.Debug.assert(i>=0,"Invalid argument: minor"),e.Debug.assert(a>=0,"Invalid argument: patch"),e.Debug.assert(!s||r.test(s),"Invalid argument: prerelease"),e.Debug.assert(!c||n.test(c),"Invalid argument: build"),this.major=t,this.minor=i,this.patch=a,this.prerelease=s?s.split("."):e.emptyArray,this.build=c?c.split("."):e.emptyArray}return t.tryParse=function(e){var r=o(e);if(r)return new t(r.major,r.minor,r.patch,r.prerelease,r.build)},t.prototype.compareTo=function(t){return this===t?0:void 0===t?1:e.compareValues(this.major,t.major)||e.compareValues(this.minor,t.minor)||e.compareValues(this.patch,t.patch)||function(t,r){if(t===r)return 0;if(0===t.length)return 0===r.length?0:1;if(0===r.length)return-1;for(var n=Math.min(t.length,r.length),a=0;a|>=|=)?\s*([a-z0-9-+.*]+)$/i;function p(t){for(var r=[],n=0,i=e.trimString(t).split(c);n=",n.version)),y(i.major)||r.push(y(i.minor)?h("<",i.version.increment("major")):y(i.patch)?h("<",i.version.increment("minor")):h("<=",i.version)),!0)}function g(e,t,r){var n=f(t);if(!n)return!1;var i=n.version,o=n.major,s=n.minor,c=n.patch;if(y(o))"<"!==e&&">"!==e||r.push(h("<",a.zero));else switch(e){case"~":r.push(h(">=",i)),r.push(h("<",i.increment(y(s)?"major":"minor")));break;case"^":r.push(h(">=",i)),r.push(h("<",i.increment(i.major>0||y(s)?"major":i.minor>0||y(c)?"minor":"patch")));break;case"<":case">=":r.push(h(e,i));break;case"<=":case">":r.push(y(s)?h("<="===e?"<":">=",i.increment("major")):y(c)?h("<="===e?"<":">=",i.increment("minor")):h(e,i));break;case"=":case void 0:y(s)||y(c)?(r.push(h(">=",i)),r.push(h("<",i.increment(y(s)?"major":"minor")))):r.push(h("=",i));break;default:return!1}return!0}function y(e){return"*"===e||"x"===e||"X"===e}function h(e,t){return{operator:e,operand:t}}function v(e,t){for(var r=0,n=t;r":return i>0;case">=":return i>=0;case"=":return 0===i;default:return e.Debug.assertNever(r)}}function x(t){return e.map(t,S).join(" ")}function S(e){return"".concat(e.operator).concat(e.operand)}}(c||(c={})),function(e){function t(e,t){return"object"==typeof e&&"number"==typeof e.timeOrigin&&"function"==typeof e.mark&&"function"==typeof e.measure&&"function"==typeof e.now&&"function"==typeof t}var r=function(){if("object"==typeof performance&&"function"==typeof PerformanceObserver&&t(performance,PerformanceObserver))return{shouldWriteNativeEvents:!0,performance:performance,PerformanceObserver:PerformanceObserver}}()||function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)try{var r,n=require("perf_hooks"),i=n.performance,a=n.PerformanceObserver;if(t(i,a)){r=i;var o=new e.Version(process.versions.node);return new e.VersionRange("<12.16.3 || 13 <13.13").test(o)&&(r={get timeOrigin(){return i.timeOrigin},now:function(){return i.now()},mark:function(e){return i.mark(e)},measure:function(e,t,r){void 0===t&&(t="nodeStart"),void 0===r&&(r="__performance.measure-fix__",i.mark(r)),i.measure(e,t,r),"__performance.measure-fix__"===r&&i.clearMarks("__performance.measure-fix__")}}),{shouldWriteNativeEvents:!1,performance:r,PerformanceObserver:a}}}catch(e){}}(),n=null==r?void 0:r.performance;e.tryGetNativePerformanceHooks=function(){return r},e.timestamp=n?function(){return n.now()}:Date.now?Date.now:function(){return+new Date}}(c||(c={})),function(e){!function(t){var r,n;function i(t,r,n){var i=0;return{enter:function(){1==++i&&u(r)},exit:function(){0==--i?(u(n),d(t,r,n)):i<0&&e.Debug.fail("enter/exit count does not match.")}}}t.createTimerIf=function(e,r,n,a){return e?i(r,n,a):t.nullTimer},t.createTimer=i,t.nullTimer={enter:e.noop,exit:e.noop};var a=!1,o=e.timestamp(),s=new e.Map,c=new e.Map,l=new e.Map;function u(t){var r;if(a){var i=null!==(r=c.get(t))&&void 0!==r?r:0;c.set(t,i+1),s.set(t,e.timestamp()),null==n||n.mark(t)}}function d(t,r,i){var c,u;if(a){var d=null!==(c=void 0!==i?s.get(i):void 0)&&void 0!==c?c:e.timestamp(),_=null!==(u=void 0!==r?s.get(r):void 0)&&void 0!==u?u:o,p=l.get(t)||0;l.set(t,p+(d-_)),null==n||n.measure(t,r,i)}}t.mark=u,t.measure=d,t.getCount=function(e){return c.get(e)||0},t.getDuration=function(e){return l.get(e)||0},t.forEachMeasure=function(e){l.forEach((function(t,r){return e(r,t)}))},t.isEnabled=function(){return a},t.enable=function(t){var i;return void 0===t&&(t=e.sys),a||(a=!0,r||(r=e.tryGetNativePerformanceHooks()),r&&(o=r.performance.timeOrigin,(r.shouldWriteNativeEvents||(null===(i=null==t?void 0:t.cpuProfilingEnabled)||void 0===i?void 0:i.call(t))||(null==t?void 0:t.debugMode))&&(n=r.performance))),!0},t.disable=function(){a&&(s.clear(),c.clear(),l.clear(),n=void 0,a=!1)}}(e.performance||(e.performance={}))}(c||(c={})),function(e){var t,r,n={logEvent:e.noop,logErrEvent:e.noop,logPerfEvent:e.noop,logInfoEvent:e.noop,logStartCommand:e.noop,logStopCommand:e.noop,logStartUpdateProgram:e.noop,logStopUpdateProgram:e.noop,logStartUpdateGraph:e.noop,logStopUpdateGraph:e.noop,logStartResolveModule:e.noop,logStopResolveModule:e.noop,logStartParseSourceFile:e.noop,logStopParseSourceFile:e.noop,logStartReadFile:e.noop,logStopReadFile:e.noop,logStartBindFile:e.noop,logStopBindFile:e.noop,logStartScheduledOperation:e.noop,logStopScheduledOperation:e.noop};try{r=se(null!==(t=process.env.TS_ETW_MODULE_PATH)&&void 0!==t?t:"./node_modules/@microsoft/typescript-etw")}catch(e){r=void 0}e.perfLogger=r&&r.logEvent?r:n}(c||(c={})),function(e){var t;!function(t){var r,i,a,o,s=0,c=0,l=[],u=[];t.startTracing=function(o,d,_){if(e.Debug.assert(!e.tracing,"Tracing already started"),void 0===r)try{r=require("fs")}catch(e){throw new Error("tracing requires having fs\n(original error: ".concat(e.message||e,")"))}i=o,l.length=0,void 0===a&&(a=e.combinePaths(d,"legend.json")),r.existsSync(d)||r.mkdirSync(d,{recursive:!0});var p="build"===i?".".concat(process.pid,"-").concat(++s):"server"===i?".".concat(process.pid):"",f=e.combinePaths(d,"trace".concat(p,".json")),m=e.combinePaths(d,"types".concat(p,".json"));u.push({configFilePath:_,tracePath:f,typesPath:m}),c=r.openSync(f,"w"),e.tracing=t;var g={cat:"__metadata",ph:"M",ts:1e3*e.timestamp(),pid:1,tid:1};r.writeSync(c,"[\n"+[n({name:"process_name",args:{name:"tsc"}},g),n({name:"thread_name",args:{name:"Main"}},g),n(n({name:"TracingStartedInBrowser"},g),{cat:"disabled-by-default-devtools.timeline"})].map((function(e){return JSON.stringify(e)})).join(",\n"))},t.stopTracing=function(){e.Debug.assert(e.tracing,"Tracing is not in progress"),e.Debug.assert(!!l.length==("server"!==i)),r.writeSync(c,"\n]\n"),r.closeSync(c),e.tracing=void 0,l.length?function(t){var i,a,o,s,c,l,d,_,p,m,g,y,h,v,b,x,S,D,C,T,E,k;e.performance.mark("beginDumpTypes");var A=u[u.length-1].typesPath,N=r.openSync(A,"w"),w=new e.Map;r.writeSync(N,"[");for(var F=t.length,P=0;P0),_(d.length-1,1e3*e.timestamp()),d.length--},t.popAll=function(){for(var t=1e3*e.timestamp(),r=d.length-1;r>=0;r--)_(r,t);d.length=0};function _(e,t){var r=d[e],n=r.phase,i=r.name,a=r.args,o=r.time;r.separateBeginAndEnd?p("E",n,i,a,void 0,t):1e4-o%1e4<=t-o&&p("X",n,i,a,'"dur":'.concat(t-o),o)}function p(t,n,a,o,s,l){void 0===l&&(l=1e3*e.timestamp()),"server"===i&&"checkTypes"===n||(e.performance.mark("beginTracing"),r.writeSync(c,',\n{"pid":1,"tid":1,"ph":"'.concat(t,'","cat":"').concat(n,'","ts":').concat(l,',"name":"').concat(a,'"')),s&&r.writeSync(c,",".concat(s)),o&&r.writeSync(c,',"args":'.concat(JSON.stringify(o))),r.writeSync(c,"}"),e.performance.mark("endTracing"),e.performance.measure("Tracing","beginTracing","endTracing"))}function f(t){var r=e.getSourceFileOfNode(t);return r?{path:r.path,start:n(e.getLineAndCharacterOfPosition(r,t.pos)),end:n(e.getLineAndCharacterOfPosition(r,t.end))}:void 0;function n(e){return{line:e.line+1,character:e.character+1}}}t.dumpLegend=function(){a&&r.writeFileSync(a,JSON.stringify(u))}}(t||(t={})),e.startTracing=t.startTracing,e.dumpTracingLegend=t.dumpLegend}(c||(c={})),function(e){var t,r,n,i,a,o,s,c,l;(t=e.SyntaxKind||(e.SyntaxKind={}))[t.Unknown=0]="Unknown",t[t.EndOfFileToken=1]="EndOfFileToken",t[t.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",t[t.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",t[t.NewLineTrivia=4]="NewLineTrivia",t[t.WhitespaceTrivia=5]="WhitespaceTrivia",t[t.ShebangTrivia=6]="ShebangTrivia",t[t.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",t[t.NumericLiteral=8]="NumericLiteral",t[t.BigIntLiteral=9]="BigIntLiteral",t[t.StringLiteral=10]="StringLiteral",t[t.JsxText=11]="JsxText",t[t.JsxTextAllWhiteSpaces=12]="JsxTextAllWhiteSpaces",t[t.RegularExpressionLiteral=13]="RegularExpressionLiteral",t[t.NoSubstitutionTemplateLiteral=14]="NoSubstitutionTemplateLiteral",t[t.TemplateHead=15]="TemplateHead",t[t.TemplateMiddle=16]="TemplateMiddle",t[t.TemplateTail=17]="TemplateTail",t[t.OpenBraceToken=18]="OpenBraceToken",t[t.CloseBraceToken=19]="CloseBraceToken",t[t.OpenParenToken=20]="OpenParenToken",t[t.CloseParenToken=21]="CloseParenToken",t[t.OpenBracketToken=22]="OpenBracketToken",t[t.CloseBracketToken=23]="CloseBracketToken",t[t.DotToken=24]="DotToken",t[t.DotDotDotToken=25]="DotDotDotToken",t[t.SemicolonToken=26]="SemicolonToken",t[t.CommaToken=27]="CommaToken",t[t.QuestionDotToken=28]="QuestionDotToken",t[t.LessThanToken=29]="LessThanToken",t[t.LessThanSlashToken=30]="LessThanSlashToken",t[t.GreaterThanToken=31]="GreaterThanToken",t[t.LessThanEqualsToken=32]="LessThanEqualsToken",t[t.GreaterThanEqualsToken=33]="GreaterThanEqualsToken",t[t.EqualsEqualsToken=34]="EqualsEqualsToken",t[t.ExclamationEqualsToken=35]="ExclamationEqualsToken",t[t.EqualsEqualsEqualsToken=36]="EqualsEqualsEqualsToken",t[t.ExclamationEqualsEqualsToken=37]="ExclamationEqualsEqualsToken",t[t.EqualsGreaterThanToken=38]="EqualsGreaterThanToken",t[t.PlusToken=39]="PlusToken",t[t.MinusToken=40]="MinusToken",t[t.AsteriskToken=41]="AsteriskToken",t[t.AsteriskAsteriskToken=42]="AsteriskAsteriskToken",t[t.SlashToken=43]="SlashToken",t[t.PercentToken=44]="PercentToken",t[t.PlusPlusToken=45]="PlusPlusToken",t[t.MinusMinusToken=46]="MinusMinusToken",t[t.LessThanLessThanToken=47]="LessThanLessThanToken",t[t.GreaterThanGreaterThanToken=48]="GreaterThanGreaterThanToken",t[t.GreaterThanGreaterThanGreaterThanToken=49]="GreaterThanGreaterThanGreaterThanToken",t[t.AmpersandToken=50]="AmpersandToken",t[t.BarToken=51]="BarToken",t[t.CaretToken=52]="CaretToken",t[t.ExclamationToken=53]="ExclamationToken",t[t.TildeToken=54]="TildeToken",t[t.AmpersandAmpersandToken=55]="AmpersandAmpersandToken",t[t.BarBarToken=56]="BarBarToken",t[t.QuestionToken=57]="QuestionToken",t[t.ColonToken=58]="ColonToken",t[t.AtToken=59]="AtToken",t[t.QuestionQuestionToken=60]="QuestionQuestionToken",t[t.BacktickToken=61]="BacktickToken",t[t.HashToken=62]="HashToken",t[t.EqualsToken=63]="EqualsToken",t[t.PlusEqualsToken=64]="PlusEqualsToken",t[t.MinusEqualsToken=65]="MinusEqualsToken",t[t.AsteriskEqualsToken=66]="AsteriskEqualsToken",t[t.AsteriskAsteriskEqualsToken=67]="AsteriskAsteriskEqualsToken",t[t.SlashEqualsToken=68]="SlashEqualsToken",t[t.PercentEqualsToken=69]="PercentEqualsToken",t[t.LessThanLessThanEqualsToken=70]="LessThanLessThanEqualsToken",t[t.GreaterThanGreaterThanEqualsToken=71]="GreaterThanGreaterThanEqualsToken",t[t.GreaterThanGreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanGreaterThanEqualsToken",t[t.AmpersandEqualsToken=73]="AmpersandEqualsToken",t[t.BarEqualsToken=74]="BarEqualsToken",t[t.BarBarEqualsToken=75]="BarBarEqualsToken",t[t.AmpersandAmpersandEqualsToken=76]="AmpersandAmpersandEqualsToken",t[t.QuestionQuestionEqualsToken=77]="QuestionQuestionEqualsToken",t[t.CaretEqualsToken=78]="CaretEqualsToken",t[t.Identifier=79]="Identifier",t[t.PrivateIdentifier=80]="PrivateIdentifier",t[t.BreakKeyword=81]="BreakKeyword",t[t.CaseKeyword=82]="CaseKeyword",t[t.CatchKeyword=83]="CatchKeyword",t[t.ClassKeyword=84]="ClassKeyword",t[t.ConstKeyword=85]="ConstKeyword",t[t.ContinueKeyword=86]="ContinueKeyword",t[t.DebuggerKeyword=87]="DebuggerKeyword",t[t.DefaultKeyword=88]="DefaultKeyword",t[t.DeleteKeyword=89]="DeleteKeyword",t[t.DoKeyword=90]="DoKeyword",t[t.ElseKeyword=91]="ElseKeyword",t[t.EnumKeyword=92]="EnumKeyword",t[t.ExportKeyword=93]="ExportKeyword",t[t.ExtendsKeyword=94]="ExtendsKeyword",t[t.FalseKeyword=95]="FalseKeyword",t[t.FinallyKeyword=96]="FinallyKeyword",t[t.ForKeyword=97]="ForKeyword",t[t.FunctionKeyword=98]="FunctionKeyword",t[t.IfKeyword=99]="IfKeyword",t[t.ImportKeyword=100]="ImportKeyword",t[t.InKeyword=101]="InKeyword",t[t.InstanceOfKeyword=102]="InstanceOfKeyword",t[t.NewKeyword=103]="NewKeyword",t[t.NullKeyword=104]="NullKeyword",t[t.ReturnKeyword=105]="ReturnKeyword",t[t.SuperKeyword=106]="SuperKeyword",t[t.SwitchKeyword=107]="SwitchKeyword",t[t.ThisKeyword=108]="ThisKeyword",t[t.ThrowKeyword=109]="ThrowKeyword",t[t.TrueKeyword=110]="TrueKeyword",t[t.TryKeyword=111]="TryKeyword",t[t.TypeOfKeyword=112]="TypeOfKeyword",t[t.VarKeyword=113]="VarKeyword",t[t.VoidKeyword=114]="VoidKeyword",t[t.WhileKeyword=115]="WhileKeyword",t[t.WithKeyword=116]="WithKeyword",t[t.ImplementsKeyword=117]="ImplementsKeyword",t[t.InterfaceKeyword=118]="InterfaceKeyword",t[t.LetKeyword=119]="LetKeyword",t[t.PackageKeyword=120]="PackageKeyword",t[t.PrivateKeyword=121]="PrivateKeyword",t[t.ProtectedKeyword=122]="ProtectedKeyword",t[t.PublicKeyword=123]="PublicKeyword",t[t.StaticKeyword=124]="StaticKeyword",t[t.YieldKeyword=125]="YieldKeyword",t[t.AbstractKeyword=126]="AbstractKeyword",t[t.AsKeyword=127]="AsKeyword",t[t.AssertsKeyword=128]="AssertsKeyword",t[t.AssertKeyword=129]="AssertKeyword",t[t.AnyKeyword=130]="AnyKeyword",t[t.AsyncKeyword=131]="AsyncKeyword",t[t.AwaitKeyword=132]="AwaitKeyword",t[t.BooleanKeyword=133]="BooleanKeyword",t[t.ConstructorKeyword=134]="ConstructorKeyword",t[t.DeclareKeyword=135]="DeclareKeyword",t[t.GetKeyword=136]="GetKeyword",t[t.InferKeyword=137]="InferKeyword",t[t.IntrinsicKeyword=138]="IntrinsicKeyword",t[t.IsKeyword=139]="IsKeyword",t[t.KeyOfKeyword=140]="KeyOfKeyword",t[t.ModuleKeyword=141]="ModuleKeyword",t[t.NamespaceKeyword=142]="NamespaceKeyword",t[t.NeverKeyword=143]="NeverKeyword",t[t.OutKeyword=144]="OutKeyword",t[t.ReadonlyKeyword=145]="ReadonlyKeyword",t[t.RequireKeyword=146]="RequireKeyword",t[t.NumberKeyword=147]="NumberKeyword",t[t.ObjectKeyword=148]="ObjectKeyword",t[t.SetKeyword=149]="SetKeyword",t[t.StringKeyword=150]="StringKeyword",t[t.SymbolKeyword=151]="SymbolKeyword",t[t.TypeKeyword=152]="TypeKeyword",t[t.UndefinedKeyword=153]="UndefinedKeyword",t[t.UniqueKeyword=154]="UniqueKeyword",t[t.UnknownKeyword=155]="UnknownKeyword",t[t.FromKeyword=156]="FromKeyword",t[t.GlobalKeyword=157]="GlobalKeyword",t[t.BigIntKeyword=158]="BigIntKeyword",t[t.OverrideKeyword=159]="OverrideKeyword",t[t.OfKeyword=160]="OfKeyword",t[t.QualifiedName=161]="QualifiedName",t[t.ComputedPropertyName=162]="ComputedPropertyName",t[t.TypeParameter=163]="TypeParameter",t[t.Parameter=164]="Parameter",t[t.Decorator=165]="Decorator",t[t.PropertySignature=166]="PropertySignature",t[t.PropertyDeclaration=167]="PropertyDeclaration",t[t.MethodSignature=168]="MethodSignature",t[t.MethodDeclaration=169]="MethodDeclaration",t[t.ClassStaticBlockDeclaration=170]="ClassStaticBlockDeclaration",t[t.Constructor=171]="Constructor",t[t.GetAccessor=172]="GetAccessor",t[t.SetAccessor=173]="SetAccessor",t[t.CallSignature=174]="CallSignature",t[t.ConstructSignature=175]="ConstructSignature",t[t.IndexSignature=176]="IndexSignature",t[t.TypePredicate=177]="TypePredicate",t[t.TypeReference=178]="TypeReference",t[t.FunctionType=179]="FunctionType",t[t.ConstructorType=180]="ConstructorType",t[t.TypeQuery=181]="TypeQuery",t[t.TypeLiteral=182]="TypeLiteral",t[t.ArrayType=183]="ArrayType",t[t.TupleType=184]="TupleType",t[t.OptionalType=185]="OptionalType",t[t.RestType=186]="RestType",t[t.UnionType=187]="UnionType",t[t.IntersectionType=188]="IntersectionType",t[t.ConditionalType=189]="ConditionalType",t[t.InferType=190]="InferType",t[t.ParenthesizedType=191]="ParenthesizedType",t[t.ThisType=192]="ThisType",t[t.TypeOperator=193]="TypeOperator",t[t.IndexedAccessType=194]="IndexedAccessType",t[t.MappedType=195]="MappedType",t[t.LiteralType=196]="LiteralType",t[t.NamedTupleMember=197]="NamedTupleMember",t[t.TemplateLiteralType=198]="TemplateLiteralType",t[t.TemplateLiteralTypeSpan=199]="TemplateLiteralTypeSpan",t[t.ImportType=200]="ImportType",t[t.ObjectBindingPattern=201]="ObjectBindingPattern",t[t.ArrayBindingPattern=202]="ArrayBindingPattern",t[t.BindingElement=203]="BindingElement",t[t.ArrayLiteralExpression=204]="ArrayLiteralExpression",t[t.ObjectLiteralExpression=205]="ObjectLiteralExpression",t[t.PropertyAccessExpression=206]="PropertyAccessExpression",t[t.ElementAccessExpression=207]="ElementAccessExpression",t[t.CallExpression=208]="CallExpression",t[t.NewExpression=209]="NewExpression",t[t.TaggedTemplateExpression=210]="TaggedTemplateExpression",t[t.TypeAssertionExpression=211]="TypeAssertionExpression",t[t.ParenthesizedExpression=212]="ParenthesizedExpression",t[t.FunctionExpression=213]="FunctionExpression",t[t.ArrowFunction=214]="ArrowFunction",t[t.DeleteExpression=215]="DeleteExpression",t[t.TypeOfExpression=216]="TypeOfExpression",t[t.VoidExpression=217]="VoidExpression",t[t.AwaitExpression=218]="AwaitExpression",t[t.PrefixUnaryExpression=219]="PrefixUnaryExpression",t[t.PostfixUnaryExpression=220]="PostfixUnaryExpression",t[t.BinaryExpression=221]="BinaryExpression",t[t.ConditionalExpression=222]="ConditionalExpression",t[t.TemplateExpression=223]="TemplateExpression",t[t.YieldExpression=224]="YieldExpression",t[t.SpreadElement=225]="SpreadElement",t[t.ClassExpression=226]="ClassExpression",t[t.OmittedExpression=227]="OmittedExpression",t[t.ExpressionWithTypeArguments=228]="ExpressionWithTypeArguments",t[t.AsExpression=229]="AsExpression",t[t.NonNullExpression=230]="NonNullExpression",t[t.MetaProperty=231]="MetaProperty",t[t.SyntheticExpression=232]="SyntheticExpression",t[t.TemplateSpan=233]="TemplateSpan",t[t.SemicolonClassElement=234]="SemicolonClassElement",t[t.Block=235]="Block",t[t.EmptyStatement=236]="EmptyStatement",t[t.VariableStatement=237]="VariableStatement",t[t.ExpressionStatement=238]="ExpressionStatement",t[t.IfStatement=239]="IfStatement",t[t.DoStatement=240]="DoStatement",t[t.WhileStatement=241]="WhileStatement",t[t.ForStatement=242]="ForStatement",t[t.ForInStatement=243]="ForInStatement",t[t.ForOfStatement=244]="ForOfStatement",t[t.ContinueStatement=245]="ContinueStatement",t[t.BreakStatement=246]="BreakStatement",t[t.ReturnStatement=247]="ReturnStatement",t[t.WithStatement=248]="WithStatement",t[t.SwitchStatement=249]="SwitchStatement",t[t.LabeledStatement=250]="LabeledStatement",t[t.ThrowStatement=251]="ThrowStatement",t[t.TryStatement=252]="TryStatement",t[t.DebuggerStatement=253]="DebuggerStatement",t[t.VariableDeclaration=254]="VariableDeclaration",t[t.VariableDeclarationList=255]="VariableDeclarationList",t[t.FunctionDeclaration=256]="FunctionDeclaration",t[t.ClassDeclaration=257]="ClassDeclaration",t[t.InterfaceDeclaration=258]="InterfaceDeclaration",t[t.TypeAliasDeclaration=259]="TypeAliasDeclaration",t[t.EnumDeclaration=260]="EnumDeclaration",t[t.ModuleDeclaration=261]="ModuleDeclaration",t[t.ModuleBlock=262]="ModuleBlock",t[t.CaseBlock=263]="CaseBlock",t[t.NamespaceExportDeclaration=264]="NamespaceExportDeclaration",t[t.ImportEqualsDeclaration=265]="ImportEqualsDeclaration",t[t.ImportDeclaration=266]="ImportDeclaration",t[t.ImportClause=267]="ImportClause",t[t.NamespaceImport=268]="NamespaceImport",t[t.NamedImports=269]="NamedImports",t[t.ImportSpecifier=270]="ImportSpecifier",t[t.ExportAssignment=271]="ExportAssignment",t[t.ExportDeclaration=272]="ExportDeclaration",t[t.NamedExports=273]="NamedExports",t[t.NamespaceExport=274]="NamespaceExport",t[t.ExportSpecifier=275]="ExportSpecifier",t[t.MissingDeclaration=276]="MissingDeclaration",t[t.ExternalModuleReference=277]="ExternalModuleReference",t[t.JsxElement=278]="JsxElement",t[t.JsxSelfClosingElement=279]="JsxSelfClosingElement",t[t.JsxOpeningElement=280]="JsxOpeningElement",t[t.JsxClosingElement=281]="JsxClosingElement",t[t.JsxFragment=282]="JsxFragment",t[t.JsxOpeningFragment=283]="JsxOpeningFragment",t[t.JsxClosingFragment=284]="JsxClosingFragment",t[t.JsxAttribute=285]="JsxAttribute",t[t.JsxAttributes=286]="JsxAttributes",t[t.JsxSpreadAttribute=287]="JsxSpreadAttribute",t[t.JsxExpression=288]="JsxExpression",t[t.CaseClause=289]="CaseClause",t[t.DefaultClause=290]="DefaultClause",t[t.HeritageClause=291]="HeritageClause",t[t.CatchClause=292]="CatchClause",t[t.AssertClause=293]="AssertClause",t[t.AssertEntry=294]="AssertEntry",t[t.ImportTypeAssertionContainer=295]="ImportTypeAssertionContainer",t[t.PropertyAssignment=296]="PropertyAssignment",t[t.ShorthandPropertyAssignment=297]="ShorthandPropertyAssignment",t[t.SpreadAssignment=298]="SpreadAssignment",t[t.EnumMember=299]="EnumMember",t[t.UnparsedPrologue=300]="UnparsedPrologue",t[t.UnparsedPrepend=301]="UnparsedPrepend",t[t.UnparsedText=302]="UnparsedText",t[t.UnparsedInternalText=303]="UnparsedInternalText",t[t.UnparsedSyntheticReference=304]="UnparsedSyntheticReference",t[t.SourceFile=305]="SourceFile",t[t.Bundle=306]="Bundle",t[t.UnparsedSource=307]="UnparsedSource",t[t.InputFiles=308]="InputFiles",t[t.JSDocTypeExpression=309]="JSDocTypeExpression",t[t.JSDocNameReference=310]="JSDocNameReference",t[t.JSDocMemberName=311]="JSDocMemberName",t[t.JSDocAllType=312]="JSDocAllType",t[t.JSDocUnknownType=313]="JSDocUnknownType",t[t.JSDocNullableType=314]="JSDocNullableType",t[t.JSDocNonNullableType=315]="JSDocNonNullableType",t[t.JSDocOptionalType=316]="JSDocOptionalType",t[t.JSDocFunctionType=317]="JSDocFunctionType",t[t.JSDocVariadicType=318]="JSDocVariadicType",t[t.JSDocNamepathType=319]="JSDocNamepathType",t[t.JSDocComment=320]="JSDocComment",t[t.JSDocText=321]="JSDocText",t[t.JSDocTypeLiteral=322]="JSDocTypeLiteral",t[t.JSDocSignature=323]="JSDocSignature",t[t.JSDocLink=324]="JSDocLink",t[t.JSDocLinkCode=325]="JSDocLinkCode",t[t.JSDocLinkPlain=326]="JSDocLinkPlain",t[t.JSDocTag=327]="JSDocTag",t[t.JSDocAugmentsTag=328]="JSDocAugmentsTag",t[t.JSDocImplementsTag=329]="JSDocImplementsTag",t[t.JSDocAuthorTag=330]="JSDocAuthorTag",t[t.JSDocDeprecatedTag=331]="JSDocDeprecatedTag",t[t.JSDocClassTag=332]="JSDocClassTag",t[t.JSDocPublicTag=333]="JSDocPublicTag",t[t.JSDocPrivateTag=334]="JSDocPrivateTag",t[t.JSDocProtectedTag=335]="JSDocProtectedTag",t[t.JSDocReadonlyTag=336]="JSDocReadonlyTag",t[t.JSDocOverrideTag=337]="JSDocOverrideTag",t[t.JSDocCallbackTag=338]="JSDocCallbackTag",t[t.JSDocEnumTag=339]="JSDocEnumTag",t[t.JSDocParameterTag=340]="JSDocParameterTag",t[t.JSDocReturnTag=341]="JSDocReturnTag",t[t.JSDocThisTag=342]="JSDocThisTag",t[t.JSDocTypeTag=343]="JSDocTypeTag",t[t.JSDocTemplateTag=344]="JSDocTemplateTag",t[t.JSDocTypedefTag=345]="JSDocTypedefTag",t[t.JSDocSeeTag=346]="JSDocSeeTag",t[t.JSDocPropertyTag=347]="JSDocPropertyTag",t[t.SyntaxList=348]="SyntaxList",t[t.NotEmittedStatement=349]="NotEmittedStatement",t[t.PartiallyEmittedExpression=350]="PartiallyEmittedExpression",t[t.CommaListExpression=351]="CommaListExpression",t[t.MergeDeclarationMarker=352]="MergeDeclarationMarker",t[t.EndOfDeclarationMarker=353]="EndOfDeclarationMarker",t[t.SyntheticReferenceExpression=354]="SyntheticReferenceExpression",t[t.Count=355]="Count",t[t.FirstAssignment=63]="FirstAssignment",t[t.LastAssignment=78]="LastAssignment",t[t.FirstCompoundAssignment=64]="FirstCompoundAssignment",t[t.LastCompoundAssignment=78]="LastCompoundAssignment",t[t.FirstReservedWord=81]="FirstReservedWord",t[t.LastReservedWord=116]="LastReservedWord",t[t.FirstKeyword=81]="FirstKeyword",t[t.LastKeyword=160]="LastKeyword",t[t.FirstFutureReservedWord=117]="FirstFutureReservedWord",t[t.LastFutureReservedWord=125]="LastFutureReservedWord",t[t.FirstTypeNode=177]="FirstTypeNode",t[t.LastTypeNode=200]="LastTypeNode",t[t.FirstPunctuation=18]="FirstPunctuation",t[t.LastPunctuation=78]="LastPunctuation",t[t.FirstToken=0]="FirstToken",t[t.LastToken=160]="LastToken",t[t.FirstTriviaToken=2]="FirstTriviaToken",t[t.LastTriviaToken=7]="LastTriviaToken",t[t.FirstLiteralToken=8]="FirstLiteralToken",t[t.LastLiteralToken=14]="LastLiteralToken",t[t.FirstTemplateToken=14]="FirstTemplateToken",t[t.LastTemplateToken=17]="LastTemplateToken",t[t.FirstBinaryOperator=29]="FirstBinaryOperator",t[t.LastBinaryOperator=78]="LastBinaryOperator",t[t.FirstStatement=237]="FirstStatement",t[t.LastStatement=253]="LastStatement",t[t.FirstNode=161]="FirstNode",t[t.FirstJSDocNode=309]="FirstJSDocNode",t[t.LastJSDocNode=347]="LastJSDocNode",t[t.FirstJSDocTagNode=327]="FirstJSDocTagNode",t[t.LastJSDocTagNode=347]="LastJSDocTagNode",t[t.FirstContextualKeyword=126]="FirstContextualKeyword",t[t.LastContextualKeyword=160]="LastContextualKeyword",t[t.JSDoc=320]="JSDoc",(r=e.NodeFlags||(e.NodeFlags={}))[r.None=0]="None",r[r.Let=1]="Let",r[r.Const=2]="Const",r[r.NestedNamespace=4]="NestedNamespace",r[r.Synthesized=8]="Synthesized",r[r.Namespace=16]="Namespace",r[r.OptionalChain=32]="OptionalChain",r[r.ExportContext=64]="ExportContext",r[r.ContainsThis=128]="ContainsThis",r[r.HasImplicitReturn=256]="HasImplicitReturn",r[r.HasExplicitReturn=512]="HasExplicitReturn",r[r.GlobalAugmentation=1024]="GlobalAugmentation",r[r.HasAsyncFunctions=2048]="HasAsyncFunctions",r[r.DisallowInContext=4096]="DisallowInContext",r[r.YieldContext=8192]="YieldContext",r[r.DecoratorContext=16384]="DecoratorContext",r[r.AwaitContext=32768]="AwaitContext",r[r.DisallowConditionalTypesContext=65536]="DisallowConditionalTypesContext",r[r.ThisNodeHasError=131072]="ThisNodeHasError",r[r.JavaScriptFile=262144]="JavaScriptFile",r[r.ThisNodeOrAnySubNodesHasError=524288]="ThisNodeOrAnySubNodesHasError",r[r.HasAggregatedChildData=1048576]="HasAggregatedChildData",r[r.PossiblyContainsDynamicImport=2097152]="PossiblyContainsDynamicImport",r[r.PossiblyContainsImportMeta=4194304]="PossiblyContainsImportMeta",r[r.JSDoc=8388608]="JSDoc",r[r.Ambient=16777216]="Ambient",r[r.InWithStatement=33554432]="InWithStatement",r[r.JsonFile=67108864]="JsonFile",r[r.TypeCached=134217728]="TypeCached",r[r.Deprecated=268435456]="Deprecated",r[r.BlockScoped=3]="BlockScoped",r[r.ReachabilityCheckFlags=768]="ReachabilityCheckFlags",r[r.ReachabilityAndEmitFlags=2816]="ReachabilityAndEmitFlags",r[r.ContextFlags=50720768]="ContextFlags",r[r.TypeExcludesFlags=40960]="TypeExcludesFlags",r[r.PermanentlySetIncrementalFlags=6291456]="PermanentlySetIncrementalFlags",(n=e.ModifierFlags||(e.ModifierFlags={}))[n.None=0]="None",n[n.Export=1]="Export",n[n.Ambient=2]="Ambient",n[n.Public=4]="Public",n[n.Private=8]="Private",n[n.Protected=16]="Protected",n[n.Static=32]="Static",n[n.Readonly=64]="Readonly",n[n.Abstract=128]="Abstract",n[n.Async=256]="Async",n[n.Default=512]="Default",n[n.Const=2048]="Const",n[n.HasComputedJSDocModifiers=4096]="HasComputedJSDocModifiers",n[n.Deprecated=8192]="Deprecated",n[n.Override=16384]="Override",n[n.In=32768]="In",n[n.Out=65536]="Out",n[n.HasComputedFlags=536870912]="HasComputedFlags",n[n.AccessibilityModifier=28]="AccessibilityModifier",n[n.ParameterPropertyModifier=16476]="ParameterPropertyModifier",n[n.NonPublicAccessibilityModifier=24]="NonPublicAccessibilityModifier",n[n.TypeScriptModifier=116958]="TypeScriptModifier",n[n.ExportDefault=513]="ExportDefault",n[n.All=125951]="All",(i=e.JsxFlags||(e.JsxFlags={}))[i.None=0]="None",i[i.IntrinsicNamedElement=1]="IntrinsicNamedElement",i[i.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",i[i.IntrinsicElement=3]="IntrinsicElement",(a=e.RelationComparisonResult||(e.RelationComparisonResult={}))[a.Succeeded=1]="Succeeded",a[a.Failed=2]="Failed",a[a.Reported=4]="Reported",a[a.ReportsUnmeasurable=8]="ReportsUnmeasurable",a[a.ReportsUnreliable=16]="ReportsUnreliable",a[a.ReportsMask=24]="ReportsMask",(o=e.GeneratedIdentifierFlags||(e.GeneratedIdentifierFlags={}))[o.None=0]="None",o[o.Auto=1]="Auto",o[o.Loop=2]="Loop",o[o.Unique=3]="Unique",o[o.Node=4]="Node",o[o.KindMask=7]="KindMask",o[o.ReservedInNestedScopes=8]="ReservedInNestedScopes",o[o.Optimistic=16]="Optimistic",o[o.FileLevel=32]="FileLevel",o[o.AllowNameSubstitution=64]="AllowNameSubstitution",(s=e.TokenFlags||(e.TokenFlags={}))[s.None=0]="None",s[s.PrecedingLineBreak=1]="PrecedingLineBreak",s[s.PrecedingJSDocComment=2]="PrecedingJSDocComment",s[s.Unterminated=4]="Unterminated",s[s.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",s[s.Scientific=16]="Scientific",s[s.Octal=32]="Octal",s[s.HexSpecifier=64]="HexSpecifier",s[s.BinarySpecifier=128]="BinarySpecifier",s[s.OctalSpecifier=256]="OctalSpecifier",s[s.ContainsSeparator=512]="ContainsSeparator",s[s.UnicodeEscape=1024]="UnicodeEscape",s[s.ContainsInvalidEscape=2048]="ContainsInvalidEscape",s[s.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",s[s.NumericLiteralFlags=1008]="NumericLiteralFlags",s[s.TemplateLiteralLikeFlags=2048]="TemplateLiteralLikeFlags",(c=e.FlowFlags||(e.FlowFlags={}))[c.Unreachable=1]="Unreachable",c[c.Start=2]="Start",c[c.BranchLabel=4]="BranchLabel",c[c.LoopLabel=8]="LoopLabel",c[c.Assignment=16]="Assignment",c[c.TrueCondition=32]="TrueCondition",c[c.FalseCondition=64]="FalseCondition",c[c.SwitchClause=128]="SwitchClause",c[c.ArrayMutation=256]="ArrayMutation",c[c.Call=512]="Call",c[c.ReduceLabel=1024]="ReduceLabel",c[c.Referenced=2048]="Referenced",c[c.Shared=4096]="Shared",c[c.Label=12]="Label",c[c.Condition=96]="Condition",(l=e.CommentDirectiveType||(e.CommentDirectiveType={}))[l.ExpectError=0]="ExpectError",l[l.Ignore=1]="Ignore";var u,d,_,p,f,m,g,y,h,v,b,x,S,D,C,T,E,k,A,N,w,F,P,I,O,M,L,R,B,J,j,U,V,K,z,G,q,W,H,Q,X,$,Y,Z,ee,te,re,ne,ie,ae,oe,se,ce,le,ue,de,_e,pe,fe,me=function(){};e.OperationCanceledException=me,(u=e.FileIncludeKind||(e.FileIncludeKind={}))[u.RootFile=0]="RootFile",u[u.SourceFromProjectReference=1]="SourceFromProjectReference",u[u.OutputFromProjectReference=2]="OutputFromProjectReference",u[u.Import=3]="Import",u[u.ReferenceFile=4]="ReferenceFile",u[u.TypeReferenceDirective=5]="TypeReferenceDirective",u[u.LibFile=6]="LibFile",u[u.LibReferenceDirective=7]="LibReferenceDirective",u[u.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",(d=e.FilePreprocessingDiagnosticsKind||(e.FilePreprocessingDiagnosticsKind={}))[d.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",d[d.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",(_=e.StructureIsReused||(e.StructureIsReused={}))[_.Not=0]="Not",_[_.SafeModules=1]="SafeModules",_[_.Completely=2]="Completely",(p=e.ExitStatus||(e.ExitStatus={}))[p.Success=0]="Success",p[p.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",p[p.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",p[p.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",p[p.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",p[p.ProjectReferenceCycle_OutputsSkupped=4]="ProjectReferenceCycle_OutputsSkupped",(f=e.MemberOverrideStatus||(e.MemberOverrideStatus={}))[f.Ok=0]="Ok",f[f.NeedsOverride=1]="NeedsOverride",f[f.HasInvalidOverride=2]="HasInvalidOverride",(m=e.UnionReduction||(e.UnionReduction={}))[m.None=0]="None",m[m.Literal=1]="Literal",m[m.Subtype=2]="Subtype",(g=e.ContextFlags||(e.ContextFlags={}))[g.None=0]="None",g[g.Signature=1]="Signature",g[g.NoConstraints=2]="NoConstraints",g[g.Completions=4]="Completions",g[g.SkipBindingPatterns=8]="SkipBindingPatterns",(y=e.NodeBuilderFlags||(e.NodeBuilderFlags={}))[y.None=0]="None",y[y.NoTruncation=1]="NoTruncation",y[y.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",y[y.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",y[y.UseStructuralFallback=8]="UseStructuralFallback",y[y.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",y[y.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",y[y.UseFullyQualifiedType=64]="UseFullyQualifiedType",y[y.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",y[y.SuppressAnyReturnType=256]="SuppressAnyReturnType",y[y.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",y[y.MultilineObjectLiterals=1024]="MultilineObjectLiterals",y[y.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",y[y.UseTypeOfFunction=4096]="UseTypeOfFunction",y[y.OmitParameterModifiers=8192]="OmitParameterModifiers",y[y.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",y[y.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",y[y.NoTypeReduction=536870912]="NoTypeReduction",y[y.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",y[y.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",y[y.AllowQualifedNameInPlaceOfIdentifier=65536]="AllowQualifedNameInPlaceOfIdentifier",y[y.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",y[y.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",y[y.AllowEmptyTuple=524288]="AllowEmptyTuple",y[y.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",y[y.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",y[y.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",y[y.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",y[y.IgnoreErrors=70221824]="IgnoreErrors",y[y.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",y[y.InTypeAlias=8388608]="InTypeAlias",y[y.InInitialEntityName=16777216]="InInitialEntityName",(h=e.TypeFormatFlags||(e.TypeFormatFlags={}))[h.None=0]="None",h[h.NoTruncation=1]="NoTruncation",h[h.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",h[h.UseStructuralFallback=8]="UseStructuralFallback",h[h.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",h[h.UseFullyQualifiedType=64]="UseFullyQualifiedType",h[h.SuppressAnyReturnType=256]="SuppressAnyReturnType",h[h.MultilineObjectLiterals=1024]="MultilineObjectLiterals",h[h.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",h[h.UseTypeOfFunction=4096]="UseTypeOfFunction",h[h.OmitParameterModifiers=8192]="OmitParameterModifiers",h[h.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",h[h.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",h[h.NoTypeReduction=536870912]="NoTypeReduction",h[h.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",h[h.AddUndefined=131072]="AddUndefined",h[h.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",h[h.InArrayType=524288]="InArrayType",h[h.InElementType=2097152]="InElementType",h[h.InFirstTypeArgument=4194304]="InFirstTypeArgument",h[h.InTypeAlias=8388608]="InTypeAlias",h[h.WriteOwnNameForAnyLike=0]="WriteOwnNameForAnyLike",h[h.NodeBuilderFlagsMask=814775659]="NodeBuilderFlagsMask",(v=e.SymbolFormatFlags||(e.SymbolFormatFlags={}))[v.None=0]="None",v[v.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",v[v.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",v[v.AllowAnyNodeKind=4]="AllowAnyNodeKind",v[v.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",v[v.DoNotIncludeSymbolChain=16]="DoNotIncludeSymbolChain",(b=e.SymbolAccessibility||(e.SymbolAccessibility={}))[b.Accessible=0]="Accessible",b[b.NotAccessible=1]="NotAccessible",b[b.CannotBeNamed=2]="CannotBeNamed",(x=e.SyntheticSymbolKind||(e.SyntheticSymbolKind={}))[x.UnionOrIntersection=0]="UnionOrIntersection",x[x.Spread=1]="Spread",(S=e.TypePredicateKind||(e.TypePredicateKind={}))[S.This=0]="This",S[S.Identifier=1]="Identifier",S[S.AssertsThis=2]="AssertsThis",S[S.AssertsIdentifier=3]="AssertsIdentifier",(D=e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}))[D.Unknown=0]="Unknown",D[D.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",D[D.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",D[D.NumberLikeType=3]="NumberLikeType",D[D.BigIntLikeType=4]="BigIntLikeType",D[D.StringLikeType=5]="StringLikeType",D[D.BooleanType=6]="BooleanType",D[D.ArrayLikeType=7]="ArrayLikeType",D[D.ESSymbolType=8]="ESSymbolType",D[D.Promise=9]="Promise",D[D.TypeWithCallSignature=10]="TypeWithCallSignature",D[D.ObjectType=11]="ObjectType",(C=e.SymbolFlags||(e.SymbolFlags={}))[C.None=0]="None",C[C.FunctionScopedVariable=1]="FunctionScopedVariable",C[C.BlockScopedVariable=2]="BlockScopedVariable",C[C.Property=4]="Property",C[C.EnumMember=8]="EnumMember",C[C.Function=16]="Function",C[C.Class=32]="Class",C[C.Interface=64]="Interface",C[C.ConstEnum=128]="ConstEnum",C[C.RegularEnum=256]="RegularEnum",C[C.ValueModule=512]="ValueModule",C[C.NamespaceModule=1024]="NamespaceModule",C[C.TypeLiteral=2048]="TypeLiteral",C[C.ObjectLiteral=4096]="ObjectLiteral",C[C.Method=8192]="Method",C[C.Constructor=16384]="Constructor",C[C.GetAccessor=32768]="GetAccessor",C[C.SetAccessor=65536]="SetAccessor",C[C.Signature=131072]="Signature",C[C.TypeParameter=262144]="TypeParameter",C[C.TypeAlias=524288]="TypeAlias",C[C.ExportValue=1048576]="ExportValue",C[C.Alias=2097152]="Alias",C[C.Prototype=4194304]="Prototype",C[C.ExportStar=8388608]="ExportStar",C[C.Optional=16777216]="Optional",C[C.Transient=33554432]="Transient",C[C.Assignment=67108864]="Assignment",C[C.ModuleExports=134217728]="ModuleExports",C[C.All=67108863]="All",C[C.Enum=384]="Enum",C[C.Variable=3]="Variable",C[C.Value=111551]="Value",C[C.Type=788968]="Type",C[C.Namespace=1920]="Namespace",C[C.Module=1536]="Module",C[C.Accessor=98304]="Accessor",C[C.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",C[C.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",C[C.ParameterExcludes=111551]="ParameterExcludes",C[C.PropertyExcludes=0]="PropertyExcludes",C[C.EnumMemberExcludes=900095]="EnumMemberExcludes",C[C.FunctionExcludes=110991]="FunctionExcludes",C[C.ClassExcludes=899503]="ClassExcludes",C[C.InterfaceExcludes=788872]="InterfaceExcludes",C[C.RegularEnumExcludes=899327]="RegularEnumExcludes",C[C.ConstEnumExcludes=899967]="ConstEnumExcludes",C[C.ValueModuleExcludes=110735]="ValueModuleExcludes",C[C.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",C[C.MethodExcludes=103359]="MethodExcludes",C[C.GetAccessorExcludes=46015]="GetAccessorExcludes",C[C.SetAccessorExcludes=78783]="SetAccessorExcludes",C[C.TypeParameterExcludes=526824]="TypeParameterExcludes",C[C.TypeAliasExcludes=788968]="TypeAliasExcludes",C[C.AliasExcludes=2097152]="AliasExcludes",C[C.ModuleMember=2623475]="ModuleMember",C[C.ExportHasLocal=944]="ExportHasLocal",C[C.BlockScoped=418]="BlockScoped",C[C.PropertyOrAccessor=98308]="PropertyOrAccessor",C[C.ClassMember=106500]="ClassMember",C[C.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",C[C.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",C[C.Classifiable=2885600]="Classifiable",C[C.LateBindingContainer=6256]="LateBindingContainer",(T=e.EnumKind||(e.EnumKind={}))[T.Numeric=0]="Numeric",T[T.Literal=1]="Literal",(E=e.CheckFlags||(e.CheckFlags={}))[E.Instantiated=1]="Instantiated",E[E.SyntheticProperty=2]="SyntheticProperty",E[E.SyntheticMethod=4]="SyntheticMethod",E[E.Readonly=8]="Readonly",E[E.ReadPartial=16]="ReadPartial",E[E.WritePartial=32]="WritePartial",E[E.HasNonUniformType=64]="HasNonUniformType",E[E.HasLiteralType=128]="HasLiteralType",E[E.ContainsPublic=256]="ContainsPublic",E[E.ContainsProtected=512]="ContainsProtected",E[E.ContainsPrivate=1024]="ContainsPrivate",E[E.ContainsStatic=2048]="ContainsStatic",E[E.Late=4096]="Late",E[E.ReverseMapped=8192]="ReverseMapped",E[E.OptionalParameter=16384]="OptionalParameter",E[E.RestParameter=32768]="RestParameter",E[E.DeferredType=65536]="DeferredType",E[E.HasNeverType=131072]="HasNeverType",E[E.Mapped=262144]="Mapped",E[E.StripOptional=524288]="StripOptional",E[E.Unresolved=1048576]="Unresolved",E[E.Synthetic=6]="Synthetic",E[E.Discriminant=192]="Discriminant",E[E.Partial=48]="Partial",(k=e.InternalSymbolName||(e.InternalSymbolName={})).Call="__call",k.Constructor="__constructor",k.New="__new",k.Index="__index",k.ExportStar="__export",k.Global="__global",k.Missing="__missing",k.Type="__type",k.Object="__object",k.JSXAttributes="__jsxAttributes",k.Class="__class",k.Function="__function",k.Computed="__computed",k.Resolving="__resolving__",k.ExportEquals="export=",k.Default="default",k.This="this",(A=e.NodeCheckFlags||(e.NodeCheckFlags={}))[A.TypeChecked=1]="TypeChecked",A[A.LexicalThis=2]="LexicalThis",A[A.CaptureThis=4]="CaptureThis",A[A.CaptureNewTarget=8]="CaptureNewTarget",A[A.SuperInstance=256]="SuperInstance",A[A.SuperStatic=512]="SuperStatic",A[A.ContextChecked=1024]="ContextChecked",A[A.AsyncMethodWithSuper=2048]="AsyncMethodWithSuper",A[A.AsyncMethodWithSuperBinding=4096]="AsyncMethodWithSuperBinding",A[A.CaptureArguments=8192]="CaptureArguments",A[A.EnumValuesComputed=16384]="EnumValuesComputed",A[A.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",A[A.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",A[A.ContainsCapturedBlockScopeBinding=131072]="ContainsCapturedBlockScopeBinding",A[A.CapturedBlockScopedBinding=262144]="CapturedBlockScopedBinding",A[A.BlockScopedBindingInLoop=524288]="BlockScopedBindingInLoop",A[A.ClassWithBodyScopedClassBinding=1048576]="ClassWithBodyScopedClassBinding",A[A.BodyScopedClassBinding=2097152]="BodyScopedClassBinding",A[A.NeedsLoopOutParameter=4194304]="NeedsLoopOutParameter",A[A.AssignmentsMarked=8388608]="AssignmentsMarked",A[A.ClassWithConstructorReference=16777216]="ClassWithConstructorReference",A[A.ConstructorReferenceInClass=33554432]="ConstructorReferenceInClass",A[A.ContainsClassWithPrivateIdentifiers=67108864]="ContainsClassWithPrivateIdentifiers",A[A.ContainsSuperPropertyInStaticInitializer=134217728]="ContainsSuperPropertyInStaticInitializer",A[A.InCheckIdentifier=268435456]="InCheckIdentifier",(N=e.TypeFlags||(e.TypeFlags={}))[N.Any=1]="Any",N[N.Unknown=2]="Unknown",N[N.String=4]="String",N[N.Number=8]="Number",N[N.Boolean=16]="Boolean",N[N.Enum=32]="Enum",N[N.BigInt=64]="BigInt",N[N.StringLiteral=128]="StringLiteral",N[N.NumberLiteral=256]="NumberLiteral",N[N.BooleanLiteral=512]="BooleanLiteral",N[N.EnumLiteral=1024]="EnumLiteral",N[N.BigIntLiteral=2048]="BigIntLiteral",N[N.ESSymbol=4096]="ESSymbol",N[N.UniqueESSymbol=8192]="UniqueESSymbol",N[N.Void=16384]="Void",N[N.Undefined=32768]="Undefined",N[N.Null=65536]="Null",N[N.Never=131072]="Never",N[N.TypeParameter=262144]="TypeParameter",N[N.Object=524288]="Object",N[N.Union=1048576]="Union",N[N.Intersection=2097152]="Intersection",N[N.Index=4194304]="Index",N[N.IndexedAccess=8388608]="IndexedAccess",N[N.Conditional=16777216]="Conditional",N[N.Substitution=33554432]="Substitution",N[N.NonPrimitive=67108864]="NonPrimitive",N[N.TemplateLiteral=134217728]="TemplateLiteral",N[N.StringMapping=268435456]="StringMapping",N[N.AnyOrUnknown=3]="AnyOrUnknown",N[N.Nullable=98304]="Nullable",N[N.Literal=2944]="Literal",N[N.Unit=109440]="Unit",N[N.StringOrNumberLiteral=384]="StringOrNumberLiteral",N[N.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",N[N.DefinitelyFalsy=117632]="DefinitelyFalsy",N[N.PossiblyFalsy=117724]="PossiblyFalsy",N[N.Intrinsic=67359327]="Intrinsic",N[N.Primitive=131068]="Primitive",N[N.StringLike=402653316]="StringLike",N[N.NumberLike=296]="NumberLike",N[N.BigIntLike=2112]="BigIntLike",N[N.BooleanLike=528]="BooleanLike",N[N.EnumLike=1056]="EnumLike",N[N.ESSymbolLike=12288]="ESSymbolLike",N[N.VoidLike=49152]="VoidLike",N[N.DefinitelyNonNullable=470302716]="DefinitelyNonNullable",N[N.DisjointDomains=469892092]="DisjointDomains",N[N.UnionOrIntersection=3145728]="UnionOrIntersection",N[N.StructuredType=3670016]="StructuredType",N[N.TypeVariable=8650752]="TypeVariable",N[N.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",N[N.InstantiablePrimitive=406847488]="InstantiablePrimitive",N[N.Instantiable=465829888]="Instantiable",N[N.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",N[N.ObjectFlagsType=3899393]="ObjectFlagsType",N[N.Simplifiable=25165824]="Simplifiable",N[N.Singleton=67358815]="Singleton",N[N.Narrowable=536624127]="Narrowable",N[N.IncludesMask=205258751]="IncludesMask",N[N.IncludesMissingType=262144]="IncludesMissingType",N[N.IncludesNonWideningType=4194304]="IncludesNonWideningType",N[N.IncludesWildcard=8388608]="IncludesWildcard",N[N.IncludesEmptyObject=16777216]="IncludesEmptyObject",N[N.IncludesInstantiable=33554432]="IncludesInstantiable",N[N.NotPrimitiveUnion=36323363]="NotPrimitiveUnion",(w=e.ObjectFlags||(e.ObjectFlags={}))[w.Class=1]="Class",w[w.Interface=2]="Interface",w[w.Reference=4]="Reference",w[w.Tuple=8]="Tuple",w[w.Anonymous=16]="Anonymous",w[w.Mapped=32]="Mapped",w[w.Instantiated=64]="Instantiated",w[w.ObjectLiteral=128]="ObjectLiteral",w[w.EvolvingArray=256]="EvolvingArray",w[w.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",w[w.ReverseMapped=1024]="ReverseMapped",w[w.JsxAttributes=2048]="JsxAttributes",w[w.JSLiteral=4096]="JSLiteral",w[w.FreshLiteral=8192]="FreshLiteral",w[w.ArrayLiteral=16384]="ArrayLiteral",w[w.PrimitiveUnion=32768]="PrimitiveUnion",w[w.ContainsWideningType=65536]="ContainsWideningType",w[w.ContainsObjectOrArrayLiteral=131072]="ContainsObjectOrArrayLiteral",w[w.NonInferrableType=262144]="NonInferrableType",w[w.CouldContainTypeVariablesComputed=524288]="CouldContainTypeVariablesComputed",w[w.CouldContainTypeVariables=1048576]="CouldContainTypeVariables",w[w.ClassOrInterface=3]="ClassOrInterface",w[w.RequiresWidening=196608]="RequiresWidening",w[w.PropagatingFlags=458752]="PropagatingFlags",w[w.ObjectTypeKindMask=1343]="ObjectTypeKindMask",w[w.ContainsSpread=2097152]="ContainsSpread",w[w.ObjectRestType=4194304]="ObjectRestType",w[w.InstantiationExpressionType=8388608]="InstantiationExpressionType",w[w.IsClassInstanceClone=16777216]="IsClassInstanceClone",w[w.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",w[w.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",w[w.IsGenericTypeComputed=2097152]="IsGenericTypeComputed",w[w.IsGenericObjectType=4194304]="IsGenericObjectType",w[w.IsGenericIndexType=8388608]="IsGenericIndexType",w[w.IsGenericType=12582912]="IsGenericType",w[w.ContainsIntersections=16777216]="ContainsIntersections",w[w.IsNeverIntersectionComputed=16777216]="IsNeverIntersectionComputed",w[w.IsNeverIntersection=33554432]="IsNeverIntersection",(F=e.VarianceFlags||(e.VarianceFlags={}))[F.Invariant=0]="Invariant",F[F.Covariant=1]="Covariant",F[F.Contravariant=2]="Contravariant",F[F.Bivariant=3]="Bivariant",F[F.Independent=4]="Independent",F[F.VarianceMask=7]="VarianceMask",F[F.Unmeasurable=8]="Unmeasurable",F[F.Unreliable=16]="Unreliable",F[F.AllowsStructuralFallback=24]="AllowsStructuralFallback",(P=e.ElementFlags||(e.ElementFlags={}))[P.Required=1]="Required",P[P.Optional=2]="Optional",P[P.Rest=4]="Rest",P[P.Variadic=8]="Variadic",P[P.Fixed=3]="Fixed",P[P.Variable=12]="Variable",P[P.NonRequired=14]="NonRequired",P[P.NonRest=11]="NonRest",(I=e.AccessFlags||(e.AccessFlags={}))[I.None=0]="None",I[I.IncludeUndefined=1]="IncludeUndefined",I[I.NoIndexSignatures=2]="NoIndexSignatures",I[I.Writing=4]="Writing",I[I.CacheSymbol=8]="CacheSymbol",I[I.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",I[I.ExpressionPosition=32]="ExpressionPosition",I[I.ReportDeprecated=64]="ReportDeprecated",I[I.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",I[I.Contextual=256]="Contextual",I[I.Persistent=1]="Persistent",(O=e.JsxReferenceKind||(e.JsxReferenceKind={}))[O.Component=0]="Component",O[O.Function=1]="Function",O[O.Mixed=2]="Mixed",(M=e.SignatureKind||(e.SignatureKind={}))[M.Call=0]="Call",M[M.Construct=1]="Construct",(L=e.SignatureFlags||(e.SignatureFlags={}))[L.None=0]="None",L[L.HasRestParameter=1]="HasRestParameter",L[L.HasLiteralTypes=2]="HasLiteralTypes",L[L.Abstract=4]="Abstract",L[L.IsInnerCallChain=8]="IsInnerCallChain",L[L.IsOuterCallChain=16]="IsOuterCallChain",L[L.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",L[L.PropagatingFlags=39]="PropagatingFlags",L[L.CallChainFlags=24]="CallChainFlags",(R=e.IndexKind||(e.IndexKind={}))[R.String=0]="String",R[R.Number=1]="Number",(B=e.TypeMapKind||(e.TypeMapKind={}))[B.Simple=0]="Simple",B[B.Array=1]="Array",B[B.Function=2]="Function",B[B.Composite=3]="Composite",B[B.Merged=4]="Merged",(J=e.InferencePriority||(e.InferencePriority={}))[J.NakedTypeVariable=1]="NakedTypeVariable",J[J.SpeculativeTuple=2]="SpeculativeTuple",J[J.SubstituteSource=4]="SubstituteSource",J[J.HomomorphicMappedType=8]="HomomorphicMappedType",J[J.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",J[J.MappedTypeConstraint=32]="MappedTypeConstraint",J[J.ContravariantConditional=64]="ContravariantConditional",J[J.ReturnType=128]="ReturnType",J[J.LiteralKeyof=256]="LiteralKeyof",J[J.NoConstraints=512]="NoConstraints",J[J.AlwaysStrict=1024]="AlwaysStrict",J[J.MaxValue=2048]="MaxValue",J[J.PriorityImpliesCombination=416]="PriorityImpliesCombination",J[J.Circularity=-1]="Circularity",(j=e.InferenceFlags||(e.InferenceFlags={}))[j.None=0]="None",j[j.NoDefault=1]="NoDefault",j[j.AnyDefault=2]="AnyDefault",j[j.SkippedGenericFunction=4]="SkippedGenericFunction",(U=e.Ternary||(e.Ternary={}))[U.False=0]="False",U[U.Unknown=1]="Unknown",U[U.Maybe=3]="Maybe",U[U.True=-1]="True",(V=e.AssignmentDeclarationKind||(e.AssignmentDeclarationKind={}))[V.None=0]="None",V[V.ExportsProperty=1]="ExportsProperty",V[V.ModuleExports=2]="ModuleExports",V[V.PrototypeProperty=3]="PrototypeProperty",V[V.ThisProperty=4]="ThisProperty",V[V.Property=5]="Property",V[V.Prototype=6]="Prototype",V[V.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",V[V.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",V[V.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message"}(K=e.DiagnosticCategory||(e.DiagnosticCategory={})),e.diagnosticCategoryName=function(e,t){void 0===t&&(t=!0);var r=K[e.category];return t?r.toLowerCase():r},(z=e.ModuleResolutionKind||(e.ModuleResolutionKind={}))[z.Classic=1]="Classic",z[z.NodeJs=2]="NodeJs",z[z.Node16=3]="Node16",z[z.NodeNext=99]="NodeNext",(G=e.ModuleDetectionKind||(e.ModuleDetectionKind={}))[G.Legacy=1]="Legacy",G[G.Auto=2]="Auto",G[G.Force=3]="Force",(q=e.WatchFileKind||(e.WatchFileKind={}))[q.FixedPollingInterval=0]="FixedPollingInterval",q[q.PriorityPollingInterval=1]="PriorityPollingInterval",q[q.DynamicPriorityPolling=2]="DynamicPriorityPolling",q[q.FixedChunkSizePolling=3]="FixedChunkSizePolling",q[q.UseFsEvents=4]="UseFsEvents",q[q.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",(W=e.WatchDirectoryKind||(e.WatchDirectoryKind={}))[W.UseFsEvents=0]="UseFsEvents",W[W.FixedPollingInterval=1]="FixedPollingInterval",W[W.DynamicPriorityPolling=2]="DynamicPriorityPolling",W[W.FixedChunkSizePolling=3]="FixedChunkSizePolling",(H=e.PollingWatchKind||(e.PollingWatchKind={}))[H.FixedInterval=0]="FixedInterval",H[H.PriorityInterval=1]="PriorityInterval",H[H.DynamicPriority=2]="DynamicPriority",H[H.FixedChunkSize=3]="FixedChunkSize",(Q=e.ModuleKind||(e.ModuleKind={}))[Q.None=0]="None",Q[Q.CommonJS=1]="CommonJS",Q[Q.AMD=2]="AMD",Q[Q.UMD=3]="UMD",Q[Q.System=4]="System",Q[Q.ES2015=5]="ES2015",Q[Q.ES2020=6]="ES2020",Q[Q.ES2022=7]="ES2022",Q[Q.ESNext=99]="ESNext",Q[Q.Node16=100]="Node16",Q[Q.NodeNext=199]="NodeNext",(X=e.JsxEmit||(e.JsxEmit={}))[X.None=0]="None",X[X.Preserve=1]="Preserve",X[X.React=2]="React",X[X.ReactNative=3]="ReactNative",X[X.ReactJSX=4]="ReactJSX",X[X.ReactJSXDev=5]="ReactJSXDev",($=e.ImportsNotUsedAsValues||(e.ImportsNotUsedAsValues={}))[$.Remove=0]="Remove",$[$.Preserve=1]="Preserve",$[$.Error=2]="Error",(Y=e.NewLineKind||(e.NewLineKind={}))[Y.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",Y[Y.LineFeed=1]="LineFeed",(Z=e.ScriptKind||(e.ScriptKind={}))[Z.Unknown=0]="Unknown",Z[Z.JS=1]="JS",Z[Z.JSX=2]="JSX",Z[Z.TS=3]="TS",Z[Z.TSX=4]="TSX",Z[Z.External=5]="External",Z[Z.JSON=6]="JSON",Z[Z.Deferred=7]="Deferred",(ee=e.ScriptTarget||(e.ScriptTarget={}))[ee.ES3=0]="ES3",ee[ee.ES5=1]="ES5",ee[ee.ES2015=2]="ES2015",ee[ee.ES2016=3]="ES2016",ee[ee.ES2017=4]="ES2017",ee[ee.ES2018=5]="ES2018",ee[ee.ES2019=6]="ES2019",ee[ee.ES2020=7]="ES2020",ee[ee.ES2021=8]="ES2021",ee[ee.ES2022=9]="ES2022",ee[ee.ESNext=99]="ESNext",ee[ee.JSON=100]="JSON",ee[ee.Latest=99]="Latest",(te=e.LanguageVariant||(e.LanguageVariant={}))[te.Standard=0]="Standard",te[te.JSX=1]="JSX",(re=e.WatchDirectoryFlags||(e.WatchDirectoryFlags={}))[re.None=0]="None",re[re.Recursive=1]="Recursive",(ne=e.CharacterCodes||(e.CharacterCodes={}))[ne.nullCharacter=0]="nullCharacter",ne[ne.maxAsciiCharacter=127]="maxAsciiCharacter",ne[ne.lineFeed=10]="lineFeed",ne[ne.carriageReturn=13]="carriageReturn",ne[ne.lineSeparator=8232]="lineSeparator",ne[ne.paragraphSeparator=8233]="paragraphSeparator",ne[ne.nextLine=133]="nextLine",ne[ne.space=32]="space",ne[ne.nonBreakingSpace=160]="nonBreakingSpace",ne[ne.enQuad=8192]="enQuad",ne[ne.emQuad=8193]="emQuad",ne[ne.enSpace=8194]="enSpace",ne[ne.emSpace=8195]="emSpace",ne[ne.threePerEmSpace=8196]="threePerEmSpace",ne[ne.fourPerEmSpace=8197]="fourPerEmSpace",ne[ne.sixPerEmSpace=8198]="sixPerEmSpace",ne[ne.figureSpace=8199]="figureSpace",ne[ne.punctuationSpace=8200]="punctuationSpace",ne[ne.thinSpace=8201]="thinSpace",ne[ne.hairSpace=8202]="hairSpace",ne[ne.zeroWidthSpace=8203]="zeroWidthSpace",ne[ne.narrowNoBreakSpace=8239]="narrowNoBreakSpace",ne[ne.ideographicSpace=12288]="ideographicSpace",ne[ne.mathematicalSpace=8287]="mathematicalSpace",ne[ne.ogham=5760]="ogham",ne[ne._=95]="_",ne[ne.$=36]="$",ne[ne._0=48]="_0",ne[ne._1=49]="_1",ne[ne._2=50]="_2",ne[ne._3=51]="_3",ne[ne._4=52]="_4",ne[ne._5=53]="_5",ne[ne._6=54]="_6",ne[ne._7=55]="_7",ne[ne._8=56]="_8",ne[ne._9=57]="_9",ne[ne.a=97]="a",ne[ne.b=98]="b",ne[ne.c=99]="c",ne[ne.d=100]="d",ne[ne.e=101]="e",ne[ne.f=102]="f",ne[ne.g=103]="g",ne[ne.h=104]="h",ne[ne.i=105]="i",ne[ne.j=106]="j",ne[ne.k=107]="k",ne[ne.l=108]="l",ne[ne.m=109]="m",ne[ne.n=110]="n",ne[ne.o=111]="o",ne[ne.p=112]="p",ne[ne.q=113]="q",ne[ne.r=114]="r",ne[ne.s=115]="s",ne[ne.t=116]="t",ne[ne.u=117]="u",ne[ne.v=118]="v",ne[ne.w=119]="w",ne[ne.x=120]="x",ne[ne.y=121]="y",ne[ne.z=122]="z",ne[ne.A=65]="A",ne[ne.B=66]="B",ne[ne.C=67]="C",ne[ne.D=68]="D",ne[ne.E=69]="E",ne[ne.F=70]="F",ne[ne.G=71]="G",ne[ne.H=72]="H",ne[ne.I=73]="I",ne[ne.J=74]="J",ne[ne.K=75]="K",ne[ne.L=76]="L",ne[ne.M=77]="M",ne[ne.N=78]="N",ne[ne.O=79]="O",ne[ne.P=80]="P",ne[ne.Q=81]="Q",ne[ne.R=82]="R",ne[ne.S=83]="S",ne[ne.T=84]="T",ne[ne.U=85]="U",ne[ne.V=86]="V",ne[ne.W=87]="W",ne[ne.X=88]="X",ne[ne.Y=89]="Y",ne[ne.Z=90]="Z",ne[ne.ampersand=38]="ampersand",ne[ne.asterisk=42]="asterisk",ne[ne.at=64]="at",ne[ne.backslash=92]="backslash",ne[ne.backtick=96]="backtick",ne[ne.bar=124]="bar",ne[ne.caret=94]="caret",ne[ne.closeBrace=125]="closeBrace",ne[ne.closeBracket=93]="closeBracket",ne[ne.closeParen=41]="closeParen",ne[ne.colon=58]="colon",ne[ne.comma=44]="comma",ne[ne.dot=46]="dot",ne[ne.doubleQuote=34]="doubleQuote",ne[ne.equals=61]="equals",ne[ne.exclamation=33]="exclamation",ne[ne.greaterThan=62]="greaterThan",ne[ne.hash=35]="hash",ne[ne.lessThan=60]="lessThan",ne[ne.minus=45]="minus",ne[ne.openBrace=123]="openBrace",ne[ne.openBracket=91]="openBracket",ne[ne.openParen=40]="openParen",ne[ne.percent=37]="percent",ne[ne.plus=43]="plus",ne[ne.question=63]="question",ne[ne.semicolon=59]="semicolon",ne[ne.singleQuote=39]="singleQuote",ne[ne.slash=47]="slash",ne[ne.tilde=126]="tilde",ne[ne.backspace=8]="backspace",ne[ne.formFeed=12]="formFeed",ne[ne.byteOrderMark=65279]="byteOrderMark",ne[ne.tab=9]="tab",ne[ne.verticalTab=11]="verticalTab",(ie=e.Extension||(e.Extension={})).Ts=".ts",ie.Tsx=".tsx",ie.Dts=".d.ts",ie.Js=".js",ie.Jsx=".jsx",ie.Json=".json",ie.TsBuildInfo=".tsbuildinfo",ie.Mjs=".mjs",ie.Mts=".mts",ie.Dmts=".d.mts",ie.Cjs=".cjs",ie.Cts=".cts",ie.Dcts=".d.cts",(ae=e.TransformFlags||(e.TransformFlags={}))[ae.None=0]="None",ae[ae.ContainsTypeScript=1]="ContainsTypeScript",ae[ae.ContainsJsx=2]="ContainsJsx",ae[ae.ContainsESNext=4]="ContainsESNext",ae[ae.ContainsES2022=8]="ContainsES2022",ae[ae.ContainsES2021=16]="ContainsES2021",ae[ae.ContainsES2020=32]="ContainsES2020",ae[ae.ContainsES2019=64]="ContainsES2019",ae[ae.ContainsES2018=128]="ContainsES2018",ae[ae.ContainsES2017=256]="ContainsES2017",ae[ae.ContainsES2016=512]="ContainsES2016",ae[ae.ContainsES2015=1024]="ContainsES2015",ae[ae.ContainsGenerator=2048]="ContainsGenerator",ae[ae.ContainsDestructuringAssignment=4096]="ContainsDestructuringAssignment",ae[ae.ContainsTypeScriptClassSyntax=4096]="ContainsTypeScriptClassSyntax",ae[ae.ContainsLexicalThis=8192]="ContainsLexicalThis",ae[ae.ContainsRestOrSpread=16384]="ContainsRestOrSpread",ae[ae.ContainsObjectRestOrSpread=32768]="ContainsObjectRestOrSpread",ae[ae.ContainsComputedPropertyName=65536]="ContainsComputedPropertyName",ae[ae.ContainsBlockScopedBinding=131072]="ContainsBlockScopedBinding",ae[ae.ContainsBindingPattern=262144]="ContainsBindingPattern",ae[ae.ContainsYield=524288]="ContainsYield",ae[ae.ContainsAwait=1048576]="ContainsAwait",ae[ae.ContainsHoistedDeclarationOrCompletion=2097152]="ContainsHoistedDeclarationOrCompletion",ae[ae.ContainsDynamicImport=4194304]="ContainsDynamicImport",ae[ae.ContainsClassFields=8388608]="ContainsClassFields",ae[ae.ContainsPossibleTopLevelAwait=16777216]="ContainsPossibleTopLevelAwait",ae[ae.ContainsLexicalSuper=33554432]="ContainsLexicalSuper",ae[ae.ContainsUpdateExpressionForIdentifier=67108864]="ContainsUpdateExpressionForIdentifier",ae[ae.HasComputedFlags=536870912]="HasComputedFlags",ae[ae.AssertTypeScript=1]="AssertTypeScript",ae[ae.AssertJsx=2]="AssertJsx",ae[ae.AssertESNext=4]="AssertESNext",ae[ae.AssertES2022=8]="AssertES2022",ae[ae.AssertES2021=16]="AssertES2021",ae[ae.AssertES2020=32]="AssertES2020",ae[ae.AssertES2019=64]="AssertES2019",ae[ae.AssertES2018=128]="AssertES2018",ae[ae.AssertES2017=256]="AssertES2017",ae[ae.AssertES2016=512]="AssertES2016",ae[ae.AssertES2015=1024]="AssertES2015",ae[ae.AssertGenerator=2048]="AssertGenerator",ae[ae.AssertDestructuringAssignment=4096]="AssertDestructuringAssignment",ae[ae.OuterExpressionExcludes=536870912]="OuterExpressionExcludes",ae[ae.PropertyAccessExcludes=536870912]="PropertyAccessExcludes",ae[ae.NodeExcludes=536870912]="NodeExcludes",ae[ae.ArrowFunctionExcludes=557748224]="ArrowFunctionExcludes",ae[ae.FunctionExcludes=591310848]="FunctionExcludes",ae[ae.ConstructorExcludes=591306752]="ConstructorExcludes",ae[ae.MethodOrAccessorExcludes=574529536]="MethodOrAccessorExcludes",ae[ae.PropertyExcludes=570433536]="PropertyExcludes",ae[ae.ClassExcludes=536940544]="ClassExcludes",ae[ae.ModuleExcludes=589443072]="ModuleExcludes",ae[ae.TypeExcludes=-2]="TypeExcludes",ae[ae.ObjectLiteralExcludes=536973312]="ObjectLiteralExcludes",ae[ae.ArrayLiteralOrCallOrNewExcludes=536887296]="ArrayLiteralOrCallOrNewExcludes",ae[ae.VariableDeclarationListExcludes=537165824]="VariableDeclarationListExcludes",ae[ae.ParameterExcludes=536870912]="ParameterExcludes",ae[ae.CatchClauseExcludes=536903680]="CatchClauseExcludes",ae[ae.BindingPatternExcludes=536887296]="BindingPatternExcludes",ae[ae.ContainsLexicalThisOrSuper=33562624]="ContainsLexicalThisOrSuper",ae[ae.PropertyNamePropagatingFlags=33562624]="PropertyNamePropagatingFlags",(oe=e.SnippetKind||(e.SnippetKind={}))[oe.TabStop=0]="TabStop",oe[oe.Placeholder=1]="Placeholder",oe[oe.Choice=2]="Choice",oe[oe.Variable=3]="Variable",(se=e.EmitFlags||(e.EmitFlags={}))[se.None=0]="None",se[se.SingleLine=1]="SingleLine",se[se.AdviseOnEmitNode=2]="AdviseOnEmitNode",se[se.NoSubstitution=4]="NoSubstitution",se[se.CapturesThis=8]="CapturesThis",se[se.NoLeadingSourceMap=16]="NoLeadingSourceMap",se[se.NoTrailingSourceMap=32]="NoTrailingSourceMap",se[se.NoSourceMap=48]="NoSourceMap",se[se.NoNestedSourceMaps=64]="NoNestedSourceMaps",se[se.NoTokenLeadingSourceMaps=128]="NoTokenLeadingSourceMaps",se[se.NoTokenTrailingSourceMaps=256]="NoTokenTrailingSourceMaps",se[se.NoTokenSourceMaps=384]="NoTokenSourceMaps",se[se.NoLeadingComments=512]="NoLeadingComments",se[se.NoTrailingComments=1024]="NoTrailingComments",se[se.NoComments=1536]="NoComments",se[se.NoNestedComments=2048]="NoNestedComments",se[se.HelperName=4096]="HelperName",se[se.ExportName=8192]="ExportName",se[se.LocalName=16384]="LocalName",se[se.InternalName=32768]="InternalName",se[se.Indented=65536]="Indented",se[se.NoIndentation=131072]="NoIndentation",se[se.AsyncFunctionBody=262144]="AsyncFunctionBody",se[se.ReuseTempVariableScope=524288]="ReuseTempVariableScope",se[se.CustomPrologue=1048576]="CustomPrologue",se[se.NoHoisting=2097152]="NoHoisting",se[se.HasEndOfDeclarationMarker=4194304]="HasEndOfDeclarationMarker",se[se.Iterator=8388608]="Iterator",se[se.NoAsciiEscaping=16777216]="NoAsciiEscaping",se[se.TypeScriptClassWrapper=33554432]="TypeScriptClassWrapper",se[se.NeverApplyImportHelper=67108864]="NeverApplyImportHelper",se[se.IgnoreSourceNewlines=134217728]="IgnoreSourceNewlines",se[se.Immutable=268435456]="Immutable",se[se.IndirectCall=536870912]="IndirectCall",(ce=e.ExternalEmitHelpers||(e.ExternalEmitHelpers={}))[ce.Extends=1]="Extends",ce[ce.Assign=2]="Assign",ce[ce.Rest=4]="Rest",ce[ce.Decorate=8]="Decorate",ce[ce.Metadata=16]="Metadata",ce[ce.Param=32]="Param",ce[ce.Awaiter=64]="Awaiter",ce[ce.Generator=128]="Generator",ce[ce.Values=256]="Values",ce[ce.Read=512]="Read",ce[ce.SpreadArray=1024]="SpreadArray",ce[ce.Await=2048]="Await",ce[ce.AsyncGenerator=4096]="AsyncGenerator",ce[ce.AsyncDelegator=8192]="AsyncDelegator",ce[ce.AsyncValues=16384]="AsyncValues",ce[ce.ExportStar=32768]="ExportStar",ce[ce.ImportStar=65536]="ImportStar",ce[ce.ImportDefault=131072]="ImportDefault",ce[ce.MakeTemplateObject=262144]="MakeTemplateObject",ce[ce.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",ce[ce.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",ce[ce.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",ce[ce.CreateBinding=4194304]="CreateBinding",ce[ce.FirstEmitHelper=1]="FirstEmitHelper",ce[ce.LastEmitHelper=4194304]="LastEmitHelper",ce[ce.ForOfIncludes=256]="ForOfIncludes",ce[ce.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",ce[ce.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",ce[ce.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",ce[ce.SpreadIncludes=1536]="SpreadIncludes",(le=e.EmitHint||(e.EmitHint={}))[le.SourceFile=0]="SourceFile",le[le.Expression=1]="Expression",le[le.IdentifierName=2]="IdentifierName",le[le.MappedTypeParameter=3]="MappedTypeParameter",le[le.Unspecified=4]="Unspecified",le[le.EmbeddedStatement=5]="EmbeddedStatement",le[le.JsxAttributeValue=6]="JsxAttributeValue",(ue=e.OuterExpressionKinds||(e.OuterExpressionKinds={}))[ue.Parentheses=1]="Parentheses",ue[ue.TypeAssertions=2]="TypeAssertions",ue[ue.NonNullAssertions=4]="NonNullAssertions",ue[ue.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",ue[ue.Assertions=6]="Assertions",ue[ue.All=15]="All",ue[ue.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",(de=e.LexicalEnvironmentFlags||(e.LexicalEnvironmentFlags={}))[de.None=0]="None",de[de.InParameters=1]="InParameters",de[de.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",(_e=e.BundleFileSectionKind||(e.BundleFileSectionKind={})).Prologue="prologue",_e.EmitHelpers="emitHelpers",_e.NoDefaultLib="no-default-lib",_e.Reference="reference",_e.Type="type",_e.TypeResolutionModeRequire="type-require",_e.TypeResolutionModeImport="type-import",_e.Lib="lib",_e.Prepend="prepend",_e.Text="text",_e.Internal="internal",(pe=e.ListFormat||(e.ListFormat={}))[pe.None=0]="None",pe[pe.SingleLine=0]="SingleLine",pe[pe.MultiLine=1]="MultiLine",pe[pe.PreserveLines=2]="PreserveLines",pe[pe.LinesMask=3]="LinesMask",pe[pe.NotDelimited=0]="NotDelimited",pe[pe.BarDelimited=4]="BarDelimited",pe[pe.AmpersandDelimited=8]="AmpersandDelimited",pe[pe.CommaDelimited=16]="CommaDelimited",pe[pe.AsteriskDelimited=32]="AsteriskDelimited",pe[pe.DelimitersMask=60]="DelimitersMask",pe[pe.AllowTrailingComma=64]="AllowTrailingComma",pe[pe.Indented=128]="Indented",pe[pe.SpaceBetweenBraces=256]="SpaceBetweenBraces",pe[pe.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",pe[pe.Braces=1024]="Braces",pe[pe.Parenthesis=2048]="Parenthesis",pe[pe.AngleBrackets=4096]="AngleBrackets",pe[pe.SquareBrackets=8192]="SquareBrackets",pe[pe.BracketsMask=15360]="BracketsMask",pe[pe.OptionalIfUndefined=16384]="OptionalIfUndefined",pe[pe.OptionalIfEmpty=32768]="OptionalIfEmpty",pe[pe.Optional=49152]="Optional",pe[pe.PreferNewLine=65536]="PreferNewLine",pe[pe.NoTrailingNewLine=131072]="NoTrailingNewLine",pe[pe.NoInterveningComments=262144]="NoInterveningComments",pe[pe.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",pe[pe.SingleElement=1048576]="SingleElement",pe[pe.SpaceAfterList=2097152]="SpaceAfterList",pe[pe.Modifiers=262656]="Modifiers",pe[pe.HeritageClauses=512]="HeritageClauses",pe[pe.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",pe[pe.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",pe[pe.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",pe[pe.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",pe[pe.UnionTypeConstituents=516]="UnionTypeConstituents",pe[pe.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",pe[pe.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",pe[pe.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",pe[pe.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",pe[pe.ImportClauseEntries=526226]="ImportClauseEntries",pe[pe.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",pe[pe.CommaListElements=528]="CommaListElements",pe[pe.CallExpressionArguments=2576]="CallExpressionArguments",pe[pe.NewExpressionArguments=18960]="NewExpressionArguments",pe[pe.TemplateExpressionSpans=262144]="TemplateExpressionSpans",pe[pe.SingleLineBlockStatements=768]="SingleLineBlockStatements",pe[pe.MultiLineBlockStatements=129]="MultiLineBlockStatements",pe[pe.VariableDeclarationList=528]="VariableDeclarationList",pe[pe.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",pe[pe.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",pe[pe.ClassHeritageClauses=0]="ClassHeritageClauses",pe[pe.ClassMembers=129]="ClassMembers",pe[pe.InterfaceMembers=129]="InterfaceMembers",pe[pe.EnumMembers=145]="EnumMembers",pe[pe.CaseBlockClauses=129]="CaseBlockClauses",pe[pe.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",pe[pe.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",pe[pe.JsxElementAttributes=262656]="JsxElementAttributes",pe[pe.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",pe[pe.HeritageClauseTypes=528]="HeritageClauseTypes",pe[pe.SourceFileStatements=131073]="SourceFileStatements",pe[pe.Decorators=2146305]="Decorators",pe[pe.TypeArguments=53776]="TypeArguments",pe[pe.TypeParameters=53776]="TypeParameters",pe[pe.Parameters=2576]="Parameters",pe[pe.IndexSignatureParameters=8848]="IndexSignatureParameters",pe[pe.JSDocComment=33]="JSDocComment",(fe=e.PragmaKindFlags||(e.PragmaKindFlags={}))[fe.None=0]="None",fe[fe.TripleSlashXML=1]="TripleSlashXML",fe[fe.SingleLine=2]="SingleLine",fe[fe.MultiLine=4]="MultiLine",fe[fe.All=7]="All",fe[fe.Default=7]="Default",e.commentPragmas={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0},{name:"resolution-mode",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}}}(c||(c={})),function(e){function t(e){for(var t=5381,r=0;r=4,m="linux"===process.platform||"darwin"===process.platform,g=l.platform(),y="win32"!==g&&"win64"!==g&&!M(__filename.replace(/\w/g,(function(e){var t=e.toUpperCase();return e===t?e.toLowerCase():t}))),v=null!==(n=s.realpathSync.native)&&void 0!==n?n:s.realpathSync,x=p&&("win32"===process.platform||"darwin"===process.platform),D=e.memoize((function(){return process.cwd()})),C=T({pollingWatchFile:f((function(e,t,n){var i;return s.watchFile(e,{persistent:!0,interval:n},a),{close:function(){return s.unwatchFile(e,a)}};function a(n,a){var o=0==+a.mtime||i===r.Deleted;if(0==+n.mtime){if(o)return;i=r.Deleted}else if(o)i=r.Created;else{if(+n.mtime==+a.mtime)return;i=r.Changed}t(e,i)}}),y),getModifiedTime:B,setTimeout:setTimeout,clearTimeout:clearTimeout,fsWatch:function(t,n,i,a,o,c){var l,u,_;m&&(u=t.substr(t.lastIndexOf(e.directorySeparator)),_=u.slice(e.directorySeparator.length));var p=O(t,n)?g():v();return{close:function(){p.close(),p=void 0}};function f(e){b("sysLog:: ".concat(t,":: Changing watcher to ").concat(e===g?"Present":"Missing","FileSystemEntryWatcher")),i("rename",""),p&&(p.close(),p=e())}function g(){if(void 0===l&&(l=x?{persistent:!0,recursive:!!a}:{persistent:!0}),d)return b("sysLog:: ".concat(t,":: Defaulting to fsWatchFile")),h();try{var e=s.watch(t,l,m?y:i);return e.on("error",(function(){return f(v)})),e}catch(e){return d||(d="ENOSPC"===e.code),b("sysLog:: ".concat(t,":: Changing to fsWatchFile")),h()}}function y(e,r){return"rename"!==e||r&&r!==_&&(-1===r.lastIndexOf(u)||r.lastIndexOf(u)!==r.length-u.length)||O(t,n)?i(e,r):f(v)}function h(){return E(t,S(i),o,c)}function v(){return E(t,(function(e,i){i===r.Created&&O(t,n)&&f(g)}),o,c)}},useCaseSensitiveFileNames:y,getCurrentDirectory:D,fileExists:M,fsSupportsRecursiveFsWatch:x,directoryExists:L,getAccessibleSortedChildDirectories:function(e){return I(e).directories},realpath:R,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,defaultWatchFileKind:function(){var e,t;return null===(t=(e=h).defaultWatchFileKind)||void 0===t?void 0:t.call(e)}}),E=C.watchFile,A=C.watchDirectory,N={args:process.argv.slice(2),newLine:l.EOL,useCaseSensitiveFileNames:y,write:function(e){process.stdout.write(e)},getWidthOfTerminal:function(){return process.stdout.columns},writeOutputIsTTY:function(){return process.stdout.isTTY},readFile:function(t,r){e.perfLogger.logStartReadFile(t);var n=function(e,t){var r;try{r=s.readFileSync(e)}catch(e){return}var n=r.length;if(n>=2&&254===r[0]&&255===r[1]){n&=-2;for(var i=0;i=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):n>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")}(t);return e.perfLogger.logStopReadFile(),n},writeFile:function(t,r,n){var i;e.perfLogger.logEvent("WriteFile: "+t),n&&(r="\ufeff"+r);try{i=s.openSync(t,"w"),s.writeSync(i,r,void 0,"utf8")}finally{void 0!==i&&s.closeSync(i)}},watchFile:E,watchDirectory:A,resolvePath:function(e){return c.resolve(e)},fileExists:M,directoryExists:L,createDirectory:function(e){if(!N.directoryExists(e))try{s.mkdirSync(e)}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:function(){return __filename},getCurrentDirectory:D,getDirectories:function(e){return I(e).directories.slice()},getEnvironmentVariable:function(e){return process.env[e]||""},readDirectory:function(t,r,n,i,a){return e.matchFiles(t,r,n,i,y,process.cwd(),a,I,R)},getModifiedTime:B,setModifiedTime:function(e,t){try{s.utimesSync(e,t,t)}catch(e){return}},deleteFile:function(e){try{return s.unlinkSync(e)}catch(e){return}},createHash:i?J:t,createSHA256Hash:i?J:void 0,getMemoryUsage:function(){return ae.gc&&ae.gc(),process.memoryUsage().heapUsed},getFileSize:function(e){try{var t=w(e);if(null==t?void 0:t.isFile())return t.size}catch(e){}return 0},exit:function(e){F((function(){return process.exit(e)}))},enableCPUProfiler:function(e,t){if(a)return t(),!1;var r=ue;if(!r||!r.Session)return t(),!1;var n=new r.Session;return n.connect(),n.post("Profiler.enable",(function(){n.post("Profiler.start",(function(){a=n,u=e,t()}))})),!0},disableCPUProfiler:F,cpuProfilingEnabled:function(){return!!a||e.contains(process.execArgv,"--cpu-prof")||e.contains(process.execArgv,"--prof")},realpath:R,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||e.some(process.execArgv,(function(e){return/^--(inspect|debug)(-brk)?(=\d+)?$/i.test(e)})),tryEnableSourceMapsForHost:function(){},setTimeout:setTimeout,clearTimeout:clearTimeout,clearScreen:function(){process.stdout.write("c")},setBlocking:function(){process.stdout&&process.stdout._handle&&process.stdout._handle.setBlocking&&process.stdout._handle.setBlocking(!0)},bufferFrom:P,base64decode:function(e){return P(e,"base64").toString("utf8")},base64encode:function(e){return P(e).toString("base64")},require:function(t,r){try{var n=e.resolveJSModule(r,t,N);return{module:se(n),modulePath:n,error:void 0}}catch(e){return{module:void 0,modulePath:void 0,error:e}}}};return N;function w(e){return s.statSync(e,{throwIfNoEntry:!1})}function F(t){if(a&&"stopping"!==a){var r=a;return a.post("Profiler.stop",(function(n,i){var l,d=i.profile;if(!n){try{(null===(l=w(u))||void 0===l?void 0:l.isDirectory())&&(u=c.join(u,"".concat((new Date).toISOString().replace(/:/g,"-"),"+P").concat(process.pid,".cpuprofile")))}catch(e){}try{s.mkdirSync(c.dirname(u),{recursive:!0})}catch(e){}s.writeFileSync(u,JSON.stringify(function(t){for(var r=0,n=new e.Map,i=e.normalizeSlashes(__dirname),a="file://".concat(1===e.getRootLength(i)?"":"/").concat(i),s=0,c=t.nodes;s0}function a(e){return 0!==u(e)}function o(e){return/^\.\.?($|[\\/])/.test(e)}function s(t,r){return t.length>r.length&&e.endsWith(t,r)}function c(e){return e.length>0&&n(e.charCodeAt(e.length-1))}function l(e){return e>=97&&e<=122||e>=65&&e<=90}function u(t){if(!t)return 0;var r=t.charCodeAt(0);if(47===r||92===r){if(t.charCodeAt(1)!==r)return 1;var n=t.indexOf(47===r?e.directorySeparator:e.altDirectorySeparator,2);return n<0?t.length:n+1}if(l(r)&&58===t.charCodeAt(1)){var i=t.charCodeAt(2);if(47===i||92===i)return 3;if(2===t.length)return 2}var a=t.indexOf("://");if(-1!==a){var o=a+"://".length,s=t.indexOf(e.directorySeparator,o);if(-1!==s){var c=t.slice(0,a),u=t.slice(o,s);if("file"===c&&(""===u||"localhost"===u)&&l(t.charCodeAt(s+1))){var d=function(e,t){var r=e.charCodeAt(t);if(58===r)return t+1;if(37===r&&51===e.charCodeAt(t+1)){var n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return-1}(t,s+2);if(-1!==d){if(47===t.charCodeAt(d))return~(d+1);if(d===t.length)return~d}}return~(s+1)}return~t.length}return 0}function d(e){var t=u(e);return t<0?~t:t}function _(t){var r=d(t=h(t));return r===t.length?t:(t=T(t)).slice(0,Math.max(r,t.lastIndexOf(e.directorySeparator)))}function p(t,r,n){if(d(t=h(t))===t.length)return"";var i=(t=T(t)).slice(Math.max(d(t),t.lastIndexOf(e.directorySeparator)+1)),a=void 0!==r&&void 0!==n?m(i,r,n):void 0;return a?i.slice(0,i.length-a.length):i}function f(t,r,n){if(e.startsWith(r,".")||(r="."+r),t.length>=r.length&&46===t.charCodeAt(t.length-r.length)){var i=t.slice(t.length-r.length);if(n(i,r))return i}}function m(t,r,n){if(r)return function(e,t,r){if("string"==typeof t)return f(e,t,r)||"";for(var n=0,i=t;n=0?i.substring(a):""}function g(t,n){return void 0===n&&(n=""),function(t,n){var i=t.substring(0,n),a=t.substring(n).split(e.directorySeparator);return a.length&&!e.lastOrUndefined(a)&&a.pop(),r([i],a,!0)}(t=b(n,t),d(t))}function y(t){return 0===t.length?"":(t[0]&&E(t[0]))+t.slice(1).join(e.directorySeparator)}function h(r){var n=r.indexOf("\\");return-1===n?r:(t.lastIndex=n,r.replace(t,e.directorySeparator))}function v(t){if(!e.some(t))return[];for(var r=[t[0]],n=1;n1){if(".."!==r[r.length-1]){r.pop();continue}}else if(r[0])continue;r.push(i)}}return r}function b(e){for(var t=[],r=1;r0&&t===e.length},e.pathIsAbsolute=a,e.pathIsRelative=o,e.pathIsBareSpecifier=function(e){return!a(e)&&!o(e)},e.hasExtension=function(t){return e.stringContains(p(t),".")},e.fileExtensionIs=s,e.fileExtensionIsOneOf=function(e,t){for(var r=0,n=t;r0==d(r)>0,"Paths must either both be absolute or both be relative");var i="function"==typeof n?n:e.identity;return y(w(t,r,"boolean"==typeof n&&n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,i))}function P(t,r,n,a,o){var s=w(x(n,t),x(n,r),e.equateStringsCaseSensitive,a),c=s[0];if(o&&i(c)){var l=c.charAt(0)===e.directorySeparator?"file://":"file:///";s[0]=l+c}return y(s)}e.comparePathsCaseSensitive=function(t,r){return N(t,r,e.compareStringsCaseSensitive)},e.comparePathsCaseInsensitive=function(t,r){return N(t,r,e.compareStringsCaseInsensitive)},e.comparePaths=function(t,r,n,i){return"string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),N(t,r,e.getStringComparer(i))},e.containsPath=function(t,r,n,i){if("string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),void 0===t||void 0===r)return!1;if(t===r)return!0;var a=v(g(t)),o=v(g(r));if(o.length type. Did you mean to write 'Promise<{0}>'?"),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:t(1066,e.DiagnosticCategory.Error,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:t(1068,e.DiagnosticCategory.Error,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:t(1069,e.DiagnosticCategory.Error,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:t(1070,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:t(1071,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:t(1079,e.DiagnosticCategory.Error,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:t(1084,e.DiagnosticCategory.Error,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:t(1085,e.DiagnosticCategory.Error,"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085","Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."),_0_modifier_cannot_appear_on_a_constructor_declaration:t(1089,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:t(1090,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:t(1091,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:t(1092,e.DiagnosticCategory.Error,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:t(1093,e.DiagnosticCategory.Error,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:t(1094,e.DiagnosticCategory.Error,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:t(1095,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:t(1096,e.DiagnosticCategory.Error,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:t(1097,e.DiagnosticCategory.Error,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:t(1098,e.DiagnosticCategory.Error,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:t(1099,e.DiagnosticCategory.Error,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:t(1100,e.DiagnosticCategory.Error,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:t(1101,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:t(1102,e.DiagnosticCategory.Error,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1103,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:t(1104,e.DiagnosticCategory.Error,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:t(1105,e.DiagnosticCategory.Error,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:t(1106,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:t(1107,e.DiagnosticCategory.Error,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:t(1108,e.DiagnosticCategory.Error,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:t(1109,e.DiagnosticCategory.Error,"Expression_expected_1109","Expression expected."),Type_expected:t(1110,e.DiagnosticCategory.Error,"Type_expected_1110","Type expected."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:t(1113,e.DiagnosticCategory.Error,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:t(1114,e.DiagnosticCategory.Error,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:t(1115,e.DiagnosticCategory.Error,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:t(1116,e.DiagnosticCategory.Error,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name:t(1117,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117","An object literal cannot have multiple properties with the same name."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:t(1118,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:t(1119,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:t(1120,e.DiagnosticCategory.Error,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_in_strict_mode:t(1121,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_strict_mode_1121","Octal literals are not allowed in strict mode."),Variable_declaration_list_cannot_be_empty:t(1123,e.DiagnosticCategory.Error,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:t(1124,e.DiagnosticCategory.Error,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:t(1125,e.DiagnosticCategory.Error,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:t(1126,e.DiagnosticCategory.Error,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:t(1127,e.DiagnosticCategory.Error,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:t(1128,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:t(1129,e.DiagnosticCategory.Error,"Statement_expected_1129","Statement expected."),case_or_default_expected:t(1130,e.DiagnosticCategory.Error,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:t(1131,e.DiagnosticCategory.Error,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:t(1132,e.DiagnosticCategory.Error,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:t(1134,e.DiagnosticCategory.Error,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:t(1135,e.DiagnosticCategory.Error,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:t(1136,e.DiagnosticCategory.Error,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:t(1137,e.DiagnosticCategory.Error,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:t(1138,e.DiagnosticCategory.Error,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:t(1139,e.DiagnosticCategory.Error,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:t(1140,e.DiagnosticCategory.Error,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:t(1141,e.DiagnosticCategory.Error,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:t(1142,e.DiagnosticCategory.Error,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:t(1144,e.DiagnosticCategory.Error,"or_expected_1144","'{' or ';' expected."),Declaration_expected:t(1146,e.DiagnosticCategory.Error,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:t(1147,e.DiagnosticCategory.Error,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:t(1148,e.DiagnosticCategory.Error,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:t(1149,e.DiagnosticCategory.Error,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),const_declarations_must_be_initialized:t(1155,e.DiagnosticCategory.Error,"const_declarations_must_be_initialized_1155","'const' declarations must be initialized."),const_declarations_can_only_be_declared_inside_a_block:t(1156,e.DiagnosticCategory.Error,"const_declarations_can_only_be_declared_inside_a_block_1156","'const' declarations can only be declared inside a block."),let_declarations_can_only_be_declared_inside_a_block:t(1157,e.DiagnosticCategory.Error,"let_declarations_can_only_be_declared_inside_a_block_1157","'let' declarations can only be declared inside a block."),Unterminated_template_literal:t(1160,e.DiagnosticCategory.Error,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:t(1161,e.DiagnosticCategory.Error,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:t(1162,e.DiagnosticCategory.Error,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:t(1163,e.DiagnosticCategory.Error,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:t(1164,e.DiagnosticCategory.Error,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1165,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:t(1166,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1168,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1169,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1170,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:t(1171,e.DiagnosticCategory.Error,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:t(1172,e.DiagnosticCategory.Error,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:t(1173,e.DiagnosticCategory.Error,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:t(1174,e.DiagnosticCategory.Error,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:t(1175,e.DiagnosticCategory.Error,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:t(1176,e.DiagnosticCategory.Error,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:t(1177,e.DiagnosticCategory.Error,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:t(1178,e.DiagnosticCategory.Error,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:t(1179,e.DiagnosticCategory.Error,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:t(1180,e.DiagnosticCategory.Error,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:t(1181,e.DiagnosticCategory.Error,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:t(1182,e.DiagnosticCategory.Error,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:t(1183,e.DiagnosticCategory.Error,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:t(1184,e.DiagnosticCategory.Error,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:t(1185,e.DiagnosticCategory.Error,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:t(1186,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:t(1187,e.DiagnosticCategory.Error,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:t(1188,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:t(1189,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:t(1190,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:t(1191,e.DiagnosticCategory.Error,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:t(1192,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:t(1193,e.DiagnosticCategory.Error,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:t(1194,e.DiagnosticCategory.Error,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:t(1195,e.DiagnosticCategory.Error,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:t(1196,e.DiagnosticCategory.Error,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:t(1197,e.DiagnosticCategory.Error,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:t(1198,e.DiagnosticCategory.Error,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:t(1199,e.DiagnosticCategory.Error,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:t(1200,e.DiagnosticCategory.Error,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:t(1202,e.DiagnosticCategory.Error,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:t(1203,e.DiagnosticCategory.Error,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:t(1205,e.DiagnosticCategory.Error,"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205","Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."),Decorators_are_not_valid_here:t(1206,e.DiagnosticCategory.Error,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:t(1207,e.DiagnosticCategory.Error,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module:t(1208,e.DiagnosticCategory.Error,"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208","'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t(1210,e.DiagnosticCategory.Error,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:t(1211,e.DiagnosticCategory.Error,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:t(1212,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t(1213,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:t(1214,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:t(1215,e.DiagnosticCategory.Error,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:t(1216,e.DiagnosticCategory.Error,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:t(1218,e.DiagnosticCategory.Error,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning:t(1219,e.DiagnosticCategory.Error,"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219","Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),Generators_are_not_allowed_in_an_ambient_context:t(1221,e.DiagnosticCategory.Error,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:t(1222,e.DiagnosticCategory.Error,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:t(1223,e.DiagnosticCategory.Error,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:t(1224,e.DiagnosticCategory.Error,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:t(1225,e.DiagnosticCategory.Error,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:t(1226,e.DiagnosticCategory.Error,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:t(1227,e.DiagnosticCategory.Error,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:t(1228,e.DiagnosticCategory.Error,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:t(1229,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:t(1230,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1231,e.DiagnosticCategory.Error,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1232,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232","An import declaration can only be used at the top level of a namespace or module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module:t(1233,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233","An export declaration can only be used at the top level of a namespace or module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:t(1234,e.DiagnosticCategory.Error,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module:t(1235,e.DiagnosticCategory.Error,"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235","A namespace declaration is only allowed at the top level of a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:t(1236,e.DiagnosticCategory.Error,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:t(1237,e.DiagnosticCategory.Error,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:t(1238,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:t(1239,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:t(1240,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:t(1241,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:t(1242,e.DiagnosticCategory.Error,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:t(1243,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:t(1244,e.DiagnosticCategory.Error,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:t(1245,e.DiagnosticCategory.Error,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:t(1246,e.DiagnosticCategory.Error,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:t(1247,e.DiagnosticCategory.Error,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:t(1248,e.DiagnosticCategory.Error,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:t(1249,e.DiagnosticCategory.Error,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:t(1250,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t(1251,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:t(1252,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:t(1254,e.DiagnosticCategory.Error,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:t(1255,e.DiagnosticCategory.Error,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:t(1257,e.DiagnosticCategory.Error,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1258,e.DiagnosticCategory.Error,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:t(1259,e.DiagnosticCategory.Error,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:t(1260,e.DiagnosticCategory.Error,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:t(1261,e.DiagnosticCategory.Error,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:t(1262,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t(1263,e.DiagnosticCategory.Error,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:t(1264,e.DiagnosticCategory.Error,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:t(1265,e.DiagnosticCategory.Error,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:t(1266,e.DiagnosticCategory.Error,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:t(1267,e.DiagnosticCategory.Error,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:t(1268,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided:t(1269,e.DiagnosticCategory.Error,"Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269","Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),Decorator_function_return_type_0_is_not_assignable_to_type_1:t(1270,e.DiagnosticCategory.Error,"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270","Decorator function return type '{0}' is not assignable to type '{1}'."),Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any:t(1271,e.DiagnosticCategory.Error,"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271","Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled:t(1272,e.DiagnosticCategory.Error,"A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272","A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."),_0_modifier_cannot_appear_on_a_type_parameter:t(1273,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_parameter_1273","'{0}' modifier cannot appear on a type parameter"),_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias:t(1274,e.DiagnosticCategory.Error,"_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274","'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),with_statements_are_not_allowed_in_an_async_function_block:t(1300,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1308,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level:t(1309,e.DiagnosticCategory.Error,"The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309","The current file is a CommonJS module and cannot use 'await' at the top level."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:t(1312,e.DiagnosticCategory.Error,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:t(1313,e.DiagnosticCategory.Error,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:t(1314,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:t(1315,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:t(1316,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:t(1317,e.DiagnosticCategory.Error,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:t(1318,e.DiagnosticCategory.Error,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:t(1319,e.DiagnosticCategory.Error,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1320,e.DiagnosticCategory.Error,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1321,e.DiagnosticCategory.Error,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1322,e.DiagnosticCategory.Error,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext:t(1323,e.DiagnosticCategory.Error,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext:t(1324,e.DiagnosticCategory.Error,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),Argument_of_dynamic_import_cannot_be_spread_element:t(1325,e.DiagnosticCategory.Error,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments:t(1326,e.DiagnosticCategory.Error,"This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326","This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),String_literal_with_double_quotes_expected:t(1327,e.DiagnosticCategory.Error,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:t(1328,e.DiagnosticCategory.Error,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:t(1329,e.DiagnosticCategory.Error,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:t(1330,e.DiagnosticCategory.Error,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:t(1331,e.DiagnosticCategory.Error,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:t(1332,e.DiagnosticCategory.Error,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:t(1333,e.DiagnosticCategory.Error,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:t(1334,e.DiagnosticCategory.Error,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:t(1335,e.DiagnosticCategory.Error,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:t(1337,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:t(1338,e.DiagnosticCategory.Error,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:t(1339,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:t(1340,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Type_arguments_cannot_be_used_here:t(1342,e.DiagnosticCategory.Error,"Type_arguments_cannot_be_used_here_1342","Type arguments cannot be used here."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext:t(1343,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),A_label_is_not_allowed_here:t(1344,e.DiagnosticCategory.Error,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:t(1345,e.DiagnosticCategory.Error,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:t(1346,e.DiagnosticCategory.Error,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:t(1347,e.DiagnosticCategory.Error,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:t(1348,e.DiagnosticCategory.Error,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:t(1349,e.DiagnosticCategory.Error,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:t(1350,e.DiagnosticCategory.Message,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:t(1351,e.DiagnosticCategory.Error,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:t(1352,e.DiagnosticCategory.Error,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:t(1353,e.DiagnosticCategory.Error,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:t(1354,e.DiagnosticCategory.Error,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:t(1355,e.DiagnosticCategory.Error,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:t(1356,e.DiagnosticCategory.Error,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:t(1357,e.DiagnosticCategory.Error,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:t(1358,e.DiagnosticCategory.Error,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:t(1359,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:t(1361,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:t(1362,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:t(1363,e.DiagnosticCategory.Error,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:t(1364,e.DiagnosticCategory.Message,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:t(1365,e.DiagnosticCategory.Message,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:t(1366,e.DiagnosticCategory.Message,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:t(1367,e.DiagnosticCategory.Message,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Did_you_mean_0:t(1369,e.DiagnosticCategory.Message,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:t(1371,e.DiagnosticCategory.Error,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),Convert_to_type_only_import:t(1373,e.DiagnosticCategory.Message,"Convert_to_type_only_import_1373","Convert to type-only import"),Convert_all_imports_not_used_as_a_value_to_type_only_imports:t(1374,e.DiagnosticCategory.Message,"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374","Convert all imports not used as a value to type-only imports"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1375,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:t(1376,e.DiagnosticCategory.Message,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:t(1377,e.DiagnosticCategory.Message,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1378,e.DiagnosticCategory.Error,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:t(1379,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:t(1380,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:t(1381,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:t(1382,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Only_named_exports_may_use_export_type:t(1383,e.DiagnosticCategory.Error,"Only_named_exports_may_use_export_type_1383","Only named exports may use 'export type'."),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1385,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1386,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1387,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1388,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:t(1389,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:t(1390,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:t(1392,e.DiagnosticCategory.Error,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:t(1393,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:t(1394,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:t(1395,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:t(1396,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:t(1397,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:t(1398,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:t(1399,e.DiagnosticCategory.Message,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:t(1400,e.DiagnosticCategory.Message,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:t(1401,e.DiagnosticCategory.Message,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:t(1402,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:t(1403,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:t(1404,e.DiagnosticCategory.Message,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:t(1405,e.DiagnosticCategory.Message,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:t(1406,e.DiagnosticCategory.Message,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:t(1407,e.DiagnosticCategory.Message,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:t(1408,e.DiagnosticCategory.Message,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:t(1409,e.DiagnosticCategory.Message,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:t(1410,e.DiagnosticCategory.Message,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:t(1411,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:t(1412,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:t(1413,e.DiagnosticCategory.Message,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:t(1414,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:t(1415,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:t(1416,e.DiagnosticCategory.Message,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:t(1417,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:t(1418,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:t(1419,e.DiagnosticCategory.Message,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:t(1420,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:t(1421,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:t(1422,e.DiagnosticCategory.Message,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:t(1423,e.DiagnosticCategory.Message,"File_is_library_specified_here_1423","File is library specified here."),Default_library:t(1424,e.DiagnosticCategory.Message,"Default_library_1424","Default library"),Default_library_for_target_0:t(1425,e.DiagnosticCategory.Message,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:t(1426,e.DiagnosticCategory.Message,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:t(1427,e.DiagnosticCategory.Message,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:t(1428,e.DiagnosticCategory.Message,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:t(1429,e.DiagnosticCategory.Message,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:t(1430,e.DiagnosticCategory.Message,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1431,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1432,e.DiagnosticCategory.Error,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Decorators_may_not_be_applied_to_this_parameters:t(1433,e.DiagnosticCategory.Error,"Decorators_may_not_be_applied_to_this_parameters_1433","Decorators may not be applied to 'this' parameters."),Unexpected_keyword_or_identifier:t(1434,e.DiagnosticCategory.Error,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:t(1435,e.DiagnosticCategory.Error,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:t(1436,e.DiagnosticCategory.Error,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:t(1437,e.DiagnosticCategory.Error,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:t(1438,e.DiagnosticCategory.Error,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:t(1439,e.DiagnosticCategory.Error,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:t(1440,e.DiagnosticCategory.Error,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:t(1441,e.DiagnosticCategory.Error,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:t(1442,e.DiagnosticCategory.Error,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:t(1443,e.DiagnosticCategory.Error,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1444,e.DiagnosticCategory.Error,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1446,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled:t(1448,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:t(1449,e.DiagnosticCategory.Message,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments:t(1450,e.DiagnosticCategory.Message,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional assertion as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:t(1451,e.DiagnosticCategory.Error,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext:t(1452,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452","'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),resolution_mode_should_be_either_require_or_import:t(1453,e.DiagnosticCategory.Error,"resolution_mode_should_be_either_require_or_import_1453","`resolution-mode` should be either `require` or `import`."),resolution_mode_can_only_be_set_for_type_only_imports:t(1454,e.DiagnosticCategory.Error,"resolution_mode_can_only_be_set_for_type_only_imports_1454","`resolution-mode` can only be set for type-only imports."),resolution_mode_is_the_only_valid_key_for_type_import_assertions:t(1455,e.DiagnosticCategory.Error,"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455","`resolution-mode` is the only valid key for type import assertions."),Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require:t(1456,e.DiagnosticCategory.Error,"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456","Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:t(1470,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead:t(1471,e.DiagnosticCategory.Error,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),catch_or_finally_expected:t(1472,e.DiagnosticCategory.Error,"catch_or_finally_expected_1472","'catch' or 'finally' expected."),An_import_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1473,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473","An import declaration can only be used at the top level of a module."),An_export_declaration_can_only_be_used_at_the_top_level_of_a_module:t(1474,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474","An export declaration can only be used at the top level of a module."),Control_what_method_is_used_to_detect_module_format_JS_files:t(1475,e.DiagnosticCategory.Message,"Control_what_method_is_used_to_detect_module_format_JS_files_1475","Control what method is used to detect module-format JS files."),auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules:t(1476,e.DiagnosticCategory.Message,"auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476",'"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),The_types_of_0_are_incompatible_between_these_types:t(2200,e.DiagnosticCategory.Error,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:t(2201,e.DiagnosticCategory.Error,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:t(2202,e.DiagnosticCategory.Error,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:t(2203,e.DiagnosticCategory.Error,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2204,e.DiagnosticCategory.Error,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2205,e.DiagnosticCategory.Error,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:t(2206,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:t(2207,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2209,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209","The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:t(2210,e.DiagnosticCategory.Error,"The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210","The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),Duplicate_identifier_0:t(2300,e.DiagnosticCategory.Error,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2301,e.DiagnosticCategory.Error,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:t(2302,e.DiagnosticCategory.Error,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:t(2303,e.DiagnosticCategory.Error,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:t(2304,e.DiagnosticCategory.Error,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:t(2305,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:t(2306,e.DiagnosticCategory.Error,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:t(2307,e.DiagnosticCategory.Error,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:t(2308,e.DiagnosticCategory.Error,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:t(2309,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:t(2310,e.DiagnosticCategory.Error,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function:t(2311,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311","Cannot find name '{0}'. Did you mean to write this in an async function?"),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2312,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:t(2313,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:t(2314,e.DiagnosticCategory.Error,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:t(2315,e.DiagnosticCategory.Error,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:t(2316,e.DiagnosticCategory.Error,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:t(2317,e.DiagnosticCategory.Error,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:t(2318,e.DiagnosticCategory.Error,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:t(2319,e.DiagnosticCategory.Error,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:t(2320,e.DiagnosticCategory.Error,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:t(2321,e.DiagnosticCategory.Error,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:t(2322,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:t(2323,e.DiagnosticCategory.Error,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:t(2324,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:t(2325,e.DiagnosticCategory.Error,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:t(2326,e.DiagnosticCategory.Error,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:t(2327,e.DiagnosticCategory.Error,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:t(2328,e.DiagnosticCategory.Error,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:t(2329,e.DiagnosticCategory.Error,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:t(2330,e.DiagnosticCategory.Error,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:t(2331,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:t(2332,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:t(2333,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:t(2334,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:t(2335,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:t(2336,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:t(2337,e.DiagnosticCategory.Error,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:t(2338,e.DiagnosticCategory.Error,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:t(2339,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:t(2340,e.DiagnosticCategory.Error,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:t(2341,e.DiagnosticCategory.Error,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:t(2343,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:t(2344,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:t(2345,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Call_target_does_not_contain_any_signatures:t(2346,e.DiagnosticCategory.Error,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:t(2347,e.DiagnosticCategory.Error,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:t(2348,e.DiagnosticCategory.Error,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:t(2349,e.DiagnosticCategory.Error,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:t(2350,e.DiagnosticCategory.Error,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:t(2351,e.DiagnosticCategory.Error,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:t(2352,e.DiagnosticCategory.Error,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:t(2353,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:t(2354,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:t(2355,e.DiagnosticCategory.Error,"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'void' nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:t(2356,e.DiagnosticCategory.Error,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:t(2357,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:t(2358,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:t(2359,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359","The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol:t(2360,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360","The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),The_right_hand_side_of_an_in_expression_must_not_be_a_primitive:t(2361,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361","The right-hand side of an 'in' expression must not be a primitive."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2362,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2363,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:t(2364,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:t(2365,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:t(2366,e.DiagnosticCategory.Error,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap:t(2367,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367","This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap."),Type_parameter_name_cannot_be_0:t(2368,e.DiagnosticCategory.Error,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:t(2369,e.DiagnosticCategory.Error,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:t(2370,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:t(2371,e.DiagnosticCategory.Error,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:t(2372,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:t(2373,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:t(2374,e.DiagnosticCategory.Error,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2375,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2376,e.DiagnosticCategory.Error,"A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376","A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:t(2377,e.DiagnosticCategory.Error,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:t(2378,e.DiagnosticCategory.Error,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2379,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type:t(2380,e.DiagnosticCategory.Error,"The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380","The return type of a 'get' accessor must be assignable to its 'set' accessor type"),Overload_signatures_must_all_be_exported_or_non_exported:t(2383,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:t(2384,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:t(2385,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:t(2386,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:t(2387,e.DiagnosticCategory.Error,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:t(2388,e.DiagnosticCategory.Error,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:t(2389,e.DiagnosticCategory.Error,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:t(2390,e.DiagnosticCategory.Error,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:t(2391,e.DiagnosticCategory.Error,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:t(2392,e.DiagnosticCategory.Error,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:t(2393,e.DiagnosticCategory.Error,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:t(2394,e.DiagnosticCategory.Error,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:t(2395,e.DiagnosticCategory.Error,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:t(2396,e.DiagnosticCategory.Error,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:t(2397,e.DiagnosticCategory.Error,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:t(2398,e.DiagnosticCategory.Error,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:t(2399,e.DiagnosticCategory.Error,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:t(2400,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2401,e.DiagnosticCategory.Error,"A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401","A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:t(2402,e.DiagnosticCategory.Error,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:t(2403,e.DiagnosticCategory.Error,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:t(2404,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:t(2405,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:t(2406,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:t(2407,e.DiagnosticCategory.Error,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:t(2408,e.DiagnosticCategory.Error,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:t(2409,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:t(2410,e.DiagnosticCategory.Error,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:t(2412,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:t(2411,e.DiagnosticCategory.Error,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:t(2413,e.DiagnosticCategory.Error,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:t(2414,e.DiagnosticCategory.Error,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:t(2415,e.DiagnosticCategory.Error,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:t(2416,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:t(2417,e.DiagnosticCategory.Error,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:t(2418,e.DiagnosticCategory.Error,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:t(2419,e.DiagnosticCategory.Error,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:t(2420,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2422,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:t(2423,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:t(2425,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:t(2426,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:t(2427,e.DiagnosticCategory.Error,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:t(2428,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:t(2430,e.DiagnosticCategory.Error,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:t(2431,e.DiagnosticCategory.Error,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:t(2432,e.DiagnosticCategory.Error,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:t(2433,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:t(2434,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:t(2435,e.DiagnosticCategory.Error,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:t(2436,e.DiagnosticCategory.Error,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:t(2437,e.DiagnosticCategory.Error,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:t(2438,e.DiagnosticCategory.Error,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:t(2439,e.DiagnosticCategory.Error,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:t(2440,e.DiagnosticCategory.Error,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:t(2441,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:t(2442,e.DiagnosticCategory.Error,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:t(2443,e.DiagnosticCategory.Error,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:t(2444,e.DiagnosticCategory.Error,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:t(2445,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:t(2446,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:t(2447,e.DiagnosticCategory.Error,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:t(2448,e.DiagnosticCategory.Error,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:t(2449,e.DiagnosticCategory.Error,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:t(2450,e.DiagnosticCategory.Error,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:t(2451,e.DiagnosticCategory.Error,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:t(2452,e.DiagnosticCategory.Error,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:t(2454,e.DiagnosticCategory.Error,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:t(2456,e.DiagnosticCategory.Error,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:t(2457,e.DiagnosticCategory.Error,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:t(2458,e.DiagnosticCategory.Error,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:t(2459,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:t(2460,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:t(2461,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:t(2462,e.DiagnosticCategory.Error,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:t(2463,e.DiagnosticCategory.Error,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:t(2464,e.DiagnosticCategory.Error,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:t(2465,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:t(2466,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:t(2467,e.DiagnosticCategory.Error,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:t(2468,e.DiagnosticCategory.Error,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:t(2469,e.DiagnosticCategory.Error,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:t(2472,e.DiagnosticCategory.Error,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:t(2473,e.DiagnosticCategory.Error,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values:t(2474,e.DiagnosticCategory.Error,"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474","const enum member initializers can only contain literal values and other computed enum values."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:t(2475,e.DiagnosticCategory.Error,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:t(2476,e.DiagnosticCategory.Error,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:t(2477,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:t(2478,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:t(2480,e.DiagnosticCategory.Error,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:t(2481,e.DiagnosticCategory.Error,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:t(2483,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:t(2484,e.DiagnosticCategory.Error,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:t(2487,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2488,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:t(2489,e.DiagnosticCategory.Error,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:t(2490,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:t(2491,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:t(2492,e.DiagnosticCategory.Error,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:t(2493,e.DiagnosticCategory.Error,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:t(2494,e.DiagnosticCategory.Error,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:t(2495,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:t(2496,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:t(2497,e.DiagnosticCategory.Error,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:t(2498,e.DiagnosticCategory.Error,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2499,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2500,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:t(2501,e.DiagnosticCategory.Error,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:t(2502,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:t(2503,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:t(2504,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:t(2505,e.DiagnosticCategory.Error,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:t(2506,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:t(2507,e.DiagnosticCategory.Error,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:t(2508,e.DiagnosticCategory.Error,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2509,e.DiagnosticCategory.Error,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:t(2510,e.DiagnosticCategory.Error,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:t(2511,e.DiagnosticCategory.Error,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:t(2512,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:t(2513,e.DiagnosticCategory.Error,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:t(2515,e.DiagnosticCategory.Error,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:t(2516,e.DiagnosticCategory.Error,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:t(2517,e.DiagnosticCategory.Error,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:t(2518,e.DiagnosticCategory.Error,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:t(2519,e.DiagnosticCategory.Error,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:t(2520,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:t(2522,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:t(2523,e.DiagnosticCategory.Error,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:t(2524,e.DiagnosticCategory.Error,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:t(2525,e.DiagnosticCategory.Error,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:t(2526,e.DiagnosticCategory.Error,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:t(2527,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:t(2528,e.DiagnosticCategory.Error,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:t(2529,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:t(2530,e.DiagnosticCategory.Error,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:t(2531,e.DiagnosticCategory.Error,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:t(2532,e.DiagnosticCategory.Error,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:t(2533,e.DiagnosticCategory.Error,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:t(2534,e.DiagnosticCategory.Error,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Enum_type_0_has_members_with_initializers_that_are_not_literals:t(2535,e.DiagnosticCategory.Error,"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535","Enum type '{0}' has members with initializers that are not literals."),Type_0_cannot_be_used_to_index_type_1:t(2536,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:t(2537,e.DiagnosticCategory.Error,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:t(2538,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:t(2539,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:t(2540,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:t(2542,e.DiagnosticCategory.Error,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:t(2543,e.DiagnosticCategory.Error,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:t(2544,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:t(2545,e.DiagnosticCategory.Error,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:t(2547,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2548,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2549,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:t(2550,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:t(2551,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:t(2552,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:t(2553,e.DiagnosticCategory.Error,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:t(2554,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:t(2555,e.DiagnosticCategory.Error,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:t(2556,e.DiagnosticCategory.Error,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:t(2558,e.DiagnosticCategory.Error,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:t(2559,e.DiagnosticCategory.Error,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:t(2560,e.DiagnosticCategory.Error,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:t(2561,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:t(2562,e.DiagnosticCategory.Error,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:t(2563,e.DiagnosticCategory.Error,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:t(2564,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:t(2565,e.DiagnosticCategory.Error,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:t(2566,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:t(2567,e.DiagnosticCategory.Error,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:t(2568,e.DiagnosticCategory.Error,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Could_not_find_name_0_Did_you_mean_1:t(2570,e.DiagnosticCategory.Error,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:t(2571,e.DiagnosticCategory.Error,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:t(2574,e.DiagnosticCategory.Error,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:t(2575,e.DiagnosticCategory.Error,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:t(2576,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:t(2577,e.DiagnosticCategory.Error,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:t(2578,e.DiagnosticCategory.Error,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:t(2580,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:t(2581,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:t(2582,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:t(2583,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:t(2584,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:t(2585,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:t(2588,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:t(2589,e.DiagnosticCategory.Error,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:t(2590,e.DiagnosticCategory.Error,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:t(2591,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:t(2592,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:t(2593,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:t(2594,e.DiagnosticCategory.Error,"This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594","This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:t(2595,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2596,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:t(2597,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2598,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:t(2602,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:t(2603,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:t(2604,e.DiagnosticCategory.Error,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:t(2606,e.DiagnosticCategory.Error,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:t(2607,e.DiagnosticCategory.Error,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:t(2608,e.DiagnosticCategory.Error,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:t(2609,e.DiagnosticCategory.Error,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:t(2610,e.DiagnosticCategory.Error,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:t(2611,e.DiagnosticCategory.Error,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:t(2612,e.DiagnosticCategory.Error,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:t(2613,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:t(2614,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:t(2615,e.DiagnosticCategory.Error,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:t(2616,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2617,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:t(2618,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:t(2619,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:t(2620,e.DiagnosticCategory.Error,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:t(2621,e.DiagnosticCategory.Error,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:t(2623,e.DiagnosticCategory.Error,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:t(2624,e.DiagnosticCategory.Error,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:t(2625,e.DiagnosticCategory.Error,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:t(2626,e.DiagnosticCategory.Error,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:t(2627,e.DiagnosticCategory.Error,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:t(2628,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:t(2629,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:t(2630,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:t(2631,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:t(2632,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:t(2633,e.DiagnosticCategory.Error,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:t(2634,e.DiagnosticCategory.Error,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable:t(2635,e.DiagnosticCategory.Error,"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635","Type '{0}' has no signatures for which the type argument list is applicable."),Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation:t(2636,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636","Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types:t(2637,e.DiagnosticCategory.Error,"Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637","Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:t(2649,e.DiagnosticCategory.Error,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:t(2651,e.DiagnosticCategory.Error,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:t(2652,e.DiagnosticCategory.Error,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:t(2653,e.DiagnosticCategory.Error,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:t(2657,e.DiagnosticCategory.Error,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:t(2658,e.DiagnosticCategory.Error,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:t(2659,e.DiagnosticCategory.Error,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:t(2660,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:t(2661,e.DiagnosticCategory.Error,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:t(2662,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:t(2663,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:t(2664,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:t(2665,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:t(2666,e.DiagnosticCategory.Error,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:t(2667,e.DiagnosticCategory.Error,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:t(2668,e.DiagnosticCategory.Error,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:t(2669,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:t(2670,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:t(2671,e.DiagnosticCategory.Error,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:t(2672,e.DiagnosticCategory.Error,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:t(2673,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:t(2674,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:t(2675,e.DiagnosticCategory.Error,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:t(2676,e.DiagnosticCategory.Error,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:t(2677,e.DiagnosticCategory.Error,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:t(2678,e.DiagnosticCategory.Error,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:t(2679,e.DiagnosticCategory.Error,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:t(2680,e.DiagnosticCategory.Error,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:t(2681,e.DiagnosticCategory.Error,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:t(2683,e.DiagnosticCategory.Error,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:t(2684,e.DiagnosticCategory.Error,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:t(2685,e.DiagnosticCategory.Error,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:t(2686,e.DiagnosticCategory.Error,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:t(2687,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:t(2688,e.DiagnosticCategory.Error,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:t(2689,e.DiagnosticCategory.Error,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:t(2690,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead:t(2691,e.DiagnosticCategory.Error,"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691","An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:t(2692,e.DiagnosticCategory.Error,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:t(2693,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:t(2694,e.DiagnosticCategory.Error,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:t(2695,e.DiagnosticCategory.Error,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:t(2696,e.DiagnosticCategory.Error,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2697,e.DiagnosticCategory.Error,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:t(2698,e.DiagnosticCategory.Error,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:t(2699,e.DiagnosticCategory.Error,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:t(2700,e.DiagnosticCategory.Error,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:t(2701,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:t(2702,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:t(2703,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:t(2704,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2705,e.DiagnosticCategory.Error,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:t(2706,e.DiagnosticCategory.Error,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:t(2707,e.DiagnosticCategory.Error,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:t(2708,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:t(2709,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:t(2710,e.DiagnosticCategory.Error,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2711,e.DiagnosticCategory.Error,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2712,e.DiagnosticCategory.Error,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:t(2713,e.DiagnosticCategory.Error,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\"{1}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:t(2714,e.DiagnosticCategory.Error,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:t(2715,e.DiagnosticCategory.Error,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:t(2716,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:t(2717,e.DiagnosticCategory.Error,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:t(2718,e.DiagnosticCategory.Error,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:t(2719,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:t(2720,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:t(2721,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:t(2722,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:t(2723,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:t(2724,e.DiagnosticCategory.Error,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:t(2725,e.DiagnosticCategory.Error,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:t(2726,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:t(2727,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:t(2728,e.DiagnosticCategory.Message,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:t(2729,e.DiagnosticCategory.Error,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:t(2730,e.DiagnosticCategory.Error,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:t(2731,e.DiagnosticCategory.Error,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:t(2732,e.DiagnosticCategory.Error,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:t(2733,e.DiagnosticCategory.Error,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:t(2734,e.DiagnosticCategory.Error,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:t(2735,e.DiagnosticCategory.Error,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:t(2736,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:t(2737,e.DiagnosticCategory.Error,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:t(2738,e.DiagnosticCategory.Message,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:t(2739,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:t(2740,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:t(2741,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:t(2742,e.DiagnosticCategory.Error,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:t(2743,e.DiagnosticCategory.Error,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:t(2744,e.DiagnosticCategory.Error,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:t(2745,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:t(2746,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:t(2747,e.DiagnosticCategory.Error,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided:t(2748,e.DiagnosticCategory.Error,"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748","Cannot access ambient const enums when the '--isolatedModules' flag is provided."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:t(2749,e.DiagnosticCategory.Error,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:t(2750,e.DiagnosticCategory.Error,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:t(2751,e.DiagnosticCategory.Error,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:t(2752,e.DiagnosticCategory.Error,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:t(2753,e.DiagnosticCategory.Error,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:t(2754,e.DiagnosticCategory.Error,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:t(2755,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:t(2756,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:t(2757,e.DiagnosticCategory.Error,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2758,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:t(2759,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:t(2760,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:t(2761,e.DiagnosticCategory.Error,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2762,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:t(2763,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:t(2764,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:t(2765,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:t(2766,e.DiagnosticCategory.Error,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:t(2767,e.DiagnosticCategory.Error,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:t(2768,e.DiagnosticCategory.Error,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:t(2769,e.DiagnosticCategory.Error,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:t(2770,e.DiagnosticCategory.Error,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:t(2771,e.DiagnosticCategory.Error,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:t(2772,e.DiagnosticCategory.Error,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:t(2773,e.DiagnosticCategory.Error,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:t(2774,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:t(2775,e.DiagnosticCategory.Error,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:t(2776,e.DiagnosticCategory.Error,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:t(2777,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:t(2778,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:t(2779,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:t(2780,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:t(2781,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:t(2782,e.DiagnosticCategory.Message,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:t(2783,e.DiagnosticCategory.Error,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:t(2784,e.DiagnosticCategory.Error,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:t(2785,e.DiagnosticCategory.Error,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:t(2786,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:t(2787,e.DiagnosticCategory.Error,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:t(2788,e.DiagnosticCategory.Error,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:t(2789,e.DiagnosticCategory.Error,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:t(2790,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:t(2791,e.DiagnosticCategory.Error,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:t(2792,e.DiagnosticCategory.Error,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:t(2793,e.DiagnosticCategory.Error,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:t(2794,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:t(2795,e.DiagnosticCategory.Error,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:t(2796,e.DiagnosticCategory.Error,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:t(2797,e.DiagnosticCategory.Error,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:t(2798,e.DiagnosticCategory.Error,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:t(2799,e.DiagnosticCategory.Error,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:t(2800,e.DiagnosticCategory.Error,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:t(2801,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:t(2802,e.DiagnosticCategory.Error,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:t(2803,e.DiagnosticCategory.Error,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:t(2804,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Private_accessor_was_defined_without_a_getter:t(2806,e.DiagnosticCategory.Error,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:t(2807,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:t(2808,e.DiagnosticCategory.Error,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses:t(2809,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments:t(2810,e.DiagnosticCategory.Error,"Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810","Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),Initializer_for_property_0:t(2811,e.DiagnosticCategory.Error,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:t(2812,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:t(2813,e.DiagnosticCategory.Error,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:t(2814,e.DiagnosticCategory.Error,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:t(2815,e.DiagnosticCategory.Error,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:t(2816,e.DiagnosticCategory.Error,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:t(2817,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:t(2818,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:t(2819,e.DiagnosticCategory.Error,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:t(2820,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext:t(2821,e.DiagnosticCategory.Error,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821","Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:t(2822,e.DiagnosticCategory.Error,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Cannot_find_namespace_0_Did_you_mean_1:t(2833,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path:t(2834,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0:t(2835,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls:t(2836,e.DiagnosticCategory.Error,"Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836","Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),Import_assertion_values_must_be_string_literal_expressions:t(2837,e.DiagnosticCategory.Error,"Import_assertion_values_must_be_string_literal_expressions_2837","Import assertion values must be string literal expressions."),All_declarations_of_0_must_have_identical_constraints:t(2838,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_constraints_2838","All declarations of '{0}' must have identical constraints."),The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(2841,e.DiagnosticCategory.Error,"The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841","The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),Import_declaration_0_is_using_private_name_1:t(4e3,e.DiagnosticCategory.Error,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:t(4002,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:t(4004,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4006,e.DiagnosticCategory.Error,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4008,e.DiagnosticCategory.Error,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4010,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4012,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4014,e.DiagnosticCategory.Error,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4016,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4019,e.DiagnosticCategory.Error,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4020,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:t(4021,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:t(4022,e.DiagnosticCategory.Error,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4023,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:t(4024,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:t(4025,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4026,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4027,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:t(4028,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4029,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4030,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:t(4031,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4032,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:t(4033,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4034,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4035,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4036,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4037,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4038,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4039,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4040,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4041,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4042,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4043,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4044,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:t(4045,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4046,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:t(4047,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4048,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:t(4049,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4050,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4051,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:t(4052,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4053,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4054,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t(4055,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4056,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:t(4057,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4058,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:t(4059,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:t(4060,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4061,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4062,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:t(4063,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4064,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4065,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4066,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4067,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4068,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4069,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4070,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4071,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4072,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4073,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4074,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4075,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4076,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:t(4077,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4078,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:t(4081,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:t(4082,e.DiagnosticCategory.Error,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:t(4083,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:t(4084,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:t(4090,e.DiagnosticCategory.Error,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4091,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:t(4092,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:t(4094,e.DiagnosticCategory.Error,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4095,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4096,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:t(4097,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4098,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4099,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:t(4100,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4101,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:t(4102,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:t(4103,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:t(4104,e.DiagnosticCategory.Error,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:t(4105,e.DiagnosticCategory.Error,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:t(4106,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:t(4107,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4108,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:t(4109,e.DiagnosticCategory.Error,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:t(4110,e.DiagnosticCategory.Error,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:t(4111,e.DiagnosticCategory.Error,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:t(4112,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:t(4113,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:t(4114,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:t(4115,e.DiagnosticCategory.Error,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:t(4116,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4117,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:t(4118,e.DiagnosticCategory.Error,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4119,e.DiagnosticCategory.Error,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4120,e.DiagnosticCategory.Error,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:t(4121,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:t(4122,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4123,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4124,e.DiagnosticCategory.Error,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4125,e.DiagnosticCategory.Error,"resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125","'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:t(5001,e.DiagnosticCategory.Error,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:t(5009,e.DiagnosticCategory.Error,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5010,e.DiagnosticCategory.Error,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:t(5012,e.DiagnosticCategory.Error,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:t(5014,e.DiagnosticCategory.Error,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:t(5023,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:t(5024,e.DiagnosticCategory.Error,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:t(5025,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:t(5033,e.DiagnosticCategory.Error,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:t(5042,e.DiagnosticCategory.Error,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:t(5047,e.DiagnosticCategory.Error,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:t(5048,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:t(5051,e.DiagnosticCategory.Error,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:t(5052,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:t(5053,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:t(5054,e.DiagnosticCategory.Error,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:t(5055,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:t(5056,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:t(5057,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:t(5058,e.DiagnosticCategory.Error,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:t(5059,e.DiagnosticCategory.Error,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:t(5061,e.DiagnosticCategory.Error,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:t(5062,e.DiagnosticCategory.Error,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:t(5063,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:t(5064,e.DiagnosticCategory.Error,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5065,e.DiagnosticCategory.Error,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:t(5066,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:t(5067,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:t(5068,e.DiagnosticCategory.Error,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:t(5069,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy:t(5070,e.DiagnosticCategory.Error,"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070","Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:t(5071,e.DiagnosticCategory.Error,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:t(5072,e.DiagnosticCategory.Error,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:t(5073,e.DiagnosticCategory.Error,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:t(5074,e.DiagnosticCategory.Error,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:t(5075,e.DiagnosticCategory.Error,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:t(5076,e.DiagnosticCategory.Error,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:t(5077,e.DiagnosticCategory.Error,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:t(5078,e.DiagnosticCategory.Error,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:t(5079,e.DiagnosticCategory.Error,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:t(5080,e.DiagnosticCategory.Error,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:t(5081,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:t(5082,e.DiagnosticCategory.Error,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:t(5083,e.DiagnosticCategory.Error,"Cannot_read_file_0_5083","Cannot read file '{0}'."),Tuple_members_must_all_have_names_or_all_not_have_names:t(5084,e.DiagnosticCategory.Error,"Tuple_members_must_all_have_names_or_all_not_have_names_5084","Tuple members must all have names or all not have names."),A_tuple_member_cannot_be_both_optional_and_rest:t(5085,e.DiagnosticCategory.Error,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:t(5086,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:t(5087,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:t(5088,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:t(5089,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:t(5090,e.DiagnosticCategory.Error,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled:t(5091,e.DiagnosticCategory.Error,"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),The_root_value_of_a_0_file_must_be_an_object:t(5092,e.DiagnosticCategory.Error,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:t(5093,e.DiagnosticCategory.Error,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:t(5094,e.DiagnosticCategory.Error,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later:t(5095,e.DiagnosticCategory.Error,"Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:t(6e3,e.DiagnosticCategory.Message,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:t(6001,e.DiagnosticCategory.Message,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:t(6002,e.DiagnosticCategory.Message,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:t(6004,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:t(6005,e.DiagnosticCategory.Message,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:t(6006,e.DiagnosticCategory.Message,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:t(6007,e.DiagnosticCategory.Message,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:t(6008,e.DiagnosticCategory.Message,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:t(6009,e.DiagnosticCategory.Message,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:t(6010,e.DiagnosticCategory.Message,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:t(6011,e.DiagnosticCategory.Message,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:t(6012,e.DiagnosticCategory.Message,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:t(6013,e.DiagnosticCategory.Message,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:t(6014,e.DiagnosticCategory.Message,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:t(6015,e.DiagnosticCategory.Message,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:t(6016,e.DiagnosticCategory.Message,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:t(6017,e.DiagnosticCategory.Message,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:t(6019,e.DiagnosticCategory.Message,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:t(6020,e.DiagnosticCategory.Message,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:t(6023,e.DiagnosticCategory.Message,"Syntax_Colon_0_6023","Syntax: {0}"),options:t(6024,e.DiagnosticCategory.Message,"options_6024","options"),file:t(6025,e.DiagnosticCategory.Message,"file_6025","file"),Examples_Colon_0:t(6026,e.DiagnosticCategory.Message,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:t(6027,e.DiagnosticCategory.Message,"Options_Colon_6027","Options:"),Version_0:t(6029,e.DiagnosticCategory.Message,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:t(6030,e.DiagnosticCategory.Message,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:t(6031,e.DiagnosticCategory.Message,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:t(6032,e.DiagnosticCategory.Message,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:t(6034,e.DiagnosticCategory.Message,"KIND_6034","KIND"),FILE:t(6035,e.DiagnosticCategory.Message,"FILE_6035","FILE"),VERSION:t(6036,e.DiagnosticCategory.Message,"VERSION_6036","VERSION"),LOCATION:t(6037,e.DiagnosticCategory.Message,"LOCATION_6037","LOCATION"),DIRECTORY:t(6038,e.DiagnosticCategory.Message,"DIRECTORY_6038","DIRECTORY"),STRATEGY:t(6039,e.DiagnosticCategory.Message,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:t(6040,e.DiagnosticCategory.Message,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Errors_Files:t(6041,e.DiagnosticCategory.Message,"Errors_Files_6041","Errors Files"),Generates_corresponding_map_file:t(6043,e.DiagnosticCategory.Message,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:t(6044,e.DiagnosticCategory.Error,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:t(6045,e.DiagnosticCategory.Error,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:t(6046,e.DiagnosticCategory.Error,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:t(6048,e.DiagnosticCategory.Error,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form or -. For example '{0}' or '{1}'."),Unable_to_open_file_0:t(6050,e.DiagnosticCategory.Error,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:t(6051,e.DiagnosticCategory.Error,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:t(6052,e.DiagnosticCategory.Message,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:t(6053,e.DiagnosticCategory.Error,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:t(6054,e.DiagnosticCategory.Error,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:t(6055,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:t(6056,e.DiagnosticCategory.Message,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:t(6058,e.DiagnosticCategory.Message,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:t(6059,e.DiagnosticCategory.Error,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:t(6060,e.DiagnosticCategory.Message,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:t(6061,e.DiagnosticCategory.Message,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:t(6064,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:t(6065,e.DiagnosticCategory.Message,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:t(6066,e.DiagnosticCategory.Message,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:t(6069,e.DiagnosticCategory.Message,"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069","Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:t(6070,e.DiagnosticCategory.Message,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:t(6071,e.DiagnosticCategory.Message,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:t(6072,e.DiagnosticCategory.Message,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:t(6073,e.DiagnosticCategory.Message,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:t(6074,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:t(6075,e.DiagnosticCategory.Message,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:t(6076,e.DiagnosticCategory.Message,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:t(6077,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:t(6078,e.DiagnosticCategory.Message,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:t(6079,e.DiagnosticCategory.Message,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:t(6080,e.DiagnosticCategory.Message,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:t(6081,e.DiagnosticCategory.Message,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:t(6082,e.DiagnosticCategory.Error,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:t(6083,e.DiagnosticCategory.Message,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:t(6084,e.DiagnosticCategory.Message,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:t(6085,e.DiagnosticCategory.Message,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:t(6086,e.DiagnosticCategory.Message,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:t(6087,e.DiagnosticCategory.Message,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:t(6088,e.DiagnosticCategory.Message,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:t(6089,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:t(6090,e.DiagnosticCategory.Message,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:t(6091,e.DiagnosticCategory.Message,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:t(6092,e.DiagnosticCategory.Message,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:t(6093,e.DiagnosticCategory.Message,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:t(6094,e.DiagnosticCategory.Message,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1:t(6095,e.DiagnosticCategory.Message,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095","Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),File_0_does_not_exist:t(6096,e.DiagnosticCategory.Message,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exist_use_it_as_a_name_resolution_result:t(6097,e.DiagnosticCategory.Message,"File_0_exist_use_it_as_a_name_resolution_result_6097","File '{0}' exist - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_type_1:t(6098,e.DiagnosticCategory.Message,"Loading_module_0_from_node_modules_folder_target_file_type_1_6098","Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),Found_package_json_at_0:t(6099,e.DiagnosticCategory.Message,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:t(6100,e.DiagnosticCategory.Message,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:t(6101,e.DiagnosticCategory.Message,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:t(6102,e.DiagnosticCategory.Message,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:t(6104,e.DiagnosticCategory.Message,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:t(6105,e.DiagnosticCategory.Message,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:t(6106,e.DiagnosticCategory.Message,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:t(6107,e.DiagnosticCategory.Message,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:t(6108,e.DiagnosticCategory.Message,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:t(6109,e.DiagnosticCategory.Message,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:t(6110,e.DiagnosticCategory.Message,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:t(6111,e.DiagnosticCategory.Message,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:t(6112,e.DiagnosticCategory.Message,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:t(6113,e.DiagnosticCategory.Message,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:t(6114,e.DiagnosticCategory.Error,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:t(6115,e.DiagnosticCategory.Message,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:t(6116,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:t(6119,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:t(6120,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:t(6121,e.DiagnosticCategory.Message,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:t(6122,e.DiagnosticCategory.Message,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:t(6123,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:t(6124,e.DiagnosticCategory.Message,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:t(6125,e.DiagnosticCategory.Message,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:t(6126,e.DiagnosticCategory.Message,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:t(6127,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:t(6128,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:t(6130,e.DiagnosticCategory.Message,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:t(6131,e.DiagnosticCategory.Error,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:t(6132,e.DiagnosticCategory.Message,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:t(6133,e.DiagnosticCategory.Error,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:t(6134,e.DiagnosticCategory.Message,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:t(6135,e.DiagnosticCategory.Message,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:t(6136,e.DiagnosticCategory.Message,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:t(6137,e.DiagnosticCategory.Error,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:t(6138,e.DiagnosticCategory.Error,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:t(6139,e.DiagnosticCategory.Message,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:t(6140,e.DiagnosticCategory.Error,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:t(6141,e.DiagnosticCategory.Message,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:t(6142,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:t(6144,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:t(6145,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:t(6146,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:t(6147,e.DiagnosticCategory.Message,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:t(6148,e.DiagnosticCategory.Message,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:t(6149,e.DiagnosticCategory.Message,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:t(6150,e.DiagnosticCategory.Message,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:t(6151,e.DiagnosticCategory.Message,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:t(6152,e.DiagnosticCategory.Message,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:t(6153,e.DiagnosticCategory.Message,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:t(6154,e.DiagnosticCategory.Message,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:t(6155,e.DiagnosticCategory.Message,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:t(6156,e.DiagnosticCategory.Message,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:t(6157,e.DiagnosticCategory.Message,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:t(6158,e.DiagnosticCategory.Message,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:t(6159,e.DiagnosticCategory.Message,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:t(6160,e.DiagnosticCategory.Message,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:t(6161,e.DiagnosticCategory.Message,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:t(6162,e.DiagnosticCategory.Message,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:t(6163,e.DiagnosticCategory.Message,"The_character_set_of_the_input_files_6163","The character set of the input files."),Do_not_truncate_error_messages:t(6165,e.DiagnosticCategory.Message,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:t(6166,e.DiagnosticCategory.Message,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:t(6167,e.DiagnosticCategory.Message,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:t(6168,e.DiagnosticCategory.Message,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:t(6169,e.DiagnosticCategory.Message,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:t(6170,e.DiagnosticCategory.Message,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:t(6171,e.DiagnosticCategory.Message,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:t(6179,e.DiagnosticCategory.Message,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:t(6180,e.DiagnosticCategory.Message,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),Scoped_package_detected_looking_in_0:t(6182,e.DiagnosticCategory.Message,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6183,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6184,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:t(6186,e.DiagnosticCategory.Message,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:t(6187,e.DiagnosticCategory.Message,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:t(6188,e.DiagnosticCategory.Error,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:t(6189,e.DiagnosticCategory.Error,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:t(6191,e.DiagnosticCategory.Message,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:t(6192,e.DiagnosticCategory.Error,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:t(6193,e.DiagnosticCategory.Message,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:t(6194,e.DiagnosticCategory.Message,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:t(6195,e.DiagnosticCategory.Message,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:t(6196,e.DiagnosticCategory.Error,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:t(6197,e.DiagnosticCategory.Message,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:t(6198,e.DiagnosticCategory.Error,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:t(6199,e.DiagnosticCategory.Error,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:t(6200,e.DiagnosticCategory.Error,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:t(6201,e.DiagnosticCategory.Message,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:t(6202,e.DiagnosticCategory.Error,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:t(6203,e.DiagnosticCategory.Message,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:t(6204,e.DiagnosticCategory.Message,"and_here_6204","and here."),All_type_parameters_are_unused:t(6205,e.DiagnosticCategory.Error,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:t(6206,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:t(6207,e.DiagnosticCategory.Message,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:t(6208,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:t(6209,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:t(6210,e.DiagnosticCategory.Message,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:t(6211,e.DiagnosticCategory.Message,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:t(6212,e.DiagnosticCategory.Message,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:t(6213,e.DiagnosticCategory.Message,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:t(6214,e.DiagnosticCategory.Message,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:t(6215,e.DiagnosticCategory.Message,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:t(6216,e.DiagnosticCategory.Message,"Found_1_error_6216","Found 1 error."),Found_0_errors:t(6217,e.DiagnosticCategory.Message,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:t(6218,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:t(6219,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:t(6220,e.DiagnosticCategory.Message,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:t(6221,e.DiagnosticCategory.Message,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:t(6222,e.DiagnosticCategory.Message,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:t(6223,e.DiagnosticCategory.Message,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:t(6224,e.DiagnosticCategory.Message,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:t(6225,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:t(6226,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:t(6227,e.DiagnosticCategory.Message,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:t(6229,e.DiagnosticCategory.Error,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:t(6230,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:t(6231,e.DiagnosticCategory.Error,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:t(6232,e.DiagnosticCategory.Error,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:t(6233,e.DiagnosticCategory.Error,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:t(6234,e.DiagnosticCategory.Error,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:t(6235,e.DiagnosticCategory.Message,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:t(6236,e.DiagnosticCategory.Error,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:t(6237,e.DiagnosticCategory.Message,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:t(6238,e.DiagnosticCategory.Error,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:t(6239,e.DiagnosticCategory.Message,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:t(6240,e.DiagnosticCategory.Message,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:t(6241,e.DiagnosticCategory.Message,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:t(6242,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:t(6243,e.DiagnosticCategory.Message,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:t(6244,e.DiagnosticCategory.Message,"Modules_6244","Modules"),File_Management:t(6245,e.DiagnosticCategory.Message,"File_Management_6245","File Management"),Emit:t(6246,e.DiagnosticCategory.Message,"Emit_6246","Emit"),JavaScript_Support:t(6247,e.DiagnosticCategory.Message,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:t(6248,e.DiagnosticCategory.Message,"Type_Checking_6248","Type Checking"),Editor_Support:t(6249,e.DiagnosticCategory.Message,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:t(6250,e.DiagnosticCategory.Message,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:t(6251,e.DiagnosticCategory.Message,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:t(6252,e.DiagnosticCategory.Message,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:t(6253,e.DiagnosticCategory.Message,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:t(6254,e.DiagnosticCategory.Message,"Language_and_Environment_6254","Language and Environment"),Projects:t(6255,e.DiagnosticCategory.Message,"Projects_6255","Projects"),Output_Formatting:t(6256,e.DiagnosticCategory.Message,"Output_Formatting_6256","Output Formatting"),Completeness:t(6257,e.DiagnosticCategory.Message,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:t(6258,e.DiagnosticCategory.Error,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Found_1_error_in_1:t(6259,e.DiagnosticCategory.Message,"Found_1_error_in_1_6259","Found 1 error in {1}"),Found_0_errors_in_the_same_file_starting_at_Colon_1:t(6260,e.DiagnosticCategory.Message,"Found_0_errors_in_the_same_file_starting_at_Colon_1_6260","Found {0} errors in the same file, starting at: {1}"),Found_0_errors_in_1_files:t(6261,e.DiagnosticCategory.Message,"Found_0_errors_in_1_files_6261","Found {0} errors in {1} files."),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:t(6270,e.DiagnosticCategory.Message,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6271,e.DiagnosticCategory.Message,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:t(6272,e.DiagnosticCategory.Message,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:t(6273,e.DiagnosticCategory.Message,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:t(6274,e.DiagnosticCategory.Message,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:t(6275,e.DiagnosticCategory.Message,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6276,e.DiagnosticCategory.Message,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Enable_project_compilation:t(6302,e.DiagnosticCategory.Message,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:t(6304,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:t(6305,e.DiagnosticCategory.Error,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:t(6306,e.DiagnosticCategory.Error,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:t(6307,e.DiagnosticCategory.Error,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:t(6308,e.DiagnosticCategory.Error,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:t(6309,e.DiagnosticCategory.Error,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:t(6310,e.DiagnosticCategory.Error,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2:t(6350,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350","Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2:t(6351,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:t(6352,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:t(6353,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:t(6354,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:t(6355,e.DiagnosticCategory.Message,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:t(6356,e.DiagnosticCategory.Message,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:t(6357,e.DiagnosticCategory.Message,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:t(6358,e.DiagnosticCategory.Message,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:t(6359,e.DiagnosticCategory.Message,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:t(6361,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:t(6362,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:t(6363,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:t(6364,e.DiagnosticCategory.Message,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:t(6365,e.DiagnosticCategory.Message,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects."),Show_what_would_be_built_or_deleted_if_specified_with_clean:t(6367,e.DiagnosticCategory.Message,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:t(6369,e.DiagnosticCategory.Error,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:t(6370,e.DiagnosticCategory.Error,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:t(6371,e.DiagnosticCategory.Message,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:t(6372,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:t(6373,e.DiagnosticCategory.Message,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:t(6374,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:t(6375,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:t(6376,e.DiagnosticCategory.Message,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:t(6377,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Composite_projects_may_not_disable_incremental_compilation:t(6379,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:t(6380,e.DiagnosticCategory.Message,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:t(6381,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:t(6382,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:t(6383,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6384,e.DiagnosticCategory.Message,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:t(6385,e.DiagnosticCategory.Suggestion,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:t(6386,e.DiagnosticCategory.Message,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:t(6387,e.DiagnosticCategory.Suggestion,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:t(6388,e.DiagnosticCategory.Message,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:t(6389,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6390,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6391,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:t(6392,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6393,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6394,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6395,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6396,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6397,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6398,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:t(6500,e.DiagnosticCategory.Message,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:t(6501,e.DiagnosticCategory.Message,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:t(6502,e.DiagnosticCategory.Message,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:t(6503,e.DiagnosticCategory.Message,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:t(6504,e.DiagnosticCategory.Error,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:t(6505,e.DiagnosticCategory.Message,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:t(6506,e.DiagnosticCategory.Message,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:t(6600,e.DiagnosticCategory.Message,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:t(6601,e.DiagnosticCategory.Message,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:t(6602,e.DiagnosticCategory.Message,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:t(6603,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:t(6604,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:t(6605,e.DiagnosticCategory.Message,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6606,e.DiagnosticCategory.Message,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:t(6607,e.DiagnosticCategory.Message,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:t(6608,e.DiagnosticCategory.Message,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:t(6609,e.DiagnosticCategory.Message,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:t(6611,e.DiagnosticCategory.Message,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:t(6612,e.DiagnosticCategory.Message,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:t(6613,e.DiagnosticCategory.Message,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:t(6614,e.DiagnosticCategory.Message,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:t(6615,e.DiagnosticCategory.Message,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:t(6616,e.DiagnosticCategory.Message,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:t(6617,e.DiagnosticCategory.Message,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:t(6618,e.DiagnosticCategory.Message,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:t(6619,e.DiagnosticCategory.Message,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:t(6620,e.DiagnosticCategory.Message,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects."),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:t(6621,e.DiagnosticCategory.Message,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:t(6622,e.DiagnosticCategory.Message,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:t(6623,e.DiagnosticCategory.Message,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:t(6624,e.DiagnosticCategory.Message,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:t(6625,e.DiagnosticCategory.Message,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:t(6626,e.DiagnosticCategory.Message,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),Filters_results_from_the_include_option:t(6627,e.DiagnosticCategory.Message,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:t(6628,e.DiagnosticCategory.Message,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:t(6629,e.DiagnosticCategory.Message,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_TC39_stage_2_draft_decorators:t(6630,e.DiagnosticCategory.Message,"Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630","Enable experimental support for TC39 stage 2 draft decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:t(6631,e.DiagnosticCategory.Message,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:t(6632,e.DiagnosticCategory.Message,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:t(6633,e.DiagnosticCategory.Message,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:t(6634,e.DiagnosticCategory.Message,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:t(6635,e.DiagnosticCategory.Message,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:t(6636,e.DiagnosticCategory.Message,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date."),Ensure_that_casing_is_correct_in_imports:t(6637,e.DiagnosticCategory.Message,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:t(6638,e.DiagnosticCategory.Message,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:t(6639,e.DiagnosticCategory.Message,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:t(6641,e.DiagnosticCategory.Message,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:t(6642,e.DiagnosticCategory.Message,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:t(6643,e.DiagnosticCategory.Message,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:t(6644,e.DiagnosticCategory.Message,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:t(6645,e.DiagnosticCategory.Message,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:t(6646,e.DiagnosticCategory.Message,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:t(6647,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:t(6648,e.DiagnosticCategory.Message,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:t(6649,e.DiagnosticCategory.Message,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:t(6650,e.DiagnosticCategory.Message,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:t(6651,e.DiagnosticCategory.Message,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:t(6652,e.DiagnosticCategory.Message,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:t(6653,e.DiagnosticCategory.Message,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:t(6654,e.DiagnosticCategory.Message,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:t(6655,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:t(6656,e.DiagnosticCategory.Message,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),Specify_what_module_code_is_generated:t(6657,e.DiagnosticCategory.Message,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:t(6658,e.DiagnosticCategory.Message,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:t(6659,e.DiagnosticCategory.Message,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:t(6660,e.DiagnosticCategory.Message,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:t(6661,e.DiagnosticCategory.Message,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like '__extends' in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:t(6662,e.DiagnosticCategory.Message,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:t(6663,e.DiagnosticCategory.Message,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:t(6664,e.DiagnosticCategory.Message,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:t(6665,e.DiagnosticCategory.Message,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied 'any' type."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:t(6666,e.DiagnosticCategory.Message,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:t(6667,e.DiagnosticCategory.Message,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:t(6668,e.DiagnosticCategory.Message,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when 'this' is given the type 'any'."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:t(6669,e.DiagnosticCategory.Message,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:t(6670,e.DiagnosticCategory.Message,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:t(6671,e.DiagnosticCategory.Message,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type."),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:t(6672,e.DiagnosticCategory.Message,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:t(6673,e.DiagnosticCategory.Message,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:t(6674,e.DiagnosticCategory.Message,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add 'undefined' to a type when accessed using an index."),Enable_error_reporting_when_local_variables_aren_t_read:t(6675,e.DiagnosticCategory.Message,"Enable_error_reporting_when_local_variables_aren_t_read_6675","Enable error reporting when local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:t(6676,e.DiagnosticCategory.Message,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read."),Deprecated_setting_Use_outFile_instead:t(6677,e.DiagnosticCategory.Message,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use 'outFile' instead."),Specify_an_output_folder_for_all_emitted_files:t(6678,e.DiagnosticCategory.Message,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:t(6679,e.DiagnosticCategory.Message,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:t(6680,e.DiagnosticCategory.Message,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:t(6681,e.DiagnosticCategory.Message,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:t(6682,e.DiagnosticCategory.Message,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing 'const enum' declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:t(6683,e.DiagnosticCategory.Message,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:t(6684,e.DiagnosticCategory.Message,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode."),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:t(6685,e.DiagnosticCategory.Message,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read."),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:t(6686,e.DiagnosticCategory.Message,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:t(6687,e.DiagnosticCategory.Message,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:t(6688,e.DiagnosticCategory.Message,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:t(6689,e.DiagnosticCategory.Message,"Enable_importing_json_files_6689","Enable importing .json files."),Specify_the_root_folder_within_your_source_files:t(6690,e.DiagnosticCategory.Message,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:t(6691,e.DiagnosticCategory.Message,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:t(6692,e.DiagnosticCategory.Message,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:t(6693,e.DiagnosticCategory.Message,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:t(6694,e.DiagnosticCategory.Message,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:t(6695,e.DiagnosticCategory.Message,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:t(6697,e.DiagnosticCategory.Message,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:t(6698,e.DiagnosticCategory.Message,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:t(6699,e.DiagnosticCategory.Message,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account 'null' and 'undefined'."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:t(6700,e.DiagnosticCategory.Message,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:t(6701,e.DiagnosticCategory.Message,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have '@internal' in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:t(6702,e.DiagnosticCategory.Message,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:t(6703,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:t(6704,e.DiagnosticCategory.Message,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:t(6705,e.DiagnosticCategory.Message,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:t(6706,e.DiagnosticCategory.Message,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the 'moduleResolution' process."),Specify_the_path_to_tsbuildinfo_incremental_compilation_file:t(6707,e.DiagnosticCategory.Message,"Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707","Specify the path to .tsbuildinfo incremental compilation file."),Specify_options_for_automatic_acquisition_of_declaration_files:t(6709,e.DiagnosticCategory.Message,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:t(6710,e.DiagnosticCategory.Message,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like './node_modules/@types'."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:t(6711,e.DiagnosticCategory.Message,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:t(6712,e.DiagnosticCategory.Message,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:t(6713,e.DiagnosticCategory.Message,"Enable_verbose_logging_6713","Enable verbose logging."),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:t(6714,e.DiagnosticCategory.Message,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:t(6715,e.DiagnosticCategory.Message,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:t(6717,e.DiagnosticCategory.Message,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:t(6718,e.DiagnosticCategory.Message,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types."),Default_catch_clause_variables_as_unknown_instead_of_any:t(6803,e.DiagnosticCategory.Message,"Default_catch_clause_variables_as_unknown_instead_of_any_6803","Default catch clause variables as 'unknown' instead of 'any'."),one_of_Colon:t(6900,e.DiagnosticCategory.Message,"one_of_Colon_6900","one of:"),one_or_more_Colon:t(6901,e.DiagnosticCategory.Message,"one_or_more_Colon_6901","one or more:"),type_Colon:t(6902,e.DiagnosticCategory.Message,"type_Colon_6902","type:"),default_Colon:t(6903,e.DiagnosticCategory.Message,"default_Colon_6903","default:"),module_system_or_esModuleInterop:t(6904,e.DiagnosticCategory.Message,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:t(6905,e.DiagnosticCategory.Message,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:t(6906,e.DiagnosticCategory.Message,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:t(6907,e.DiagnosticCategory.Message,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:t(6908,e.DiagnosticCategory.Message,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:t(6909,e.DiagnosticCategory.Message,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:t(69010,e.DiagnosticCategory.Message,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:t(6911,e.DiagnosticCategory.Message,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:t(6912,e.DiagnosticCategory.Message,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:t(6913,e.DiagnosticCategory.Message,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:t(6914,e.DiagnosticCategory.Message,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:t(6915,e.DiagnosticCategory.Message,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:t(6916,e.DiagnosticCategory.Message,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:t(6917,e.DiagnosticCategory.Message,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:t(6918,e.DiagnosticCategory.Message,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:t(6919,e.DiagnosticCategory.Message,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:t(6920,e.DiagnosticCategory.Message,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:t(6921,e.DiagnosticCategory.Message,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:t(6922,e.DiagnosticCategory.Message,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:t(6923,e.DiagnosticCategory.Message,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:t(6924,e.DiagnosticCategory.Message,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:t(6925,e.DiagnosticCategory.Message,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:t(6926,e.DiagnosticCategory.Message,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:t(6927,e.DiagnosticCategory.Message,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:t(6928,e.DiagnosticCategory.Message,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:t(6929,e.DiagnosticCategory.Message,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:t(6930,e.DiagnosticCategory.Message,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),List_of_file_name_suffixes_to_search_when_resolving_a_module:t(6931,e.DiagnosticCategory.Error,"List_of_file_name_suffixes_to_search_when_resolving_a_module_6931","List of file name suffixes to search when resolving a module."),Variable_0_implicitly_has_an_1_type:t(7005,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:t(7006,e.DiagnosticCategory.Error,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:t(7008,e.DiagnosticCategory.Error,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:t(7009,e.DiagnosticCategory.Error,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:t(7010,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7011,e.DiagnosticCategory.Error,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7013,e.DiagnosticCategory.Error,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7014,e.DiagnosticCategory.Error,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:t(7015,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:t(7016,e.DiagnosticCategory.Error,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:t(7017,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:t(7018,e.DiagnosticCategory.Error,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:t(7019,e.DiagnosticCategory.Error,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7020,e.DiagnosticCategory.Error,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:t(7022,e.DiagnosticCategory.Error,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7023,e.DiagnosticCategory.Error,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7024,e.DiagnosticCategory.Error,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:t(7025,e.DiagnosticCategory.Error,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:t(7026,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:t(7027,e.DiagnosticCategory.Error,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:t(7028,e.DiagnosticCategory.Error,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:t(7029,e.DiagnosticCategory.Error,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:t(7030,e.DiagnosticCategory.Error,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:t(7031,e.DiagnosticCategory.Error,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:t(7032,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:t(7033,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:t(7034,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:t(7035,e.DiagnosticCategory.Error,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:t(7036,e.DiagnosticCategory.Error,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:t(7037,e.DiagnosticCategory.Message,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:t(7038,e.DiagnosticCategory.Message,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:t(7039,e.DiagnosticCategory.Error,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:t(7040,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:t(7041,e.DiagnosticCategory.Error,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:t(7042,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7043,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7044,e.DiagnosticCategory.Suggestion,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7045,e.DiagnosticCategory.Suggestion,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:t(7046,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:t(7047,e.DiagnosticCategory.Suggestion,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:t(7048,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:t(7049,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:t(7050,e.DiagnosticCategory.Suggestion,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:t(7051,e.DiagnosticCategory.Error,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:t(7052,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:t(7053,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:t(7054,e.DiagnosticCategory.Error,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:t(7055,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:t(7056,e.DiagnosticCategory.Error,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:t(7057,e.DiagnosticCategory.Error,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:t(7058,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:t(7059,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:t(7060,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:t(7061,e.DiagnosticCategory.Error,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),You_cannot_rename_this_element:t(8e3,e.DiagnosticCategory.Error,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:t(8001,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:t(8002,e.DiagnosticCategory.Error,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:t(8003,e.DiagnosticCategory.Error,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:t(8004,e.DiagnosticCategory.Error,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:t(8005,e.DiagnosticCategory.Error,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:t(8006,e.DiagnosticCategory.Error,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:t(8008,e.DiagnosticCategory.Error,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:t(8009,e.DiagnosticCategory.Error,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:t(8010,e.DiagnosticCategory.Error,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:t(8011,e.DiagnosticCategory.Error,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:t(8012,e.DiagnosticCategory.Error,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:t(8013,e.DiagnosticCategory.Error,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:t(8016,e.DiagnosticCategory.Error,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:t(8017,e.DiagnosticCategory.Error,"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017","Octal literal types must use ES2015 syntax. Use the syntax '{0}'."),Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0:t(8018,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018","Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."),Report_errors_in_js_files:t(8019,e.DiagnosticCategory.Message,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:t(8020,e.DiagnosticCategory.Error,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:t(8021,e.DiagnosticCategory.Error,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:t(8022,e.DiagnosticCategory.Error,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:t(8023,e.DiagnosticCategory.Error,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:t(8024,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:t(8025,e.DiagnosticCategory.Error,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:t(8026,e.DiagnosticCategory.Error,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:t(8027,e.DiagnosticCategory.Error,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:t(8028,e.DiagnosticCategory.Error,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:t(8029,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:t(8030,e.DiagnosticCategory.Error,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:t(8031,e.DiagnosticCategory.Error,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:t(8032,e.DiagnosticCategory.Error,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:t(8033,e.DiagnosticCategory.Error,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:t(8034,e.DiagnosticCategory.Error,"The_tag_was_first_specified_here_8034","The tag was first specified here."),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:t(9005,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:t(9006,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:t(17e3,e.DiagnosticCategory.Error,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:t(17001,e.DiagnosticCategory.Error,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:t(17002,e.DiagnosticCategory.Error,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:t(17004,e.DiagnosticCategory.Error,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:t(17005,e.DiagnosticCategory.Error,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17006,e.DiagnosticCategory.Error,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17007,e.DiagnosticCategory.Error,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:t(17008,e.DiagnosticCategory.Error,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:t(17009,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:t(17010,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:t(17011,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:t(17012,e.DiagnosticCategory.Error,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:t(17013,e.DiagnosticCategory.Error,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:t(17014,e.DiagnosticCategory.Error,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:t(17015,e.DiagnosticCategory.Error,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:t(17016,e.DiagnosticCategory.Error,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:t(17017,e.DiagnosticCategory.Error,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:t(17018,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),Circularity_detected_while_resolving_configuration_Colon_0:t(18e3,e.DiagnosticCategory.Error,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:t(18002,e.DiagnosticCategory.Error,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:t(18003,e.DiagnosticCategory.Error,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:t(80001,e.DiagnosticCategory.Suggestion,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:t(80002,e.DiagnosticCategory.Suggestion,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:t(80003,e.DiagnosticCategory.Suggestion,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:t(80004,e.DiagnosticCategory.Suggestion,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:t(80005,e.DiagnosticCategory.Suggestion,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:t(80006,e.DiagnosticCategory.Suggestion,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:t(80007,e.DiagnosticCategory.Suggestion,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:t(80008,e.DiagnosticCategory.Suggestion,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),Add_missing_super_call:t(90001,e.DiagnosticCategory.Message,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:t(90002,e.DiagnosticCategory.Message,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:t(90003,e.DiagnosticCategory.Message,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:t(90004,e.DiagnosticCategory.Message,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:t(90005,e.DiagnosticCategory.Message,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:t(90006,e.DiagnosticCategory.Message,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:t(90007,e.DiagnosticCategory.Message,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:t(90008,e.DiagnosticCategory.Message,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:t(90010,e.DiagnosticCategory.Message,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:t(90011,e.DiagnosticCategory.Message,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:t(90012,e.DiagnosticCategory.Message,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_1:t(90013,e.DiagnosticCategory.Message,"Import_0_from_1_90013","Import '{0}' from \"{1}\""),Change_0_to_1:t(90014,e.DiagnosticCategory.Message,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Declare_property_0:t(90016,e.DiagnosticCategory.Message,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:t(90017,e.DiagnosticCategory.Message,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:t(90018,e.DiagnosticCategory.Message,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:t(90019,e.DiagnosticCategory.Message,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:t(90020,e.DiagnosticCategory.Message,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:t(90021,e.DiagnosticCategory.Message,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:t(90022,e.DiagnosticCategory.Message,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:t(90023,e.DiagnosticCategory.Message,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:t(90024,e.DiagnosticCategory.Message,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:t(90025,e.DiagnosticCategory.Message,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:t(90026,e.DiagnosticCategory.Message,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:t(90027,e.DiagnosticCategory.Message,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:t(90028,e.DiagnosticCategory.Message,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:t(90029,e.DiagnosticCategory.Message,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:t(90030,e.DiagnosticCategory.Message,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:t(90031,e.DiagnosticCategory.Message,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Add_parameter_name:t(90034,e.DiagnosticCategory.Message,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:t(90035,e.DiagnosticCategory.Message,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:t(90036,e.DiagnosticCategory.Message,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:t(90037,e.DiagnosticCategory.Message,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:t(90038,e.DiagnosticCategory.Message,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:t(90039,e.DiagnosticCategory.Message,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:t(90041,e.DiagnosticCategory.Message,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:t(90053,e.DiagnosticCategory.Message,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:t(90054,e.DiagnosticCategory.Message,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Remove_type_from_import_declaration_from_0:t(90055,e.DiagnosticCategory.Message,"Remove_type_from_import_declaration_from_0_90055","Remove 'type' from import declaration from \"{0}\""),Remove_type_from_import_of_0_from_1:t(90056,e.DiagnosticCategory.Message,"Remove_type_from_import_of_0_from_1_90056","Remove 'type' from import of '{0}' from \"{1}\""),Add_import_from_0:t(90057,e.DiagnosticCategory.Message,"Add_import_from_0_90057",'Add import from "{0}"'),Update_import_from_0:t(90058,e.DiagnosticCategory.Message,"Update_import_from_0_90058",'Update import from "{0}"'),Convert_function_to_an_ES2015_class:t(95001,e.DiagnosticCategory.Message,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:t(95003,e.DiagnosticCategory.Message,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:t(95004,e.DiagnosticCategory.Message,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:t(95005,e.DiagnosticCategory.Message,"Extract_function_95005","Extract function"),Extract_constant:t(95006,e.DiagnosticCategory.Message,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:t(95007,e.DiagnosticCategory.Message,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:t(95008,e.DiagnosticCategory.Message,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:t(95009,e.DiagnosticCategory.Message,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:t(95011,e.DiagnosticCategory.Message,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:t(95012,e.DiagnosticCategory.Message,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:t(95013,e.DiagnosticCategory.Message,"Convert_to_default_import_95013","Convert to default import"),Install_0:t(95014,e.DiagnosticCategory.Message,"Install_0_95014","Install '{0}'"),Replace_import_with_0:t(95015,e.DiagnosticCategory.Message,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:t(95016,e.DiagnosticCategory.Message,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:t(95017,e.DiagnosticCategory.Message,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:t(95018,e.DiagnosticCategory.Message,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:t(95019,e.DiagnosticCategory.Message,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:t(95020,e.DiagnosticCategory.Message,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:t(95021,e.DiagnosticCategory.Message,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:t(95022,e.DiagnosticCategory.Message,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:t(95023,e.DiagnosticCategory.Message,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:t(95024,e.DiagnosticCategory.Message,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:t(95025,e.DiagnosticCategory.Message,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:t(95026,e.DiagnosticCategory.Message,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:t(95027,e.DiagnosticCategory.Message,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:t(95028,e.DiagnosticCategory.Message,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:t(95029,e.DiagnosticCategory.Message,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:t(95030,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:t(95031,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:t(95032,e.DiagnosticCategory.Message,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:t(95033,e.DiagnosticCategory.Message,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:t(95034,e.DiagnosticCategory.Message,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:t(95035,e.DiagnosticCategory.Message,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:t(95036,e.DiagnosticCategory.Message,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:t(95037,e.DiagnosticCategory.Message,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:t(95038,e.DiagnosticCategory.Message,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:t(95039,e.DiagnosticCategory.Message,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:t(95040,e.DiagnosticCategory.Message,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:t(95041,e.DiagnosticCategory.Message,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:t(95042,e.DiagnosticCategory.Message,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:t(95043,e.DiagnosticCategory.Message,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:t(95044,e.DiagnosticCategory.Message,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:t(95045,e.DiagnosticCategory.Message,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:t(95046,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:t(95047,e.DiagnosticCategory.Message,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:t(95048,e.DiagnosticCategory.Message,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:t(95049,e.DiagnosticCategory.Message,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:t(95050,e.DiagnosticCategory.Message,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:t(95051,e.DiagnosticCategory.Message,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:t(95052,e.DiagnosticCategory.Message,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:t(95053,e.DiagnosticCategory.Message,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:t(95054,e.DiagnosticCategory.Message,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:t(95055,e.DiagnosticCategory.Message,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:t(95056,e.DiagnosticCategory.Message,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:t(95057,e.DiagnosticCategory.Message,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:t(95058,e.DiagnosticCategory.Message,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:t(95059,e.DiagnosticCategory.Message,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:t(95060,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:t(95061,e.DiagnosticCategory.Message,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:t(95062,e.DiagnosticCategory.Message,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:t(95063,e.DiagnosticCategory.Message,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:t(95064,e.DiagnosticCategory.Message,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:t(95065,e.DiagnosticCategory.Message,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:t(95066,e.DiagnosticCategory.Message,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:t(95067,e.DiagnosticCategory.Message,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:t(95068,e.DiagnosticCategory.Message,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:t(95069,e.DiagnosticCategory.Message,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:t(95070,e.DiagnosticCategory.Message,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:t(95071,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:t(95072,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:t(95073,e.DiagnosticCategory.Message,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:t(95074,e.DiagnosticCategory.Message,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:t(95075,e.DiagnosticCategory.Message,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:t(95077,e.DiagnosticCategory.Message,"Extract_type_95077","Extract type"),Extract_to_type_alias:t(95078,e.DiagnosticCategory.Message,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:t(95079,e.DiagnosticCategory.Message,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:t(95080,e.DiagnosticCategory.Message,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:t(95081,e.DiagnosticCategory.Message,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:t(95082,e.DiagnosticCategory.Message,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:t(95083,e.DiagnosticCategory.Message,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:t(95084,e.DiagnosticCategory.Message,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:t(95085,e.DiagnosticCategory.Message,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:t(95086,e.DiagnosticCategory.Message,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:t(95087,e.DiagnosticCategory.Message,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:t(95088,e.DiagnosticCategory.Message,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:t(95089,e.DiagnosticCategory.Message,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:t(95090,e.DiagnosticCategory.Message,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:t(95091,e.DiagnosticCategory.Message,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:t(95092,e.DiagnosticCategory.Message,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:t(95093,e.DiagnosticCategory.Message,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:t(95094,e.DiagnosticCategory.Message,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:t(95095,e.DiagnosticCategory.Message,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:t(95096,e.DiagnosticCategory.Message,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:t(95097,e.DiagnosticCategory.Message,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:t(95098,e.DiagnosticCategory.Message,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:t(95099,e.DiagnosticCategory.Message,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:t(95100,e.DiagnosticCategory.Message,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:t(95101,e.DiagnosticCategory.Message,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_function_expression_0_to_arrow_function:t(95105,e.DiagnosticCategory.Message,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:t(95106,e.DiagnosticCategory.Message,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:t(95107,e.DiagnosticCategory.Message,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:t(95108,e.DiagnosticCategory.Message,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:t(95109,e.DiagnosticCategory.Message,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file:t(95110,e.DiagnosticCategory.Message,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig to read more about this file"),Add_a_return_statement:t(95111,e.DiagnosticCategory.Message,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:t(95112,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:t(95113,e.DiagnosticCategory.Message,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:t(95114,e.DiagnosticCategory.Message,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:t(95115,e.DiagnosticCategory.Message,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:t(95116,e.DiagnosticCategory.Message,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:t(95117,e.DiagnosticCategory.Message,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:t(95118,e.DiagnosticCategory.Message,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:t(95119,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:t(95120,e.DiagnosticCategory.Message,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:t(95121,e.DiagnosticCategory.Message,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:t(95122,e.DiagnosticCategory.Message,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:t(95123,e.DiagnosticCategory.Message,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:t(95124,e.DiagnosticCategory.Message,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:t(95125,e.DiagnosticCategory.Message,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:t(95126,e.DiagnosticCategory.Message,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:t(95127,e.DiagnosticCategory.Message,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:t(95128,e.DiagnosticCategory.Message,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:t(95129,e.DiagnosticCategory.Message,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:t(95130,e.DiagnosticCategory.Message,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:t(95131,e.DiagnosticCategory.Message,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:t(95132,e.DiagnosticCategory.Message,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:t(95133,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:t(95134,e.DiagnosticCategory.Message,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:t(95135,e.DiagnosticCategory.Message,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:t(95136,e.DiagnosticCategory.Message,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:t(95137,e.DiagnosticCategory.Message,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:t(95138,e.DiagnosticCategory.Message,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:t(95139,e.DiagnosticCategory.Message,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:t(95140,e.DiagnosticCategory.Message,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:t(95141,e.DiagnosticCategory.Message,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:t(95142,e.DiagnosticCategory.Message,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:t(95143,e.DiagnosticCategory.Message,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:t(95144,e.DiagnosticCategory.Message,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:t(95145,e.DiagnosticCategory.Message,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:t(95146,e.DiagnosticCategory.Message,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:t(95147,e.DiagnosticCategory.Message,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:t(95148,e.DiagnosticCategory.Message,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:t(95149,e.DiagnosticCategory.Message,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:t(95150,e.DiagnosticCategory.Message,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:t(95151,e.DiagnosticCategory.Message,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:t(95152,e.DiagnosticCategory.Message,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:t(95153,e.DiagnosticCategory.Message,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenation:t(95154,e.DiagnosticCategory.Message,"Can_only_convert_string_concatenation_95154","Can only convert string concatenation"),Selection_is_not_a_valid_statement_or_statements:t(95155,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:t(95156,e.DiagnosticCategory.Message,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:t(95157,e.DiagnosticCategory.Message,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:t(95158,e.DiagnosticCategory.Message,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:t(95159,e.DiagnosticCategory.Message,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:t(95160,e.DiagnosticCategory.Message,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:t(95161,e.DiagnosticCategory.Message,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:t(95162,e.DiagnosticCategory.Message,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:t(95163,e.DiagnosticCategory.Message,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:t(95164,e.DiagnosticCategory.Message,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:t(95165,e.DiagnosticCategory.Message,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:t(95166,e.DiagnosticCategory.Message,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:t(95167,e.DiagnosticCategory.Message,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:t(95168,e.DiagnosticCategory.Message,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:t(95169,e.DiagnosticCategory.Message,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),Convert_named_imports_to_default_import:t(95170,e.DiagnosticCategory.Message,"Convert_named_imports_to_default_import_95170","Convert named imports to default import"),Delete_unused_param_tag_0:t(95171,e.DiagnosticCategory.Message,"Delete_unused_param_tag_0_95171","Delete unused '@param' tag '{0}'"),Delete_all_unused_param_tags:t(95172,e.DiagnosticCategory.Message,"Delete_all_unused_param_tags_95172","Delete all unused '@param' tags"),Rename_param_tag_name_0_to_1:t(95173,e.DiagnosticCategory.Message,"Rename_param_tag_name_0_to_1_95173","Rename '@param' tag name '{0}' to '{1}'"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:t(18004,e.DiagnosticCategory.Error,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:t(18006,e.DiagnosticCategory.Error,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:t(18007,e.DiagnosticCategory.Error,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:t(18009,e.DiagnosticCategory.Error,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:t(18010,e.DiagnosticCategory.Error,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:t(18011,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:t(18012,e.DiagnosticCategory.Error,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:t(18013,e.DiagnosticCategory.Error,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:t(18014,e.DiagnosticCategory.Error,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:t(18015,e.DiagnosticCategory.Error,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:t(18016,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:t(18017,e.DiagnosticCategory.Error,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:t(18018,e.DiagnosticCategory.Error,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:t(18019,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:t(18024,e.DiagnosticCategory.Error,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:t(18026,e.DiagnosticCategory.Error,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:t(18027,e.DiagnosticCategory.Error,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18028,e.DiagnosticCategory.Error,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:t(18029,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:t(18030,e.DiagnosticCategory.Error,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:t(18031,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:t(18032,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead:t(18033,e.DiagnosticCategory.Error,"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033","Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:t(18034,e.DiagnosticCategory.Message,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:t(18035,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:t(18036,e.DiagnosticCategory.Error,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),Await_expression_cannot_be_used_inside_a_class_static_block:t(18037,e.DiagnosticCategory.Error,"Await_expression_cannot_be_used_inside_a_class_static_block_18037","Await expression cannot be used inside a class static block."),For_await_loops_cannot_be_used_inside_a_class_static_block:t(18038,e.DiagnosticCategory.Error,"For_await_loops_cannot_be_used_inside_a_class_static_block_18038","'For await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:t(18039,e.DiagnosticCategory.Error,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:t(18041,e.DiagnosticCategory.Error,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block.")}}(c||(c={})),function(e){var t;function r(e){return e>=79}e.tokenIsIdentifierOrKeyword=r,e.tokenIsIdentifierOrKeywordOrGreaterThan=function(e){return 31===e||r(e)},e.textToKeywordObj=((t={abstract:126,any:130,as:127,asserts:128,assert:129,bigint:158,boolean:133,break:81,case:82,catch:83,class:84,continue:86,const:85}).constructor=134,t.debugger=87,t.declare=135,t.default=88,t.delete=89,t.do=90,t.else=91,t.enum=92,t.export=93,t.extends=94,t.false=95,t.finally=96,t.for=97,t.from=156,t.function=98,t.get=136,t.if=99,t.implements=117,t.import=100,t.in=101,t.infer=137,t.instanceof=102,t.interface=118,t.intrinsic=138,t.is=139,t.keyof=140,t.let=119,t.module=141,t.namespace=142,t.never=143,t.new=103,t.null=104,t.number=147,t.object=148,t.package=120,t.private=121,t.protected=122,t.public=123,t.override=159,t.out=144,t.readonly=145,t.require=146,t.global=157,t.return=105,t.set=149,t.static=124,t.string=150,t.super=106,t.switch=107,t.symbol=151,t.this=108,t.throw=109,t.true=110,t.try=111,t.type=152,t.typeof=112,t.undefined=153,t.unique=154,t.unknown=155,t.var=113,t.void=114,t.while=115,t.with=116,t.yield=125,t.async=131,t.await=132,t.of=160,t);var i=new e.Map(e.getEntries(e.textToKeywordObj)),a=new e.Map(e.getEntries(n(n({},e.textToKeywordObj),{"{":18,"}":19,"(":20,")":21,"[":22,"]":23,".":24,"...":25,";":26,",":27,"<":29,">":31,"<=":32,">=":33,"==":34,"!=":35,"===":36,"!==":37,"=>":38,"+":39,"-":40,"**":42,"*":41,"/":43,"%":44,"++":45,"--":46,"<<":47,">":48,">>>":49,"&":50,"|":51,"^":52,"!":53,"~":54,"&&":55,"||":56,"?":57,"??":60,"?.":28,":":58,"=":63,"+=":64,"-=":65,"*=":66,"**=":67,"/=":68,"%=":69,"<<=":70,">>=":71,">>>=":72,"&=":73,"|=":74,"^=":78,"||=":75,"&&=":76,"??=":77,"@":59,"#":62,"`":61}))),o=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],s=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],c=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],l=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],u=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],d=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],_=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,p=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;function f(e,t){if(e=2?u:1===t?c:o)}e.isUnicodeIdentifierStart=m;var g,y=(g=[],a.forEach((function(e,t){g[e]=t})),g);function h(e){for(var t=new Array,r=0,n=0;r127&&T(i)&&(t.push(n),n=r)}}return t.push(n),t}function v(t,r,n,i,a){(r<0||r>=t.length)&&(a?r=r<0?0:r>=t.length?t.length-1:r:e.Debug.fail("Bad line number. Line: ".concat(r,", lineStarts.length: ").concat(t.length," , line map is correct? ").concat(void 0!==i?e.arraysEqual(t,h(i)):"unknown")));var o=t[r]+n;return a?o>t[r+1]?t[r+1]:"string"==typeof i&&o>i.length?i.length:o:(r=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function T(e){return 10===e||13===e||8232===e||8233===e}function E(e){return e>=48&&e<=57}function k(e){return E(e)||e>=65&&e<=70||e>=97&&e<=102}function A(e){return e>=48&&e<=55}e.tokenToString=function(e){return y[e]},e.stringToToken=function(e){return a.get(e)},e.computeLineStarts=h,e.getPositionOfLineAndCharacter=function(e,t,r,n){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,n):v(b(e),t,r,e.text,n)},e.computePositionOfLineAndCharacter=v,e.getLineStarts=b,e.computeLineAndCharacterOfPosition=x,e.computeLineOfPosition=S,e.getLinesBetweenPositions=function(e,t,r){if(t===r)return 0;var n=b(e),i=Math.min(t,r),a=i===r,o=a?t:r,s=S(n,i),c=S(n,o,s);return a?s-c:c-s},e.getLineAndCharacterOfPosition=function(e,t){return x(b(e),t)},e.isWhiteSpaceLike=D,e.isWhiteSpaceSingleLine=C,e.isLineBreak=T,e.isOctalDigit=A,e.couldStartTrivia=function(e,t){var r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return!0;case 35:return 0===t;default:return r>127}},e.skipTrivia=function(t,r,n,i,a){if(e.positionIsSynthesized(r))return r;for(var o=!1;;){var s=t.charCodeAt(r);switch(s){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)return r;o=!!a;continue;case 9:case 11:case 12:case 32:r++;continue;case 47:if(i)break;if(47===t.charCodeAt(r+1)){for(r+=2;r127&&D(s)){r++;continue}}return r}};var N="<<<<<<<".length;function w(t,r){if(e.Debug.assert(r>=0),0===r||T(t.charCodeAt(r-1))){var n=t.charCodeAt(r);if(r+N=0&&r127&&D(m)){d&&T(m)&&(u=!0),r++;continue}break e}}return d&&(p=i(s,c,l,u,a,p)),p}function L(e,t,r,n,i){return M(!0,e,t,!1,r,n,i)}function R(e,t,r,n,i){return M(!0,e,t,!0,r,n,i)}function B(e,t,r,n,i,a){return a||(a=[]),a.push({kind:r,pos:e,end:t,hasTrailingNewLine:n}),a}function J(e){var t=P.exec(e);if(t)return t[0]}function j(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&m(e,t)}function U(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||1===r&&(45===e||58===e)||e>127&&function(e,t){return f(e,t>=2?d:1===t?l:s)}(e,t)}e.isShebangTrivia=I,e.scanShebangTrivia=O,e.forEachLeadingCommentRange=function(e,t,r,n){return M(!1,e,t,!1,r,n)},e.forEachTrailingCommentRange=function(e,t,r,n){return M(!1,e,t,!0,r,n)},e.reduceEachLeadingCommentRange=L,e.reduceEachTrailingCommentRange=R,e.getLeadingCommentRanges=function(e,t){return L(e,t,B,void 0,void 0)},e.getTrailingCommentRanges=function(e,t){return R(e,t,B,void 0,void 0)},e.getShebang=J,e.isIdentifierStart=j,e.isIdentifierPart=U,e.isIdentifierText=function(e,t,r){var n=V(e,0);if(!j(n,t))return!1;for(var i=K(n);i116},isReservedWord:function(){return g>=81&&g<=116},isUnterminated:function(){return 0!=(4&h)},getCommentDirectives:function(){return v},getNumericLiteralFlags:function(){return 1008&h},getTokenFlags:function(){return h},reScanGreaterToken:function(){if(31===g){if(62===b.charCodeAt(u))return 62===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,g=72):(u+=2,g=49):61===b.charCodeAt(u+1)?(u+=2,g=71):(u++,g=48);if(61===b.charCodeAt(u))return u++,g=33}return g},reScanAsteriskEqualsToken:function(){return e.Debug.assert(66===g,"'reScanAsteriskEqualsToken' should only be called on a '*='"),u=m+1,g=63},reScanSlashToken:function(){if(43===g||68===g){for(var r=m+1,n=!1,i=!1;;){if(r>=d){h|=4,N(e.Diagnostics.Unterminated_regular_expression_literal);break}var a=b.charCodeAt(r);if(T(a)){h|=4,N(e.Diagnostics.Unterminated_regular_expression_literal);break}if(n)n=!1;else{if(47===a&&!i){r++;break}91===a?i=!0:92===a?n=!0:93===a&&(i=!1)}r++}for(;r=d)return g=1;var e=V(b,u);switch(u+=K(e),e){case 9:case 11:case 12:case 32:for(;u=0&&j(r,t))return u+=3,h|=8,y=X()+Z(),g=ee();var n=$();return n>=0&&j(n,t)?(u+=6,h|=1024,y=String.fromCharCode(n)+Z(),g=ee()):(u++,g=0)}if(j(e,t)){for(var i=e;u=65&&s<=70)s+=32;else if(!(s>=48&&s<=57||s>=97&&s<=102))break;i.push(s),u++,o=!1}}return i.length=d){n+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_string_literal);break}var a=b.charCodeAt(u);if(a===r){n+=b.substring(i,u),u++;break}if(92!==a||t){if(T(a)&&!t){n+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_string_literal);break}u++}else n+=b.substring(i,u),n+=H(),i=u}return n}function W(t){for(var r,n=96===b.charCodeAt(u),i=++u,a="";;){if(u>=d){a+=b.substring(i,u),h|=4,N(e.Diagnostics.Unterminated_template_literal),r=n?14:17;break}var o=b.charCodeAt(u);if(96===o){a+=b.substring(i,u),u++,r=n?14:17;break}if(36===o&&u+1=d)return N(e.Diagnostics.Unexpected_end_of_text),"";var n=b.charCodeAt(u);switch(u++,n){case 48:return t&&u=0?String.fromCharCode(r):(N(e.Diagnostics.Hexadecimal_digit_expected),"")}function X(){var t=J(1,!1),r=t?parseInt(t,16):-1,n=!1;return r<0?(N(e.Diagnostics.Hexadecimal_digit_expected),n=!0):r>1114111&&(N(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),u>=d?(N(e.Diagnostics.Unexpected_end_of_text),n=!0):125===b.charCodeAt(u)?u++:(N(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":G(r)}function $(){if(u+5=2&&117===V(b,u+1)&&123===V(b,u+2)){var e=u;u+=3;var r=J(1,!1),n=r?parseInt(r,16):-1;return u=e,n}return-1}function Z(){for(var e="",r=u;u=0&&U(n,t)){u+=3,h|=8,e+=X(),r=u;continue}if(!((n=$())>=0&&U(n,t)))break;h|=1024,e+=b.substring(r,u),e+=G(n),r=u+=6}}return e+=b.substring(r,u)}function ee(){var e=y.length;if(e>=2&&e<=12){var t=y.charCodeAt(0);if(t>=97&&t<=122){var r=i.get(y);if(void 0!==r)return g=r}}return g=79}function te(t){for(var r="",n=!1,i=!1;;){var a=b.charCodeAt(u);if(95!==a){if(n=!0,!E(a)||a-48>=t)break;r+=b[u],u++,i=!1}else h|=512,n?(n=!1,i=!0):N(i?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++}return 95===b.charCodeAt(u-1)&&N(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),r}function re(){if(110===b.charCodeAt(u))return y+="n",384&h&&(y=e.parsePseudoBigInt(y)+"n"),u++,9;var t=128&h?parseInt(y.slice(2),2):256&h?parseInt(y.slice(2),8):+y;return y=""+t,8}function ne(){var r;f=u,h=0;for(var i=!1;;){if(m=u,u>=d)return g=1;var o=V(b,u);if(35===o&&0===u&&I(b,u)){if(u=O(b,u),n)continue;return g=6}switch(o){case 10:case 13:if(h|=1,n){u++;continue}return 13===o&&u+1=0&&j(S,t))return u+=3,h|=8,y=X()+Z(),g=ee();var D=$();return D>=0&&j(D,t)?(u+=6,h|=1024,y=String.fromCharCode(D)+Z(),g=ee()):(N(e.Diagnostics.Invalid_character),u++,g=0);case 35:return 0!==u&&"!"===b[u+1]?(N(e.Diagnostics.can_only_be_used_at_the_start_of_a_file),u++,g=0):(j(V(b,u+1),t)?(u++,ie(V(b,u),t)):(y=String.fromCharCode(V(b,u)),N(e.Diagnostics.Invalid_character,u++,K(o))),g=80);default:var k=ie(o,t);if(k)return g=k;if(C(o)){u+=K(o);continue}if(T(o)){h|=1,u+=K(o);continue}var P=K(o);return N(e.Diagnostics.Invalid_character,u,P),u+=P,g=0}}}function ie(e,t){var r=e;if(j(r,t)){for(u+=K(r);u=d)return g=1;var r=b.charCodeAt(u);if(60===r)return 47===b.charCodeAt(u+1)?(u+=2,g=30):(u++,g=29);if(123===r)return u++,g=18;for(var n=0;u0)break;D(r)||(n=u)}u++}return y=b.substring(f,u),-1===n?12:11}function se(){switch(f=u,b.charCodeAt(u)){case 34:case 39:return y=q(!0),g=10;default:return ne()}}function ce(e,t){var r=u,n=f,i=m,a=g,o=y,s=h,c=e();return c&&!t||(u=r,f=n,m=i,g=a,y=o,h=s),c}function le(e,t,r){b=e||"",d=void 0===r?b.length:t+r,ue(t||0)}function ue(t){e.Debug.assert(t>=0),u=t,f=t,m=t,g=0,y=void 0,h=0}};var V=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n=e.charCodeAt(t);if(n>=55296&&n<=56319&&r>t+1){var i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return 1024*(n-55296)+i-56320+65536}return n}};function K(e){return e>=65536?2:1}var z=String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var r=Math.floor((t-65536)/1024)+55296,n=(t-65536)%1024+56320;return String.fromCharCode(r,n)};function G(e){return z(e)}e.utf16EncodeAsString=G}(c||(c={})),function(e){function t(e){return e.start+e.length}function r(e){return 0===e.length}function n(e,t){var r=a(e,t);return r&&0===r.length?void 0:r}function i(e,t,r,n){return r<=e+t&&r+n>=e}function a(e,r){var n=Math.max(e.start,r.start),i=Math.min(t(e),t(r));return n<=i?s(n,i):void 0}function o(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return{start:e,length:t}}function s(e,t){return o(e,t-e)}function c(e,t){if(t<0)throw new Error("newLength < 0");return{span:e,newLength:t}}function l(t){return!!Y(t)&&e.every(t.elements,u)}function u(t){return!!e.isOmittedExpression(t)||l(t.name)}function d(t){for(var r=t.parent;e.isBindingElement(r.parent);)r=r.parent.parent;return r.parent}function _(t,r){e.isBindingElement(t)&&(t=d(t));var n=r(t);return 254===t.kind&&(t=t.parent),t&&255===t.kind&&(n|=r(t),t=t.parent),t&&237===t.kind&&(n|=r(t)),n}function p(e){return 0==(8&e.flags)}function f(e){var t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function m(e){return f(e.escapedText)}function g(t){var r=t.parent.parent;if(r){if(se(r))return y(r);switch(r.kind){case 237:if(r.declarationList&&r.declarationList.declarations[0])return y(r.declarationList.declarations[0]);break;case 238:var n=r.expression;switch(221===n.kind&&63===n.operatorToken.kind&&(n=n.left),n.kind){case 206:return n.name;case 207:var i=n.argumentExpression;if(e.isIdentifier(i))return i}break;case 212:return y(r.expression);case 250:if(se(r.statement)||ne(r.statement))return y(r.statement)}}}function y(t){var r=x(t);return r&&e.isIdentifier(r)?r:void 0}function h(e){return e.name||g(e)}function v(e){return!!e.name}function b(t){switch(t.kind){case 79:return t;case 347:case 340:var r=t.name;if(161===r.kind)return r.right;break;case 208:case 221:var n=t;switch(e.getAssignmentDeclarationKind(n)){case 1:case 4:case 5:case 3:return e.getElementOrPropertyAccessArgumentExpressionOrName(n.left);case 7:case 8:case 9:return n.arguments[1];default:return}case 345:return h(t);case 339:return g(t);case 271:var i=t.expression;return e.isIdentifier(i)?i:void 0;case 207:var a=t;if(e.isBindableStaticElementAccessExpression(a))return a.argumentExpression}return t.name}function x(t){if(void 0!==t)return b(t)||(e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t)?S(t):void 0)}function S(t){if(t.parent){if(e.isPropertyAssignment(t.parent)||e.isBindingElement(t.parent))return t.parent.name;if(e.isBinaryExpression(t.parent)&&t===t.parent.right){if(e.isIdentifier(t.parent.left))return t.parent.left;if(e.isAccessExpression(t.parent.left))return e.getElementOrPropertyAccessArgumentExpressionOrName(t.parent.left)}else if(e.isVariableDeclaration(t.parent)&&e.isIdentifier(t.parent.name))return t.parent.name}}function D(t,r){if(t.name){if(e.isIdentifier(t.name)){var n=t.name.escapedText;return N(t.parent,r).filter((function(t){return e.isJSDocParameterTag(t)&&e.isIdentifier(t.name)&&t.name.escapedText===n}))}var i=t.parent.parameters.indexOf(t);e.Debug.assert(i>-1,"Parameters should always be in their parents' parameter list");var a=N(t.parent,r).filter(e.isJSDocParameterTag);if(i=161}function B(e){return e>=0&&e<=160}function J(e){return 8<=e&&e<=14}function j(e){return 14<=e&&e<=17}function U(t){return(e.isPropertyDeclaration(t)||Q(t))&&e.isPrivateIdentifier(t.name)}function V(e){switch(e){case 126:case 131:case 85:case 135:case 88:case 93:case 101:case 123:case 121:case 122:case 145:case 124:case 144:case 159:return!0}return!1}function K(t){return!!(16476&e.modifierToFlag(t))}function z(e){return!!e&&q(e.kind)}function G(e){switch(e){case 256:case 169:case 171:case 172:case 173:case 213:case 214:return!0;default:return!1}}function q(e){switch(e){case 168:case 174:case 323:case 175:case 176:case 179:case 317:case 180:return!0;default:return G(e)}}function W(e){var t=e.kind;return 171===t||167===t||169===t||172===t||173===t||176===t||170===t||234===t}function H(e){return e&&(257===e.kind||226===e.kind)}function Q(e){switch(e.kind){case 169:case 172:case 173:return!0;default:return!1}}function X(e){var t=e.kind;return 175===t||174===t||166===t||168===t||176===t||172===t||173===t}function $(e){var t=e.kind;return 296===t||297===t||298===t||169===t||172===t||173===t}function Y(e){if(e){var t=e.kind;return 202===t||201===t}return!1}function Z(e){switch(e.kind){case 201:case 205:return!0}return!1}function ee(e){switch(e.kind){case 202:case 204:return!0}return!1}function te(e){switch(e){case 206:case 207:case 209:case 208:case 278:case 279:case 282:case 210:case 204:case 212:case 205:case 226:case 213:case 79:case 80:case 13:case 8:case 9:case 10:case 14:case 223:case 95:case 104:case 108:case 110:case 106:case 230:case 228:case 231:case 100:return!0;default:return!1}}function re(e){switch(e){case 219:case 220:case 215:case 216:case 217:case 218:case 211:return!0;default:return te(e)}}function ne(e){return function(e){switch(e){case 222:case 224:case 214:case 221:case 225:case 229:case 227:case 351:case 350:return!0;default:return re(e)}}(M(e).kind)}function ie(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function ae(e){return 256===e||276===e||257===e||258===e||259===e||260===e||261===e||266===e||265===e||272===e||271===e||264===e}function oe(e){return 246===e||245===e||253===e||240===e||238===e||236===e||243===e||244===e||242===e||239===e||250===e||247===e||249===e||251===e||252===e||237===e||241===e||248===e||349===e||353===e||352===e}function se(t){return 163===t.kind?t.parent&&344!==t.parent.kind||e.isInJSFile(t):214===(r=t.kind)||203===r||257===r||226===r||170===r||171===r||260===r||299===r||275===r||256===r||213===r||172===r||267===r||265===r||270===r||258===r||285===r||169===r||168===r||261===r||264===r||268===r||274===r||164===r||296===r||167===r||166===r||173===r||297===r||259===r||163===r||254===r||345===r||338===r||347===r;var r}function ce(e){return e.kind>=327&&e.kind<=347}e.isExternalModuleNameRelative=function(t){return e.pathIsRelative(t)||e.isRootedDiskPath(t)},e.sortAndDeduplicateDiagnostics=function(t){return e.sortAndDeduplicate(t,e.compareDiagnostics)},e.getDefaultLibFileName=function(t){switch(e.getEmitScriptTarget(t)){case 99:return"lib.esnext.full.d.ts";case 9:return"lib.es2022.full.d.ts";case 8:return"lib.es2021.full.d.ts";case 7:return"lib.es2020.full.d.ts";case 6:return"lib.es2019.full.d.ts";case 5:return"lib.es2018.full.d.ts";case 4:return"lib.es2017.full.d.ts";case 3:return"lib.es2016.full.d.ts";case 2:return"lib.es6.d.ts";default:return"lib.d.ts"}},e.textSpanEnd=t,e.textSpanIsEmpty=r,e.textSpanContainsPosition=function(e,r){return r>=e.start&&r=e.pos&&t<=e.end},e.textSpanContainsTextSpan=function(e,r){return r.start>=e.start&&t(r)<=t(e)},e.textSpanOverlapsWith=function(e,t){return void 0!==n(e,t)},e.textSpanOverlap=n,e.textSpanIntersectsWithTextSpan=function(e,t){return i(e.start,e.length,t.start,t.length)},e.textSpanIntersectsWith=function(e,t,r){return i(e.start,e.length,t,r)},e.decodedTextSpanIntersectsWith=i,e.textSpanIntersectsWithPosition=function(e,r){return r<=t(e)&&r>=e.start},e.textSpanIntersection=a,e.createTextSpan=o,e.createTextSpanFromBounds=s,e.textChangeRangeNewSpan=function(e){return o(e.span.start,e.newLength)},e.textChangeRangeIsUnchanged=function(e){return r(e.span)&&0===e.newLength},e.createTextChangeRange=c,e.unchangedTextChangeRange=c(o(0,0),0),e.collapseTextChangeRangesAcrossMultipleVersions=function(r){if(0===r.length)return e.unchangedTextChangeRange;if(1===r.length)return r[0];for(var n=r[0],i=n.span.start,a=t(n.span),o=i+n.newLength,l=1;l=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e},e.unescapeLeadingUnderscores=f,e.idText=m,e.symbolName=function(e){return e.valueDeclaration&&U(e.valueDeclaration)?m(e.valueDeclaration.name):f(e.escapedName)},e.nodeHasName=function t(r,n){return!(!v(r)||!e.isIdentifier(r.name)||m(r.name)!==m(n))||!(!e.isVariableStatement(r)||!e.some(r.declarationList.declarations,(function(e){return t(e,n)})))},e.getNameOfJSDocTypedef=h,e.isNamedDeclaration=v,e.getNonAssignedNameOfDeclaration=b,e.getNameOfDeclaration=x,e.getAssignedName=S,e.getJSDocParameterTags=C,e.getJSDocParameterTagsNoCache=function(e){return D(e,!0)},e.getJSDocTypeParameterTags=function(e){return T(e,!1)},e.getJSDocTypeParameterTagsNoCache=function(e){return T(e,!0)},e.hasJSDocParameterTags=function(t){return!!F(t,e.isJSDocParameterTag)},e.getJSDocAugmentsTag=function(t){return F(t,e.isJSDocAugmentsTag)},e.getJSDocImplementsTags=function(t){return P(t,e.isJSDocImplementsTag)},e.getJSDocClassTag=function(t){return F(t,e.isJSDocClassTag)},e.getJSDocPublicTag=function(t){return F(t,e.isJSDocPublicTag)},e.getJSDocPublicTagNoCache=function(t){return F(t,e.isJSDocPublicTag,!0)},e.getJSDocPrivateTag=function(t){return F(t,e.isJSDocPrivateTag)},e.getJSDocPrivateTagNoCache=function(t){return F(t,e.isJSDocPrivateTag,!0)},e.getJSDocProtectedTag=function(t){return F(t,e.isJSDocProtectedTag)},e.getJSDocProtectedTagNoCache=function(t){return F(t,e.isJSDocProtectedTag,!0)},e.getJSDocReadonlyTag=function(t){return F(t,e.isJSDocReadonlyTag)},e.getJSDocReadonlyTagNoCache=function(t){return F(t,e.isJSDocReadonlyTag,!0)},e.getJSDocOverrideTagNoCache=function(t){return F(t,e.isJSDocOverrideTag,!0)},e.getJSDocDeprecatedTag=function(t){return F(t,e.isJSDocDeprecatedTag)},e.getJSDocDeprecatedTagNoCache=function(t){return F(t,e.isJSDocDeprecatedTag,!0)},e.getJSDocEnumTag=function(t){return F(t,e.isJSDocEnumTag)},e.getJSDocThisTag=function(t){return F(t,e.isJSDocThisTag)},e.getJSDocReturnTag=E,e.getJSDocTemplateTag=function(t){return F(t,e.isJSDocTemplateTag)},e.getJSDocTypeTag=k,e.getJSDocType=A,e.getJSDocReturnType=function(t){var r=E(t);if(r&&r.typeExpression)return r.typeExpression.type;var n=k(t);if(n&&n.typeExpression){var i=n.typeExpression.type;if(e.isTypeLiteralNode(i)){var a=e.find(i.members,e.isCallSignatureDeclaration);return a&&a.type}if(e.isFunctionTypeNode(i)||e.isJSDocFunctionType(i))return i.type}},e.getJSDocTags=w,e.getJSDocTagsNoCache=function(e){return N(e,!0)},e.getAllJSDocTags=P,e.getAllJSDocTagsOfKind=function(e,t){return w(e).filter((function(e){return e.kind===t}))},e.getTextOfJSDocComment=function(t){return"string"==typeof t?t:null==t?void 0:t.map((function(t){return 321===t.kind?t.text:function(t){var r=324===t.kind?"link":325===t.kind?"linkcode":"linkplain",n=t.name?e.entityNameToString(t.name):"",i=t.name&&t.text.startsWith("://")?"":" ";return"{@".concat(r," ").concat(n).concat(i).concat(t.text,"}")}(t)})).join("")},e.getEffectiveTypeParameterDeclarations=function(t){if(e.isJSDocSignature(t))return e.emptyArray;if(e.isJSDocTypeAlias(t))return e.Debug.assert(320===t.parent.kind),e.flatMap(t.parent.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}));if(t.typeParameters)return t.typeParameters;if(e.isInJSFile(t)){var r=e.getJSDocTypeParameterDeclarations(t);if(r.length)return r;var n=A(t);if(n&&e.isFunctionTypeNode(n)&&n.typeParameters)return n.typeParameters}return e.emptyArray},e.getEffectiveConstraintOfTypeParameter=function(t){return t.constraint?t.constraint:e.isJSDocTemplateTag(t.parent)&&t===t.parent.typeParameters[0]?t.parent.constraint:void 0},e.isMemberName=function(e){return 79===e.kind||80===e.kind},e.isGetOrSetAccessorDeclaration=function(e){return 173===e.kind||172===e.kind},e.isPropertyAccessChain=function(t){return e.isPropertyAccessExpression(t)&&!!(32&t.flags)},e.isElementAccessChain=function(t){return e.isElementAccessExpression(t)&&!!(32&t.flags)},e.isCallChain=function(t){return e.isCallExpression(t)&&!!(32&t.flags)},e.isOptionalChain=I,e.isOptionalChainRoot=O,e.isExpressionOfOptionalChainRoot=function(e){return O(e.parent)&&e.parent.expression===e},e.isOutermostOptionalChain=function(e){return!I(e.parent)||O(e.parent)||e!==e.parent.expression},e.isNullishCoalesce=function(e){return 221===e.kind&&60===e.operatorToken.kind},e.isConstTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"const"===t.typeName.escapedText&&!t.typeArguments},e.skipPartiallyEmittedExpressions=M,e.isNonNullChain=function(t){return e.isNonNullExpression(t)&&!!(32&t.flags)},e.isBreakOrContinueStatement=function(e){return 246===e.kind||245===e.kind},e.isNamedExportBindings=function(e){return 274===e.kind||273===e.kind},e.isUnparsedTextLike=L,e.isUnparsedNode=function(e){return L(e)||300===e.kind||304===e.kind},e.isJSDocPropertyLikeTag=function(e){return 347===e.kind||340===e.kind},e.isNode=function(e){return R(e.kind)},e.isNodeKind=R,e.isTokenKind=B,e.isToken=function(e){return B(e.kind)},e.isNodeArray=function(e){return e.hasOwnProperty("pos")&&e.hasOwnProperty("end")},e.isLiteralKind=J,e.isLiteralExpression=function(e){return J(e.kind)},e.isTemplateLiteralKind=j,e.isTemplateLiteralToken=function(e){return j(e.kind)},e.isTemplateMiddleOrTemplateTail=function(e){var t=e.kind;return 16===t||17===t},e.isImportOrExportSpecifier=function(t){return e.isImportSpecifier(t)||e.isExportSpecifier(t)},e.isTypeOnlyImportOrExportDeclaration=function(e){switch(e.kind){case 270:case 275:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 268:return e.parent.isTypeOnly;case 267:case 265:return e.isTypeOnly;default:return!1}},e.isAssertionKey=function(t){return e.isStringLiteral(t)||e.isIdentifier(t)},e.isStringTextContainingNode=function(e){return 10===e.kind||j(e.kind)},e.isGeneratedIdentifier=function(t){return e.isIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isPrivateIdentifierClassElementDeclaration=U,e.isPrivateIdentifierPropertyAccessExpression=function(t){return e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name)},e.isModifierKind=V,e.isParameterPropertyModifier=K,e.isClassMemberModifier=function(e){return K(e)||124===e||159===e},e.isModifier=function(e){return V(e.kind)},e.isEntityName=function(e){var t=e.kind;return 161===t||79===t},e.isPropertyName=function(e){var t=e.kind;return 79===t||80===t||10===t||8===t||162===t},e.isBindingName=function(e){var t=e.kind;return 79===t||201===t||202===t},e.isFunctionLike=z,e.isFunctionLikeOrClassStaticBlockDeclaration=function(t){return!!t&&(q(t.kind)||e.isClassStaticBlockDeclaration(t))},e.isFunctionLikeDeclaration=function(e){return e&&G(e.kind)},e.isBooleanLiteral=function(e){return 110===e.kind||95===e.kind},e.isFunctionLikeKind=q,e.isFunctionOrModuleBlock=function(t){return e.isSourceFile(t)||e.isModuleBlock(t)||e.isBlock(t)&&z(t.parent)},e.isClassElement=W,e.isClassLike=H,e.isAccessor=function(e){return e&&(172===e.kind||173===e.kind)},e.isMethodOrAccessor=Q,e.isTypeElement=X,e.isClassOrTypeElement=function(e){return X(e)||W(e)},e.isObjectLiteralElementLike=$,e.isTypeNode=function(t){return e.isTypeNodeKind(t.kind)},e.isFunctionOrConstructorTypeNode=function(e){switch(e.kind){case 179:case 180:return!0}return!1},e.isBindingPattern=Y,e.isAssignmentPattern=function(e){var t=e.kind;return 204===t||205===t},e.isArrayBindingElement=function(e){var t=e.kind;return 203===t||227===t},e.isDeclarationBindingElement=function(e){switch(e.kind){case 254:case 164:case 203:return!0}return!1},e.isBindingOrAssignmentPattern=function(e){return Z(e)||ee(e)},e.isObjectBindingOrAssignmentPattern=Z,e.isObjectBindingOrAssignmentElement=function(e){switch(e.kind){case 203:case 296:case 297:case 298:return!0}return!1},e.isArrayBindingOrAssignmentPattern=ee,e.isPropertyAccessOrQualifiedNameOrImportTypeNode=function(e){var t=e.kind;return 206===t||161===t||200===t},e.isPropertyAccessOrQualifiedName=function(e){var t=e.kind;return 206===t||161===t},e.isCallLikeExpression=function(e){switch(e.kind){case 280:case 279:case 208:case 209:case 210:case 165:return!0;default:return!1}},e.isCallOrNewExpression=function(e){return 208===e.kind||209===e.kind},e.isTemplateLiteral=function(e){var t=e.kind;return 223===t||14===t},e.isLeftHandSideExpression=function(e){return te(M(e).kind)},e.isUnaryExpression=function(e){return re(M(e).kind)},e.isUnaryExpressionWithWrite=function(e){switch(e.kind){case 220:return!0;case 219:return 45===e.operator||46===e.operator;default:return!1}},e.isExpression=ne,e.isAssertionExpression=function(e){var t=e.kind;return 211===t||229===t},e.isNotEmittedOrPartiallyEmittedNode=function(t){return e.isNotEmittedStatement(t)||e.isPartiallyEmittedExpression(t)},e.isIterationStatement=function e(t,r){switch(t.kind){case 242:case 243:case 244:case 240:case 241:return!0;case 250:return r&&e(t.statement,r)}return!1},e.isScopeMarker=ie,e.hasScopeMarker=function(t){return e.some(t,ie)},e.needsScopeMarker=function(t){return!(e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)||e.isAmbientModule(t))},e.isExternalModuleIndicator=function(t){return e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)},e.isForInOrOfStatement=function(e){return 243===e.kind||244===e.kind},e.isConciseBody=function(t){return e.isBlock(t)||ne(t)},e.isFunctionBody=function(t){return e.isBlock(t)},e.isForInitializer=function(t){return e.isVariableDeclarationList(t)||ne(t)},e.isModuleBody=function(e){var t=e.kind;return 262===t||261===t||79===t},e.isNamespaceBody=function(e){var t=e.kind;return 262===t||261===t},e.isJSDocNamespaceBody=function(e){var t=e.kind;return 79===t||261===t},e.isNamedImportBindings=function(e){var t=e.kind;return 269===t||268===t},e.isModuleOrEnumDeclaration=function(e){return 261===e.kind||260===e.kind},e.isDeclaration=se,e.isDeclarationStatement=function(e){return ae(e.kind)},e.isStatementButNotDeclaration=function(e){return oe(e.kind)},e.isStatement=function(t){var r=t.kind;return oe(r)||ae(r)||function(t){if(235!==t.kind)return!1;if(void 0!==t.parent&&(252===t.parent.kind||292===t.parent.kind))return!1;return!e.isFunctionBlock(t)}(t)},e.isStatementOrBlock=function(e){var t=e.kind;return oe(t)||ae(t)||235===t},e.isModuleReference=function(e){var t=e.kind;return 277===t||161===t||79===t},e.isJsxTagNameExpression=function(e){var t=e.kind;return 108===t||79===t||206===t},e.isJsxChild=function(e){var t=e.kind;return 278===t||288===t||279===t||11===t||282===t},e.isJsxAttributeLike=function(e){var t=e.kind;return 285===t||287===t},e.isStringLiteralOrJsxExpression=function(e){var t=e.kind;return 10===t||288===t},e.isJsxOpeningLikeElement=function(e){var t=e.kind;return 280===t||279===t},e.isCaseOrDefaultClause=function(e){var t=e.kind;return 289===t||290===t},e.isJSDocNode=function(e){return e.kind>=309&&e.kind<=347},e.isJSDocCommentContainingNode=function(t){return 320===t.kind||319===t.kind||321===t.kind||ue(t)||ce(t)||e.isJSDocTypeLiteral(t)||e.isJSDocSignature(t)},e.isJSDocTag=ce,e.isSetAccessor=function(e){return 173===e.kind},e.isGetAccessor=function(e){return 172===e.kind},e.hasJSDocNodes=function(e){var t=e.jsDoc;return!!t&&t.length>0},e.hasType=function(e){return!!e.type},e.hasInitializer=function(e){return!!e.initializer},e.hasOnlyExpressionInitializer=function(e){switch(e.kind){case 254:case 164:case 203:case 166:case 167:case 296:case 299:return!0;default:return!1}},e.isObjectLiteralElement=function(e){return 285===e.kind||287===e.kind||$(e)},e.isTypeReferenceType=function(e){return 178===e.kind||228===e.kind};var le=1073741823;function ue(e){return 324===e.kind||325===e.kind||326===e.kind}e.guessIndentation=function(t){for(var r=le,n=0,i=t;n=0);var n=e.getLineStarts(r),i=t,a=r.text;if(i+1===n.length)return a.length-1;var o=n[i],s=n[i+1]-1;for(e.Debug.assert(e.isLineBreak(a.charCodeAt(s)));o<=s&&e.isLineBreak(a.charCodeAt(s));)s--;return s}function _(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function p(e){return!_(e)}function f(e,t,n){if(void 0===t||0===t.length)return e;for(var i=0;i0?h(t._children[0],r,n):e.skipTrivia((r||u(t)).text,t.pos,!1,!1,De(t))}function v(e,t,r){return void 0===r&&(r=!1),b(e.text,t,r)}function b(t,r,n){if(void 0===n&&(n=!1),_(r))return"";var i=t.substring(n?r.pos:e.skipTrivia(t,r.pos),r.end);return function(t){return!!e.findAncestor(t,e.isJSDocTypeExpression)}(r)&&(i=i.split(/\r\n|\n|\r/).map((function(t){return e.trimStringStart(t.replace(/^\s*\*/,""))})).join("\n")),i}function x(e,t){return void 0===t&&(t=!1),v(u(e),e,t)}function S(e){return e.pos}function D(e){var t=e.emitNode;return t&&t.flags||0}function C(e){var t=Ft(e);return 254===t.kind&&292===t.parent.kind}function T(t){return e.isModuleDeclaration(t)&&(10===t.name.kind||k(t))}function E(t){return e.isModuleDeclaration(t)||e.isIdentifier(t)}function k(e){return!!(1024&e.flags)}function A(e){return T(e)&&N(e)}function N(t){switch(t.parent.kind){case 305:return e.isExternalModule(t.parent);case 262:return T(t.parent.parent)&&e.isSourceFile(t.parent.parent.parent)&&!e.isExternalModule(t.parent.parent.parent)}return!1}function w(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find((function(t){return!(A(t)||e.isModuleDeclaration(t)&&k(t))}))}function F(t,r){switch(t.kind){case 305:case 263:case 292:case 261:case 242:case 243:case 244:case 171:case 169:case 172:case 173:case 256:case 213:case 214:case 167:case 170:return!0;case 235:return!e.isFunctionLikeOrClassStaticBlockDeclaration(r)}return!1}function P(t){switch(t.kind){case 174:case 175:case 168:case 176:case 179:case 180:case 317:case 257:case 226:case 258:case 259:case 344:case 256:case 169:case 171:case 172:case 173:case 213:case 214:return!0;default:return e.assertType(t),!1}}function I(e){switch(e.kind){case 266:case 265:return!0;default:return!1}}function O(t){return I(t)||e.isExportDeclaration(t)}function M(t){return e.findAncestor(t.parent,(function(e){return F(e,e.parent)}))}function L(e){return e&&0!==s(e)?x(e):"(Missing)"}function R(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:case 14:return e.escapeLeadingUnderscores(t.text);case 162:return Ct(t.expression)?e.escapeLeadingUnderscores(t.expression.text):void 0;default:return e.Debug.assertNever(t)}}function B(t){switch(t.kind){case 108:return"this";case 80:case 79:return 0===s(t)?e.idText(t):x(t);case 161:return B(t.left)+"."+B(t.right);case 206:return e.isIdentifier(t.name)||e.isPrivateIdentifier(t.name)?B(t.expression)+"."+B(t.name):e.Debug.assertNever(t.name);case 311:return B(t.left)+B(t.right);default:return e.Debug.assertNever(t)}}function J(e,t,r,n,i,a,o){var s=K(e,t);return Dn(e,s.start,s.length,r,n,i,a,o)}function j(t,r,n){e.Debug.assertGreaterThanOrEqual(r,0),e.Debug.assertGreaterThanOrEqual(n,0),t&&(e.Debug.assertLessThanOrEqual(r,t.text.length),e.Debug.assertLessThanOrEqual(r+n,t.text.length))}function U(e,t,r,n,i){return j(e,t,r),{file:e,start:t,length:r,code:n.code,category:n.category,messageText:n.next?n:n.messageText,relatedInformation:i}}function V(t,r){var n=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,r);n.scan();var i=n.getTokenPos();return e.createTextSpanFromBounds(i,n.getTextPos())}function K(t,r){var n=r;switch(r.kind){case 305:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):V(t,i);case 254:case 203:case 257:case 226:case 258:case 261:case 260:case 299:case 256:case 213:case 169:case 172:case 173:case 259:case 167:case 166:case 268:n=r.name;break;case 214:return function(t,r){var n=e.skipTrivia(t.text,r.pos);if(r.body&&235===r.body.kind){var i=e.getLineAndCharacterOfPosition(t,r.body.pos).line;if(i0?r.statements[0].pos:r.end;return e.createTextSpanFromBounds(a,o)}if(void 0===n)return V(t,r.pos);e.Debug.assert(!e.isJSDoc(n));var s=_(n),c=s||e.isJsxText(r)?n.pos:e.skipTrivia(t.text,n.pos);return s?(e.Debug.assert(c===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(e.Debug.assert(c>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),e.createTextSpanFromBounds(c,n.end)}function z(e){return 6===e.scriptKind}function G(t){return!!(2&e.getCombinedNodeFlags(t))}function q(e){return 208===e.kind&&100===e.expression.kind}function W(t){return e.isImportTypeNode(t)&&e.isLiteralTypeNode(t.argument)&&e.isStringLiteral(t.argument.literal)}function H(e){return 238===e.kind&&10===e.expression.kind}function Q(e){return!!(1048576&D(e))}function X(t){return e.isIdentifier(t.name)&&!t.initializer}e.changesAffectModuleResolution=function(e,t){return e.configFilePath!==t.configFilePath||a(e,t)},e.optionsHaveModuleResolutionChanges=a,e.changesAffectingProgramStructure=function(t,r){return o(t,r,e.optionsAffectingProgramStructure)},e.optionsHaveChanges=o,e.forEachAncestor=function(t,r){for(;;){var n=r(t);if("quit"===n)return;if(void 0!==n)return n;if(e.isSourceFile(t))return;t=t.parent}},e.forEachEntry=function(e,t){for(var r=e.entries(),n=r.next();!n.done;n=r.next()){var i=n.value,a=i[0],o=t(i[1],a);if(o)return o}},e.forEachKey=function(e,t){for(var r=e.keys(),n=r.next();!n.done;n=r.next()){var i=t(n.value);if(i)return i}},e.copyEntries=function(e,t){e.forEach((function(e,r){t.set(r,e)}))},e.usingSingleLineStringWriter=function(e){var t=i.getText();try{return e(i),i.getText()}finally{i.clear(),i.writeKeyword(t)}},e.getFullWidth=s,e.getResolvedModule=function(e,t,r){return e&&e.resolvedModules&&e.resolvedModules.get(t,r)},e.setResolvedModule=function(t,r,n,i){t.resolvedModules||(t.resolvedModules=e.createModeAwareCache()),t.resolvedModules.set(r,i,n)},e.setResolvedTypeReferenceDirective=function(t,r,n){t.resolvedTypeReferenceDirectiveNames||(t.resolvedTypeReferenceDirectiveNames=e.createModeAwareCache()),t.resolvedTypeReferenceDirectiveNames.set(r,void 0,n)},e.projectReferenceIsEqualTo=function(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular},e.moduleResolutionIsEqualTo=function(e,t){return e.isExternalLibraryImport===t.isExternalLibraryImport&&e.extension===t.extension&&e.resolvedFileName===t.resolvedFileName&&e.originalPath===t.originalPath&&function(e,t){return e===t||!!e&&!!t&&e.name===t.name&&e.subModuleName===t.subModuleName&&e.version===t.version}(e.packageId,t.packageId)},e.packageIdToPackageName=c,e.packageIdToString=function(e){return"".concat(c(e),"@").concat(e.version)},e.typeDirectiveIsEqualTo=function(e,t){return e.resolvedFileName===t.resolvedFileName&&e.primary===t.primary&&e.originalPath===t.originalPath},e.hasChangesInResolutions=function(t,r,n,i,a){e.Debug.assert(t.length===r.length);for(var o=0;o=0),e.getLineStarts(r)[t]},e.nodePosToString=function(t){var r=u(t),n=e.getLineAndCharacterOfPosition(r,t.pos);return"".concat(r.fileName,"(").concat(n.line+1,",").concat(n.character+1,")")},e.getEndLinePosition=d,e.isFileLevelUniqueName=function(e,t,r){return!(r&&r(t)||e.identifiers.has(t))},e.nodeIsMissing=_,e.nodeIsPresent=p,e.insertStatementsAfterStandardPrologue=function(e,t){return f(e,t,H)},e.insertStatementsAfterCustomPrologue=function(e,t){return f(e,t,g)},e.insertStatementAfterStandardPrologue=function(e,t){return m(e,t,H)},e.insertStatementAfterCustomPrologue=function(e,t){return m(e,t,g)},e.isRecognizedTripleSlashComment=function(t,r,n){if(47===t.charCodeAt(r+1)&&r+2=e.ModuleKind.ES2015||!r.noImplicitUseStrict)))},e.isBlockScope=F,e.isDeclarationWithTypeParameters=function(t){switch(t.kind){case 338:case 345:case 323:return!0;default:return e.assertType(t),P(t)}},e.isDeclarationWithTypeParameterChildren=P,e.isAnyImportSyntax=I,e.isAnyImportOrBareOrAccessedRequire=function(e){return I(e)||Ee(e)},e.isLateVisibilityPaintedStatement=function(e){switch(e.kind){case 266:case 265:case 237:case 257:case 256:case 261:case 259:case 258:case 260:return!0;default:return!1}},e.hasPossibleExternalModuleReference=function(t){return O(t)||e.isModuleDeclaration(t)||e.isImportTypeNode(t)||q(t)},e.isAnyImportOrReExport=O,e.getEnclosingBlockScopeContainer=M,e.forEachEnclosingBlockScopeContainer=function(e,t){for(var r=M(e);r;)t(r),r=M(r)},e.declarationNameToString=L,e.getNameFromIndexInfo=function(e){return e.declaration?L(e.declaration.parameters[0].name):void 0},e.isComputedNonLiteralName=function(e){return 162===e.kind&&!Ct(e.expression)},e.tryGetTextOfPropertyName=R,e.getTextOfPropertyName=function(t){return e.Debug.checkDefined(R(t))},e.entityNameToString=B,e.createDiagnosticForNode=function(e,t,r,n,i,a){return J(u(e),e,t,r,n,i,a)},e.createDiagnosticForNodeArray=function(t,r,n,i,a,o,s){var c=e.skipTrivia(t.text,r.pos);return Dn(t,c,r.end-c,n,i,a,o,s)},e.createDiagnosticForNodeInSourceFile=J,e.createDiagnosticForNodeFromMessageChain=function(e,t,r){var n=u(e),i=K(n,e);return U(n,i.start,i.length,t,r)},e.createFileDiagnosticFromMessageChain=U,e.createDiagnosticForFileFromMessageChain=function(e,t,r){return{file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}},e.createDiagnosticMessageChainFromDiagnostic=function(e){return"string"==typeof e.messageText?{code:e.code,category:e.category,messageText:e.messageText,next:e.next}:e.messageText},e.createDiagnosticForRange=function(e,t,r){return{file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}},e.getSpanOfTokenAtPosition=V,e.getErrorSpanForNode=K,e.isExternalOrCommonJsModule=function(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)},e.isJsonSourceFile=z,e.isEnumConst=function(t){return!!(2048&e.getCombinedModifierFlags(t))},e.isDeclarationReadonly=function(t){return!(!(64&e.getCombinedModifierFlags(t))||e.isParameterPropertyDeclaration(t,t.parent))},e.isVarConst=G,e.isLet=function(t){return!!(1&e.getCombinedNodeFlags(t))},e.isSuperCall=function(e){return 208===e.kind&&106===e.expression.kind},e.isImportCall=q,e.isImportMeta=function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText},e.isLiteralImportTypeNode=W,e.isPrologueDirective=H,e.isCustomPrologue=Q,e.isHoistedFunction=function(t){return Q(t)&&e.isFunctionDeclaration(t)},e.isHoistedVariableStatement=function(t){return Q(t)&&e.isVariableStatement(t)&&e.every(t.declarationList.declarations,X)},e.getLeadingCommentRangesOfNode=function(t,r){return 11!==t.kind?e.getLeadingCommentRanges(r.text,t.pos):void 0},e.getJSDocCommentRanges=function(t,r){var n=164===t.kind||163===t.kind||213===t.kind||214===t.kind||212===t.kind||254===t.kind||275===t.kind?e.concatenate(e.getTrailingCommentRanges(r,t.pos),e.getLeadingCommentRanges(r,t.pos)):e.getLeadingCommentRanges(r,t.pos);return e.filter(n,(function(e){return 42===r.charCodeAt(e.pos+1)&&42===r.charCodeAt(e.pos+2)&&47!==r.charCodeAt(e.pos+3)}))},e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*/;var $=/^(\/\/\/\s*/;e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*/;var Y,Z,ee,te,re=/^(\/\/\/\s*/;function ne(t){if(177<=t.kind&&t.kind<=200)return!0;switch(t.kind){case 130:case 155:case 147:case 158:case 150:case 133:case 151:case 148:case 153:case 143:return!0;case 114:return 217!==t.parent.kind;case 228:return e.isHeritageClause(t.parent)&&!Kr(t);case 163:return 195===t.parent.kind||190===t.parent.kind;case 79:(161===t.parent.kind&&t.parent.right===t||206===t.parent.kind&&t.parent.name===t)&&(t=t.parent),e.Debug.assert(79===t.kind||161===t.kind||206===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 161:case 206:case 108:var r=t.parent;if(181===r.kind)return!1;if(200===r.kind)return!r.isTypeOf;if(177<=r.kind&&r.kind<=200)return!0;switch(r.kind){case 228:return e.isHeritageClause(r.parent)&&!Kr(r);case 163:case 344:return t===r.constraint;case 167:case 166:case 164:case 254:case 256:case 213:case 214:case 171:case 169:case 168:case 172:case 173:case 174:case 175:case 176:case 211:return t===r.type;case 208:case 209:return e.contains(r.typeArguments,t);case 210:return!1}}return!1}function ie(e){if(e)switch(e.kind){case 203:case 299:case 164:case 296:case 167:case 166:case 297:case 254:return!0}return!1}function ae(e){return 255===e.parent.kind&&237===e.parent.parent.kind}function oe(t){return!!Se(t)&&(e.isBinaryExpression(t)&&1===Le(t))}function se(e,t,r){return e.properties.filter((function(e){if(296===e.kind){var n=R(e.name);return t===n||!!r&&r===n}return!1}))}function ce(t){if(t&&t.statements.length){var r=t.statements[0].expression;return e.tryCast(r,e.isObjectLiteralExpression)}}function le(t,r){var n=ce(t);return n?se(n,r):e.emptyArray}function ue(t,r){for(e.Debug.assert(305!==t.kind);;){if(!(t=t.parent))return e.Debug.fail();switch(t.kind){case 162:if(e.isClassLike(t.parent.parent))return t;t=t.parent;break;case 165:164===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);break;case 214:if(!r)continue;case 256:case 213:case 261:case 170:case 167:case 166:case 169:case 168:case 171:case 172:case 173:case 174:case 175:case 176:case 260:case 305:return t}}}function de(e){var t=e.kind;return(206===t||207===t)&&106===e.expression.kind}function _e(t,r,n){if(e.isNamedDeclaration(t)&&e.isPrivateIdentifier(t.name))return!1;switch(t.kind){case 257:return!0;case 167:return 257===r.kind;case 172:case 173:case 169:return void 0!==t.body&&257===r.kind;case 164:return void 0!==r.body&&(171===r.kind||169===r.kind||173===r.kind)&&257===n.kind}return!1}function pe(e,t,r){return void 0!==e.decorators&&_e(e,t,r)}function fe(e,t,r){return pe(e,t,r)||me(e,t)}function me(t,r){switch(t.kind){case 257:return e.some(t.members,(function(e){return fe(e,t,r)}));case 169:case 173:case 171:return e.some(t.parameters,(function(e){return pe(e,t,r)}));default:return!1}}function ge(e){var t=e.parent;return(280===t.kind||279===t.kind||281===t.kind)&&t.tagName===e}function ye(t){switch(t.kind){case 106:case 104:case 110:case 95:case 13:case 204:case 205:case 206:case 207:case 208:case 209:case 210:case 229:case 211:case 230:case 212:case 213:case 226:case 214:case 217:case 215:case 216:case 219:case 220:case 221:case 222:case 225:case 223:case 227:case 278:case 279:case 282:case 224:case 218:case 231:return!0;case 228:return!e.isHeritageClause(t.parent);case 161:for(;161===t.parent.kind;)t=t.parent;return 181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 311:for(;e.isJSDocMemberName(t.parent);)t=t.parent;return 181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 80:return e.isBinaryExpression(t.parent)&&t.parent.left===t&&101===t.parent.operatorToken.kind;case 79:if(181===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t))return!0;case 8:case 9:case 10:case 14:case 108:return he(t);default:return!1}}function he(e){var t=e.parent;switch(t.kind){case 254:case 164:case 167:case 166:case 299:case 296:case 203:return t.initializer===e;case 238:case 239:case 240:case 241:case 247:case 248:case 249:case 289:case 251:return t.expression===e;case 242:var r=t;return r.initializer===e&&255!==r.initializer.kind||r.condition===e||r.incrementor===e;case 243:case 244:var n=t;return n.initializer===e&&255!==n.initializer.kind||n.expression===e;case 211:case 229:case 233:case 162:return e===t.expression;case 165:case 288:case 287:case 298:return!0;case 228:return t.expression===e&&!ne(t);case 297:return t.objectAssignmentInitializer===e;default:return ye(t)}}function ve(e){for(;161===e.kind||79===e.kind;)e=e.parent;return 181===e.kind}function be(e){return 265===e.kind&&277===e.moduleReference.kind}function xe(e){return Se(e)}function Se(e){return!!e&&!!(262144&e.flags)}function De(e){return!!e&&!!(8388608&e.flags)}function Ce(t,r){if(208!==t.kind)return!1;var n=t,i=n.expression,a=n.arguments;if(79!==i.kind||"require"!==i.escapedText)return!1;if(1!==a.length)return!1;var o=a[0];return!r||e.isStringLiteralLike(o)}function Te(e){return ke(e,!1)}function Ee(e){return ke(e,!0)}function ke(t,r){return e.isVariableDeclaration(t)&&!!t.initializer&&Ce(r?dn(t.initializer):t.initializer,!0)}function Ae(t){return e.isBinaryExpression(t)||un(t)||e.isIdentifier(t)||e.isCallExpression(t)}function Ne(t){return Se(t)&&t.initializer&&e.isBinaryExpression(t.initializer)&&(56===t.initializer.operatorToken.kind||60===t.initializer.operatorToken.kind)&&t.name&&zr(t.name)&&Fe(t.name,t.initializer.left)?t.initializer.right:t.initializer}function we(t,r){if(e.isCallExpression(t)){var n=_t(t.expression);return 213===n.kind||214===n.kind?t:void 0}return 213===t.kind||226===t.kind||214===t.kind||e.isObjectLiteralExpression(t)&&(0===t.properties.length||r)?t:void 0}function Fe(t,r){return Nt(t)&&Nt(r)?wt(t)===wt(r):e.isMemberName(t)&&Be(r)&&(108===r.expression.kind||e.isIdentifier(r.expression)&&("window"===r.expression.escapedText||"self"===r.expression.escapedText||"global"===r.expression.escapedText))?Fe(t,Ke(r)):!(!Be(t)||!Be(r))&&(Ge(t)===Ge(r)&&Fe(t.expression,r.expression))}function Pe(e){for(;Vr(e,!0);)e=e.right;return e}function Ie(t){return e.isIdentifier(t)&&"exports"===t.escapedText}function Oe(t){return e.isIdentifier(t)&&"module"===t.escapedText}function Me(t){return(e.isPropertyAccessExpression(t)||Je(t))&&Oe(t.expression)&&"exports"===Ge(t)}function Le(t){var r=function(t){if(e.isCallExpression(t)){if(!Re(t))return 0;var r=t.arguments[0];return Ie(r)||Me(r)?8:je(r)&&"prototype"===Ge(r)?9:7}if(63!==t.operatorToken.kind||!un(t.left)||function(t){return e.isVoidExpression(t)&&e.isNumericLiteral(t.expression)&&"0"===t.expression.text}(Pe(t)))return 0;if(Ve(t.left.expression,!0)&&"prototype"===Ge(t.left)&&e.isObjectLiteralExpression(We(t)))return 6;return qe(t.left)}(t);return 5===r||Se(t)?r:0}function Re(t){return 3===e.length(t.arguments)&&e.isPropertyAccessExpression(t.expression)&&e.isIdentifier(t.expression.expression)&&"Object"===e.idText(t.expression.expression)&&"defineProperty"===e.idText(t.expression.name)&&Ct(t.arguments[1])&&Ve(t.arguments[0],!0)}function Be(t){return e.isPropertyAccessExpression(t)||Je(t)}function Je(t){return e.isElementAccessExpression(t)&&Ct(t.argumentExpression)}function je(t,r){return e.isPropertyAccessExpression(t)&&(!r&&108===t.expression.kind||e.isIdentifier(t.name)&&Ve(t.expression,!0))||Ue(t,r)}function Ue(e,t){return Je(e)&&(!t&&108===e.expression.kind||zr(e.expression)||je(e.expression,!0))}function Ve(e,t){return zr(e)||je(e,t)}function Ke(t){return e.isPropertyAccessExpression(t)?t.name:t.argumentExpression}function ze(t){if(e.isPropertyAccessExpression(t))return t.name;var r=_t(t.argumentExpression);return e.isNumericLiteral(r)||e.isStringLiteralLike(r)?r:t}function Ge(t){var r=ze(t);if(r){if(e.isIdentifier(r))return r.escapedText;if(e.isStringLiteralLike(r)||e.isNumericLiteral(r))return e.escapeLeadingUnderscores(r.text)}}function qe(t){if(108===t.expression.kind)return 4;if(Me(t))return 2;if(Ve(t.expression,!0)){if(qr(t.expression))return 3;for(var r=t;!e.isIdentifier(r.expression);)r=r.expression;var n=r.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===Ge(r))&&je(t))return 1;if(Ve(t,!0)||e.isElementAccessExpression(t)&&kt(t))return 5}return 0}function We(t){for(;e.isBinaryExpression(t.right);)t=t.right;return t.right}function He(t){switch(t.parent.kind){case 266:case 272:return t.parent;case 277:return t.parent.parent;case 208:return q(t.parent)||Ce(t.parent,!1)?t.parent:void 0;case 196:return e.Debug.assert(e.isStringLiteral(t)),e.tryCast(t.parent.parent,e.isImportTypeNode);default:return}}function Qe(t){switch(t.kind){case 266:case 272:return t.moduleSpecifier;case 265:return 277===t.moduleReference.kind?t.moduleReference.expression:void 0;case 200:return W(t)?t.argument.literal:void 0;case 208:return t.arguments[0];case 261:return 10===t.name.kind?t.name:void 0;default:return e.Debug.assertNever(t)}}function Xe(e){return 345===e.kind||338===e.kind||339===e.kind}function $e(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&0!==Le(t.expression)&&e.isBinaryExpression(t.expression.right)&&(56===t.expression.right.operatorToken.kind||60===t.expression.right.operatorToken.kind)?t.expression.right.right:void 0}function Ye(e){switch(e.kind){case 237:var t=Ze(e);return t&&t.initializer;case 167:case 296:return e.initializer}}function Ze(t){return e.isVariableStatement(t)?e.firstOrUndefined(t.declarationList.declarations):void 0}function et(t){return e.isModuleDeclaration(t)&&t.body&&261===t.body.kind?t.body:void 0}function tt(t,r){if(e.isJSDoc(r)){var n=e.filter(r.tags,(function(e){return rt(t,e)}));return r.tags===n?[r]:n}return rt(t,r)?[r]:void 0}function rt(t,r){return!(e.isJSDocTypeTag(r)&&r.parent&&e.isJSDoc(r.parent)&&e.isParenthesizedExpression(r.parent.parent)&&r.parent.parent!==t)}function nt(t){var r=t.parent;return 296===r.kind||271===r.kind||167===r.kind||238===r.kind&&206===t.kind||247===r.kind||et(r)||e.isBinaryExpression(t)&&63===t.operatorToken.kind?r:r.parent&&(Ze(r.parent)===t||e.isBinaryExpression(r)&&63===r.operatorToken.kind)?r.parent:r.parent&&r.parent.parent&&(Ze(r.parent.parent)||Ye(r.parent.parent)===t||$e(r.parent.parent))?r.parent.parent:void 0}function it(t){var r=at(t);if(r)return e.isPropertySignature(r)&&r.type&&e.isFunctionLike(r.type)?r.type:e.isFunctionLike(r)?r:void 0}function at(t){var r=ot(t);if(r)return $e(r)||function(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&63===t.expression.operatorToken.kind?Pe(t.expression):void 0}(r)||Ye(r)||Ze(r)||et(r)||r}function ot(t){var r=st(t);if(r){var n=r.parent;return n&&n.jsDoc&&r===e.lastOrUndefined(n.jsDoc)?n:void 0}}function st(t){return e.findAncestor(t.parent,e.isJSDoc)}function ct(t){var r=e.isJSDocParameterTag(t)?t.typeExpression&&t.typeExpression.type:t.type;return void 0!==t.dotDotDotToken||!!r&&318===r.kind}function lt(e){for(var t=e.parent;;){switch(t.kind){case 221:var r=t.operatorToken.kind;return Jr(r)&&t.left===e?63===r||Br(r)?1:2:0;case 219:case 220:var n=t.operator;return 45===n||46===n?2:0;case 243:case 244:return t.initializer===e?1:0;case 212:case 204:case 225:case 230:e=t;break;case 298:e=t.parent;break;case 297:if(t.name!==e)return 0;e=t.parent;break;case 296:if(t.name===e)return 0;e=t.parent;break;default:return 0}t=e.parent}}function ut(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function dt(e){return ut(e,212)}function _t(t,r){var n=r?17:1;return e.skipOuterExpressions(t,n)}function pt(t){return zr(t)||e.isClassExpression(t)}function ft(e){return pt(mt(e))}function mt(t){return e.isExportAssignment(t)?t.expression:t.right}function gt(t){var r=yt(t);if(r&&Se(t)){var n=e.getJSDocAugmentsTag(t);if(n)return n.class}return r}function yt(e){var t=bt(e.heritageClauses,94);return t&&t.types.length>0?t.types[0]:void 0}function ht(t){if(Se(t))return e.getJSDocImplementsTags(t).map((function(e){return e.class}));var r=bt(t.heritageClauses,117);return null==r?void 0:r.types}function vt(e){var t=bt(e.heritageClauses,94);return t?t.types:void 0}function bt(e,t){if(e)for(var r=0,n=e;r0&&e.every(t.declarationList.declarations,(function(e){return Te(e)}))},e.isSingleOrDoubleQuote=function(e){return 39===e||34===e},e.isStringDoubleQuoted=function(e,t){return 34===v(t,e).charCodeAt(0)},e.isAssignmentDeclaration=Ae,e.getEffectiveInitializer=Ne,e.getDeclaredExpandoInitializer=function(e){var t=Ne(e);return t&&we(t,qr(e.name))},e.getAssignedExpandoInitializer=function(t){if(t&&t.parent&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind){var r=qr(t.parent.left);return we(t.parent.right,r)||function(t,r,n){var i=e.isBinaryExpression(r)&&(56===r.operatorToken.kind||60===r.operatorToken.kind)&&we(r.right,n);if(i&&Fe(t,r.left))return i}(t.parent.left,t.parent.right,r)}if(t&&e.isCallExpression(t)&&Re(t)){var n=function(t,r){return e.forEach(t.properties,(function(t){return e.isPropertyAssignment(t)&&e.isIdentifier(t.name)&&"value"===t.name.escapedText&&t.initializer&&we(t.initializer,r)}))}(t.arguments[2],"prototype"===t.arguments[1].text);if(n)return n}},e.getExpandoInitializer=we,e.isDefaultedExpandoInitializer=function(t){var r=e.isVariableDeclaration(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind?t.parent.left:void 0;return r&&we(t.right,qr(r))&&zr(r)&&Fe(r,t.left)},e.getNameOfExpando=function(t){if(e.isBinaryExpression(t.parent)){var r=56!==t.parent.operatorToken.kind&&60!==t.parent.operatorToken.kind||!e.isBinaryExpression(t.parent.parent)?t.parent:t.parent.parent;if(63===r.operatorToken.kind&&e.isIdentifier(r.left))return r.left}else if(e.isVariableDeclaration(t.parent))return t.parent.name},e.isSameEntityName=Fe,e.getRightMostAssignedExpression=Pe,e.isExportsIdentifier=Ie,e.isModuleIdentifier=Oe,e.isModuleExportsAccessExpression=Me,e.getAssignmentDeclarationKind=Le,e.isBindableObjectDefinePropertyCall=Re,e.isLiteralLikeAccess=Be,e.isLiteralLikeElementAccess=Je,e.isBindableStaticAccessExpression=je,e.isBindableStaticElementAccessExpression=Ue,e.isBindableStaticNameExpression=Ve,e.getNameOrArgument=Ke,e.getElementOrPropertyAccessArgumentExpressionOrName=ze,e.getElementOrPropertyAccessName=Ge,e.getAssignmentDeclarationPropertyAccessKind=qe,e.getInitializerOfBinaryExpression=We,e.isPrototypePropertyAssignment=function(t){return e.isBinaryExpression(t)&&3===Le(t)},e.isSpecialPropertyDeclaration=function(t){return Se(t)&&t.parent&&238===t.parent.kind&&(!e.isElementAccessExpression(t)||Je(t))&&!!e.getJSDocTypeTag(t.parent)},e.setValueDeclaration=function(e,t){var r=e.valueDeclaration;(!r||(!(16777216&t.flags)||16777216&r.flags)&&Ae(r)&&!Ae(t)||r.kind!==t.kind&&E(r))&&(e.valueDeclaration=t)},e.isFunctionSymbol=function(t){if(!t||!t.valueDeclaration)return!1;var r=t.valueDeclaration;return 256===r.kind||e.isVariableDeclaration(r)&&r.initializer&&e.isFunctionLike(r.initializer)},e.tryGetModuleSpecifierFromDeclaration=function(t){var r,n;switch(t.kind){case 254:return null===(r=e.findAncestor(t.initializer,(function(e){return Ce(e,!0)})))||void 0===r?void 0:r.arguments[0];case 266:return e.tryCast(t.moduleSpecifier,e.isStringLiteralLike);case 265:return e.tryCast(null===(n=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===n?void 0:n.expression,e.isStringLiteralLike);default:e.Debug.assertNever(t)}},e.importFromModuleSpecifier=function(t){return He(t)||e.Debug.failBadSyntaxKind(t.parent)},e.tryGetImportFromModuleSpecifier=He,e.getExternalModuleName=Qe,e.getNamespaceDeclarationNode=function(t){switch(t.kind){case 266:return t.importClause&&e.tryCast(t.importClause.namedBindings,e.isNamespaceImport);case 265:return t;case 272:return t.exportClause&&e.tryCast(t.exportClause,e.isNamespaceExport);default:return e.Debug.assertNever(t)}},e.isDefaultImport=function(e){return 266===e.kind&&!!e.importClause&&!!e.importClause.name},e.forEachImportClauseDeclaration=function(t,r){var n;if(t.name&&(n=r(t)))return n;if(t.namedBindings&&(n=e.isNamespaceImport(t.namedBindings)?r(t.namedBindings):e.forEach(t.namedBindings.elements,r)))return n},e.hasQuestionToken=function(e){if(e)switch(e.kind){case 164:case 169:case 168:case 297:case 296:case 167:case 166:return void 0!==e.questionToken}return!1},e.isJSDocConstructSignature=function(t){var r=e.isJSDocFunctionType(t)?e.firstOrUndefined(t.parameters):void 0,n=e.tryCast(r&&r.name,e.isIdentifier);return!!n&&"new"===n.escapedText},e.isJSDocTypeAlias=Xe,e.isTypeAlias=function(t){return Xe(t)||e.isTypeAliasDeclaration(t)},e.getSingleInitializerOfVariableStatementOrPropertyDeclaration=Ye,e.getSingleVariableOfVariableStatement=Ze,e.getJSDocCommentsAndTags=function(t,r){var n;ie(t)&&e.hasInitializer(t)&&e.hasJSDocNodes(t.initializer)&&(n=e.addRange(n,tt(t,e.last(t.initializer.jsDoc))));for(var i=t;i&&i.parent;){if(e.hasJSDocNodes(i)&&(n=e.addRange(n,tt(t,e.last(i.jsDoc)))),164===i.kind){n=e.addRange(n,(r?e.getJSDocParameterTagsNoCache:e.getJSDocParameterTags)(i));break}if(163===i.kind){n=e.addRange(n,(r?e.getJSDocTypeParameterTagsNoCache:e.getJSDocTypeParameterTags)(i));break}i=nt(i)}return n||e.emptyArray},e.getNextJSDocCommentLocation=nt,e.getParameterSymbolFromJSDoc=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t.name)){var r=t.name.escapedText,n=it(t);if(n){var i=e.find(n.parameters,(function(e){return 79===e.name.kind&&e.name.escapedText===r}));return i&&i.symbol}}},e.getEffectiveContainerForJSDocTemplateTag=function(t){if(e.isJSDoc(t.parent)&&t.parent.tags){var r=e.find(t.parent.tags,Xe);if(r)return r}return it(t)},e.getHostSignatureFromJSDoc=it,e.getEffectiveJSDocHost=at,e.getJSDocHost=ot,e.getJSDocRoot=st,e.getTypeParameterFromJsDoc=function(t){var r=t.name.escapedText,n=t.parent.parent.parent.typeParameters;return n&&e.find(n,(function(e){return e.name.escapedText===r}))},e.hasRestParameter=function(t){var r=e.lastOrUndefined(t.parameters);return!!r&&ct(r)},e.isRestParameter=ct,e.hasTypeArguments=function(e){return!!e.typeArguments},(Y=e.AssignmentKind||(e.AssignmentKind={}))[Y.None=0]="None",Y[Y.Definite=1]="Definite",Y[Y.Compound=2]="Compound",e.getAssignmentTargetKind=lt,e.isAssignmentTarget=function(e){return 0!==lt(e)},e.isNodeWithPossibleHoistedDeclaration=function(e){switch(e.kind){case 235:case 237:case 248:case 239:case 249:case 263:case 289:case 290:case 250:case 242:case 243:case 244:case 240:case 241:case 252:case 292:return!0}return!1},e.isValueSignatureDeclaration=function(t){return e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isMethodOrAccessor(t)||e.isFunctionDeclaration(t)||e.isConstructorDeclaration(t)},e.walkUpParenthesizedTypes=function(e){return ut(e,191)},e.walkUpParenthesizedExpressions=dt,e.walkUpParenthesizedTypesAndGetParentAndChild=function(e){for(var t;e&&191===e.kind;)t=e,e=e.parent;return[t,e]},e.skipParentheses=_t,e.isDeleteTarget=function(e){return(206===e.kind||207===e.kind)&&((e=dt(e.parent))&&215===e.kind)},e.isNodeDescendantOf=function(e,t){for(;e;){if(e===t)return!0;e=e.parent}return!1},e.isDeclarationName=function(t){return!e.isSourceFile(t)&&!e.isBindingPattern(t)&&e.isDeclaration(t.parent)&&t.parent.name===t},e.getDeclarationFromName=function(t){var r=t.parent;switch(t.kind){case 10:case 14:case 8:if(e.isComputedPropertyName(r))return r.parent;case 79:if(e.isDeclaration(r))return r.name===t?r:void 0;if(e.isQualifiedName(r)){var n=r.parent;return e.isJSDocParameterTag(n)&&n.name===r?n:void 0}var i=r.parent;return e.isBinaryExpression(i)&&0!==Le(i)&&(i.left.symbol||i.symbol)&&e.getNameOfDeclaration(i)===t?i:void 0;case 80:return e.isDeclaration(r)&&r.name===t?r:void 0;default:return}},e.isLiteralComputedPropertyDeclarationName=function(t){return Ct(t)&&162===t.parent.kind&&e.isDeclaration(t.parent.parent)},e.isIdentifierName=function(e){var t=e.parent;switch(t.kind){case 167:case 166:case 169:case 168:case 172:case 173:case 299:case 296:case 206:return t.name===e;case 161:return t.right===e;case 203:case 270:return t.propertyName===e;case 275:case 285:case 279:case 280:case 281:return!0}return!1},e.isAliasSymbolDeclaration=function(t){return!!(265===t.kind||264===t.kind||267===t.kind&&t.name||268===t.kind||274===t.kind||270===t.kind||275===t.kind||271===t.kind&&ft(t))||Se(t)&&(e.isBinaryExpression(t)&&2===Le(t)&&ft(t)||e.isPropertyAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&pt(t.parent.right))},e.getAliasDeclarationFromName=function e(t){switch(t.parent.kind){case 267:case 270:case 268:case 275:case 271:case 265:case 274:return t.parent;case 161:do{t=t.parent}while(161===t.parent.kind);return e(t)}},e.isAliasableExpression=pt,e.exportAssignmentIsAlias=ft,e.getExportAssignmentExpression=mt,e.getPropertyAssignmentAliasLikeExpression=function(e){return 297===e.kind?e.name:296===e.kind?e.initializer:e.parent.right},e.getEffectiveBaseTypeNode=gt,e.getClassExtendsHeritageElement=yt,e.getEffectiveImplementsTypeNodes=ht,e.getAllSuperTypeNodes=function(t){return e.isInterfaceDeclaration(t)?vt(t)||e.emptyArray:e.isClassLike(t)&&e.concatenate(e.singleElementArray(gt(t)),ht(t))||e.emptyArray},e.getInterfaceBaseTypeNodes=vt,e.getHeritageClause=bt,e.getAncestor=function(e,t){for(;e;){if(e.kind===t)return e;e=e.parent}},e.isKeyword=xt,e.isContextualKeyword=St,e.isNonContextualKeyword=Dt,e.isFutureReservedKeyword=function(e){return 117<=e&&e<=125},e.isStringANonContextualKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&Dt(r)},e.isStringAKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&xt(r)},e.isIdentifierANonContextualKeyword=function(e){var t=e.originalKeywordKind;return!!t&&!St(t)},e.isTrivia=function(e){return 2<=e&&e<=7},(Z=e.FunctionFlags||(e.FunctionFlags={}))[Z.Normal=0]="Normal",Z[Z.Generator=1]="Generator",Z[Z.Async=2]="Async",Z[Z.Invalid=4]="Invalid",Z[Z.AsyncGenerator=3]="AsyncGenerator",e.getFunctionFlags=function(e){if(!e)return 4;var t=0;switch(e.kind){case 256:case 213:case 169:e.asteriskToken&&(t|=1);case 214:Tr(e,256)&&(t|=2)}return e.body||(t|=4),t},e.isAsyncFunction=function(e){switch(e.kind){case 256:case 213:case 214:case 169:return void 0!==e.body&&void 0===e.asteriskToken&&Tr(e,256)}return!1},e.isStringOrNumericLiteralLike=Ct,e.isSignedNumericLiteral=Tt,e.hasDynamicName=Et,e.isDynamicName=kt,e.getPropertyNameForPropertyNameNode=At,e.isPropertyNameLiteral=Nt,e.getTextOfIdentifierOrLiteral=wt,e.getEscapedTextOfIdentifierOrLiteral=function(t){return e.isMemberName(t)?t.escapedText:e.escapeLeadingUnderscores(t.text)},e.getPropertyNameForUniqueESSymbol=function(t){return"__@".concat(e.getSymbolId(t),"@").concat(t.escapedName)},e.getSymbolNameForPrivateIdentifier=function(t,r){return"__#".concat(e.getSymbolId(t),"@").concat(r)},e.isKnownSymbol=function(t){return e.startsWith(t.escapedName,"__@")},e.isPrivateIdentifierSymbol=function(t){return e.startsWith(t.escapedName,"__#")},e.isESSymbolIdentifier=function(e){return 79===e.kind&&"Symbol"===e.escapedText},e.isPushOrUnshiftIdentifier=function(e){return"push"===e.escapedText||"unshift"===e.escapedText},e.isParameterDeclaration=function(e){return 164===Ft(e).kind},e.getRootDeclaration=Ft,e.nodeStartsNewLexicalEnvironment=function(e){var t=e.kind;return 171===t||213===t||256===t||214===t||169===t||172===t||173===t||261===t||305===t},e.nodeIsSynthesized=Pt,e.getOriginalSourceFile=function(t){return e.getParseTreeNode(t,e.isSourceFile)||t},(ee=e.Associativity||(e.Associativity={}))[ee.Left=0]="Left",ee[ee.Right=1]="Right",e.getExpressionAssociativity=function(e){var t=Ot(e),r=209===e.kind&&void 0!==e.arguments;return It(e.kind,t,r)},e.getOperatorAssociativity=It,e.getExpressionPrecedence=function(e){var t=Ot(e),r=209===e.kind&&void 0!==e.arguments;return Mt(e.kind,t,r)},e.getOperator=Ot,(te=e.OperatorPrecedence||(e.OperatorPrecedence={}))[te.Comma=0]="Comma",te[te.Spread=1]="Spread",te[te.Yield=2]="Yield",te[te.Assignment=3]="Assignment",te[te.Conditional=4]="Conditional",te[te.Coalesce=4]="Coalesce",te[te.LogicalOR=5]="LogicalOR",te[te.LogicalAND=6]="LogicalAND",te[te.BitwiseOR=7]="BitwiseOR",te[te.BitwiseXOR=8]="BitwiseXOR",te[te.BitwiseAND=9]="BitwiseAND",te[te.Equality=10]="Equality",te[te.Relational=11]="Relational",te[te.Shift=12]="Shift",te[te.Additive=13]="Additive",te[te.Multiplicative=14]="Multiplicative",te[te.Exponentiation=15]="Exponentiation",te[te.Unary=16]="Unary",te[te.Update=17]="Update",te[te.LeftHandSide=18]="LeftHandSide",te[te.Member=19]="Member",te[te.Primary=20]="Primary",te[te.Highest=20]="Highest",te[te.Lowest=0]="Lowest",te[te.Invalid=-1]="Invalid",e.getOperatorPrecedence=Mt,e.getBinaryOperatorPrecedence=Lt,e.getSemanticJsxChildren=function(t){return e.filter(t,(function(e){switch(e.kind){case 288:return!!e.expression;case 11:return!e.containsOnlyTriviaWhiteSpaces;default:return!0}}))},e.createDiagnosticCollection=function(){var t=[],r=[],n=new e.Map,i=!1;return{add:function(a){var o;a.file?(o=n.get(a.file.fileName))||(o=[],n.set(a.file.fileName,o),e.insertSorted(r,a.file.fileName,e.compareStringsCaseSensitive)):(i&&(i=!1,t=t.slice()),o=t);e.insertSorted(o,a,En)},lookup:function(r){var i;i=r.file?n.get(r.file.fileName):t;if(!i)return;var a=e.binarySearch(i,r,e.identity,kn);if(a>=0)return i[a];return},getGlobalDiagnostics:function(){return i=!0,t},getDiagnostics:function(i){if(i)return n.get(i)||[];var a=e.flatMapToMutable(r,(function(e){return n.get(e)}));if(!t.length)return a;return a.unshift.apply(a,t),a}}};var Rt=/\$\{/g;e.hasInvalidEscape=function(t){return t&&!!(e.isNoSubstitutionTemplateLiteral(t)?t.templateFlags:t.head.templateFlags||e.some(t.templateSpans,(function(e){return!!e.literal.templateFlags})))};var Bt=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Jt=/[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,jt=/\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,Ut=new e.Map(e.getEntries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085","\r\n":"\\r\\n"}));function Vt(e){return"\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Kt(e,t,r){if(0===e.charCodeAt(0)){var n=r.charCodeAt(t+e.length);return n>=48&&n<=57?"\\x00":"\\0"}return Ut.get(e)||Vt(e.charCodeAt(0))}function zt(e,t){var r=96===t?jt:39===t?Jt:Bt;return e.replace(r,Kt)}e.escapeString=zt;var Gt=/[^\u0000-\u007F]/g;function qt(e,t){return e=zt(e,t),Gt.test(e)?e.replace(Gt,(function(e){return Vt(e.charCodeAt(0))})):e}e.escapeNonAsciiString=qt;var Wt=/[\"\u0000-\u001f\u2028\u2029\u0085]/g,Ht=/[\'\u0000-\u001f\u2028\u2029\u0085]/g,Qt=new e.Map(e.getEntries({'"':""","'":"'"}));function Xt(e){return 0===e.charCodeAt(0)?"�":Qt.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function $t(e,t){var r=39===t?Ht:Wt;return e.replace(r,Xt)}e.escapeJsxAttributeString=$t,e.stripQuotes=function(e){var t,r=e.length;return r>=2&&e.charCodeAt(0)===e.charCodeAt(r-1)&&(39===(t=e.charCodeAt(0))||34===t||96===t)?e.substring(1,r-1):e},e.isIntrinsicJsxName=function(t){var r=t.charCodeAt(0);return r>=97&&r<=122||e.stringContains(t,"-")||e.stringContains(t,":")};var Yt=[""," "];function Zt(e){for(var t=Yt[1],r=Yt.length;r<=e;r++)Yt.push(Yt[r-1]+t);return Yt[e]}function er(){return Yt[1].length}function tr(e){return!!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function rr(e,t,r){return t.moduleName||ir(e,t.fileName,r&&r.fileName)}function nr(t,r){return t.getCanonicalFileName(e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()))}function ir(t,r,n){var i=function(e){return t.getCanonicalFileName(e)},a=e.toPath(n?e.getDirectoryPath(n):t.getCommonSourceDirectory(),t.getCurrentDirectory(),i),o=e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()),s=pi(e.getRelativePathToDirectoryOrUrl(a,o,a,i,!1));return n?e.ensurePathIsNonModuleName(s):s}function ar(e,t,r,n,i){var a=t.declarationDir||t.outDir,o=a?ur(e,a,r,n,i):e,s=or(o);return pi(o)+s}function or(t){return e.fileExtensionIsOneOf(t,[".mjs",".mts"])?".d.mts":e.fileExtensionIsOneOf(t,[".cjs",".cts"])?".d.cts":e.fileExtensionIsOneOf(t,[".json"])?".json.d.ts":".d.ts"}function sr(e){return e.outFile||e.out}function cr(e,t,r){return!(t.getCompilerOptions().noEmitForJsFiles&&xe(e))&&!e.isDeclarationFile&&!t.isSourceFileFromExternalLibrary(e)&&(r||!(z(e)&&t.getResolvedProjectReferenceToRedirect(e.fileName))&&!t.isSourceOfProjectReferenceRedirect(e.fileName))}function lr(e,t,r){return ur(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))}function ur(t,r,n,i,a){var o=e.getNormalizedAbsolutePath(t,n);return o=0===a(o).indexOf(a(i))?o.substring(i.length):o,e.combinePaths(r,o)}function dr(t,r,n){t.length>e.getRootLength(t)&&!n(t)&&(dr(e.getDirectoryPath(t),r,n),r(t))}function _r(t,r){return e.computeLineOfPosition(t,r)}function pr(t){return e.find(t.members,(function(t){return e.isConstructorDeclaration(t)&&p(t.body)}))}function fr(e){if(e&&e.parameters.length>0){var t=2===e.parameters.length&&mr(e.parameters[0]);return e.parameters[t?1:0]}}function mr(e){return gr(e.name)}function gr(e){return!!e&&79===e.kind&&yr(e)}function yr(e){return 108===e.originalKeywordKind}function hr(t){if(Se(t)||!e.isFunctionDeclaration(t)){var r=t.type;return r||!Se(t)?r:e.isJSDocPropertyLikeTag(t)?t.typeExpression&&t.typeExpression.type:e.getJSDocType(t)}}function vr(e,t,r,n){br(e,t,r.pos,n)}function br(e,t,r,n){n&&n.length&&r!==n[0].pos&&_r(e,r)!==_r(e,n[0].pos)&&t.writeLine()}function xr(e,t,r,n,i,a,o,s){if(n&&n.length>0){i&&r.writeSpace(" ");for(var c=!1,l=0,u=n;l=0&&e.kind<=160?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|Mr(e)),!t||4096&e.modifierFlagsCache||!r&&!Se(e)||!e.parent||(e.modifierFlagsCache|=4096|Or(e)),-536875009&e.modifierFlagsCache)}function Pr(e){return Fr(e,!0)}function Ir(e){return Fr(e,!1)}function Or(t){var r=0;return t.parent&&!e.isParameter(t)&&(Se(t)&&(e.getJSDocPublicTagNoCache(t)&&(r|=4),e.getJSDocPrivateTagNoCache(t)&&(r|=8),e.getJSDocProtectedTagNoCache(t)&&(r|=16),e.getJSDocReadonlyTagNoCache(t)&&(r|=64),e.getJSDocOverrideTagNoCache(t)&&(r|=16384)),e.getJSDocDeprecatedTagNoCache(t)&&(r|=8192)),r}function Mr(e){var t=Lr(e.modifiers);return(4&e.flags||79===e.kind&&e.isInJSDocNamespace)&&(t|=1),t}function Lr(e){var t=0;if(e)for(var r=0,n=e;r=63&&e<=78}function jr(e){var t=Ur(e);return t&&!t.isImplements?t.class:void 0}function Ur(t){return e.isExpressionWithTypeArguments(t)&&e.isHeritageClause(t.parent)&&e.isClassLike(t.parent.parent)?{class:t.parent.parent,isImplements:117===t.parent.token}:void 0}function Vr(t,r){return e.isBinaryExpression(t)&&(r?63===t.operatorToken.kind:Jr(t.operatorToken.kind))&&e.isLeftHandSideExpression(t.left)}function Kr(e){return void 0!==jr(e)}function zr(e){return 79===e.kind||Gr(e)}function Gr(t){return e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&zr(t.expression)}function qr(e){return je(e)&&"prototype"===Ge(e)}function Wr(t){return e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isElementAccessExpression(t.parent)&&t.parent.argumentExpression===t}e.getIndentString=Zt,e.getIndentSize=er,e.isNightly=function(){return e.stringContains(e.version,"-dev")||e.stringContains(e.version,"-insiders")},e.createTextWriter=function(t){var r,n,i,a,o,s=!1;function c(t){var n=e.computeLineStarts(t);n.length>1?(a=a+n.length-1,o=r.length-t.length+e.last(n),i=o-r.length==0):i=!1}function l(e){e&&e.length&&(i&&(e=Zt(n)+e,i=!1),r+=e,c(e))}function u(e){e&&(s=!1),l(e)}function d(){r="",n=0,i=!0,a=0,o=0,s=!1}return d(),{write:u,rawWrite:function(e){void 0!==e&&(r+=e,c(e),s=!1)},writeLiteral:function(e){e&&e.length&&u(e)},writeLine:function(e){i&&!e||(a++,o=(r+=t).length,i=!0,s=!1)},increaseIndent:function(){n++},decreaseIndent:function(){n--},getIndent:function(){return n},getTextPos:function(){return r.length},getLine:function(){return a},getColumn:function(){return i?n*er():r.length-o},getText:function(){return r},isAtStartOfLine:function(){return i},hasTrailingComment:function(){return s},hasTrailingWhitespace:function(){return!!r.length&&e.isWhiteSpaceLike(r.charCodeAt(r.length-1))},clear:d,reportInaccessibleThisError:e.noop,reportPrivateInBaseOfClassExpression:e.noop,reportInaccessibleUniqueSymbolError:e.noop,trackSymbol:function(){return!1},writeKeyword:u,writeOperator:u,writeParameter:u,writeProperty:u,writePunctuation:u,writeSpace:u,writeStringLiteral:u,writeSymbol:function(e,t){return u(e)},writeTrailingSemicolon:u,writeComment:function(e){e&&(s=!0),l(e)},getTextPosWithWriteLine:function(){return i?r.length:r.length+t.length}}},e.getTrailingSemicolonDeferringWriter=function(e){var t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1)}return n(n({},e),{writeTrailingSemicolon:function(){t=!0},writeLiteral:function(t){r(),e.writeLiteral(t)},writeStringLiteral:function(t){r(),e.writeStringLiteral(t)},writeSymbol:function(t,n){r(),e.writeSymbol(t,n)},writePunctuation:function(t){r(),e.writePunctuation(t)},writeKeyword:function(t){r(),e.writeKeyword(t)},writeOperator:function(t){r(),e.writeOperator(t)},writeParameter:function(t){r(),e.writeParameter(t)},writeSpace:function(t){r(),e.writeSpace(t)},writeProperty:function(t){r(),e.writeProperty(t)},writeComment:function(t){r(),e.writeComment(t)},writeLine:function(){r(),e.writeLine()},increaseIndent:function(){r(),e.increaseIndent()},decreaseIndent:function(){r(),e.decreaseIndent()}})},e.hostUsesCaseSensitiveFileNames=tr,e.hostGetCanonicalFileName=function(t){return e.createGetCanonicalFileName(tr(t))},e.getResolvedExternalModuleName=rr,e.getExternalModuleNameFromDeclaration=function(t,r,n){var i=r.getExternalModuleFileFromDeclaration(n);if(i&&!i.isDeclarationFile){var a=Qe(n);if(!a||!e.isStringLiteralLike(a)||e.pathIsRelative(a.text)||-1!==nr(t,i.path).indexOf(nr(t,e.ensureTrailingDirectorySeparator(t.getCommonSourceDirectory()))))return rr(t,i)}},e.getExternalModuleNameFromPath=ir,e.getOwnEmitOutputFilePath=function(e,t,r){var n=t.getCompilerOptions();return(n.outDir?pi(lr(e,t,n.outDir)):pi(e))+r},e.getDeclarationEmitOutputFilePath=function(e,t){return ar(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))},e.getDeclarationEmitOutputFilePathWorker=ar,e.getDeclarationEmitExtensionForPath=or,e.getPossibleOriginalInputExtensionForExtension=function(t){return e.fileExtensionIsOneOf(t,[".d.mts",".mjs",".mts"])?[".mts",".mjs"]:e.fileExtensionIsOneOf(t,[".d.cts",".cjs",".cts"])?[".cts",".cjs"]:e.fileExtensionIsOneOf(t,[".json.d.ts"])?[".json"]:[".tsx",".ts",".jsx",".js"]},e.outFile=sr,e.getPathsBasePath=function(t,r){var n,i;if(t.paths)return null!==(n=t.baseUrl)&&void 0!==n?n:e.Debug.checkDefined(t.pathsBasePath||(null===(i=r.getCurrentDirectory)||void 0===i?void 0:i.call(r)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")},e.getSourceFilesToEmit=function(t,r,n){var i=t.getCompilerOptions();if(sr(i)){var a=In(i),o=i.emitDeclarationOnly||a===e.ModuleKind.AMD||a===e.ModuleKind.System;return e.filter(t.getSourceFiles(),(function(r){return(o||!e.isExternalModule(r))&&cr(r,t,n)}))}var s=void 0===r?t.getSourceFiles():[r];return e.filter(s,(function(e){return cr(e,t,n)}))},e.sourceFileMayBeEmitted=cr,e.getSourceFilePathInNewDir=lr,e.getSourceFilePathInNewDirWorker=ur,e.writeFile=function(t,r,n,i,a,o,s){t.writeFile(n,i,a,(function(t){r.add(Cn(e.Diagnostics.Could_not_write_file_0_Colon_1,n,t))}),o,s)},e.writeFileEnsuringDirectories=function(t,r,n,i,a,o){try{i(t,r,n)}catch(s){dr(e.getDirectoryPath(e.normalizePath(t)),a,o),i(t,r,n)}},e.getLineOfLocalPosition=function(t,r){var n=e.getLineStarts(t);return e.computeLineOfPosition(n,r)},e.getLineOfLocalPositionFromLineMap=_r,e.getFirstConstructorWithBody=pr,e.getSetAccessorValueParameter=fr,e.getSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&t.type},e.getThisParameter=function(t){if(t.parameters.length&&!e.isJSDocSignature(t)){var r=t.parameters[0];if(mr(r))return r}},e.parameterIsThisKeyword=mr,e.isThisIdentifier=gr,e.isThisInTypeQuery=function(t){if(!gr(t))return!1;for(;e.isQualifiedName(t.parent)&&t.parent.left===t;)t=t.parent;return 181===t.parent.kind},e.identifierIsThisKeyword=yr,e.getAllAccessorDeclarations=function(t,r){var n,i,a,o;return Et(r)?(n=r,172===r.kind?a=r:173===r.kind?o=r:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,(function(t){e.isAccessor(t)&&Er(t)===Er(r)&&(At(t.name)===At(r.name)&&(n?i||(i=t):n=t,172!==t.kind||a||(a=t),173!==t.kind||o||(o=t)))})),{firstAccessor:n,secondAccessor:i,getAccessor:a,setAccessor:o}},e.getEffectiveTypeAnnotationNode=hr,e.getTypeAnnotationNode=function(e){return e.type},e.getEffectiveReturnTypeNode=function(t){return e.isJSDocSignature(t)?t.type&&t.type.typeExpression&&t.type.typeExpression.type:t.type||(Se(t)?e.getJSDocReturnType(t):void 0)},e.getJSDocTypeParameterDeclarations=function(t){return e.flatMap(e.getJSDocTags(t),(function(t){return function(t){return e.isJSDocTemplateTag(t)&&!(320===t.parent.kind&&t.parent.tags.some(Xe))}(t)?t.typeParameters:void 0}))},e.getEffectiveSetAccessorTypeAnnotationNode=function(e){var t=fr(e);return t&&hr(t)},e.emitNewLineBeforeLeadingComments=vr,e.emitNewLineBeforeLeadingCommentsOfPosition=br,e.emitNewLineBeforeLeadingCommentOfPosition=function(e,t,r,n){r!==n&&_r(e,r)!==_r(e,n)&&t.writeLine()},e.emitComments=xr,e.emitDetachedComments=function(t,r,n,i,a,o,s){var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),(function(e){return y(t,e.pos)}))):c=e.getLeadingCommentRanges(t,a.pos),c){for(var u=[],d=void 0,_=0,p=c;_=m+2)break}u.push(f),d=f}if(u.length){m=_r(r,e.last(u).end);_r(r,e.skipTrivia(t,a.pos))>=m+2&&(vr(r,n,a,c),xr(t,r,n,u,!1,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.last(u).end})}}return l},e.writeCommentRange=function(t,r,n,i,a,o){if(42===t.charCodeAt(i+1))for(var s=e.computeLineAndCharacterOfPosition(r,i),c=r.length,l=void 0,u=i,d=s.line;u0){var f=p%er(),m=Zt((p-f)/er());for(n.rawWrite(m);f;)n.rawWrite(" "),f--}else n.rawWrite("")}Sr(t,a,n,o,u,_),u=_}else n.writeComment(t.substring(i,a))},e.hasEffectiveModifiers=function(e){return 0!==Pr(e)},e.hasSyntacticModifiers=function(e){return 0!==Ir(e)},e.hasEffectiveModifier=Cr,e.hasSyntacticModifier=Tr,e.isStatic=Er,e.hasStaticModifier=kr,e.hasOverrideModifier=function(e){return Cr(e,16384)},e.hasAbstractModifier=function(e){return Tr(e,128)},e.hasAmbientModifier=function(e){return Tr(e,2)},e.hasEffectiveReadonlyModifier=Ar,e.getSelectedEffectiveModifierFlags=Nr,e.getSelectedSyntacticModifierFlags=wr,e.getEffectiveModifierFlags=Pr,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc=function(e){return Fr(e,!0,!0)},e.getSyntacticModifierFlags=Ir,e.getEffectiveModifierFlagsNoCache=function(e){return Mr(e)|Or(e)},e.getSyntacticModifierFlagsNoCache=Mr,e.modifiersToFlags=Lr,e.modifierToFlag=Rr,e.createModifiers=function(t){return t?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(t)):void 0},e.isLogicalOperator=function(e){return 56===e||55===e||53===e},e.isLogicalOrCoalescingAssignmentOperator=Br,e.isLogicalOrCoalescingAssignmentExpression=function(e){return Br(e.operatorToken.kind)},e.isAssignmentOperator=Jr,e.tryGetClassExtendingExpressionWithTypeArguments=jr,e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments=Ur,e.isAssignmentExpression=Vr,e.isLeftHandSideOfAssignment=function(e){return Vr(e.parent)&&e.parent.left===e},e.isDestructuringAssignment=function(e){if(Vr(e,!0)){var t=e.left.kind;return 205===t||204===t}return!1},e.isExpressionWithTypeArgumentsInClassExtendsClause=Kr,e.isEntityNameExpression=zr,e.getFirstIdentifier=function(e){switch(e.kind){case 79:return e;case 161:do{e=e.left}while(79!==e.kind);return e;case 206:do{e=e.expression}while(79!==e.kind);return e}},e.isDottedName=function e(t){return 79===t.kind||108===t.kind||106===t.kind||231===t.kind||206===t.kind&&e(t.expression)||212===t.kind&&e(t.expression)},e.isPropertyAccessEntityNameExpression=Gr,e.tryGetPropertyAccessOrIdentifierToString=function t(r){if(e.isPropertyAccessExpression(r)){if(void 0!==(n=t(r.expression)))return n+"."+B(r.name)}else if(e.isElementAccessExpression(r)){var n;if(void 0!==(n=t(r.expression))&&e.isPropertyName(r.argumentExpression))return n+"."+At(r.argumentExpression)}else if(e.isIdentifier(r))return e.unescapeLeadingUnderscores(r.escapedText)},e.isPrototypeAccess=qr,e.isRightSideOfQualifiedNameOrPropertyAccess=function(e){return 161===e.parent.kind&&e.parent.right===e||206===e.parent.kind&&e.parent.name===e},e.isRightSideOfAccessExpression=Wr,e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName=function(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isJSDocMemberName(t.parent)&&t.parent.right===t},e.isEmptyObjectLiteral=function(e){return 205===e.kind&&0===e.properties.length},e.isEmptyArrayLiteral=function(e){return 204===e.kind&&0===e.elements.length},e.getLocalSymbolForExportDefault=function(t){if(function(t){return t&&e.length(t.declarations)>0&&Tr(t.declarations[0],512)}(t)&&t.declarations)for(var r=0,n=t.declarations;r>6|192),r.push(63&a|128)):a<65536?(r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)):a<131072?(r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point")}return r}(t),c=0,l=s.length;c>2,n=(3&s[c])<<4|s[c+1]>>4,i=(15&s[c+1])<<2|s[c+2]>>6,a=63&s[c+2],c+1>=l?i=a=64:c+2>=l&&(a=64),o+=Hr.charAt(r)+Hr.charAt(n)+Hr.charAt(i)+Hr.charAt(a),c+=3;return o}e.convertToBase64=Qr,e.base64encode=function(e,t){return e&&e.base64encode?e.base64encode(t):Qr(t)},e.base64decode=function(e,t){if(e&&e.base64decode)return e.base64decode(t);for(var r=t.length,n=[],i=0;i>4&3,u=(15&o)<<4|s>>2&15,d=(3&s)<<6|63&c;0===u&&0!==s?n.push(l):0===d&&0!==c?n.push(l,u):n.push(l,u,d),i+=4}return function(e){for(var t="",r=0,n=e.length;r=t||-1===r),{pos:t,end:r}}function Zr(e,t){return Yr(t,e.end)}function en(e){return e.decorators&&e.decorators.length>0?Zr(e,e.decorators.end):e}function tn(e,t,r){return rn(nn(e,r,!1),t.end,r)}function rn(t,r,n){return 0===e.getLinesBetweenPositions(n,t,r)}function nn(t,r,n){return yi(t.pos)?-1:e.skipTrivia(r.text,t.pos,!1,n)}function an(e){return void 0!==e.initializer}function on(e){return 33554432&e.flags?e.checkFlags:0}function sn(t){var r=t.parent;if(!r)return 0;switch(r.kind){case 212:case 204:return sn(r);case 220:case 219:var n=r.operator;return 45===n||46===n?c():0;case 221:var i=r,a=i.left,o=i.operatorToken;return a===t&&Jr(o.kind)?63===o.kind?1:c():0;case 206:return r.name!==t?0:sn(r);case 296:var s=sn(r.parent);return t===r.name?function(t){switch(t){case 0:return 1;case 1:return 0;case 2:return 2;default:return e.Debug.assertNever(t)}}(s):s;case 297:return t===r.objectAssignmentInitializer?0:sn(r.parent);default:return 0}function c(){return r.parent&&238===dt(r.parent).kind?1:2}}function cn(e,t,r){var n=r.onDeleteValue,i=r.onExistingValue;e.forEach((function(r,a){var o=t.get(a);void 0===o?(e.delete(a),n(r,a)):i&&i(r,o,a)}))}function ln(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find(e.isClassLike)}function un(e){return 206===e.kind||207===e.kind}function dn(e){for(;un(e);)e=e.expression;return e}function _n(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=void 0,this.mergeId=void 0,this.parent=void 0}function pn(t,r){this.flags=r,(e.Debug.isDebugging||e.tracing)&&(this.checker=t)}function fn(t,r){this.flags=r,e.Debug.isDebugging&&(this.checker=t)}function mn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0}function gn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0}function yn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.flowNode=void 0}function hn(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||function(e){return e}}function vn(t,r,n){return void 0===n&&(n=0),t.replace(/{(\d+)}/g,(function(t,i){return""+e.Debug.checkDefined(r[+i+n])}))}function bn(e){return $r&&$r[e.key]||e.message}function xn(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function Sn(t,r){var n=r.fileName||"",i=r.text.length;e.Debug.assertEqual(t.fileName,n),e.Debug.assertLessThanOrEqual(t.start,i),e.Debug.assertLessThanOrEqual(t.start+t.length,i);var a={file:r,start:t.start,length:t.length,messageText:t.messageText,category:t.category,code:t.code,reportsUnnecessary:t.reportsUnnecessary};if(t.relatedInformation){a.relatedInformation=[];for(var o=0,s=t.relatedInformation;o4&&(i=vn(i,arguments,4)),{file:e,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated}}function Cn(e){var t=bn(e);return arguments.length>1&&(t=vn(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function Tn(e){return e.file?e.file.path:void 0}function En(t,r){return kn(t,r)||function(t,r){if(!t.relatedInformation&&!r.relatedInformation)return 0;if(t.relatedInformation&&r.relatedInformation)return e.compareValues(t.relatedInformation.length,r.relatedInformation.length)||e.forEach(t.relatedInformation,(function(e,t){return En(e,r.relatedInformation[t])}))||0;return t.relatedInformation?-1:1}(t,r)||0}function kn(t,r){return e.compareStringsCaseSensitive(Tn(t),Tn(r))||e.compareValues(t.start,r.start)||e.compareValues(t.length,r.length)||e.compareValues(t.code,r.code)||An(t.messageText,r.messageText)||0}function An(t,r){if("string"==typeof t&&"string"==typeof r)return e.compareStringsCaseSensitive(t,r);if("string"==typeof t)return-1;if("string"==typeof r)return 1;var n=e.compareStringsCaseSensitive(t.messageText,r.messageText);if(n)return n;if(!t.next&&!r.next)return 0;if(!t.next)return-1;if(!r.next)return 1;for(var i=Math.min(t.next.length,r.next.length),a=0;ar.next.length?1:0}function Nn(t){if(2&t.transformFlags)return e.isJsxOpeningLikeElement(t)||e.isJsxFragment(t)?t:e.forEachChild(t,Nn)}function wn(e){return e.isDeclarationFile?void 0:Nn(e)}function Fn(t){return!(t.impliedNodeFormat!==e.ModuleKind.ESNext&&!e.fileExtensionIsOneOf(t.fileName,[".cjs",".cts"])||t.isDeclarationFile)||void 0}function Pn(t){return t.target||t.module===e.ModuleKind.Node16&&9||t.module===e.ModuleKind.NodeNext&&99||0}function In(t){return"number"==typeof t.module?t.module:Pn(t)>=2?e.ModuleKind.ES2015:e.ModuleKind.CommonJS}function On(t){return t.moduleDetection||(In(t)===e.ModuleKind.Node16||In(t)===e.ModuleKind.NodeNext?e.ModuleDetectionKind.Force:e.ModuleDetectionKind.Auto)}function Mn(t){if(void 0!==t.esModuleInterop)return t.esModuleInterop;switch(In(t)){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return!0}}function Ln(e){return!(!e.declaration&&!e.composite)}function Rn(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function Bn(e){return void 0===e.allowJs?!!e.checkJs:e.allowJs}function Jn(e,t){return t.strictFlag?Rn(e,t.name):e[t.name]}function jn(t,r){return void 0!==t&&("node_modules"===r(t)||e.startsWith(t,"@"))}e.getNewLineCharacter=function(t,r){switch(t.newLine){case 0:return"\r\n";case 1:return"\n"}return r?r():e.sys?e.sys.newLine:"\r\n"},e.createRange=Yr,e.moveRangeEnd=function(e,t){return Yr(e.pos,t)},e.moveRangePos=Zr,e.moveRangePastDecorators=en,e.moveRangePastModifiers=function(e){return e.modifiers&&e.modifiers.length>0?Zr(e,e.modifiers.end):en(e)},e.isCollapsedRange=function(e){return e.pos===e.end},e.createTokenRange=function(t,r){return Yr(t,t+e.tokenToString(r).length)},e.rangeIsOnSingleLine=function(e,t){return tn(e,e,t)},e.rangeStartPositionsAreOnSameLine=function(e,t,r){return rn(nn(e,r,!1),nn(t,r,!1),r)},e.rangeEndPositionsAreOnSameLine=function(e,t,r){return rn(e.end,t.end,r)},e.rangeStartIsOnSameLineAsRangeEnd=tn,e.rangeEndIsOnSameLineAsRangeStart=function(e,t,r){return rn(e.end,nn(t,r,!1),r)},e.getLinesBetweenRangeEndAndRangeStart=function(t,r,n,i){var a=nn(r,n,i);return e.getLinesBetweenPositions(n,t.end,a)},e.getLinesBetweenRangeEndPositions=function(t,r,n){return e.getLinesBetweenPositions(n,t.end,r.end)},e.isNodeArrayMultiLine=function(e,t){return!rn(e.pos,e.end,t)},e.positionsAreOnSameLine=rn,e.getStartPositionOfRange=nn,e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i),o=function(t,r,n){void 0===r&&(r=0);for(;t-- >r;)if(!e.isWhiteSpaceLike(n.text.charCodeAt(t)))return t}(a,r,n);return e.getLinesBetweenPositions(n,null!=o?o:r,a)},e.getLinesBetweenPositionAndNextNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i);return e.getLinesBetweenPositions(n,t,Math.min(r,a))},e.isDeclarationNameOfEnumOrNamespace=function(t){var r=e.getParseTreeNode(t);if(r)switch(r.parent.kind){case 260:case 261:return r===r.parent.name}return!1},e.getInitializedVariables=function(t){return e.filter(t.declarations,an)},e.isWatchSet=function(e){return e.watch&&e.hasOwnProperty("watch")},e.closeFileWatcher=function(e){e.close()},e.getCheckFlags=on,e.getDeclarationModifierFlagsFromSymbol=function(t,r){if(void 0===r&&(r=!1),t.valueDeclaration){var n=r&&t.declarations&&e.find(t.declarations,(function(e){return 173===e.kind}))||t.valueDeclaration,i=e.getCombinedModifierFlags(n);return t.parent&&32&t.parent.flags?i:-29&i}if(6&on(t)){var a=t.checkFlags;return(1024&a?8:256&a?4:16)|(2048&a?32:0)}return 4194304&t.flags?36:0},e.skipAlias=function(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e},e.getCombinedLocalAndExportSymbolFlags=function(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags},e.isWriteOnlyAccess=function(e){return 1===sn(e)},e.isWriteAccess=function(e){return 0!==sn(e)},function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Xr||(Xr={})),e.compareDataObjects=function e(t,r){if(!t||!r||Object.keys(t).length!==Object.keys(r).length)return!1;for(var n in t)if("object"==typeof t[n]){if(!e(t[n],r[n]))return!1}else if("function"!=typeof t[n]&&t[n]!==r[n])return!1;return!0},e.clearMap=function(e,t){e.forEach(t),e.clear()},e.mutateMapSkippingNewValues=cn,e.mutateMap=function(e,t,r){cn(e,t,r);var n=r.createNewValue;t.forEach((function(t,r){e.has(r)||e.set(r,n(r,t))}))},e.isAbstractConstructorSymbol=function(e){if(32&e.flags){var t=ln(e);return!!t&&Tr(t,128)}return!1},e.getClassLikeDeclarationOfSymbol=ln,e.getObjectFlags=function(e){return 3899393&e.flags?e.objectFlags:0},e.typeHasCallOrConstructSignatures=function(e,t){return 0!==t.getSignaturesOfType(e,0).length||0!==t.getSignaturesOfType(e,1).length},e.forSomeAncestorDirectory=function(t,r){return!!e.forEachAncestorDirectory(t,(function(e){return!!r(e)||void 0}))},e.isUMDExportSymbol=function(t){return!!t&&!!t.declarations&&!!t.declarations[0]&&e.isNamespaceExportDeclaration(t.declarations[0])},e.showModuleSpecifier=function(t){var r=t.moduleSpecifier;return e.isStringLiteral(r)?r.text:x(r)},e.getLastChild=function(t){var r;return e.forEachChild(t,(function(e){p(e)&&(r=e)}),(function(e){for(var t=e.length-1;t>=0;t--)if(p(e[t])){r=e[t];break}})),r},e.addToSeen=function(e,t,r){return void 0===r&&(r=!0),!e.has(t)&&(e.set(t,r),!0)},e.isObjectTypeDeclaration=function(t){return e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)},e.isTypeNodeKind=function(e){return e>=177&&e<=200||130===e||155===e||147===e||158===e||148===e||133===e||150===e||151===e||114===e||153===e||143===e||228===e||312===e||313===e||314===e||315===e||316===e||317===e||318===e},e.isAccessExpression=un,e.getNameOfAccessExpression=function(t){return 206===t.kind?t.name:(e.Debug.assert(207===t.kind),t.argumentExpression)},e.isBundleFileTextLike=function(e){switch(e.kind){case"text":case"internal":return!0;default:return!1}},e.isNamedImportsOrExports=function(e){return 269===e.kind||273===e.kind},e.getLeftmostAccessExpression=dn,e.forEachNameInAccessChainWalkingLeft=function(t,r){if(un(t.parent)&&Wr(t))return function t(n){if(206===n.kind){if(void 0!==(i=r(n.name)))return i}else if(207===n.kind){if(!e.isIdentifier(n.argumentExpression)&&!e.isStringLiteralLike(n.argumentExpression))return;var i;if(void 0!==(i=r(n.argumentExpression)))return i}if(un(n.expression))return t(n.expression);if(e.isIdentifier(n.expression))return r(n.expression);return}(t.parent)},e.getLeftmostExpression=function(e,t){for(;;){switch(e.kind){case 220:e=e.operand;continue;case 221:e=e.left;continue;case 222:e=e.condition;continue;case 210:e=e.tag;continue;case 208:if(t)return e;case 229:case 207:case 206:case 230:case 350:e=e.expression;continue}return e}},e.objectAllocator={getNodeConstructor:function(){return mn},getTokenConstructor:function(){return gn},getIdentifierConstructor:function(){return yn},getPrivateIdentifierConstructor:function(){return mn},getSourceFileConstructor:function(){return mn},getSymbolConstructor:function(){return _n},getTypeConstructor:function(){return pn},getSignatureConstructor:function(){return fn},getSourceMapSourceConstructor:function(){return hn}},e.setObjectAllocator=function(t){Object.assign(e.objectAllocator,t)},e.formatStringFromArgs=vn,e.setLocalizedDiagnosticMessages=function(e){$r=e},e.maybeSetLocalizedDiagnosticMessages=function(e){!$r&&e&&($r=e())},e.getLocaleSpecificMessage=bn,e.createDetachedDiagnostic=function(e,t,r,n){j(void 0,t,r);var i=bn(n);return arguments.length>4&&(i=vn(i,arguments,4)),{file:void 0,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,fileName:e}},e.attachFileToDiagnostics=function(e,t){for(var r=[],n=0,i=e;n2&&(r=vn(r,arguments,2)),r},e.createCompilerDiagnostic=Cn,e.createCompilerDiagnosticFromMessageChain=function(e,t){return{file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}},e.chainDiagnosticMessages=function(e,t){var r=bn(t);return arguments.length>2&&(r=vn(r,arguments,2)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}},e.concatenateDiagnosticMessageChains=function(e,t){for(var r=e;r.next;)r=r.next[0];r.next=[t]},e.compareDiagnostics=En,e.compareDiagnosticsSkipRelatedInformation=kn,e.getLanguageVariant=function(e){return 4===e||2===e||1===e||6===e?1:0},e.getSetExternalModuleIndicator=function(t){switch(On(t)){case e.ModuleDetectionKind.Force:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t)||!t.isDeclarationFile||void 0};case e.ModuleDetectionKind.Legacy:return function(t){t.externalModuleIndicator=e.isFileProbablyExternalModule(t)};case e.ModuleDetectionKind.Auto:var r=[e.isFileProbablyExternalModule];4!==t.jsx&&5!==t.jsx||r.push(wn);var n=In(t);n!==e.ModuleKind.Node16&&n!==e.ModuleKind.NodeNext||r.push(Fn);var i=e.or.apply(void 0,r);return function(e){e.externalModuleIndicator=i(e)}}},e.getEmitScriptTarget=Pn,e.getEmitModuleKind=In,e.getEmitModuleResolutionKind=function(t){var r=t.moduleResolution;if(void 0===r)switch(In(t)){case e.ModuleKind.CommonJS:r=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node16:r=e.ModuleResolutionKind.Node16;break;case e.ModuleKind.NodeNext:r=e.ModuleResolutionKind.NodeNext;break;default:r=e.ModuleResolutionKind.Classic}return r},e.getEmitModuleDetectionKind=On,e.hasJsonModuleEmitEnabled=function(t){switch(In(t)){case e.ModuleKind.CommonJS:case e.ModuleKind.AMD:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return!0;default:return!1}},e.unreachableCodeIsError=function(e){return!1===e.allowUnreachableCode},e.unusedLabelIsError=function(e){return!1===e.allowUnusedLabels},e.getAreDeclarationMapsEnabled=function(e){return!(!Ln(e)||!e.declarationMap)},e.getESModuleInterop=Mn,e.getAllowSyntheticDefaultImports=function(t){var r=In(t);return void 0!==t.allowSyntheticDefaultImports?t.allowSyntheticDefaultImports:Mn(t)||r===e.ModuleKind.System},e.getEmitDeclarations=Ln,e.shouldPreserveConstEnums=function(e){return!(!e.preserveConstEnums&&!e.isolatedModules)},e.isIncrementalCompilation=function(e){return!(!e.incremental&&!e.composite)},e.getStrictOptionValue=Rn,e.getAllowJSCompilerOption=Bn,e.getUseDefineForClassFields=function(e){return void 0===e.useDefineForClassFields?Pn(e)>=9:e.useDefineForClassFields},e.compilerOptionsAffectSemanticDiagnostics=function(t,r){return o(r,t,e.semanticDiagnosticsOptionDeclarations)},e.compilerOptionsAffectEmit=function(t,r){return o(r,t,e.affectsEmitOptionDeclarations)},e.getCompilerOptionValue=Jn,e.getJSXTransformEnabled=function(e){var t=e.jsx;return 2===t||4===t||5===t},e.getJSXImplicitImportBase=function(t,r){var n=null==r?void 0:r.pragmas.get("jsximportsource"),i=e.isArray(n)?n[n.length-1]:n;return 4===t.jsx||5===t.jsx||t.jsxImportSource||i?(null==i?void 0:i.arguments.factory)||t.jsxImportSource||"react":void 0},e.getJSXRuntimeImport=function(e,t){return e?"".concat(e,"/").concat(5===t.jsx?"jsx-dev-runtime":"jsx-runtime"):void 0},e.hasZeroOrOneAsteriskCharacter=function(e){for(var t=!1,r=0;r=2&&o.length>=2&&!jn(a[a.length-2],i)&&!jn(o[o.length-2],i)&&i(a[a.length-1])===i(o[o.length-1]);)a.pop(),o.pop(),s=!0;return s?[e.getPathFromPathComponents(a),e.getPathFromPathComponents(o)]:void 0}(a,o,t,r)||e.emptyArray,c=s[0],l=s[1];c&&l&&n.setSymlinkedDirectory(l,{real:c,realPath:e.toPath(c,t,r)})}}},e.tryRemoveDirectoryPrefix=function(t,r,n){var i=e.tryRemovePrefix(t,r,n);return void 0===i?void 0:function(t){return e.isAnyDirectorySeparator(t.charCodeAt(0))?t.slice(1):void 0}(i)};var Un=/[^\w\s\/]/g;function Vn(e){return"\\"+e}e.regExpEscape=function(e){return e.replace(Un,Vn)};var Kn=[42,63];e.commonPackageFolders=["node_modules","bower_components","jspm_packages"];var zn="(?!(".concat(e.commonPackageFolders.join("|"),")(/|$))"),Gn={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:"(/".concat(zn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return Zn(e,Gn.singleAsteriskRegexFragment)}},qn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/".concat(zn,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return Zn(e,qn.singleAsteriskRegexFragment)}},Wn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:function(e){return Zn(e,Wn.singleAsteriskRegexFragment)}},Hn={files:Gn,directories:qn,exclude:Wn};function Qn(e,t,r){var n=Xn(e,t,r);if(n&&n.length){var i=n.map((function(e){return"(".concat(e,")")})).join("|"),a="exclude"===r?"($|/)":"$";return"^(".concat(i,")").concat(a)}}function Xn(t,r,n){if(void 0!==t&&0!==t.length)return e.flatMap(t,(function(e){return e&&Yn(e,r,n,Hn[n])}))}function $n(e){return!/[.*?]/.test(e)}function Yn(t,r,n,i){var a=i.singleAsteriskRegexFragment,o=i.doubleAsteriskRegexFragment,s=i.replaceWildcardCharacter,c="",l=!1,u=e.getNormalizedPathComponents(t,r),d=e.last(u);if("exclude"===n||"**"!==d){u[0]=e.removeTrailingDirectorySeparator(u[0]),$n(d)&&u.push("**","*");for(var _=0,p=0,f=u;p0;)c+=")?",_--;return c}}function Zn(e,t){return"*"===e?t:"?"===e?"[^/]":"\\"+e}function ei(t,r,n,i,a){t=e.normalizePath(t),a=e.normalizePath(a);var o=e.combinePaths(a,t);return{includeFilePatterns:e.map(Xn(n,o,"files"),(function(e){return"^".concat(e,"$")})),includeFilePattern:Qn(n,o,"files"),includeDirectoryPattern:Qn(n,o,"directories"),excludePattern:Qn(r,o,"exclude"),basePaths:ri(t,n,i)}}function ti(e,t){return new RegExp(e,t?"":"i")}function ri(t,r,n){var i=[t];if(r){for(var a=[],o=0,s=r;o=0)}function hi(e){return".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e}function vi(t){return e.find(_i,(function(r){return e.fileExtensionIs(t,r)}))}function bi(t,r){return t===r||"object"==typeof t&&null!==t&&"object"==typeof r&&null!==r&&e.equalOwnProperties(t,r,bi)}function xi(e,t){return e.pos=t,e}function Si(e,t){return e.end=t,e}function Di(e,t,r){return Si(xi(e,t),r)}function Ci(e,t){return e&&t&&(e.parent=t),e}function Ti(t){return!e.isOmittedExpression(t)}function Ei(t){return e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))}function ki(e){return 254===e.kind&&292===e.parent.kind}function Ai(e){return(+e).toString()===e}e.removeFileExtension=pi,e.tryRemoveExtension=fi,e.removeExtension=mi,e.changeExtension=function(t,r){return e.changeAnyExtension(t,r,_i,!1)},e.tryParsePattern=gi,e.tryParsePatterns=function(t){return e.mapDefined(e.getOwnKeys(t),(function(e){return gi(e)}))},e.positionIsSynthesized=yi,e.extensionIsTS=hi,e.resolutionExtensionIsTSOrJson=function(e){return hi(e)||".json"===e},e.extensionFromPath=function(t){var r=vi(t);return void 0!==r?r:e.Debug.fail("File ".concat(t," has unknown extension."))},e.isAnySupportedFileExtension=function(e){return void 0!==vi(e)},e.tryGetExtensionFromPath=vi,e.isCheckJsEnabledForFile=function(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs},e.emptyFileSystemEntries={files:e.emptyArray,directories:e.emptyArray},e.matchPatternOrExact=function(t,r){for(var n=[],i=0,a=t;ii&&(i=o)}return{min:n,max:i}},e.rangeOfNode=function(e){return{pos:h(e),end:e.end}},e.rangeOfTypeParameters=function(t,r){return{pos:r.pos-1,end:e.skipTrivia(t.text,r.end)+1}},e.skipTypeChecking=function(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)},e.isJsonEqual=bi,e.parsePseudoBigInt=function(e){var t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:for(var r=e.length-1,n=0;48===e.charCodeAt(n);)n++;return e.slice(n,r)||"0"}for(var i=e.length-1,a=(i-2)*t,o=new Uint16Array((a>>>4)+(15&a?1:0)),s=i-1,c=0;s>=2;s--,c+=t){var l=c>>>4,u=e.charCodeAt(s),d=(u<=57?u-48:10+u-(u<=70?65:97))<<(15&c);o[l]|=d;var _=d>>>16;_&&(o[l+1]|=_)}for(var p="",f=o.length-1,m=!0;m;){var g=0;m=!1;for(l=f;l>=0;l--){var y=g<<16|o[l],h=y/10|0;o[l]=h,g=y-10*h,h&&!m&&(f=l,m=!0)}p=g+p}return p},e.pseudoBigIntToString=function(e){var t=e.negative,r=e.base10Value;return(t&&"0"!==r?"-":"")+r},e.isValidTypeOnlyAliasUseSite=function(t){return!!(16777216&t.flags)||ve(t)||function(t){if(79!==t.kind)return!1;var r=e.findAncestor(t.parent,(function(e){switch(e.kind){case 291:return!0;case 206:case 228:return!1;default:return"quit"}}));return 117===(null==r?void 0:r.token)||258===(null==r?void 0:r.parent.kind)}(t)||function(e){for(;79===e.kind||206===e.kind;)e=e.parent;if(162!==e.kind)return!1;if(Tr(e.parent,128))return!0;var t=e.parent.parent.kind;return 258===t||182===t}(t)||!(ye(t)||function(t){return e.isIdentifier(t)&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t}(t))},e.isIdentifierTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)},e.arrayIsHomogeneous=function(t,r){if(void 0===r&&(r=e.equateValues),t.length<2)return!0;for(var n=t[0],i=1,a=t.length;i=0?e.factory.createNumericLiteral(+t):e.factory.createStringLiteral(t,!!n)},e.isThisTypeParameter=function(e){return!!(262144&e.flags&&e.isThisType)},e.getNodeModulePathParts=function(t){var r,n=0,i=0,a=0;!function(e){e[e.BeforeNodeModules=0]="BeforeNodeModules",e[e.NodeModules=1]="NodeModules",e[e.Scope=2]="Scope",e[e.PackageContent=3]="PackageContent"}(r||(r={}));for(var o=0,s=0,c=0;s>=0;)switch(o=s,s=t.indexOf("/",o+1),c){case 0:t.indexOf(e.nodeModulesPathPart,o)===o&&(n=o,i=s,c=1);break;case 1:case 2:1===c&&"@"===t.charAt(o+1)?c=2:(a=s,c=3);break;case 3:c=t.indexOf(e.nodeModulesPathPart,o)===o?1:3}return c>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:i,packageRootIndex:a,fileNameIndex:o}:void 0},e.getParameterTypeNode=function(e){var t;return 340===e.kind?null===(t=e.typeExpression)||void 0===t?void 0:t.type:e.type}}(c||(c={})),function(e){e.createBaseNodeFactory=function(){var t,r,n,i,a;return{createBaseSourceFileNode:function(t){return new(a||(a=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(n||(n=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(i||(i=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(r||(r=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(r){return new(t||(t=e.objectAllocator.getNodeConstructor()))(r,-1,-1)}}}}(c||(c={})),function(e){e.createParenthesizerRules=function(t){var r,n;return{getParenthesizeLeftSideOfBinaryForOperator:function(t){r||(r=new e.Map);var n=r.get(t);n||(n=function(e){return o(t,e)},r.set(t,n));return n},getParenthesizeRightSideOfBinaryForOperator:function(t){n||(n=new e.Map);var r=n.get(t);r||(r=function(e){return s(t,void 0,e)},n.set(t,r));return r},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:s,parenthesizeExpressionOfComputedPropertyName:function(r){return e.isCommaSequence(r)?t.createParenthesizedExpression(r):r},parenthesizeConditionOfConditionalExpression:function(r){var n=e.getOperatorPrecedence(222,57),i=e.skipPartiallyEmittedExpressions(r),a=e.getExpressionPrecedence(i);if(1!==e.compareValues(a,n))return t.createParenthesizedExpression(r);return r},parenthesizeBranchOfConditionalExpression:function(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isCommaSequence(n)?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfExportDefault:function(r){var n=e.skipPartiallyEmittedExpressions(r),i=e.isCommaSequence(n);if(!i)switch(e.getLeftmostExpression(n,!1).kind){case 226:case 213:i=!0}return i?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfNew:function(r){var n=e.getLeftmostExpression(r,!0);switch(n.kind){case 208:return t.createParenthesizedExpression(r);case 209:return n.arguments?r:t.createParenthesizedExpression(r)}return c(r)},parenthesizeLeftSideOfAccess:c,parenthesizeOperandOfPostfixUnary:function(r){return e.isLeftHandSideExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeOperandOfPrefixUnary:function(r){return e.isUnaryExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeExpressionsOfCommaDelimitedList:function(r){var n=e.sameMap(r,l);return e.setTextRange(t.createNodeArray(n,r.hasTrailingComma),r)},parenthesizeExpressionForDisallowedComma:l,parenthesizeExpressionOfExpressionStatement:function(r){var n=e.skipPartiallyEmittedExpressions(r);if(e.isCallExpression(n)){var i=n.expression,a=e.skipPartiallyEmittedExpressions(i).kind;if(213===a||214===a){var o=t.updateCallExpression(n,e.setTextRange(t.createParenthesizedExpression(i),i),n.typeArguments,n.arguments);return t.restoreOuterExpressions(r,o,8)}}var s=e.getLeftmostExpression(n,!1).kind;if(205===s||213===s)return e.setTextRange(t.createParenthesizedExpression(r),r);return r},parenthesizeConciseBodyOfArrowFunction:function(r){if(!e.isBlock(r)&&(e.isCommaSequence(r)||205===e.getLeftmostExpression(r,!1).kind))return e.setTextRange(t.createParenthesizedExpression(r),r);return r},parenthesizeCheckTypeOfConditionalType:u,parenthesizeExtendsTypeOfConditionalType:function(e){if(189===e.kind)return t.createParenthesizedType(e);return e},parenthesizeConstituentTypesOfUnionType:function(r){return t.createNodeArray(e.sameMap(r,d))},parenthesizeConstituentTypeOfUnionType:d,parenthesizeConstituentTypesOfIntersectionType:function(r){return t.createNodeArray(e.sameMap(r,_))},parenthesizeConstituentTypeOfIntersectionType:_,parenthesizeOperandOfTypeOperator:p,parenthesizeOperandOfReadonlyTypeOperator:function(e){if(193===e.kind)return t.createParenthesizedType(e);return p(e)},parenthesizeNonArrayTypeOfPostfixType:f,parenthesizeElementTypesOfTupleType:function(r){return t.createNodeArray(e.sameMap(r,m))},parenthesizeElementTypeOfTupleType:m,parenthesizeTypeOfOptionalType:function(e){return g(e)?t.createParenthesizedType(e):f(e)},parenthesizeTypeArguments:function(r){if(e.some(r))return t.createNodeArray(e.sameMap(r,h))},parenthesizeLeadingTypeArgument:y};function i(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isLiteralKind(t.kind))return t.kind;if(221===t.kind&&39===t.operatorToken.kind){if(void 0!==t.cachedLiteralKind)return t.cachedLiteralKind;var r=i(t.left),n=e.isLiteralKind(r)&&r===i(t.right)?r:0;return t.cachedLiteralKind=n,n}return 0}function a(r,n,a,o){return 212===e.skipPartiallyEmittedExpressions(n).kind?n:function(t,r,n,a){var o=e.getOperatorPrecedence(221,t),s=e.getOperatorAssociativity(221,t),c=e.skipPartiallyEmittedExpressions(r);if(!n&&214===r.kind&&o>3)return!0;var l=e.getExpressionPrecedence(c);switch(e.compareValues(l,o)){case-1:return!(!n&&1===s&&224===r.kind);case 1:return!1;case 0:if(n)return 1===s;if(e.isBinaryExpression(c)&&c.operatorToken.kind===t){if(function(e){return 41===e||51===e||50===e||52===e}(t))return!1;if(39===t){var u=a?i(a):0;if(e.isLiteralKind(u)&&u===i(c))return!1}}return 0===e.getExpressionAssociativity(c)}}(r,n,a,o)?t.createParenthesizedExpression(n):n}function o(e,t){return a(e,t,!0)}function s(e,t,r){return a(e,r,!1,t)}function c(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isLeftHandSideExpression(n)&&(209!==n.kind||n.arguments)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function l(r){var n=e.skipPartiallyEmittedExpressions(r);return e.getExpressionPrecedence(n)>e.getOperatorPrecedence(221,27)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function u(e){switch(e.kind){case 179:case 180:case 189:return t.createParenthesizedType(e)}return e}function d(e){switch(e.kind){case 187:case 188:return t.createParenthesizedType(e)}return u(e)}function _(e){switch(e.kind){case 187:case 188:return t.createParenthesizedType(e)}return d(e)}function p(e){return 188===e.kind?t.createParenthesizedType(e):_(e)}function f(e){switch(e.kind){case 190:case 193:case 181:return t.createParenthesizedType(e)}return p(e)}function m(e){return g(e)?t.createParenthesizedType(e):e}function g(t){return e.isJSDocNullableType(t)?t.postfix:e.isNamedTupleMember(t)||e.isFunctionTypeNode(t)||e.isConstructorTypeNode(t)||e.isTypeOperatorNode(t)?g(t.type):e.isConditionalTypeNode(t)?g(t.falseType):e.isUnionTypeNode(t)||e.isIntersectionTypeNode(t)?g(e.last(t.types)):!!e.isInferTypeNode(t)&&(!!t.typeParameter.constraint&&g(t.typeParameter.constraint))}function y(r){return e.isFunctionOrConstructorTypeNode(r)&&r.typeParameters?t.createParenthesizedType(r):r}function h(e,t){return 0===t?y(e):e}},e.nullParenthesizerRules={getParenthesizeLeftSideOfBinaryForOperator:function(t){return e.identity},getParenthesizeRightSideOfBinaryForOperator:function(t){return e.identity},parenthesizeLeftSideOfBinary:function(e,t){return t},parenthesizeRightSideOfBinary:function(e,t,r){return r},parenthesizeExpressionOfComputedPropertyName:e.identity,parenthesizeConditionOfConditionalExpression:e.identity,parenthesizeBranchOfConditionalExpression:e.identity,parenthesizeExpressionOfExportDefault:e.identity,parenthesizeExpressionOfNew:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeLeftSideOfAccess:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPostfixUnary:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPrefixUnary:function(t){return e.cast(t,e.isUnaryExpression)},parenthesizeExpressionsOfCommaDelimitedList:function(t){return e.cast(t,e.isNodeArray)},parenthesizeExpressionForDisallowedComma:e.identity,parenthesizeExpressionOfExpressionStatement:e.identity,parenthesizeConciseBodyOfArrowFunction:e.identity,parenthesizeCheckTypeOfConditionalType:e.identity,parenthesizeExtendsTypeOfConditionalType:e.identity,parenthesizeConstituentTypesOfUnionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfUnionType:e.identity,parenthesizeConstituentTypesOfIntersectionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeConstituentTypeOfIntersectionType:e.identity,parenthesizeOperandOfTypeOperator:e.identity,parenthesizeOperandOfReadonlyTypeOperator:e.identity,parenthesizeNonArrayTypeOfPostfixType:e.identity,parenthesizeElementTypesOfTupleType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeElementTypeOfTupleType:e.identity,parenthesizeTypeOfOptionalType:e.identity,parenthesizeTypeArguments:function(t){return t&&e.cast(t,e.isNodeArray)},parenthesizeLeadingTypeArgument:e.identity}}(c||(c={})),function(e){e.createNodeConverters=function(t){return{convertToFunctionBlock:function(r,n){if(e.isBlock(r))return r;var i=t.createReturnStatement(r);e.setTextRange(i,r);var a=t.createBlock([i],n);return e.setTextRange(a,r),a},convertToFunctionExpression:function(r){if(!r.body)return e.Debug.fail("Cannot convert a FunctionDeclaration without a body");var n=t.createFunctionExpression(r.modifiers,r.asteriskToken,r.name,r.typeParameters,r.parameters,r.type,r.body);e.setOriginalNode(n,r),e.setTextRange(n,r),e.getStartsOnNewLine(r)&&e.setStartsOnNewLine(n,!0);return n},convertToArrayAssignmentElement:r,convertToObjectAssignmentElement:n,convertToAssignmentPattern:i,convertToObjectAssignmentPattern:a,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:s};function r(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadElement(r.name),r),r);var n=s(r.name);return r.initializer?e.setOriginalNode(e.setTextRange(t.createAssignment(n,r.initializer),r),r):n}return e.cast(r,e.isExpression)}function n(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadAssignment(r.name),r),r);if(r.propertyName){var n=s(r.name);return e.setOriginalNode(e.setTextRange(t.createPropertyAssignment(r.propertyName,r.initializer?t.createAssignment(n,r.initializer):n),r),r)}return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createShorthandPropertyAssignment(r.name,r.initializer),r),r)}return e.cast(r,e.isObjectLiteralElementLike)}function i(e){switch(e.kind){case 202:case 204:return o(e);case 201:case 205:return a(e)}}function a(r){return e.isObjectBindingPattern(r)?e.setOriginalNode(e.setTextRange(t.createObjectLiteralExpression(e.map(r.elements,n)),r),r):e.cast(r,e.isObjectLiteralExpression)}function o(n){return e.isArrayBindingPattern(n)?e.setOriginalNode(e.setTextRange(t.createArrayLiteralExpression(e.map(n.elements,r)),n),n):e.cast(n,e.isArrayLiteralExpression)}function s(t){return e.isBindingPattern(t)?i(t):e.cast(t,e.isExpression)}},e.nullNodeConverters={convertToFunctionBlock:e.notImplemented,convertToFunctionExpression:e.notImplemented,convertToArrayAssignmentElement:e.notImplemented,convertToObjectAssignmentElement:e.notImplemented,convertToAssignmentPattern:e.notImplemented,convertToObjectAssignmentPattern:e.notImplemented,convertToArrayAssignmentPattern:e.notImplemented,convertToAssignmentElementTarget:e.notImplemented}}(c||(c={})),function(e){var t,n,i=0;function a(t,a){var f=8&t?o:s,m=e.memoize((function(){return 1&t?e.nullParenthesizerRules:e.createParenthesizerRules(w)})),g=e.memoize((function(){return 2&t?e.nullNodeConverters:e.createNodeConverters(w)})),y=e.memoizeOne((function(e){return function(t,r){return Rt(t,e,r)}})),h=e.memoizeOne((function(e){return function(t){return Mt(e,t)}})),b=e.memoizeOne((function(e){return function(t){return Lt(t,e)}})),x=e.memoizeOne((function(e){return function(){return function(e){return P(e)}(e)}})),S=e.memoizeOne((function(e){return function(t){return on(e,t)}})),D=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(on(e,r),t):t}(e,t,r)}})),C=e.memoizeOne((function(e){return function(t,r){return an(e,t,r)}})),T=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(an(e,r,t.postfix),t):t}(e,t,r)}})),E=e.memoizeOne((function(e){return function(t,r){return En(e,t,r)}})),k=e.memoizeOne((function(e){return function(t,r,n){return function(e,t,r,n){void 0===r&&(r=dn(t));return t.tagName!==r||t.comment!==n?f(En(e,r,n),t):t}(e,t,r,n)}})),A=e.memoizeOne((function(e){return function(t,r,n){return kn(e,t,r,n)}})),N=e.memoizeOne((function(e){return function(t,r,n,i){return function(e,t,r,n,i){void 0===r&&(r=dn(t));return t.tagName!==r||t.typeExpression!==n||t.comment!==i?f(kn(e,r,n,i),t):t}(e,t,r,n,i)}})),w={get parenthesizer(){return m()},get converters(){return g()},baseFactory:a,flags:t,createNodeArray:F,createNumericLiteral:G,createBigIntLiteral:q,createStringLiteral:H,createStringLiteralFromNode:function(t){var r=W(e.getTextOfIdentifierOrLiteral(t),void 0);return r.textSourceNode=t,r},createRegularExpressionLiteral:Q,createLiteralLikeNode:function(e,t){switch(e){case 8:return G(t,0);case 9:return q(t);case 10:return H(t,void 0);case 11:return Ln(t,!1);case 12:return Ln(t,!0);case 13:return Q(t);case 14:return Vt(e,t,void 0,0)}},createIdentifier:Y,updateIdentifier:function(t,r){return t.typeArguments!==r?f(Y(e.idText(t),r),t):t},createTempVariable:Z,createLoopVariable:function(e){var t=2;e&&(t|=8);return $("",t)},createUniqueName:function(t,r){void 0===r&&(r=0);return e.Debug.assert(!(7&r),"Argument out of range: flags"),e.Debug.assert(32!=(48&r),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),$(t,3|r)},getGeneratedNameForNode:ee,createPrivateIdentifier:function(t){e.startsWith(t,"#")||e.Debug.fail("First character of private identifier must be #: "+t);var r=a.createBasePrivateIdentifierNode(80);return r.escapedText=e.escapeLeadingUnderscores(t),r.transformFlags|=8388608,r},createToken:re,createSuper:function(){return re(106)},createThis:ne,createNull:function(){return re(104)},createTrue:ie,createFalse:ae,createModifier:oe,createModifiersFromModifierFlags:se,createQualifiedName:ce,updateQualifiedName:function(e,t,r){return e.left!==t||e.right!==r?f(ce(t,r),e):e},createComputedPropertyName:le,updateComputedPropertyName:function(e,t){return e.expression!==t?f(le(t),e):e},createTypeParameterDeclaration:ue,updateTypeParameterDeclaration:function(t,r,n,i,a){var o,s,c;void 0===r||e.isArray(r)?(s=r,o=n,c=i):(s=void 0,o=r,c=n);return t.modifiers!==s||t.name!==o||t.constraint!==c||t.default!==a?f(ue(s,o,c,a),t):t},createParameterDeclaration:de,updateParameterDeclaration:_e,createDecorator:pe,updateDecorator:function(e,t){return e.expression!==t?f(pe(t),e):e},createPropertySignature:fe,updatePropertySignature:me,createPropertyDeclaration:ge,updatePropertyDeclaration:ye,createMethodSignature:he,updateMethodSignature:ve,createMethodDeclaration:be,updateMethodDeclaration:xe,createConstructorDeclaration:De,updateConstructorDeclaration:Ce,createGetAccessorDeclaration:Te,updateGetAccessorDeclaration:Ee,createSetAccessorDeclaration:ke,updateSetAccessorDeclaration:Ae,createCallSignature:Ne,updateCallSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(Ne(t,r,n),e):e},createConstructSignature:we,updateConstructSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(we(t,r,n),e):e},createIndexSignature:Fe,updateIndexSignature:Pe,createClassStaticBlockDeclaration:Se,updateClassStaticBlockDeclaration:function(e,t,r,n){return e.decorators!==t||e.modifier!==r||e.body!==n?f(Se(t,r,n),e):e},createTemplateLiteralTypeSpan:Ie,updateTemplateLiteralTypeSpan:function(e,t,r){return e.type!==t||e.literal!==r?f(Ie(t,r),e):e},createKeywordTypeNode:function(e){return re(e)},createTypePredicateNode:Oe,updateTypePredicateNode:function(e,t,r,n){return e.assertsModifier!==t||e.parameterName!==r||e.type!==n?f(Oe(t,r,n),e):e},createTypeReferenceNode:Me,updateTypeReferenceNode:function(e,t,r){return e.typeName!==t||e.typeArguments!==r?f(Me(t,r),e):e},createFunctionTypeNode:Le,updateFunctionTypeNode:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?R(Le(t,r,n),e):e},createConstructorTypeNode:Re,updateConstructorTypeNode:function(){for(var t=[],r=0;r10?ei(t):e.reduceLeft(t,w.createComma)},getInternalName:function(e,t,r){return ci(e,t,r,49152)},getLocalName:function(e,t,r){return ci(e,t,r,16384)},getExportName:li,getDeclarationName:function(e,t,r){return ci(e,t,r)},getNamespaceMemberName:ui,getExternalModuleOrNamespaceExportName:function(t,r,n,i){if(t&&e.hasSyntacticModifier(r,1))return ui(t,ci(r),n,i);return li(r,n,i)},restoreOuterExpressions:function t(r,n,i){void 0===i&&(i=15);if(r&&e.isOuterExpression(r,i)&&!function(t){return e.isParenthesizedExpression(t)&&e.nodeIsSynthesized(t)&&e.nodeIsSynthesized(e.getSourceMapRange(t))&&e.nodeIsSynthesized(e.getCommentRange(t))&&!e.some(e.getSyntheticLeadingComments(t))&&!e.some(e.getSyntheticTrailingComments(t))}(r))return function(e,t){switch(e.kind){case 212:return Et(e,t);case 211:return Ct(e,e.type,t);case 229:return Qt(e,t,e.type);case 230:return $t(e,t);case 350:return Yn(e,t)}}(r,t(r.expression,n));return n},restoreEnclosingLabel:function t(r,n,i){if(!n)return r;var a=vr(n,n.label,e.isLabeledStatement(n.statement)?t(r,n.statement):r);i&&i(n);return a},createUseStrictPrologue:_i,copyPrologue:function(e,t,r,n){var i=pi(e,t,0,r);return fi(e,t,i,n)},copyStandardPrologue:pi,copyCustomPrologue:fi,ensureUseStrict:function(t){if(!e.findUseStrictPrologue(t))return e.setTextRange(F(r([_i()],t,!0)),t);return t},liftToBlock:function(t){return e.Debug.assert(e.every(t,e.isStatementOrBlock),"Cannot lift nodes to a Block."),e.singleOrUndefined(t)||rr(t)},mergeLexicalEnvironment:function(t,n){if(!e.some(n))return t;var i=mi(t,e.isPrologueDirective,0),a=mi(t,e.isHoistedFunction,i),o=mi(t,e.isHoistedVariableStatement,a),s=mi(n,e.isPrologueDirective,0),c=mi(n,e.isHoistedFunction,s),l=mi(n,e.isHoistedVariableStatement,c),u=mi(n,e.isCustomPrologue,l);e.Debug.assert(u===n.length,"Expected declarations to be valid standard or custom prologues");var d=e.isNodeArray(t)?t.slice():t;u>l&&d.splice.apply(d,r([o,0],n.slice(l,u),!1));l>c&&d.splice.apply(d,r([a,0],n.slice(c,l),!1));c>s&&d.splice.apply(d,r([i,0],n.slice(s,c),!1));if(s>0)if(0===i)d.splice.apply(d,r([0,0],n.slice(0,s),!1));else{for(var _=new e.Map,p=0;p=0;p--){var m=n[p];_.has(m.expression.text)||d.unshift(m)}}if(e.isNodeArray(t))return e.setTextRange(F(d,t.hasTrailingComma),t);return t},updateModifiers:function(t,r){var n,i;i="number"==typeof r?se(r):r;return e.isParameter(t)?_e(t,t.decorators,i,t.dotDotDotToken,t.name,t.questionToken,t.type,t.initializer):e.isPropertySignature(t)?me(t,i,t.name,t.questionToken,t.type):e.isPropertyDeclaration(t)?ye(t,t.decorators,i,t.name,null!==(n=t.questionToken)&&void 0!==n?n:t.exclamationToken,t.type,t.initializer):e.isMethodSignature(t)?ve(t,i,t.name,t.questionToken,t.typeParameters,t.parameters,t.type):e.isMethodDeclaration(t)?xe(t,t.decorators,i,t.asteriskToken,t.name,t.questionToken,t.typeParameters,t.parameters,t.type,t.body):e.isConstructorDeclaration(t)?Ce(t,t.decorators,i,t.parameters,t.body):e.isGetAccessorDeclaration(t)?Ee(t,t.decorators,i,t.name,t.parameters,t.type,t.body):e.isSetAccessorDeclaration(t)?Ae(t,t.decorators,i,t.name,t.parameters,t.body):e.isIndexSignatureDeclaration(t)?Pe(t,t.decorators,i,t.parameters,t.type):e.isFunctionExpression(t)?At(t,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isArrowFunction(t)?wt(t,i,t.typeParameters,t.parameters,t.type,t.equalsGreaterThanToken,t.body):e.isClassExpression(t)?qt(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isVariableStatement(t)?ir(t,i,t.declarationList):e.isFunctionDeclaration(t)?Tr(t,t.decorators,i,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isClassDeclaration(t)?kr(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isInterfaceDeclaration(t)?Nr(t,t.decorators,i,t.name,t.typeParameters,t.heritageClauses,t.members):e.isTypeAliasDeclaration(t)?Fr(t,t.decorators,i,t.name,t.typeParameters,t.type):e.isEnumDeclaration(t)?Ir(t,t.decorators,i,t.name,t.members):e.isModuleDeclaration(t)?Mr(t,t.decorators,i,t.name,t.body):e.isImportEqualsDeclaration(t)?jr(t,t.decorators,i,t.isTypeOnly,t.name,t.moduleReference):e.isImportDeclaration(t)?Vr(t,t.decorators,i,t.importClause,t.moduleSpecifier,t.assertClause):e.isExportAssignment(t)?Yr(t,t.decorators,i,t.expression):e.isExportDeclaration(t)?en(t,t.decorators,i,t.isTypeOnly,t.exportClause,t.moduleSpecifier,t.assertClause):e.Debug.assertNever(t)}};return w;function F(t,r){if(void 0===t||t===e.emptyArray)t=[];else if(e.isNodeArray(t)){if(void 0===r||t.hasTrailingComma===r)return void 0===t.transformFlags&&p(t),e.Debug.attachNodeArrayDebugInfo(t),t;var n=t.slice();return n.pos=t.pos,n.end=t.end,n.hasTrailingComma=r,n.transformFlags=t.transformFlags,e.Debug.attachNodeArrayDebugInfo(n),n}var i=t.length,a=i>=1&&i<=4?t.slice():t;return e.setTextRangePosEnd(a,-1,-1),a.hasTrailingComma=!!r,p(a),e.Debug.attachNodeArrayDebugInfo(a),a}function P(e){return a.createBaseNode(e)}function I(e,t,r){var n=P(e);return n.decorators=gi(t),n.modifiers=gi(r),n.transformFlags|=_(n.decorators)|_(n.modifiers),n.symbol=void 0,n.localSymbol=void 0,n.locals=void 0,n.nextContainer=void 0,n}function O(t,r,n,i){var a=I(t,r,n);if(i=yi(i),a.name=i,i)switch(a.kind){case 169:case 172:case 173:case 167:case 296:if(e.isIdentifier(i)){a.transformFlags|=u(i);break}default:a.transformFlags|=d(i)}return a}function M(e,t,r,n,i){var a=O(e,t,r,n);return a.typeParameters=gi(i),a.transformFlags|=_(a.typeParameters),i&&(a.transformFlags|=1),a}function L(e,t,r,n,i,a,o){var s=M(e,t,r,n,i);return s.parameters=F(a),s.type=o,s.transformFlags|=_(s.parameters)|d(s.type),o&&(s.transformFlags|=1),s}function R(e,t){return t.typeArguments&&(e.typeArguments=t.typeArguments),f(e,t)}function B(e,t,r,n,i,a,o,s){var c=L(e,t,r,n,i,a,o);return c.body=s,c.transformFlags|=-16777217&d(c.body),s||(c.transformFlags|=1),c}function J(e,t){return t.exclamationToken&&(e.exclamationToken=t.exclamationToken),t.typeArguments&&(e.typeArguments=t.typeArguments),R(e,t)}function j(e,t,r,n,i,a){var o=M(e,t,r,n,i);return o.heritageClauses=gi(a),o.transformFlags|=_(o.heritageClauses),o}function U(e,t,r,n,i,a,o){var s=j(e,t,r,n,i,a);return s.members=F(o),s.transformFlags|=_(s.members),s}function V(e,t,r,n,i){var a=O(e,t,r,n);return a.initializer=i,a.transformFlags|=d(a.initializer),a}function K(e,t,r,n,i,a){var o=V(e,t,r,n,a);return o.type=i,o.transformFlags|=d(i),i&&(o.transformFlags|=1),o}function z(e,t){var r=te(e);return r.text=t,r}function G(e,t){void 0===t&&(t=0);var r=z(8,"number"==typeof e?e+"":e);return r.numericLiteralFlags=t,384&t&&(r.transformFlags|=1024),r}function q(t){var r=z(9,"string"==typeof t?t:e.pseudoBigIntToString(t)+"n");return r.transformFlags|=4,r}function W(e,t){var r=z(10,e);return r.singleQuote=t,r}function H(e,t,r){var n=W(e,t);return n.hasExtendedUnicodeEscape=r,r&&(n.transformFlags|=1024),n}function Q(e){return z(13,e)}function X(t,r){void 0===r&&t&&(r=e.stringToToken(t)),79===r&&(r=void 0);var n=a.createBaseIdentifierNode(79);return n.originalKeywordKind=r,n.escapedText=e.escapeLeadingUnderscores(t),n}function $(e,t){var r=X(e,void 0);return r.autoGenerateFlags=t,r.autoGenerateId=i,i++,r}function Y(e,t,r){var n=X(e,r);return t&&(n.typeArguments=F(t)),132===n.originalKeywordKind&&(n.transformFlags|=16777216),n}function Z(e,t){var r=1;t&&(r|=8);var n=$("",r);return e&&e(n),n}function ee(t,r){void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags");var n=$(t&&e.isIdentifier(t)?e.idText(t):"",4|r);return n.original=t,n}function te(e){return a.createBaseTokenNode(e)}function re(t){e.Debug.assert(t>=0&&t<=160,"Invalid token"),e.Debug.assert(t<=14||t>=17,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),e.Debug.assert(t<=8||t>=14,"Invalid token. Use 'createLiteralLikeNode' to create literals."),e.Debug.assert(79!==t,"Invalid token. Use 'createIdentifier' to create identifiers");var r=te(t),n=0;switch(t){case 131:n=384;break;case 123:case 121:case 122:case 145:case 126:case 135:case 85:case 130:case 147:case 158:case 143:case 148:case 101:case 144:case 159:case 150:case 133:case 151:case 114:case 155:case 153:n=1;break;case 106:n=33555456;break;case 124:n=1024;break;case 108:n=8192}return n&&(r.transformFlags|=n),r}function ne(){return re(108)}function ie(){return re(110)}function ae(){return re(95)}function oe(e){return re(e)}function se(e){var t=[];return 1&e&&t.push(oe(93)),2&e&&t.push(oe(135)),512&e&&t.push(oe(88)),2048&e&&t.push(oe(85)),4&e&&t.push(oe(123)),8&e&&t.push(oe(121)),16&e&&t.push(oe(122)),128&e&&t.push(oe(126)),32&e&&t.push(oe(124)),16384&e&&t.push(oe(159)),64&e&&t.push(oe(145)),256&e&&t.push(oe(131)),32768&e&&t.push(oe(101)),65536&e&&t.push(oe(144)),t.length?t:void 0}function ce(e,t){var r=P(161);return r.left=e,r.right=yi(t),r.transformFlags|=d(r.left)|u(r.right),r}function le(e){var t=P(162);return t.expression=m().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=66560|d(t.expression),t}function ue(t,r,n,i){var a,o,s;void 0===t||e.isArray(t)?(o=t,a=r,s=n):(o=void 0,a=t,s=r);var c=O(163,void 0,o,a);return c.constraint=s,c.default=i,c.transformFlags=1,c}function de(t,r,n,i,a,o,s){var c=K(164,t,r,i,o,s&&m().parenthesizeExpressionForDisallowedComma(s));return c.dotDotDotToken=n,c.questionToken=a,e.isThisIdentifier(c.name)?c.transformFlags=1:(c.transformFlags|=d(c.dotDotDotToken)|d(c.questionToken),a&&(c.transformFlags|=1),16476&e.modifiersToFlags(c.modifiers)&&(c.transformFlags|=4096),(s||n)&&(c.transformFlags|=1024)),c}function _e(e,t,r,n,i,a,o,s){return e.decorators!==t||e.modifiers!==r||e.dotDotDotToken!==n||e.name!==i||e.questionToken!==a||e.type!==o||e.initializer!==s?f(de(t,r,n,i,a,o,s),e):e}function pe(e){var t=P(165);return t.expression=m().parenthesizeLeftSideOfAccess(e),t.transformFlags|=4097|d(t.expression),t}function fe(e,t,r,n){var i=O(166,void 0,e,t);return i.type=n,i.questionToken=r,i.transformFlags=1,i}function me(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(fe(t,r,n,i),e):e}function ge(t,r,n,i,a,o){var s=K(167,t,r,n,a,o);return s.questionToken=i&&e.isQuestionToken(i)?i:void 0,s.exclamationToken=i&&e.isExclamationToken(i)?i:void 0,s.transformFlags|=d(s.questionToken)|d(s.exclamationToken)|8388608,(e.isComputedPropertyName(s.name)||e.hasStaticModifier(s)&&s.initializer)&&(s.transformFlags|=4096),(i||2&e.modifiersToFlags(s.modifiers))&&(s.transformFlags|=1),s}function ye(t,r,n,i,a,o,s){return t.decorators!==r||t.modifiers!==n||t.name!==i||t.questionToken!==(void 0!==a&&e.isQuestionToken(a)?a:void 0)||t.exclamationToken!==(void 0!==a&&e.isExclamationToken(a)?a:void 0)||t.type!==o||t.initializer!==s?f(ge(r,n,i,a,o,s),t):t}function he(e,t,r,n,i,a){var o=L(168,void 0,e,t,n,i,a);return o.questionToken=r,o.transformFlags=1,o}function ve(e,t,r,n,i,a,o){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o?R(he(t,r,n,i,a,o),e):e}function be(t,r,n,i,a,o,s,c,l){var u=B(169,t,r,i,o,s,c,l);return u.asteriskToken=n,u.questionToken=a,u.transformFlags|=d(u.asteriskToken)|d(u.questionToken)|1024,a&&(u.transformFlags|=1),256&e.modifiersToFlags(u.modifiers)?u.transformFlags|=n?128:256:n&&(u.transformFlags|=2048),u}function xe(e,t,r,n,i,a,o,s,c,l){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.questionToken!==a||e.typeParameters!==o||e.parameters!==s||e.type!==c||e.body!==l?J(be(t,r,n,i,a,o,s,c,l),e):e}function Se(e,t,r){var n=M(170,e,t,void 0,void 0);return n.body=r,n.transformFlags=8388608|d(r),n}function De(e,t,r,n){var i=B(171,e,t,void 0,void 0,r,void 0,n);return i.transformFlags|=1024,i}function Ce(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.parameters!==n||e.body!==i?J(De(t,r,n,i),e):e}function Te(e,t,r,n,i,a){return B(172,e,t,r,void 0,n,i,a)}function Ee(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.type!==a||e.body!==o?J(Te(t,r,n,i,a,o),e):e}function ke(e,t,r,n,i){return B(173,e,t,r,void 0,n,void 0,i)}function Ae(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.body!==a?J(ke(t,r,n,i,a),e):e}function Ne(e,t,r){var n=L(174,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function we(e,t,r){var n=L(175,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Fe(e,t,r,n){var i=L(176,e,t,void 0,void 0,r,n);return i.transformFlags=1,i}function Pe(e,t,r,n,i){return e.parameters!==n||e.type!==i||e.decorators!==t||e.modifiers!==r?R(Fe(t,r,n,i),e):e}function Ie(e,t){var r=P(199);return r.type=e,r.literal=t,r.transformFlags=1,r}function Oe(e,t,r){var n=P(177);return n.assertsModifier=e,n.parameterName=yi(t),n.type=r,n.transformFlags=1,n}function Me(e,t){var r=P(178);return r.typeName=yi(e),r.typeArguments=t&&m().parenthesizeTypeArguments(F(t)),r.transformFlags=1,r}function Le(e,t,r){var n=L(179,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Re(){for(var t=[],r=0;r0;default:return!0}}function ci(t,r,n,i){void 0===i&&(i=0);var a=e.getNameOfDeclaration(t);if(a&&e.isIdentifier(a)&&!e.isGeneratedIdentifier(a)){var o=e.setParent(e.setTextRange(ri(a),a),a.parent);return i|=e.getEmitFlags(a),n||(i|=48),r||(i|=1536),i&&e.setEmitFlags(o,i),o}return ee(t)}function li(e,t,r){return ci(e,t,r,8192)}function ui(t,r,n,i){var a=_t(t,e.nodeIsSynthesized(r)?r:ri(r));e.setTextRange(a,r);var o=0;return i||(o|=48),n||(o|=1536),o&&e.setEmitFlags(a,o),a}function di(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function _i(){return e.startOnNewLine(or(H("use strict")))}function pi(t,r,n,i){void 0===n&&(n=0),e.Debug.assert(0===r.length,"Prologue directives should be at the first statement in the target statements array");for(var a=!1,o=t.length;n=177&&e<=200)return-2;switch(e){case 208:case 209:case 204:case 201:case 202:return 536887296;case 261:return 589443072;case 164:case 211:case 229:case 350:case 212:case 106:case 206:case 207:default:return 536870912;case 214:return 557748224;case 213:case 256:return 591310848;case 255:return 537165824;case 257:case 226:return 536940544;case 171:return 591306752;case 167:return 570433536;case 169:case 172:case 173:return 574529536;case 130:case 147:case 158:case 143:case 150:case 148:case 133:case 151:case 114:case 163:case 166:case 168:case 174:case 175:case 176:case 258:case 259:return-2;case 205:return 536973312;case 292:return 536903680}}e.getTransformFlagsSubtreeExclusions=f;var m=e.createBaseNodeFactory();function g(e){return e.flags|=8,e}var y,h={createBaseSourceFileNode:function(e){return g(m.createBaseSourceFileNode(e))},createBaseIdentifierNode:function(e){return g(m.createBaseIdentifierNode(e))},createBasePrivateIdentifierNode:function(e){return g(m.createBasePrivateIdentifierNode(e))},createBaseTokenNode:function(e){return g(m.createBaseTokenNode(e))},createBaseNode:function(e){return g(m.createBaseNode(e))}};function v(t,r){if(t.original=r,r){var n=r.emitNode;n&&(t.emitNode=function(t,r){var n=t.flags,i=t.leadingComments,a=t.trailingComments,o=t.commentRange,s=t.sourceMapRange,c=t.tokenSourceMapRanges,l=t.constantValue,u=t.helpers,d=t.startsOnNewLine;r||(r={});i&&(r.leadingComments=e.addRange(i.slice(),r.leadingComments));a&&(r.trailingComments=e.addRange(a.slice(),r.trailingComments));n&&(r.flags=-268435457&n);o&&(r.commentRange=o);s&&(r.sourceMapRange=s);c&&(r.tokenSourceMapRanges=function(e,t){t||(t=[]);for(var r in e)t[r]=e[r];return t}(c,r.tokenSourceMapRanges));void 0!==l&&(r.constantValue=l);if(u)for(var _=0,p=u;_0&&(o[l-c]=u)}c>0&&(o.length-=c)}},e.getSnippetElement=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.snippetElement},e.setSnippetElement=function(e,r){return t(e).snippetElement=r,e},e.ignoreSourceNewlines=function(e){return t(e).flags|=134217728,e},e.setTypeNode=function(e,r){return t(e).typeNode=r,e},e.getTypeNode=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.typeNode}}(c||(c={})),function(e){function t(e){for(var t=[],r=1;r=2)return n.createCallExpression(n.createPropertyAccessExpression(n.createIdentifier("Object"),"assign"),void 0,r);return t.requestEmitHelper(e.assignHelper),n.createCallExpression(o("__assign"),void 0,r)},createAwaitHelper:function(r){return t.requestEmitHelper(e.awaitHelper),n.createCallExpression(o("__await"),void 0,[r])},createAsyncGeneratorHelper:function(r,i){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncGeneratorHelper),(r.emitNode||(r.emitNode={})).flags|=786432,n.createCallExpression(o("__asyncGenerator"),void 0,[i?n.createThis():n.createVoidZero(),n.createIdentifier("arguments"),r])},createAsyncDelegatorHelper:function(r){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncDelegator),n.createCallExpression(o("__asyncDelegator"),void 0,[r])},createAsyncValuesHelper:function(r){return t.requestEmitHelper(e.asyncValues),n.createCallExpression(o("__asyncValues"),void 0,[r])},createRestHelper:function(r,i,a,s){t.requestEmitHelper(e.restHelper);for(var c=[],l=0,u=0;u= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };'},e.metadataHelper={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };'},e.paramHelper={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };"},e.assignHelper={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };"},e.awaitHelper={name:"typescript:await",importName:"__await",scoped:!1,text:"\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},e.asyncGeneratorHelper={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };'},e.asyncDelegator={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n };'},e.asyncValues={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };'},e.restHelper={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };'},e.awaiterHelper={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };'},e.extendsHelper={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();'},e.templateObjectHelper={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };'},e.readHelper={name:"typescript:read",importName:"__read",scoped:!1,text:'\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };'},e.spreadArrayHelper={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"},e.valuesHelper={name:"typescript:values",importName:"__values",scoped:!1,text:'\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };'},e.generatorHelper={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };'},e.createBindingHelper={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:'\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));'},e.setModuleDefaultHelper={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });'},e.importStarHelper={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[e.createBindingHelper,e.setModuleDefaultHelper],priority:2,text:'\n var __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n };'},e.importDefaultHelper={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };'},e.exportStarHelper={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[e.createBindingHelper],priority:2,text:'\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };'},e.classPrivateFieldGetHelper={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };'},e.classPrivateFieldSetHelper={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };'},e.classPrivateFieldInHelper={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };'},e.getAllUnscopedEmitHelpers=function(){return n||(n=e.arrayToMap([e.decorateHelper,e.metadataHelper,e.paramHelper,e.assignHelper,e.awaitHelper,e.asyncGeneratorHelper,e.asyncDelegator,e.asyncValues,e.restHelper,e.awaiterHelper,e.extendsHelper,e.templateObjectHelper,e.spreadArrayHelper,e.valuesHelper,e.readHelper,e.generatorHelper,e.importStarHelper,e.importDefaultHelper,e.exportStarHelper,e.classPrivateFieldGetHelper,e.classPrivateFieldSetHelper,e.classPrivateFieldInHelper,e.createBindingHelper,e.setModuleDefaultHelper],(function(e){return e.name})))},e.asyncSuperHelper={name:"typescript:async-super",scoped:!0,text:t(i(["\n const "," = name => super[name];"],["\n const "," = name => super[name];"]),"_superIndex")},e.advancedAsyncSuperHelper={name:"typescript:advanced-async-super",scoped:!0,text:t(i(["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"],["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"]),"_superIndex")},e.isCallToHelper=function(t,r){return e.isCallExpression(t)&&e.isIdentifier(t.expression)&&0!=(4096&e.getEmitFlags(t.expression))&&t.expression.escapedText===r}}(c||(c={})),function(e){e.isNumericLiteral=function(e){return 8===e.kind},e.isBigIntLiteral=function(e){return 9===e.kind},e.isStringLiteral=function(e){return 10===e.kind},e.isJsxText=function(e){return 11===e.kind},e.isRegularExpressionLiteral=function(e){return 13===e.kind},e.isNoSubstitutionTemplateLiteral=function(e){return 14===e.kind},e.isTemplateHead=function(e){return 15===e.kind},e.isTemplateMiddle=function(e){return 16===e.kind},e.isTemplateTail=function(e){return 17===e.kind},e.isDotDotDotToken=function(e){return 25===e.kind},e.isCommaToken=function(e){return 27===e.kind},e.isPlusToken=function(e){return 39===e.kind},e.isMinusToken=function(e){return 40===e.kind},e.isAsteriskToken=function(e){return 41===e.kind},e.isExclamationToken=function(e){return 53===e.kind},e.isQuestionToken=function(e){return 57===e.kind},e.isColonToken=function(e){return 58===e.kind},e.isQuestionDotToken=function(e){return 28===e.kind},e.isEqualsGreaterThanToken=function(e){return 38===e.kind},e.isIdentifier=function(e){return 79===e.kind},e.isPrivateIdentifier=function(e){return 80===e.kind},e.isExportModifier=function(e){return 93===e.kind},e.isAsyncModifier=function(e){return 131===e.kind},e.isAssertsKeyword=function(e){return 128===e.kind},e.isAwaitKeyword=function(e){return 132===e.kind},e.isReadonlyKeyword=function(e){return 145===e.kind},e.isStaticModifier=function(e){return 124===e.kind},e.isAbstractModifier=function(e){return 126===e.kind},e.isSuperKeyword=function(e){return 106===e.kind},e.isImportKeyword=function(e){return 100===e.kind},e.isQualifiedName=function(e){return 161===e.kind},e.isComputedPropertyName=function(e){return 162===e.kind},e.isTypeParameterDeclaration=function(e){return 163===e.kind},e.isParameter=function(e){return 164===e.kind},e.isDecorator=function(e){return 165===e.kind},e.isPropertySignature=function(e){return 166===e.kind},e.isPropertyDeclaration=function(e){return 167===e.kind},e.isMethodSignature=function(e){return 168===e.kind},e.isMethodDeclaration=function(e){return 169===e.kind},e.isClassStaticBlockDeclaration=function(e){return 170===e.kind},e.isConstructorDeclaration=function(e){return 171===e.kind},e.isGetAccessorDeclaration=function(e){return 172===e.kind},e.isSetAccessorDeclaration=function(e){return 173===e.kind},e.isCallSignatureDeclaration=function(e){return 174===e.kind},e.isConstructSignatureDeclaration=function(e){return 175===e.kind},e.isIndexSignatureDeclaration=function(e){return 176===e.kind},e.isTypePredicateNode=function(e){return 177===e.kind},e.isTypeReferenceNode=function(e){return 178===e.kind},e.isFunctionTypeNode=function(e){return 179===e.kind},e.isConstructorTypeNode=function(e){return 180===e.kind},e.isTypeQueryNode=function(e){return 181===e.kind},e.isTypeLiteralNode=function(e){return 182===e.kind},e.isArrayTypeNode=function(e){return 183===e.kind},e.isTupleTypeNode=function(e){return 184===e.kind},e.isNamedTupleMember=function(e){return 197===e.kind},e.isOptionalTypeNode=function(e){return 185===e.kind},e.isRestTypeNode=function(e){return 186===e.kind},e.isUnionTypeNode=function(e){return 187===e.kind},e.isIntersectionTypeNode=function(e){return 188===e.kind},e.isConditionalTypeNode=function(e){return 189===e.kind},e.isInferTypeNode=function(e){return 190===e.kind},e.isParenthesizedTypeNode=function(e){return 191===e.kind},e.isThisTypeNode=function(e){return 192===e.kind},e.isTypeOperatorNode=function(e){return 193===e.kind},e.isIndexedAccessTypeNode=function(e){return 194===e.kind},e.isMappedTypeNode=function(e){return 195===e.kind},e.isLiteralTypeNode=function(e){return 196===e.kind},e.isImportTypeNode=function(e){return 200===e.kind},e.isTemplateLiteralTypeSpan=function(e){return 199===e.kind},e.isTemplateLiteralTypeNode=function(e){return 198===e.kind},e.isObjectBindingPattern=function(e){return 201===e.kind},e.isArrayBindingPattern=function(e){return 202===e.kind},e.isBindingElement=function(e){return 203===e.kind},e.isArrayLiteralExpression=function(e){return 204===e.kind},e.isObjectLiteralExpression=function(e){return 205===e.kind},e.isPropertyAccessExpression=function(e){return 206===e.kind},e.isElementAccessExpression=function(e){return 207===e.kind},e.isCallExpression=function(e){return 208===e.kind},e.isNewExpression=function(e){return 209===e.kind},e.isTaggedTemplateExpression=function(e){return 210===e.kind},e.isTypeAssertionExpression=function(e){return 211===e.kind},e.isParenthesizedExpression=function(e){return 212===e.kind},e.isFunctionExpression=function(e){return 213===e.kind},e.isArrowFunction=function(e){return 214===e.kind},e.isDeleteExpression=function(e){return 215===e.kind},e.isTypeOfExpression=function(e){return 216===e.kind},e.isVoidExpression=function(e){return 217===e.kind},e.isAwaitExpression=function(e){return 218===e.kind},e.isPrefixUnaryExpression=function(e){return 219===e.kind},e.isPostfixUnaryExpression=function(e){return 220===e.kind},e.isBinaryExpression=function(e){return 221===e.kind},e.isConditionalExpression=function(e){return 222===e.kind},e.isTemplateExpression=function(e){return 223===e.kind},e.isYieldExpression=function(e){return 224===e.kind},e.isSpreadElement=function(e){return 225===e.kind},e.isClassExpression=function(e){return 226===e.kind},e.isOmittedExpression=function(e){return 227===e.kind},e.isExpressionWithTypeArguments=function(e){return 228===e.kind},e.isAsExpression=function(e){return 229===e.kind},e.isNonNullExpression=function(e){return 230===e.kind},e.isMetaProperty=function(e){return 231===e.kind},e.isSyntheticExpression=function(e){return 232===e.kind},e.isPartiallyEmittedExpression=function(e){return 350===e.kind},e.isCommaListExpression=function(e){return 351===e.kind},e.isTemplateSpan=function(e){return 233===e.kind},e.isSemicolonClassElement=function(e){return 234===e.kind},e.isBlock=function(e){return 235===e.kind},e.isVariableStatement=function(e){return 237===e.kind},e.isEmptyStatement=function(e){return 236===e.kind},e.isExpressionStatement=function(e){return 238===e.kind},e.isIfStatement=function(e){return 239===e.kind},e.isDoStatement=function(e){return 240===e.kind},e.isWhileStatement=function(e){return 241===e.kind},e.isForStatement=function(e){return 242===e.kind},e.isForInStatement=function(e){return 243===e.kind},e.isForOfStatement=function(e){return 244===e.kind},e.isContinueStatement=function(e){return 245===e.kind},e.isBreakStatement=function(e){return 246===e.kind},e.isReturnStatement=function(e){return 247===e.kind},e.isWithStatement=function(e){return 248===e.kind},e.isSwitchStatement=function(e){return 249===e.kind},e.isLabeledStatement=function(e){return 250===e.kind},e.isThrowStatement=function(e){return 251===e.kind},e.isTryStatement=function(e){return 252===e.kind},e.isDebuggerStatement=function(e){return 253===e.kind},e.isVariableDeclaration=function(e){return 254===e.kind},e.isVariableDeclarationList=function(e){return 255===e.kind},e.isFunctionDeclaration=function(e){return 256===e.kind},e.isClassDeclaration=function(e){return 257===e.kind},e.isInterfaceDeclaration=function(e){return 258===e.kind},e.isTypeAliasDeclaration=function(e){return 259===e.kind},e.isEnumDeclaration=function(e){return 260===e.kind},e.isModuleDeclaration=function(e){return 261===e.kind},e.isModuleBlock=function(e){return 262===e.kind},e.isCaseBlock=function(e){return 263===e.kind},e.isNamespaceExportDeclaration=function(e){return 264===e.kind},e.isImportEqualsDeclaration=function(e){return 265===e.kind},e.isImportDeclaration=function(e){return 266===e.kind},e.isImportClause=function(e){return 267===e.kind},e.isImportTypeAssertionContainer=function(e){return 295===e.kind},e.isAssertClause=function(e){return 293===e.kind},e.isAssertEntry=function(e){return 294===e.kind},e.isNamespaceImport=function(e){return 268===e.kind},e.isNamespaceExport=function(e){return 274===e.kind},e.isNamedImports=function(e){return 269===e.kind},e.isImportSpecifier=function(e){return 270===e.kind},e.isExportAssignment=function(e){return 271===e.kind},e.isExportDeclaration=function(e){return 272===e.kind},e.isNamedExports=function(e){return 273===e.kind},e.isExportSpecifier=function(e){return 275===e.kind},e.isMissingDeclaration=function(e){return 276===e.kind},e.isNotEmittedStatement=function(e){return 349===e.kind},e.isSyntheticReference=function(e){return 354===e.kind},e.isMergeDeclarationMarker=function(e){return 352===e.kind},e.isEndOfDeclarationMarker=function(e){return 353===e.kind},e.isExternalModuleReference=function(e){return 277===e.kind},e.isJsxElement=function(e){return 278===e.kind},e.isJsxSelfClosingElement=function(e){return 279===e.kind},e.isJsxOpeningElement=function(e){return 280===e.kind},e.isJsxClosingElement=function(e){return 281===e.kind},e.isJsxFragment=function(e){return 282===e.kind},e.isJsxOpeningFragment=function(e){return 283===e.kind},e.isJsxClosingFragment=function(e){return 284===e.kind},e.isJsxAttribute=function(e){return 285===e.kind},e.isJsxAttributes=function(e){return 286===e.kind},e.isJsxSpreadAttribute=function(e){return 287===e.kind},e.isJsxExpression=function(e){return 288===e.kind},e.isCaseClause=function(e){return 289===e.kind},e.isDefaultClause=function(e){return 290===e.kind},e.isHeritageClause=function(e){return 291===e.kind},e.isCatchClause=function(e){return 292===e.kind},e.isPropertyAssignment=function(e){return 296===e.kind},e.isShorthandPropertyAssignment=function(e){return 297===e.kind},e.isSpreadAssignment=function(e){return 298===e.kind},e.isEnumMember=function(e){return 299===e.kind},e.isUnparsedPrepend=function(e){return 301===e.kind},e.isSourceFile=function(e){return 305===e.kind},e.isBundle=function(e){return 306===e.kind},e.isUnparsedSource=function(e){return 307===e.kind},e.isJSDocTypeExpression=function(e){return 309===e.kind},e.isJSDocNameReference=function(e){return 310===e.kind},e.isJSDocMemberName=function(e){return 311===e.kind},e.isJSDocLink=function(e){return 324===e.kind},e.isJSDocLinkCode=function(e){return 325===e.kind},e.isJSDocLinkPlain=function(e){return 326===e.kind},e.isJSDocAllType=function(e){return 312===e.kind},e.isJSDocUnknownType=function(e){return 313===e.kind},e.isJSDocNullableType=function(e){return 314===e.kind},e.isJSDocNonNullableType=function(e){return 315===e.kind},e.isJSDocOptionalType=function(e){return 316===e.kind},e.isJSDocFunctionType=function(e){return 317===e.kind},e.isJSDocVariadicType=function(e){return 318===e.kind},e.isJSDocNamepathType=function(e){return 319===e.kind},e.isJSDoc=function(e){return 320===e.kind},e.isJSDocTypeLiteral=function(e){return 322===e.kind},e.isJSDocSignature=function(e){return 323===e.kind},e.isJSDocAugmentsTag=function(e){return 328===e.kind},e.isJSDocAuthorTag=function(e){return 330===e.kind},e.isJSDocClassTag=function(e){return 332===e.kind},e.isJSDocCallbackTag=function(e){return 338===e.kind},e.isJSDocPublicTag=function(e){return 333===e.kind},e.isJSDocPrivateTag=function(e){return 334===e.kind},e.isJSDocProtectedTag=function(e){return 335===e.kind},e.isJSDocReadonlyTag=function(e){return 336===e.kind},e.isJSDocOverrideTag=function(e){return 337===e.kind},e.isJSDocDeprecatedTag=function(e){return 331===e.kind},e.isJSDocSeeTag=function(e){return 346===e.kind},e.isJSDocEnumTag=function(e){return 339===e.kind},e.isJSDocParameterTag=function(e){return 340===e.kind},e.isJSDocReturnTag=function(e){return 341===e.kind},e.isJSDocThisTag=function(e){return 342===e.kind},e.isJSDocTypeTag=function(e){return 343===e.kind},e.isJSDocTemplateTag=function(e){return 344===e.kind},e.isJSDocTypedefTag=function(e){return 345===e.kind},e.isJSDocUnknownTag=function(e){return 327===e.kind},e.isJSDocPropertyTag=function(e){return 347===e.kind},e.isJSDocImplementsTag=function(e){return 329===e.kind},e.isSyntaxList=function(e){return 348===e.kind}}(c||(c={})),function(e){function t(t,r,n,i){if(e.isComputedPropertyName(n))return e.setTextRange(t.createElementAccessExpression(r,n.expression),i);var a=e.setTextRange(e.isMemberName(n)?t.createPropertyAccessExpression(r,n):t.createElementAccessExpression(r,n),n);return e.getOrCreateEmitNode(a).flags|=64,a}function n(t,r){var n=e.parseNodeFactory.createIdentifier(t||"React");return e.setParent(n,e.getParseTreeNode(r)),n}function i(t,r,a){if(e.isQualifiedName(r)){var o=i(t,r.left,a),s=t.createIdentifier(e.idText(r.right));return s.escapedText=r.right.escapedText,t.createPropertyAccessExpression(o,s)}return n(e.idText(r),a)}function a(e,t,r,a){return t?i(e,t,a):e.createPropertyAccessExpression(n(r,a),"createElement")}function o(t,r){return e.isIdentifier(r)?t.createStringLiteralFromNode(r):e.isComputedPropertyName(r)?e.setParent(e.setTextRange(t.cloneNode(r.expression),r.expression),r.expression.parent):e.setParent(e.setTextRange(t.cloneNode(r),r),r.parent)}function s(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function c(t){return e.isParenthesizedExpression(t)&&e.isInJSFile(t)&&!!e.getJSDocTypeTag(t)}function l(e,t){switch(void 0===t&&(t=15),e.kind){case 212:return!(16&t&&c(e))&&0!=(1&t);case 211:case 229:return 0!=(2&t);case 230:return 0!=(4&t);case 350:return 0!=(8&t)}return!1}function u(e,t){for(void 0===t&&(t=15);l(e,t);)e=e.expression;return e}function d(t){return e.setStartsOnNewLine(t,!0)}function _(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return n&&n.externalHelpersModuleName}function p(t,r,n,i,a){if(n.importHelpers&&e.isEffectiveExternalModule(r,n)){var o=_(r);if(o)return o;var s=e.getEmitModuleKind(n),c=(i||e.getESModuleInterop(n)&&a)&&s!==e.ModuleKind.System&&(s0)if(i||s.push(t.createNull()),a.length>1)for(var c=0,l=a;c0)if(c.length>1)for(var f=0,m=c;f=e.ModuleKind.ES2015&&l<=e.ModuleKind.ESNext||n.impliedNodeFormat===e.ModuleKind.ESNext){var u=e.getEmitHelpers(n);if(u){for(var d=[],_=0,f=u;_0?o[n-1]:void 0;return e.Debug.assertEqual(i[n],r),o[n]=t.onEnter(a[n],u,l),i[n]=c(t,r),n}function n(t,r,i,a,o,s,d){e.Debug.assertEqual(i[r],n),e.Debug.assertIsDefined(t.onLeft),i[r]=c(t,n);var _=t.onLeft(a[r].left,o[r],a[r]);return _?(u(r,a,_),l(r,i,a,o,_)):r}function i(t,r,n,a,o,s,l){return e.Debug.assertEqual(n[r],i),e.Debug.assertIsDefined(t.onOperator),n[r]=c(t,i),t.onOperator(a[r].operatorToken,o[r],a[r]),r}function a(t,r,n,i,o,s,d){e.Debug.assertEqual(n[r],a),e.Debug.assertIsDefined(t.onRight),n[r]=c(t,a);var _=t.onRight(i[r].right,o[r],i[r]);return _?(u(r,i,_),l(r,n,i,o,_)):r}function o(t,r,n,i,a,s,l){e.Debug.assertEqual(n[r],o),n[r]=c(t,o);var u=t.onExit(i[r],a[r]);if(r>0){if(r--,t.foldState){var d=n[r]===o?"right":"left";a[r]=t.foldState(a[r],u,d)}}else s.value=u;return r}function s(t,r,n,i,a,o,c){return e.Debug.assertEqual(n[r],s),r}function c(t,c){switch(c){case r:if(t.onLeft)return n;case n:if(t.onOperator)return i;case i:if(t.onRight)return a;case a:return o;case o:case s:return s;default:e.Debug.fail("Invalid state")}}function l(e,t,n,i,a){return t[++e]=r,n[e]=a,i[e]=void 0,e}function u(t,r,n){if(e.Debug.shouldAssert(2))for(;t>=0;)e.Debug.assert(r[t]!==n,"Circular traversal detected."),t--}t.enter=r,t.left=n,t.operator=i,t.right=a,t.exit=o,t.done=s,t.nextState=c}(v||(v={}));var b=function(e,t,r,n,i,a){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=n,this.onExit=i,this.foldState=a};e.createBinaryExpressionTrampoline=function(t,r,n,i,a,o){var s=new b(t,r,n,i,a,o);return function(t,r){var n={value:void 0},i=[v.enter],a=[t],o=[void 0],c=0;for(;i[c]!==v.done;)c=i[c](s,c,i,a,o,n,r);return e.Debug.assertEqual(c,0),n.value}}}(c||(c={})),function(e){e.setTextRange=function(t,r){return r?e.setTextRangePosEnd(t,r.pos,r.end):t}}(c||(c={})),function(e){var t,i,a,o,s,c,l,u,d;function _(e,t){return t&&e(t)}function p(e,t,r){if(r){if(t)return t(r);for(var n=0,i=r;nt.checkJsDirective.pos)&&(t.checkJsDirective={enabled:"ts-check"===a,end:e.range.end,pos:e.range.pos})}));break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:e.Debug.fail("Unhandled pragma kind")}}))}!function(e){e[e.None=0]="None",e[e.Yield=1]="Yield",e[e.Await=2]="Await",e[e.Type=4]="Type",e[e.IgnoreMissingOpenBrace=16]="IgnoreMissingOpenBrace",e[e.JSDoc=32]="JSDoc"}(t||(t={})),function(e){e[e.TryParse=0]="TryParse",e[e.Lookahead=1]="Lookahead",e[e.Reparse=2]="Reparse"}(i||(i={})),e.parseBaseNodeFactory={createBaseSourceFileNode:function(t){return new(l||(l=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(s||(s=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(c||(c=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(o||(o=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(t){return new(a||(a=e.objectAllocator.getNodeConstructor()))(t,-1,-1)}},e.parseNodeFactory=e.createNodeFactory(1,e.parseBaseNodeFactory),e.isJSDocLikeText=f,e.isFileProbablyExternalModule=m,e.forEachChild=h,e.forEachChildRecursively=function(t,r,n){for(var i=v(t),a=[];a.length=0;--c)i.push(o[c]),a.push(s)}else{var l;if(l=r(o,s)){if("skip"===l)continue;return l}if(o.kind>=161)for(var u=0,d=v(o);u=r.pos})),u=l>=0?e.findIndex(a,(function(e){return e.start>=n.pos}),l):-1;l>=0&&e.addRange(v,a,l,u>=0?u:void 0),we((function(){var e=M;for(M|=32768,c.setTextPos(n.pos),Se();1!==ve();){var r=c.getStartPos(),a=kt(0,ei);if(i.push(a),r===c.getStartPos()&&Se(),o>=0){var s=t.statements[o];if(a.end===s.pos)break;a.end>s.pos&&(o=m(t.statements,o+1))}}M=e}),2),s=o>=0?f(t.statements,o):-1};-1!==s;)l();if(o>=0){var u=t.statements[o];e.addRange(i,t.statements,o);var _=e.findIndex(a,(function(e){return e.start>=u.pos}));_>=0&&e.addRange(v,a,_)}return E=r,R.updateSourceFile(t,e.setTextRange(R.createNodeArray(i),t.statements));function p(e){return!(32768&e.flags||!(16777216&e.transformFlags))}function f(e,t){for(var r=t;r116}function Oe(){return 79===ve()||(125!==ve()||!se())&&((132!==ve()||!de())&&ve()>116)}function Me(t,r,n){return void 0===n&&(n=!0),ve()===t?(n&&Se(),!0):(r?_e(r):_e(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}t.fixupParentReferences=W;var Le,Re,Be,Je=Object.keys(e.textToKeywordObj).filter((function(e){return e.length>2}));function je(t){var r;if(e.isTaggedTemplateExpression(t))fe(e.skipTrivia(m,t.template.pos),t.template.end,e.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);else{var n=e.isIdentifier(t)?e.idText(t):void 0;if(n&&e.isIdentifierText(n,g)){var i=e.skipTrivia(m,t.pos);switch(n){case"const":case"let":case"var":return void fe(i,t.end,e.Diagnostics.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void Ue(e.Diagnostics.Interface_name_cannot_be_0,e.Diagnostics.Interface_must_be_given_a_name,18);case"is":return void fe(i,c.getTextPos(),e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void Ue(e.Diagnostics.Namespace_name_cannot_be_0,e.Diagnostics.Namespace_must_be_given_a_name,18);case"type":return void Ue(e.Diagnostics.Type_alias_name_cannot_be_0,e.Diagnostics.Type_alias_must_be_given_a_name,63)}var a=null!==(r=e.getSpellingSuggestion(n,Je,(function(e){return e})))&&void 0!==r?r:function(t){for(var r=0,n=Je;ri.length+2&&e.startsWith(t,i))return"".concat(i," ").concat(t.slice(i.length))}return}(n);a?fe(i,t.end,e.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0,a):0!==ve()&&fe(i,t.end,e.Diagnostics.Unexpected_keyword_or_identifier)}else _e(e.Diagnostics._0_expected,e.tokenToString(26))}}function Ue(e,t,r){ve()===r?_e(t):_e(e,c.getTokenValue())}function Ve(t){return ve()===t?(De(),!0):(_e(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function Ke(t,r,n,i){if(ve()!==r){var a=_e(e.Diagnostics._0_expected,e.tokenToString(r));n&&a&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,i,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,e.tokenToString(t),e.tokenToString(r)))}else Se()}function ze(e){return ve()===e&&(Se(),!0)}function Ge(e){if(ve()===e)return He()}function qe(e){if(ve()===e)return t=ye(),r=ve(),De(),Ze(R.createToken(r),t);var t,r}function We(t,r,n){return Ge(t)||et(t,!1,r||e.Diagnostics._0_expected,n||e.tokenToString(t))}function He(){var e=ye(),t=ve();return Se(),Ze(R.createToken(t),e)}function Qe(){return 26===ve()||(19===ve()||1===ve()||c.hasPrecedingLineBreak())}function Xe(){return!!Qe()&&(26===ve()&&Se(),!0)}function $e(){return Xe()||Me(26)}function Ye(t,r,n,i){var a=R.createNodeArray(t,i);return e.setTextRangePosEnd(a,r,null!=n?n:c.getStartPos()),a}function Ze(t,r,n){return e.setTextRangePosEnd(t,r,null!=n?n:c.getStartPos()),M&&(t.flags|=M),J&&(J=!1,t.flags|=131072),t}function et(t,r,n,i){r?pe(c.getStartPos(),0,n,i):n&&_e(n,i);var a=ye();return Ze(79===t?R.createIdentifier("",void 0,void 0):e.isTemplateLiteralKind(t)?R.createTemplateLiteralLikeNode(t,"","",void 0):8===t?R.createNumericLiteral("",void 0):10===t?R.createStringLiteral("",void 0):276===t?R.createMissingDeclaration():R.createToken(t),a)}function tt(e){var t=N.get(e);return void 0===t&&N.set(e,t=e),t}function rt(t,r,n){if(t){P++;var i=ye(),a=ve(),o=tt(c.getTokenValue());return be(),Ze(R.createIdentifier(o,void 0,a),i)}if(80===ve())return _e(n||e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),rt(!0);if(0===ve()&&c.tryScan((function(){return 79===c.reScanInvalidIdentifier()})))return rt(!0);P++;var s=1===ve(),l=c.isReservedWord(),u=c.getTokenText(),d=l?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:e.Diagnostics.Identifier_expected;return et(79,s,r||d,u)}function nt(e){return rt(Ie(),void 0,e)}function it(e,t){return rt(Oe(),e,t)}function at(t){return rt(e.tokenIsIdentifierOrKeyword(ve()),t)}function ot(){return e.tokenIsIdentifierOrKeyword(ve())||10===ve()||8===ve()}function st(e){if(10===ve()||8===ve()){var t=Kt();return t.text=tt(t.text),t}return e&&22===ve()?function(){var e=ye();Me(22);var t=re(Qr);return Me(23),Ze(R.createComputedPropertyName(t),e)}():80===ve()?lt():at()}function ct(){return st(!0)}function lt(){var e,t,r=ye(),n=R.createPrivateIdentifier((e=c.getTokenText(),void 0===(t=w.get(e))&&w.set(e,t=e),t));return Se(),Ze(n,r)}function ut(e){return ve()===e&&Pe(_t)}function dt(){return Se(),!c.hasPrecedingLineBreak()&&mt()}function _t(){switch(ve()){case 85:return 92===Se();case 93:return Se(),88===ve()?Fe(gt):152===ve()?Fe(ft):pt();case 88:return gt();case 124:case 136:case 149:return Se(),mt();default:return dt()}}function pt(){return 41!==ve()&&127!==ve()&&18!==ve()&&mt()}function ft(){return Se(),pt()}function mt(){return 22===ve()||18===ve()||41===ve()||25===ve()||ot()}function gt(){return Se(),84===ve()||98===ve()||118===ve()||126===ve()&&Fe(Wn)||131===ve()&&Fe(Hn)}function yt(t,r){if(At(t))return!0;switch(t){case 0:case 1:case 3:return!(26===ve()&&r)&&Yn();case 2:return 82===ve()||88===ve();case 4:return Fe(_r);case 5:return Fe(xi)||26===ve()&&!r;case 6:return 22===ve()||ot();case 12:switch(ve()){case 22:case 41:case 25:case 24:return!0;default:return ot()}case 18:return ot();case 9:return 22===ve()||25===ve()||ot();case 24:return e.tokenIsIdentifierOrKeyword(ve())||10===ve();case 7:return 18===ve()?Fe(ht):r?Oe()&&!St():Wr()&&!St();case 8:return ci();case 10:return 27===ve()||25===ve()||ci();case 19:return 101===ve()||Oe();case 15:switch(ve()){case 27:case 24:return!0}case 11:return 25===ve()||Hr();case 16:return tr(!1);case 17:return tr(!0);case 20:case 21:return 27===ve()||Fr();case 22:return Li();case 23:return e.tokenIsIdentifierOrKeyword(ve());case 13:return e.tokenIsIdentifierOrKeyword(ve())||18===ve();case 14:return!0}return e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function ht(){if(e.Debug.assert(18===ve()),19===Se()){var t=Se();return 27===t||18===t||94===t||117===t}return!0}function vt(){return Se(),Oe()}function bt(){return Se(),e.tokenIsIdentifierOrKeyword(ve())}function xt(){return Se(),e.tokenIsIdentifierOrKeywordOrGreaterThan(ve())}function St(){return(117===ve()||94===ve())&&Fe(Dt)}function Dt(){return Se(),Hr()}function Ct(){return Se(),Fr()}function Tt(e){if(1===ve())return!0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 19===ve();case 3:return 19===ve()||82===ve()||88===ve();case 7:return 18===ve()||94===ve()||117===ve();case 8:return function(){if(Qe())return!0;if(on(ve()))return!0;if(38===ve())return!0;return!1}();case 19:return 31===ve()||20===ve()||18===ve()||94===ve()||117===ve();case 11:return 21===ve()||26===ve();case 15:case 21:case 10:return 23===ve();case 17:case 16:case 18:return 21===ve()||23===ve();case 20:return 27!==ve();case 22:return 18===ve()||19===ve();case 13:return 31===ve()||43===ve();case 14:return 29===ve()&&Fe(Ki);default:return!1}}function Et(e,t){var r=I;I|=1<=0)}function Pt(t){return 6===t?e.Diagnostics.An_enum_member_name_must_be_followed_by_a_or:void 0}function It(){var e=Ye([],ye());return e.isMissingList=!0,e}function Ot(e,t,r,n){if(Me(r)){var i=Ft(e,t);return Me(n),i}return It()}function Mt(e,t){for(var r=ye(),n=e?at(t):it(t),i=ye();ze(24);){if(29===ve()){n.jsdocDotPos=i;break}i=ye(),n=Ze(R.createQualifiedName(n,Rt(e,!1)),r)}return n}function Lt(e,t){return Ze(R.createQualifiedName(e,t),e.pos)}function Rt(t,r){if(c.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(ve())&&Fe(qn))return et(79,!0,e.Diagnostics.Identifier_expected);if(80===ve()){var n=lt();return r?n:et(79,!0,e.Diagnostics.Identifier_expected)}return t?at():it()}function Bt(e){var t=ye();return Ze(R.createTemplateExpression(zt(e),function(e){var t,r=ye(),n=[];do{t=Vt(e),n.push(t)}while(16===t.literal.kind);return Ye(n,r)}(e)),t)}function Jt(){var e=ye();return Ze(R.createTemplateLiteralType(zt(!1),function(){var e,t=ye(),r=[];do{e=jt(),r.push(e)}while(16===e.literal.kind);return Ye(r,t)}()),e)}function jt(){var e=ye();return Ze(R.createTemplateLiteralTypeSpan(Gr(),Ut(!1)),e)}function Ut(t){return 19===ve()?(function(e){k=c.reScanTemplateToken(e)}(t),r=Gt(ve()),e.Debug.assert(16===r.kind||17===r.kind,"Template fragment has wrong token kind"),r):We(17,e.Diagnostics._0_expected,e.tokenToString(19));var r}function Vt(e){var t=ye();return Ze(R.createTemplateSpan(re(Qr),Ut(e)),t)}function Kt(){return Gt(ve())}function zt(t){t&&Te();var r=Gt(ve());return e.Debug.assert(15===r.kind,"Template head has wrong token kind"),r}function Gt(t){var r=ye(),n=e.isTemplateLiteralKind(t)?R.createTemplateLiteralLikeNode(t,c.getTokenValue(),function(e){var t=14===e||17===e,r=c.getTokenText();return r.substring(1,r.length-(c.isUnterminated()?0:t?1:2))}(t),2048&c.getTokenFlags()):8===t?R.createNumericLiteral(c.getTokenValue(),c.getNumericLiteralFlags()):10===t?R.createStringLiteral(c.getTokenValue(),void 0,c.hasExtendedUnicodeEscape()):e.isLiteralKind(t)?R.createLiteralLikeNode(t,c.getTokenValue()):e.Debug.fail();return c.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),c.isUnterminated()&&(n.isUnterminated=!0),Se(),Ze(n,r)}function qt(){return Mt(!0,e.Diagnostics.Type_expected)}function Wt(){if(!c.hasPrecedingLineBreak()&&29===Ee())return Ot(20,Gr,29,31)}function Ht(){var e=ye();return Ze(R.createTypeReferenceNode(qt(),Wt()),e)}function Qt(t){switch(t.kind){case 178:return e.nodeIsMissing(t.typeName);case 179:case 180:var r=t,n=r.parameters,i=r.type;return!!n.isMissingList||Qt(i);case 191:return Qt(t.type);default:return!1}}function Xt(){var e=ye();return Se(),Ze(R.createThisTypeNode(),e)}function $t(){var e,t=ye();return 108!==ve()&&103!==ve()||(e=at(),Me(58)),Ze(R.createParameterDeclaration(void 0,void 0,void 0,e,void 0,Yt(),void 0),t)}function Yt(){c.setInJSDocType(!0);var e=ye();if(ze(141)){var t=R.createJSDocNamepathType(void 0);e:for(;;)switch(ve()){case 19:case 1:case 27:case 5:break e;default:De()}return c.setInJSDocType(!1),Ze(t,e)}var r=ze(25),n=Kr();return c.setInJSDocType(!1),r&&(n=Ze(R.createJSDocVariadicType(n),e)),63===ve()?(Se(),Ze(R.createJSDocOptionalType(n),e)):n}function Zt(){var e,t,r=ye(),n=ki(),i=it();ze(94)&&(Fr()||!Hr()?e=Gr():t=un());var a=ze(63)?Gr():void 0,o=R.createTypeParameterDeclaration(n,i,e,a);return o.expression=t,Ze(o,r)}function er(){if(29===ve())return Ot(19,Zt,29,31)}function tr(t){return 25===ve()||ci()||e.isModifierKind(ve())||59===ve()||Fr(!t)}function rr(e){return nr(e)}function nr(t,r){void 0===r&&(r=!0);var n=ye(),i=he(),a=t?ae(Ti):Ti();if(108===ve()){var o=R.createParameterDeclaration(a,void 0,void 0,rt(!0),void 0,qr(),void 0);return a&&me(a[0],e.Diagnostics.Decorators_may_not_be_applied_to_this_parameters),z(Ze(o,n),i)}var s=B;B=!1;var c=ki(),l=Ge(25);if(r||Ie()||22===ve()||18===ve()){var u=z(Ze(R.createParameterDeclaration(a,c,l,function(t){var r=li(e.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);return 0===e.getFullWidth(r)&&!e.some(t)&&e.isModifierKind(ve())&&Se(),r}(c),Ge(57),qr(),Xr()),n),i);return B=s,u}}function ir(t,r){if(function(t,r){if(38===t)return Me(t),!0;if(ze(58))return!0;if(r&&38===ve())return _e(e.Diagnostics._0_expected,e.tokenToString(58)),Se(),!0;return!1}(t,r))return ne(Kr)}function ar(e,t){var r=se(),n=de();$(!!(1&e)),Z(!!(2&e));var i=32&e?Ft(17,$t):Ft(16,(function(){return t?rr(n):nr(n,!1)}));return $(r),Z(n),i}function or(e){if(!Me(20))return It();var t=ar(e,!0);return Me(21),t}function sr(){ze(27)||$e()}function cr(e){var t=ye(),r=he();175===e&&Me(103);var n=er(),i=or(4),a=ir(58,!0);return sr(),z(Ze(174===e?R.createCallSignature(n,i,a):R.createConstructSignature(n,i,a),t),r)}function lr(){return 22===ve()&&Fe(ur)}function ur(){if(Se(),25===ve()||23===ve())return!0;if(e.isModifierKind(ve())){if(Se(),Oe())return!0}else{if(!Oe())return!1;Se()}return 58===ve()||27===ve()||57===ve()&&(Se(),58===ve()||27===ve()||23===ve())}function dr(e,t,r,n){var i=Ot(16,(function(){return rr(!1)}),22,23),a=qr();return sr(),z(Ze(R.createIndexSignature(r,n,i,a),e),t)}function _r(){if(20===ve()||29===ve()||136===ve()||149===ve())return!0;for(var t=!1;e.isModifierKind(ve());)t=!0,Se();return 22===ve()||(ot()&&(t=!0,Se()),!!t&&(20===ve()||29===ve()||57===ve()||58===ve()||27===ve()||Qe()))}function pr(){if(20===ve()||29===ve())return cr(174);if(103===ve()&&Fe(fr))return cr(175);var e=ye(),t=he(),r=ki();return ut(136)?bi(e,t,void 0,r,172):ut(149)?bi(e,t,void 0,r,173):lr()?dr(e,t,void 0,r):function(e,t,r){var n,i=ct(),a=Ge(57);if(20===ve()||29===ve()){var o=er(),s=or(4),c=ir(58,!0);n=R.createMethodSignature(r,i,a,o,s,c)}else c=qr(),n=R.createPropertySignature(r,i,a,c),63===ve()&&(n.initializer=Xr());return sr(),z(Ze(n,e),t)}(e,t,r)}function fr(){return Se(),20===ve()||29===ve()}function mr(){return 24===Se()}function gr(){switch(Se()){case 20:case 29:case 24:return!0}return!1}function yr(){var e;return Me(18)?(e=Et(4,pr),Me(19)):e=It(),e}function hr(){return Se(),39===ve()||40===ve()?145===Se():(145===ve()&&Se(),22===ve()&&vt()&&101===Se())}function vr(){var e,t=ye();Me(18),145!==ve()&&39!==ve()&&40!==ve()||145!==(e=He()).kind&&Me(145),Me(22);var r,n=function(){var e=ye(),t=at();Me(101);var r=Gr();return Ze(R.createTypeParameterDeclaration(void 0,t,r,void 0),e)}(),i=ze(127)?Gr():void 0;Me(23),57!==ve()&&39!==ve()&&40!==ve()||57!==(r=He()).kind&&Me(57);var a=qr();$e();var o=Et(4,pr);return Me(19),Ze(R.createMappedTypeNode(e,n,i,r,a,o),t)}function br(){var t=ye();if(ze(25))return Ze(R.createRestTypeNode(Gr()),t);var r=Gr();if(e.isJSDocNullableType(r)&&r.pos===r.type.pos){var n=R.createOptionalTypeNode(r.type);return e.setTextRange(n,r),n.flags=r.flags,n}return r}function xr(){return 58===Se()||57===ve()&&58===Se()}function Sr(){return 25===ve()?e.tokenIsIdentifierOrKeyword(Se())&&xr():e.tokenIsIdentifierOrKeyword(ve())&&xr()}function Dr(){if(Fe(Sr)){var e=ye(),t=he(),r=Ge(25),n=at(),i=Ge(57);Me(58);var a=br();return z(Ze(R.createNamedTupleMember(r,n,i,a),e),t)}return br()}function Cr(){var e=ye(),t=he(),r=function(){var e;if(126===ve()){var t=ye();Se(),e=Ye([Ze(R.createToken(126),t)],t)}return e}(),n=ze(103),i=er(),a=or(4),o=ir(38,!1),s=n?R.createConstructorTypeNode(r,i,a,o):R.createFunctionTypeNode(i,a,o);return n||(s.modifiers=r),z(Ze(s,e),t)}function Tr(){var e=He();return 24===ve()?void 0:e}function Er(e){var t=ye();e&&Se();var r=110===ve()||95===ve()||104===ve()?He():Gt(ve());return e&&(r=Ze(R.createPrefixUnaryExpression(40,r),t)),Ze(R.createLiteralTypeNode(r),t)}function kr(){return Se(),100===ve()}function Ar(){p|=2097152;var t=ye(),r=ze(112);Me(100),Me(20);var n,i=Gr();ze(27)&&(n=function(){var t=ye(),r=c.getTokenPos();Me(18);var n=c.hasPrecedingLineBreak();Me(129),Me(58);var i=Gi(!0);if(!Me(19)){var a=e.lastOrUndefined(v);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here,"{","}"))}return Ze(R.createImportTypeAssertionContainer(i,n),t)}()),Me(21);var a=ze(24)?qt():void 0,o=Wt();return Ze(R.createImportTypeNode(i,n,a,o,r),t)}function Nr(){return Se(),8===ve()||9===ve()}function wr(){switch(ve()){case 130:case 155:case 150:case 147:case 158:case 151:case 133:case 153:case 143:case 148:return Pe(Tr)||Ht();case 66:c.reScanAsteriskEqualsToken();case 41:return r=ye(),Se(),Ze(R.createJSDocAllType(),r);case 60:c.reScanQuestionToken();case 57:return function(){var e=ye();return Se(),27===ve()||19===ve()||21===ve()||31===ve()||63===ve()||51===ve()?Ze(R.createJSDocUnknownType(),e):Ze(R.createJSDocNullableType(Gr(),!1),e)}();case 98:return function(){var e=ye(),t=he();if(Fe(Ui)){Se();var r=or(36),n=ir(58,!1);return z(Ze(R.createJSDocFunctionType(r,n),e),t)}return Ze(R.createTypeReferenceNode(at(),void 0),e)}();case 53:return function(){var e=ye();return Se(),Ze(R.createJSDocNonNullableType(wr(),!1),e)}();case 14:case 10:case 8:case 9:case 110:case 95:case 104:return Er();case 40:return Fe(Nr)?Er(!0):Ht();case 114:return He();case 108:var e=Xt();return 139!==ve()||c.hasPrecedingLineBreak()?e:(t=e,Se(),Ze(R.createTypePredicateNode(void 0,t,Gr()),t.pos));case 112:return Fe(kr)?Ar():function(){var e=ye();Me(112);var t=Mt(!0),r=c.hasPrecedingLineBreak()?void 0:Mi();return Ze(R.createTypeQueryNode(t,r),e)}();case 18:return Fe(hr)?vr():function(){var e=ye();return Ze(R.createTypeLiteralNode(yr()),e)}();case 22:return function(){var e=ye();return Ze(R.createTupleTypeNode(Ot(21,Dr,22,23)),e)}();case 20:return function(){var e=ye();Me(20);var t=Gr();return Me(21),Ze(R.createParenthesizedType(t),e)}();case 100:return Ar();case 128:return Fe(qn)?function(){var e=ye(),t=We(128),r=108===ve()?Xt():it(),n=ze(139)?Gr():void 0;return Ze(R.createTypePredicateNode(t,r,n),e)}():Ht();case 15:return Jt();default:return Ht()}var t,r}function Fr(e){switch(ve()){case 130:case 155:case 150:case 147:case 158:case 133:case 145:case 151:case 154:case 114:case 153:case 104:case 108:case 112:case 143:case 18:case 22:case 29:case 51:case 50:case 103:case 10:case 8:case 9:case 110:case 95:case 148:case 41:case 57:case 53:case 25:case 137:case 100:case 128:case 14:case 15:return!0;case 98:return!e;case 40:return!e&&Fe(Nr);case 20:return!e&&Fe(Pr);default:return Oe()}}function Pr(){return Se(),21===ve()||tr(!1)||Fr()}function Ir(){for(var e=ye(),t=wr();!c.hasPrecedingLineBreak();)switch(ve()){case 53:Se(),t=Ze(R.createJSDocNonNullableType(t,!0),e);break;case 57:if(Fe(Ct))return t;Se(),t=Ze(R.createJSDocNullableType(t,!0),e);break;case 22:if(Me(22),Fr()){var r=Gr();Me(23),t=Ze(R.createIndexedAccessTypeNode(t,r),e)}else Me(23),t=Ze(R.createArrayTypeNode(t),e);break;default:return t}return t}function Or(){if(ze(94)){var e=ie(Gr);if(le()||57!==ve())return e}}function Mr(){var e=ye();return Me(137),Ze(R.createInferTypeNode(function(){var e=ye(),t=it(),r=Pe(Or);return Ze(R.createTypeParameterDeclaration(void 0,t,r),e)}()),e)}function Lr(){var e=ve();switch(e){case 140:case 154:case 145:return function(e){var t=ye();return Me(e),Ze(R.createTypeOperatorNode(e,Lr()),t)}(e);case 137:return Mr()}return ne(Ir)}function Rr(t){if(Ur()){var r=Cr();return me(r,e.isFunctionTypeNode(r)?t?e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t?e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type),r}}function Br(e,t,r){var n=ye(),i=51===e,a=ze(e),o=a&&Rr(i)||t();if(ve()===e||a){for(var s=[o];ze(e);)s.push(Rr(i)||t());o=Ze(r(Ye(s,n)),n)}return o}function Jr(){return Br(50,Lr,R.createIntersectionTypeNode)}function jr(){return Se(),103===ve()}function Ur(){return 29===ve()||(!(20!==ve()||!Fe(Vr))||(103===ve()||126===ve()&&Fe(jr)))}function Vr(){if(Se(),21===ve()||25===ve())return!0;if(function(){if(e.isModifierKind(ve())&&ki(),Oe()||108===ve())return Se(),!0;if(22===ve()||18===ve()){var t=v.length;return li(),t===v.length}return!1}()){if(58===ve()||27===ve()||57===ve()||63===ve())return!0;if(21===ve()&&(Se(),38===ve()))return!0}return!1}function Kr(){var e=ye(),t=Oe()&&Pe(zr),r=Gr();return t?Ze(R.createTypePredicateNode(void 0,t,r),e):r}function zr(){var e=it();if(139===ve()&&!c.hasPrecedingLineBreak())return Se(),e}function Gr(){if(40960&M)return ee(40960,Gr);if(Ur())return Cr();var e=ye(),t=Br(51,Jr,R.createUnionTypeNode);if(!le()&&!c.hasPrecedingLineBreak()&&ze(94)){var r=ie(Gr);Me(57);var n=ne(Gr);Me(58);var i=ne(Gr);return Ze(R.createConditionalTypeNode(t,r,n,i),e)}return t}function qr(){return ze(58)?Gr():void 0}function Wr(){switch(ve()){case 108:case 106:case 104:case 110:case 95:case 8:case 9:case 10:case 14:case 15:case 20:case 22:case 18:case 98:case 84:case 103:case 43:case 68:case 79:return!0;case 100:return Fe(gr);default:return Oe()}}function Hr(){if(Wr())return!0;switch(ve()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 45:case 46:case 29:case 132:case 125:case 80:return!0;default:return!!function(){if(ce()&&101===ve())return!1;return e.getBinaryOperatorPrecedence(ve())>0}()||Oe()}}function Qr(){var e=ue();e&&Y(!1);for(var t,r=ye(),n=$r();t=Ge(27);)n=cn(n,t,$r(),r);return e&&Y(!0),n}function Xr(){return ze(63)?$r():void 0}function $r(){if(function(){if(125===ve())return!!se()||Fe(Qn);return!1}())return function(){var e=ye();return Se(),c.hasPrecedingLineBreak()||41!==ve()&&!Hr()?Ze(R.createYieldExpression(void 0,void 0),e):Ze(R.createYieldExpression(Ge(41),$r()),e)}();var t=function(){var e=function(){if(20===ve()||29===ve()||131===ve())return Fe(Zr);if(38===ve())return 1;return 0}();if(0===e)return;return 1===e?rn(!0):Pe(en)}()||function(){if(131===ve()&&1===Fe(tn)){var e=ye(),t=Ai();return Yr(e,an(0),t)}return}();if(t)return t;var r=ye(),n=an(0);return 79===n.kind&&38===ve()?Yr(r,n,void 0):e.isLeftHandSideExpression(n)&&e.isAssignmentOperator(Ce())?cn(n,He(),$r(),r):function(t,r){var n,i=Ge(57);if(!i)return t;return Ze(R.createConditionalExpression(t,i,ee(l,$r),n=We(58),e.nodeIsPresent(n)?$r():et(79,!1,e.Diagnostics._0_expected,e.tokenToString(58))),r)}(n,r)}function Yr(t,r,n){e.Debug.assert(38===ve(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var i=R.createParameterDeclaration(void 0,void 0,void 0,r,void 0,void 0,void 0);Ze(i,r.pos);var a=Ye([i],i.pos,i.end),o=We(38),s=nn(!!n);return q(Ze(R.createArrowFunction(n,void 0,a,void 0,o,s),t))}function Zr(){if(131===ve()){if(Se(),c.hasPrecedingLineBreak())return 0;if(20!==ve()&&29!==ve())return 0}var t=ve(),r=Se();if(20===t){if(21===r)switch(Se()){case 38:case 58:case 18:return 1;default:return 0}if(22===r||18===r)return 2;if(25===r)return 1;if(e.isModifierKind(r)&&131!==r&&Fe(vt))return Fe((function(){return 127===Se()}))?0:1;if(!Oe()&&108!==r)return 0;switch(Se()){case 58:return 1;case 57:return Se(),58===ve()||27===ve()||63===ve()||21===ve()?1:0;case 27:case 63:case 21:return 2}return 0}if(e.Debug.assert(29===t),!Oe())return 0;if(1===h){var n=Fe((function(){var e=Se();if(94===e)switch(Se()){case 63:case 31:return!1;default:return!0}else if(27===e||63===e)return!0;return!1}));return n?1:0}return 2}function en(){var t=c.getTokenPos();if(!(null==O?void 0:O.has(t))){var r=rn(!1);return r||(O||(O=new e.Set)).add(t),r}}function tn(){if(131===ve()){if(Se(),c.hasPrecedingLineBreak()||38===ve())return 0;var e=an(0);if(!c.hasPrecedingLineBreak()&&79===e.kind&&38===ve())return 1}return 0}function rn(t){var r,n=ye(),i=he(),a=Ai(),o=e.some(a,e.isAsyncModifier)?2:0,s=er();if(Me(20)){if(t)r=ar(o,t);else{var c=ar(o,t);if(!c)return;r=c}if(!Me(21)&&!t)return}else{if(!t)return;r=It()}var l=ir(58,!1);if(!l||t||!Qt(l)){for(var u=l;191===(null==u?void 0:u.kind);)u=u.type;var d=u&&e.isJSDocFunctionType(u);if(t||38===ve()||!d&&18===ve()){var _=ve(),p=We(38),f=38===_||18===_?nn(e.some(a,e.isAsyncModifier)):it();return z(Ze(R.createArrowFunction(a,s,r,l,p,f),n),i)}}}function nn(e){if(18===ve())return jn(e?2:0);if(26!==ve()&&98!==ve()&&84!==ve()&&Yn()&&(18===ve()||98===ve()||84===ve()||59===ve()||!Hr()))return jn(16|(e?2:0));var t=B;B=!1;var r=e?ae($r):function(e){return ee(32768,e)}($r);return B=t,r}function an(e){var t=ye();return sn(e,un(),t)}function on(e){return 101===e||160===e}function sn(t,r,n){for(;;){Ce();var i=e.getBinaryOperatorPrecedence(ve());if(!(42===ve()?i>=t:i>t))break;if(101===ve()&&ce())break;if(127===ve()){if(c.hasPrecedingLineBreak())break;Se(),a=r,o=Gr(),r=Ze(R.createAsExpression(a,o),a.pos)}else r=cn(r,He(),an(i),n)}var a,o;return r}function cn(e,t,r,n){return Ze(R.createBinaryExpression(e,t,r),n)}function ln(){var e=ye();return Ze(R.createPrefixUnaryExpression(ve(),xe(dn)),e)}function un(){if(function(){switch(ve()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 132:return!1;case 29:if(1!==h)return!1;default:return!0}}()){var t=ye(),r=_n();return 42===ve()?sn(e.getBinaryOperatorPrecedence(ve()),r,t):r}var n=ve(),i=dn();if(42===ve()){t=e.skipTrivia(m,i.pos);var a=i.end;211===i.kind?fe(t,a,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):fe(t,a,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n))}return i}function dn(){switch(ve()){case 39:case 40:case 54:case 53:return ln();case 89:return e=ye(),Ze(R.createDeleteExpression(xe(dn)),e);case 112:return function(){var e=ye();return Ze(R.createTypeOfExpression(xe(dn)),e)}();case 114:return function(){var e=ye();return Ze(R.createVoidExpression(xe(dn)),e)}();case 29:return function(){var e=ye();Me(29);var t=Gr();Me(31);var r=dn();return Ze(R.createTypeAssertion(t,r),e)}();case 132:if(132===ve()&&(de()||Fe(Qn)))return function(){var e=ye();return Ze(R.createAwaitExpression(xe(dn)),e)}();default:return _n()}var e}function _n(){if(45===ve()||46===ve()){var t=ye();return Ze(R.createPrefixUnaryExpression(ve(),xe(pn)),t)}if(1===h&&29===ve()&&Fe(xt))return mn(!0);var r=pn();if(e.Debug.assert(e.isLeftHandSideExpression(r)),(45===ve()||46===ve())&&!c.hasPrecedingLineBreak()){var n=ve();return Se(),Ze(R.createPostfixUnaryExpression(r,n),r.pos)}return r}function pn(){var t,r=ye();return 100===ve()?Fe(fr)?(p|=2097152,t=He()):Fe(mr)?(Se(),Se(),t=Ze(R.createMetaProperty(100,at()),r),p|=4194304):t=fn():t=106===ve()?function(){var t=ye(),r=He();if(29===ve()){var n=ye();void 0!==Pe(wn)&&fe(n,ye(),e.Diagnostics.super_may_not_use_type_arguments)}if(20===ve()||24===ve()||22===ve())return r;return We(24,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),Ze(R.createPropertyAccessExpression(r,Rt(!0,!0)),t)}():fn(),An(r,t)}function fn(){return Tn(ye(),Fn(),!0)}function mn(t,n,i){var a,o=ye(),s=function(e){var t=ye();if(Me(29),31===ve())return Ne(),Ze(R.createJsxOpeningFragment(),t);var r,n=hn(),i=0==(262144&M)?Mi():void 0,a=function(){var e=ye();return Ze(R.createJsxAttributes(Et(13,bn)),e)}();31===ve()?(Ne(),r=R.createJsxOpeningElement(n,i,a)):(Me(43),Me(31,void 0,!1)&&(e?Se():Ne()),r=R.createJsxSelfClosingElement(n,i,a));return Ze(r,t)}(t);if(280===s.kind){var c=yn(s),l=void 0,u=c[c.length-1];if(278===(null==u?void 0:u.kind)&&!F(u.openingElement.tagName,u.closingElement.tagName)&&F(s.tagName,u.closingElement.tagName)){var d=u.children.end,_=Ze(R.createJsxElement(u.openingElement,u.children,Ze(R.createJsxClosingElement(Ze(R.createIdentifier(""),d,d)),d,d)),u.openingElement.pos,d);c=Ye(r(r([],c.slice(0,c.length-1),!0),[_],!1),c.pos,d),l=u.closingElement}else l=function(e,t){var r=ye();Me(30);var n=hn();Me(31,void 0,!1)&&(t||!F(e.tagName,n)?Se():Ne());return Ze(R.createJsxClosingElement(n),r)}(s,t),F(s.tagName,l.tagName)||(i&&e.isJsxOpeningElement(i)&&F(l.tagName,i.tagName)?me(s.tagName,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(m,s.tagName)):me(l.tagName,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(m,s.tagName)));a=Ze(R.createJsxElement(s,c,l),o)}else 283===s.kind?a=Ze(R.createJsxFragment(s,yn(s),function(t){var r=ye();Me(30),e.tokenIsIdentifierOrKeyword(ve())&&me(hn(),e.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);Me(31,void 0,!1)&&(t?Se():Ne());return Ze(R.createJsxJsxClosingFragment(),r)}(t)),o):(e.Debug.assert(279===s.kind),a=s);if(t&&29===ve()){var p=void 0===n?a.pos:n,f=Pe((function(){return mn(!0,p)}));if(f){var g=et(27,!1);return e.setTextRangePosWidth(g,f.pos,0),fe(e.skipTrivia(m,p),f.end,e.Diagnostics.JSX_expressions_must_have_one_parent_element),Ze(R.createBinaryExpression(a,g,f),o)}}return a}function gn(t,r){switch(r){case 1:if(e.isJsxOpeningFragment(t))me(t,e.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);else{var n=t.tagName;fe(e.skipTrivia(m,n.pos),n.end,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(m,t.tagName))}return;case 30:case 7:return;case 11:case 12:return function(){var e=ye(),t=R.createJsxText(c.getTokenValue(),12===k);return k=c.scanJsxToken(),Ze(t,e)}();case 18:return vn(!1);case 29:return mn(!1,void 0,t);default:return e.Debug.assertNever(r)}}function yn(t){var r=[],n=ye(),i=I;for(I|=16384;;){var a=gn(t,k=c.reScanJsxToken());if(!a)break;if(r.push(a),e.isJsxOpeningElement(t)&&278===(null==a?void 0:a.kind)&&!F(a.openingElement.tagName,a.closingElement.tagName)&&F(t.tagName,a.closingElement.tagName))break}return I=i,Ye(r,n)}function hn(){var e=ye();Ae();for(var t=108===ve()?He():at();ze(24);)t=Ze(R.createPropertyAccessExpression(t,Rt(!0,!1)),e);return t}function vn(e){var t,r,n=ye();if(Me(18))return 19!==ve()&&(t=Ge(25),r=Qr()),e?Me(19):Me(19,void 0,!1)&&Ne(),Ze(R.createJsxExpression(t,r),n)}function bn(){if(18===ve())return function(){var e=ye();Me(18),Me(25);var t=Qr();return Me(19),Ze(R.createJsxSpreadAttribute(t),e)}();Ae();var e=ye();return Ze(R.createJsxAttribute(at(),63!==ve()?void 0:10===(k=c.scanJsxAttributeValue())?Kt():vn(!0)),e)}function xn(){return Se(),e.tokenIsIdentifierOrKeyword(ve())||22===ve()||En()}function Sn(t){if(32&t.flags)return!0;if(e.isNonNullExpression(t)){for(var r=t.expression;e.isNonNullExpression(r)&&!(32&r.flags);)r=r.expression;if(32&r.flags){for(;e.isNonNullExpression(t);)t.flags|=32,t=t.expression;return!0}}return!1}function Dn(t,r,n){var i=Rt(!0,!0),a=n||Sn(r),o=a?R.createPropertyAccessChain(r,n,i):R.createPropertyAccessExpression(r,i);return a&&e.isPrivateIdentifier(o.name)&&me(o.name,e.Diagnostics.An_optional_chain_cannot_contain_private_identifiers),Ze(o,t)}function Cn(t,r,n){var i;if(23===ve())i=et(79,!0,e.Diagnostics.An_element_access_expression_should_take_an_argument);else{var a=re(Qr);e.isStringOrNumericLiteralLike(a)&&(a.text=tt(a.text)),i=a}return Me(23),Ze(n||Sn(r)?R.createElementAccessChain(r,n,i):R.createElementAccessExpression(r,i),t)}function Tn(t,r,n){for(;;){var i=void 0,a=!1;if(n&&28===ve()&&Fe(xn)?(i=We(28),a=e.tokenIsIdentifierOrKeyword(ve())):a=ze(24),a)r=Dn(t,r,i);else if(!i&&ue()||!ze(22)){if(!En()){if(!i){if(53===ve()&&!c.hasPrecedingLineBreak()){Se(),r=Ze(R.createNonNullExpression(r),t);continue}var o=Pe(wn);if(o){r=Ze(R.createExpressionWithTypeArguments(r,o),t);continue}}return r}r=i||228!==r.kind?kn(t,r,i,void 0):kn(t,r.expression,i,r.typeArguments)}else r=Cn(t,r,i)}}function En(){return 14===ve()||15===ve()}function kn(e,t,r,n){var i=R.createTaggedTemplateExpression(t,n,14===ve()?(Te(),Kt()):Bt(!0));return(r||32&t.flags)&&(i.flags|=32),i.questionDotToken=r,Ze(i,e)}function An(t,r){for(;;){r=Tn(t,r,!0);var n=void 0,i=Ge(28);if(i&&(n=Pe(wn),En()))r=kn(t,r,i,n);else{if(!n&&20!==ve()){if(i){var a=et(79,!1,e.Diagnostics.Identifier_expected);r=Ze(R.createPropertyAccessChain(r,i,a),t)}break}i||228!==r.kind||(n=r.typeArguments,r=r.expression);var o=Nn();r=Ze(i||Sn(r)?R.createCallChain(r,i,n,o):R.createCallExpression(r,n,o),t)}}return r}function Nn(){Me(20);var e=Ft(11,In);return Me(21),e}function wn(){if(0==(262144&M)&&29===Ee()){Se();var e=Ft(20,Gr);if(Me(31))return e&&function(){switch(ve()){case 20:case 14:case 15:return!0}return!Hr()}()?e:void 0}}function Fn(){switch(ve()){case 8:case 9:case 10:case 14:return Kt();case 108:case 106:case 104:case 110:case 95:return He();case 20:return function(){var e=ye(),t=he();Me(20);var r=re(Qr);return Me(21),z(Ze(R.createParenthesizedExpression(r),e),t)}();case 22:return On();case 18:return Ln();case 131:if(!Fe(Hn))break;return Rn();case 84:return Fi(ye(),he(),void 0,void 0,226);case 98:return Rn();case 103:return function(){var e=ye();if(Me(103),ze(24)){var t=at();return Ze(R.createMetaProperty(103,t),e)}var r,n=Tn(ye(),Fn(),!1);228===n.kind&&(r=n.typeArguments,n=n.expression);var i=20===ve()?Nn():void 0;return Ze(R.createNewExpression(n,r,i),e)}();case 43:case 68:if(13===(k=c.reScanSlashToken()))return Kt();break;case 15:return Bt(!1);case 80:return lt()}return it(e.Diagnostics.Expression_expected)}function Pn(){return 25===ve()?function(){var e=ye();Me(25);var t=$r();return Ze(R.createSpreadElement(t),e)}():27===ve()?Ze(R.createOmittedExpression(),ye()):$r()}function In(){return ee(l,Pn)}function On(){var e=ye(),t=c.getTokenPos(),r=Me(22),n=c.hasPrecedingLineBreak(),i=Ft(15,Pn);return Ke(22,23,r,t),Ze(R.createArrayLiteralExpression(i,n),e)}function Mn(){var e=ye(),t=he();if(Ge(25)){var r=$r();return z(Ze(R.createSpreadAssignment(r),e),t)}var n=Ti(),i=ki();if(ut(136))return bi(e,t,n,i,172);if(ut(149))return bi(e,t,n,i,173);var a,o=Ge(41),s=Oe(),c=ct(),l=Ge(57),u=Ge(53);if(o||20===ve()||29===ve())return yi(e,t,n,i,o,c,l,u);if(s&&58!==ve()){var d=Ge(63),_=d?re($r):void 0;(a=R.createShorthandPropertyAssignment(c,_)).equalsToken=d}else{Me(58);var p=re($r);a=R.createPropertyAssignment(c,p)}return a.decorators=n,a.modifiers=i,a.questionToken=l,a.exclamationToken=u,z(Ze(a,e),t)}function Ln(){var e=ye(),t=c.getTokenPos(),r=Me(18),n=c.hasPrecedingLineBreak(),i=Ft(12,Mn,!0);return Ke(18,19,r,t),Ze(R.createObjectLiteralExpression(i,n),e)}function Rn(){var t=ue();Y(!1);var r=ye(),n=he(),i=ki();Me(98);var a=Ge(41),o=a?1:0,s=e.some(i,e.isAsyncModifier)?2:0,c=o&&s?function(e){return te(40960,e)}(Bn):o?function(e){return te(8192,e)}(Bn):s?ae(Bn):Bn(),l=er(),u=or(o|s),d=ir(58,!1),_=jn(o|s);return Y(t),z(Ze(R.createFunctionExpression(i,a,c,l,u,d,_),r),n)}function Bn(){return Ie()?nt():void 0}function Jn(t,r){var n=ye(),i=he(),a=c.getTokenPos(),o=Me(18,r);if(o||t){var s=c.hasPrecedingLineBreak(),l=Et(1,ei);Ke(18,19,o,a);var u=z(Ze(R.createBlock(l,s),n),i);return 63===ve()&&(_e(e.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses),Se()),u}l=It();return z(Ze(R.createBlock(l,void 0),n),i)}function jn(e,t){var r=se();$(!!(1&e));var n=de();Z(!!(2&e));var i=B;B=!1;var a=ue();a&&Y(!1);var o=Jn(!!(16&e),t);return a&&Y(!0),B=i,$(r),Z(n),o}function Un(){var e=ye(),t=he();Me(97);var r,n,i=Ge(132);if(Me(20),26!==ve()&&(r=113===ve()||119===ve()||85===ve()?_i(!0):function(e){return te(4096,e)}(Qr)),i?Me(160):ze(160)){var a=re($r);Me(21),n=R.createForOfStatement(i,r,a,ei())}else if(ze(101)){a=re(Qr);Me(21),n=R.createForInStatement(r,a,ei())}else{Me(26);var o=26!==ve()&&21!==ve()?re(Qr):void 0;Me(26);var s=21!==ve()?re(Qr):void 0;Me(21),n=R.createForStatement(r,o,s,ei())}return z(Ze(n,e),t)}function Vn(e){var t=ye(),r=he();Me(246===e?81:86);var n=Qe()?void 0:it();return $e(),z(Ze(246===e?R.createBreakStatement(n):R.createContinueStatement(n),t),r)}function Kn(){return 82===ve()?function(){var e=ye(),t=he();Me(82);var r=re(Qr);Me(58);var n=Et(3,ei);return z(Ze(R.createCaseClause(r,n),e),t)}():function(){var e=ye();Me(88),Me(58);var t=Et(3,ei);return Ze(R.createDefaultClause(t),e)}()}function zn(){var e=ye(),t=he();Me(107),Me(20);var r=re(Qr);Me(21);var n=function(){var e=ye();Me(18);var t=Et(2,Kn);return Me(19),Ze(R.createCaseBlock(t),e)}();return z(Ze(R.createSwitchStatement(r,n),e),t)}function Gn(){var t=ye(),r=he();Me(111);var n,i=Jn(!1),a=83===ve()?function(){var e,t=ye();Me(83),ze(20)?(e=di(),Me(21)):e=void 0;var r=Jn(!1);return Ze(R.createCatchClause(e,r),t)}():void 0;return a&&96!==ve()||(Me(96,e.Diagnostics.catch_or_finally_expected),n=Jn(!1)),z(Ze(R.createTryStatement(i,a,n),t),r)}function qn(){return Se(),e.tokenIsIdentifierOrKeyword(ve())&&!c.hasPrecedingLineBreak()}function Wn(){return Se(),84===ve()&&!c.hasPrecedingLineBreak()}function Hn(){return Se(),98===ve()&&!c.hasPrecedingLineBreak()}function Qn(){return Se(),(e.tokenIsIdentifierOrKeyword(ve())||8===ve()||9===ve()||10===ve())&&!c.hasPrecedingLineBreak()}function Xn(){for(;;)switch(ve()){case 113:case 119:case 85:case 98:case 84:case 92:return!0;case 118:case 152:return Se(),!c.hasPrecedingLineBreak()&&Oe();case 141:case 142:return ii();case 126:case 131:case 135:case 121:case 122:case 123:case 145:if(Se(),c.hasPrecedingLineBreak())return!1;continue;case 157:return Se(),18===ve()||79===ve()||93===ve();case 100:return Se(),10===ve()||41===ve()||18===ve()||e.tokenIsIdentifierOrKeyword(ve());case 93:var t=Se();if(152===t&&(t=Fe(Se)),63===t||41===t||18===t||88===t||127===t)return!0;continue;case 124:Se();continue;default:return!1}}function $n(){return Fe(Xn)}function Yn(){switch(ve()){case 59:case 26:case 18:case 113:case 119:case 98:case 84:case 92:case 99:case 90:case 115:case 97:case 86:case 81:case 105:case 116:case 107:case 109:case 111:case 87:case 83:case 96:case 131:case 135:case 118:case 141:case 142:case 152:case 157:return!0;case 100:return $n()||Fe(gr);case 85:case 93:return $n();case 123:case 121:case 122:case 124:case 145:return $n()||!Fe(qn);default:return Hr()}}function Zn(){return Se(),Ie()||18===ve()||22===ve()}function ei(){switch(ve()){case 26:return t=ye(),r=he(),Me(26),z(Ze(R.createEmptyStatement(),t),r);case 18:return Jn(!1);case 113:return fi(ye(),he(),void 0,void 0);case 119:if(Fe(Zn))return fi(ye(),he(),void 0,void 0);break;case 98:return mi(ye(),he(),void 0,void 0);case 84:return wi(ye(),he(),void 0,void 0);case 99:return function(){var e=ye(),t=he();Me(99);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=ei(),o=ze(91)?ei():void 0;return z(Ze(R.createIfStatement(i,a,o),e),t)}();case 90:return function(){var e=ye(),t=he();Me(90);var r=ei();Me(115);var n=c.getTokenPos(),i=Me(20),a=re(Qr);return Ke(20,21,i,n),ze(26),z(Ze(R.createDoStatement(r,a),e),t)}();case 115:return function(){var e=ye(),t=he();Me(115);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=ei();return z(Ze(R.createWhileStatement(i,a),e),t)}();case 97:return Un();case 86:return Vn(245);case 81:return Vn(246);case 105:return function(){var e=ye(),t=he();Me(105);var r=Qe()?void 0:re(Qr);return $e(),z(Ze(R.createReturnStatement(r),e),t)}();case 116:return function(){var e=ye(),t=he();Me(116);var r=c.getTokenPos(),n=Me(20),i=re(Qr);Ke(20,21,n,r);var a=te(33554432,ei);return z(Ze(R.createWithStatement(i,a),e),t)}();case 107:return zn();case 109:return function(){var e=ye(),t=he();Me(109);var r=c.hasPrecedingLineBreak()?void 0:re(Qr);return void 0===r&&(P++,r=Ze(R.createIdentifier(""),ye())),Xe()||je(r),z(Ze(R.createThrowStatement(r),e),t)}();case 111:case 83:case 96:return Gn();case 87:return function(){var e=ye(),t=he();return Me(87),$e(),z(Ze(R.createDebuggerStatement(),e),t)}();case 59:return ri();case 131:case 118:case 152:case 141:case 142:case 135:case 85:case 92:case 93:case 100:case 121:case 122:case 123:case 126:case 124:case 145:case 157:if($n())return ri()}var t,r;return function(){var t,r=ye(),n=he(),i=20===ve(),a=re(Qr);return e.isIdentifier(a)&&ze(58)?t=R.createLabeledStatement(a,ei()):(Xe()||je(a),t=R.createExpressionStatement(a),i&&(n=!1)),z(Ze(t,r),n)}()}function ti(e){return 135===e.kind}function ri(){var t=e.some(Fe((function(){return Ti(),ki()})),ti);if(t){var r=te(16777216,(function(){var e=At(I);if(e)return Nt(e)}));if(r)return r}var n=ye(),i=he(),a=Ti(),o=ki();if(t){for(var s=0,c=o;s=0),e.Debug.assert(t<=o),e.Debug.assert(o<=a.length),f(a,t)){var s,l,u,d,p,g=[],y=[];return c.scanRange(t+3,i-5,(function(){var r,n=1,i=t-(a.lastIndexOf("\n",t)+1)+4;function _(e){r||(r=i),g.push(e),i+=e.length}for(De();W(5););W(4)&&(n=0,i=0);e:for(;;){switch(ve()){case 59:0===n||1===n?(v(g),p||(p=ye()),w(D(i)),n=0,r=void 0):_(c.getTokenText());break;case 4:g.push(c.getTokenText()),n=0,i=0;break;case 41:var f=c.getTokenText();1===n||2===n?(n=2,_(f)):(n=1,i+=f.length);break;case 5:var m=c.getTokenText();2===n?g.push(m):void 0!==r&&i+m.length>r&&g.push(m.slice(r-i)),i+=m.length;break;case 1:break e;case 18:n=2;var b=c.getStartPos(),x=k(c.getTextPos()-1);if(x){d||h(g),y.push(Ze(R.createJSDocText(g.join("")),null!=d?d:t,b)),y.push(x),g=[],d=c.getTextPos();break}default:n=2,_(c.getTokenText())}De()}v(g),y.length&&g.length&&y.push(Ze(R.createJSDocText(g.join("")),null!=d?d:t,p)),y.length&&s&&e.Debug.assertIsDefined(p,"having parsed tags implies that the end of the comment span should be set");var S=s&&Ye(s,l,u);return Ze(R.createJSDocComment(y.length?Ye(y,t,p):g.length?g.join(""):void 0,S),t,o)}))}function h(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift()}function v(e){for(;e.length&&""===e[e.length-1].trim();)e.pop()}function b(){for(;;){if(De(),1===ve())return!0;if(5!==ve()&&4!==ve())return!1}}function x(){if(5!==ve()&&4!==ve()||!Fe(b))for(;5===ve()||4===ve();)De()}function S(){if((5===ve()||4===ve())&&Fe(b))return"";for(var e=c.hasPrecedingLineBreak(),t=!1,r="";e&&41===ve()||5===ve()||4===ve();)r+=c.getTokenText(),4===ve()?(e=!0,t=!0,r=""):41===ve()&&(e=!1),De();return t?r:""}function D(t){e.Debug.assert(59===ve());var i=c.getTokenPos();De();var a,o=H(void 0),l=S();switch(o.escapedText){case"author":a=function(t,r,n,i){var a=ye(),o=function(){var e=[],t=!1,r=c.getToken();for(;1!==r&&4!==r;){if(29===r)t=!0;else{if(59===r&&!t)break;if(31===r&&t){e.push(c.getTokenText()),c.setTextPos(c.getTokenPos()+1);break}}e.push(c.getTokenText()),r=De()}return R.createJSDocText(e.join(""))}(),s=c.getStartPos(),l=C(t,s,n,i);l||(s=c.getStartPos());var u="string"!=typeof l?Ye(e.concatenate([Ze(o,a,s)],l),a):o.text+l;return Ze(R.createJSDocAuthorTag(r,u),t)}(i,o,t,l);break;case"implements":a=function(e,t,r,n){var i=B();return Ze(R.createJSDocImplementsTag(t,i,C(e,ye(),r,n)),e)}(i,o,t,l);break;case"augments":case"extends":a=function(e,t,r,n){var i=B();return Ze(R.createJSDocAugmentsTag(t,i,C(e,ye(),r,n)),e)}(i,o,t,l);break;case"class":case"constructor":a=J(i,R.createJSDocClassTag,o,t,l);break;case"public":a=J(i,R.createJSDocPublicTag,o,t,l);break;case"private":a=J(i,R.createJSDocPrivateTag,o,t,l);break;case"protected":a=J(i,R.createJSDocProtectedTag,o,t,l);break;case"readonly":a=J(i,R.createJSDocReadonlyTag,o,t,l);break;case"override":a=J(i,R.createJSDocOverrideTag,o,t,l);break;case"deprecated":G=!0,a=J(i,R.createJSDocDeprecatedTag,o,t,l);break;case"this":a=function(e,t,n,i){var a=r(!0);return x(),Ze(R.createJSDocThisTag(t,a,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"enum":a=function(e,t,n,i){var a=r(!0);return x(),Ze(R.createJSDocEnumTag(t,a,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"arg":case"argument":case"param":return M(i,o,2,t);case"return":case"returns":a=function(t,r,n,i){e.some(s,e.isJSDocReturnTag)&&fe(r.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,r.escapedText);var a=F();return Ze(R.createJSDocReturnTag(r,a,C(t,ye(),n,i)),t)}(i,o,t,l);break;case"template":a=function(e,t,n,i){var a=18===ve()?r():void 0,o=function(){var e=ye(),t=[];do{x();var r=q();void 0!==r&&t.push(r),S()}while(W(27));return Ye(t,e)}();return Ze(R.createJSDocTemplateTag(t,a,o,C(e,ye(),n,i)),e)}(i,o,t,l);break;case"type":a=L(i,o,t,l);break;case"typedef":a=function(t,r,n,i){var a,o=F();S();var s=j();x();var c,l=T(n);if(!o||O(o.type)){for(var u=void 0,d=void 0,p=void 0,f=!1;u=Pe((function(){return V(n)}));)if(f=!0,343===u.kind){if(d){var m=_e(e.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);m&&e.addRelatedInfo(m,e.createDetachedDiagnostic(_,0,0,e.Diagnostics.The_tag_was_first_specified_here));break}d=u}else p=e.append(p,u);if(f){var g=o&&183===o.type.kind,y=R.createJSDocTypeLiteral(p,g);c=(o=d&&d.typeExpression&&!O(d.typeExpression.type)?d.typeExpression:Ze(y,t)).end}}c=c||void 0!==l?ye():(null!==(a=null!=s?s:o)&&void 0!==a?a:r).end,l||(l=C(t,c,n,i));return Ze(R.createJSDocTypedefTag(r,o,s,l),t,c)}(i,o,t,l);break;case"callback":a=function(t,r,n,i){var a=j();x();var o=T(n),s=function(t){var r,n,i=ye();for(;r=Pe((function(){return K(4,t)}));)n=e.append(n,r);return Ye(n||[],i)}(n),c=Pe((function(){if(W(59)){var e=D(n);if(e&&341===e.kind)return e}})),l=Ze(R.createJSDocSignature(void 0,s,c),t);o||(o=C(t,ye(),n,i));var u=void 0!==o?ye():l.end;return Ze(R.createJSDocCallbackTag(r,l,a,o),t,u)}(i,o,t,l);break;case"see":a=function(t,r,i,a){var o=22===ve()||Fe((function(){return 59===De()&&e.tokenIsIdentifierOrKeyword(De())&&N(c.getTokenValue())}))?void 0:n(),s=void 0!==i&&void 0!==a?C(t,ye(),i,a):void 0;return Ze(R.createJSDocSeeTag(r,o,s),t)}(i,o,t,l);break;default:a=function(e,t,r,n){return Ze(R.createJSDocUnknownTag(t,C(e,ye(),r,n)),e)}(i,o,t,l)}return a}function C(e,t,r,n){return n||(r+=t-e),T(r,n.slice(r))}function T(e,t){var r,n,i=ye(),a=[],o=[],s=0,l=!0;function u(t){n||(n=e),a.push(t),e+=t.length}void 0!==t&&(""!==t&&u(t),s=1);var d=ve();e:for(;;){switch(d){case 4:s=0,a.push(c.getTokenText()),e=0;break;case 59:if(3===s||2===s&&(!l||Fe(E))){a.push(c.getTokenText());break}c.setTextPos(c.getTextPos()-1);case 1:break e;case 5:if(2===s||3===s)u(c.getTokenText());else{var _=c.getTokenText();void 0!==n&&e+_.length>n&&a.push(_.slice(n-e)),e+=_.length}break;case 18:s=2;var p=c.getStartPos(),f=k(c.getTextPos()-1);f?(o.push(Ze(R.createJSDocText(a.join("")),null!=r?r:i,p)),o.push(f),a=[],r=c.getTextPos()):u(c.getTokenText());break;case 61:s=3===s?2:3,u(c.getTokenText());break;case 41:if(0===s){s=1,e+=1;break}default:3!==s&&(s=2),u(c.getTokenText())}l=5===ve(),d=De()}return h(a),v(a),o.length?(a.length&&o.push(Ze(R.createJSDocText(a.join("")),null!=r?r:i)),Ye(o,i,c.getTextPos())):a.length?a.join(""):void 0}function E(){var e=De();return 5===e||4===e}function k(t){var r=Pe(A);if(r){De(),x();var n=ye(),i=e.tokenIsIdentifierOrKeyword(ve())?Mt(!0):void 0;if(i)for(;80===ve();)ke(),De(),i=Ze(R.createJSDocMemberName(i,it()),n);for(var a=[];19!==ve()&&4!==ve()&&1!==ve();)a.push(c.getTokenText()),De();return Ze(("link"===r?R.createJSDocLink:"linkcode"===r?R.createJSDocLinkCode:R.createJSDocLinkPlain)(i,a.join("")),t,c.getTextPos())}}function A(){if(S(),18===ve()&&59===De()&&e.tokenIsIdentifierOrKeyword(De())){var t=c.getTokenValue();if(N(t))return t}}function N(e){return"link"===e||"linkcode"===e||"linkplain"===e}function w(e){e&&(s?s.push(e):(s=[e],l=e.pos),u=e.end)}function F(){return S(),18===ve()?r():void 0}function I(){var t=W(22);t&&x();var r,n=W(61),i=function(){var e=H();ze(22)&&Me(23);for(;ze(24);){var t=H();ze(22)&&Me(23),e=Lt(e,t)}return e}();return n&&(qe(r=61)||et(r,!1,e.Diagnostics._0_expected,e.tokenToString(r))),t&&(x(),Ge(63)&&Qr(),Me(23)),{name:i,isBracketed:t}}function O(t){switch(t.kind){case 148:return!0;case 183:return O(t.elementType);default:return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&!t.typeArguments}}function M(t,r,n,i){var a=F(),o=!a;S();var s=I(),c=s.name,l=s.isBracketed,u=S();o&&!Fe(A)&&(a=F());var d=C(t,ye(),i,u),_=4!==n&&function(t,r,n,i){if(t&&O(t.type)){for(var a=ye(),o=void 0,s=void 0;o=Pe((function(){return K(n,i,r)}));)340!==o.kind&&347!==o.kind||(s=e.append(s,o));if(s){var c=Ze(R.createJSDocTypeLiteral(s,183===t.type.kind),a);return Ze(R.createJSDocTypeExpression(c),a)}}}(a,c,n,i);return _&&(a=_,o=!0),Ze(1===n?R.createJSDocPropertyTag(r,c,l,a,o,d):R.createJSDocParameterTag(r,c,l,a,o,d),t)}function L(t,n,i,a){e.some(s,e.isJSDocTypeTag)&&fe(n.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,n.escapedText);var o=r(!0),l=void 0!==i&&void 0!==a?C(t,ye(),i,a):void 0;return Ze(R.createJSDocTypeTag(n,o,l),t)}function B(){var e=ze(18),t=ye(),r=function(){var e=ye(),t=H();for(;ze(24);){var r=H();t=Ze(R.createPropertyAccessExpression(t,r),e)}return t}(),n=Mi(),i=Ze(R.createExpressionWithTypeArguments(r,n),t);return e&&Me(19),i}function J(e,t,r,n,i){return Ze(t(r,C(e,ye(),n,i)),e)}function j(t){var r=c.getTokenPos();if(e.tokenIsIdentifierOrKeyword(ve())){var n=H();if(ze(24)){var i=j(!0);return Ze(R.createModuleDeclaration(void 0,void 0,n,i,t?4:void 0),r)}return t&&(n.isInJSDocNamespace=!0),n}}function U(t,r){for(;!e.isIdentifier(t)||!e.isIdentifier(r);){if(e.isIdentifier(t)||e.isIdentifier(r)||t.right.escapedText!==r.right.escapedText)return!1;t=t.left,r=r.left}return t.escapedText===r.escapedText}function V(e){return K(1,e)}function K(t,r,n){for(var i=!0,a=!1;;)switch(De()){case 59:if(i){var o=z(t,r);return!(o&&(340===o.kind||347===o.kind)&&4!==t&&n&&(e.isIdentifier(o.name)||!U(n,o.name.left)))&&o}a=!1;break;case 4:i=!0,a=!1;break;case 41:a&&(i=!1),a=!0;break;case 79:i=!1;break;case 1:return!1}}function z(t,r){e.Debug.assert(59===ve());var n=c.getStartPos();De();var i,a=H();switch(x(),a.escapedText){case"type":return 1===t&&L(n,a);case"prop":case"property":i=1;break;case"arg":case"argument":case"param":i=6;break;default:return!1}return!!(t&i)&&M(n,a,t,r)}function q(){var t=ye(),r=W(22);r&&x();var n,i=H(e.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);if(r&&(x(),Me(63),n=te(8388608,Yt),Me(23)),!e.nodeIsMissing(i))return Ze(R.createTypeParameterDeclaration(void 0,i,void 0,n),t)}function W(e){return ve()===e&&(De(),!0)}function H(t){if(!e.tokenIsIdentifierOrKeyword(ve()))return et(79,!t,t||e.Diagnostics.Identifier_expected);P++;var r=c.getTokenPos(),n=c.getTextPos(),i=ve(),a=tt(c.getTokenValue()),o=Ze(R.createIdentifier(a,void 0,i),r,n);return De(),o}}t.parseJSDocTypeExpressionForTests=function(t,n,i){U("file.js",t,99,void 0,1),c.setText(t,n,i),k=c.scan();var a=r(),o=H("file.js",99,1,!1,[],R.createToken(1),0,e.noop),s=e.attachFileToDiagnostics(v,o);return T&&(o.jsDocDiagnostics=e.attachFileToDiagnostics(T,o)),V(),a?{jsDocTypeExpression:a,diagnostics:s}:void 0},t.parseJSDocTypeExpression=r,t.parseJSDocNameReference=n,t.parseIsolatedJSDocComment=function(t,r,n){U("",t,99,void 0,1);var i=te(8388608,(function(){return o(r,n)})),a={languageVariant:0,text:t},s=e.attachFileToDiagnostics(v,a);return V(),i?{jsDoc:i,diagnostics:s}:void 0},t.parseJSDocComment=function(t,r,n){var i=k,a=v.length,s=J,c=te(8388608,(function(){return o(r,n)}));return e.setParent(c,t),262144&M&&(T||(T=[]),T.push.apply(T,v)),k=i,v.length=a,J=s,c},function(e){e[e.BeginningOfLine=0]="BeginningOfLine",e[e.SawAsterisk=1]="SawAsterisk",e[e.SavingComments=2]="SavingComments",e[e.SavingBackticks=3]="SavingBackticks"}(i||(i={})),function(e){e[e.Property=1]="Property",e[e.Parameter=2]="Parameter",e[e.CallbackParameter=4]="CallbackParameter"}(a||(a={}))}(Be=t.JSDocParser||(t.JSDocParser={}))}(u||(u={})),function(t){function r(t,r,i,o,s,c){return void(r?u(t):l(t));function l(t){var r="";if(c&&n(t)&&(r=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),e.setTextRangePosEnd(t,t.pos+i,t.end+i),c&&n(t)&&e.Debug.assert(r===s.substring(t.pos,t.end)),h(t,l,u),e.hasJSDocNodes(t))for(var d=0,_=t.jsDoc;d<_.length;d++){l(_[d])}a(t,c)}function u(t){t._children=void 0,e.setTextRangePosEnd(t,t.pos+i,t.end+i);for(var r=0,n=t;r=r,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=n,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end);var o=Math.min(t.pos,i),s=t.end>=n?t.end+a:Math.min(t.end,i);e.Debug.assert(o<=s),t.parent&&(e.Debug.assertGreaterThanOrEqual(o,t.parent.pos),e.Debug.assertLessThanOrEqual(s,t.parent.end)),e.setTextRangePosEnd(t,o,s)}function a(t,r){if(r){var n=t.pos,i=function(t){e.Debug.assert(t.pos>=n),n=t.end};if(e.hasJSDocNodes(t))for(var a=0,o=t.jsDoc;ar),!0;if(a.pos>=i.pos&&(i=a),ri.pos&&(i=a)}return i}function s(t,r,n,i){var a=t.text;if(n&&(e.Debug.assert(a.length-n.span.length+n.newLength===r.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,n.span.start),s=r.substr(0,n.span.start);e.Debug.assert(o===s);var c=a.substring(e.textSpanEnd(n.span),a.length),l=r.substring(e.textSpanEnd(e.textChangeRangeNewSpan(n)),r.length);e.Debug.assert(c===l)}}function c(t){var r=t.statements,n=0;e.Debug.assert(n=t.pos&&e=t.pos&&e0&&a<=n;a++){var s=o(t,i);e.Debug.assert(s.pos<=i);var c=s.pos;i=Math.max(0,c-1)}var l=e.createTextSpanFromBounds(i,e.textSpanEnd(r.span)),u=r.newLength+(r.span.start-i);return e.createTextChangeRange(l,u)}(t,l);s(t,n,m,d),e.Debug.assert(m.span.start<=l.span.start),e.Debug.assert(e.textSpanEnd(m.span)===e.textSpanEnd(l.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(m))===e.textSpanEnd(e.textChangeRangeNewSpan(l)));var g=e.textChangeRangeNewSpan(m).length-m.span.length;!function(t,n,o,s,c,l,u,d){return void _(t);function _(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!1,c,l,u,d);else{var f=t.end;if(f>=n){if(t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c),h(t,_,p),e.hasJSDocNodes(t))for(var m=0,g=t.jsDoc;mo)r(t,!0,c,l,u,d);else{var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c);for(var p=0,f=t;pi){y();var g={range:{pos:f.pos+a,end:f.end+a},type:m};l=e.append(l,g),c&&e.Debug.assert(o.substring(f.pos,f.end)===s.substring(g.range.pos,g.range.end))}}return y(),l;function y(){u||(u=!0,l?r&&l.push.apply(l,r):l=r)}}(t.commentDirectives,y.commentDirectives,m.span.start,e.textSpanEnd(m.span),g,p,n,d),y.impliedNodeFormat=t.impliedNodeFormat,y},t.createSyntaxCursor=c,function(e){e[e.Value=-1]="Value"}(l||(l={}))}(d||(d={})),e.isDeclarationFileName=S,e.processCommentPragmas=D,e.processPragmasIntoFields=C;var T=new e.Map;function E(e){if(T.has(e))return T.get(e);var t=new RegExp("(\\s".concat(e,"\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"),"im");return T.set(e,t),t}var k=/^\/\/\/\s*<(\S+)\s.*?\/>/im,A=/^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;function N(t,r,n){var i=2===r.kind&&k.exec(n);if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(!(o&&1&o.kind))return;if(o.args){for(var s={},c=0,l=o.args;c=r.length)break;var o=a;if(34===r.charCodeAt(o)){for(a++;a32;)a++;i.push(r.substring(o,a))}}c(i)}else s.push(r)}}function v(t,r,n,i,a,o){if(i.isTSConfigOnly)"null"===(s=t[r])?(a[i.name]=void 0,r++):"boolean"===i.type?"false"===s?(a[i.name]=ge(i,!1,o),r++):("true"===s&&r++,o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),s&&!e.startsWith(s,"-")&&r++);else if(t[r]||"boolean"===i.type||o.push(e.createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,i.name,V(i))),"null"!==t[r])switch(i.type){case"number":a[i.name]=ge(i,parseInt(t[r]),o),r++;break;case"boolean":var s=t[r];a[i.name]=ge(i,"false"!==s,o),"false"!==s&&"true"!==s||r++;break;case"string":a[i.name]=ge(i,t[r]||"",o),r++;break;case"list":var c=m(i,t[r],o);a[i.name]=c||[],c&&r++;break;default:a[i.name]=f(i,t[r],o),r++}else a[i.name]=void 0,r++;return r}function b(e,t){return x(c,e,t)}function x(e,t,r){void 0===r&&(r=!1),t=t.toLowerCase();var n=e(),i=n.optionsNameMap,a=n.shortOptionNames;if(r){var o=a.get(t);void 0!==o&&(t=o)}return i.get(t)}function S(){return l||(l=s(e.buildOpts))}e.defaultInitCompilerOptions={module:e.ModuleKind.CommonJS,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},e.convertEnableAutoDiscoveryToEnable=d,e.createCompilerDiagnosticForInvalidCustomType=_,e.parseCustomTypeOption=f,e.parseListTypeOption=m,e.parseCommandLineWorker=h,e.compilerOptionsDidYouMeanDiagnostics={alternateMode:u,getOptionsNameMap:c,optionDeclarations:e.optionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Compiler_option_0_expects_an_argument},e.parseCommandLine=function(t,r){return h(e.compilerOptionsDidYouMeanDiagnostics,t,r)},e.getOptionFromName=b;var D={alternateMode:{diagnostic:e.Diagnostics.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:c},getOptionsNameMap:S,optionDeclarations:e.buildOpts,unknownOptionDiagnostic:e.Diagnostics.Unknown_build_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Build_option_0_requires_a_value_of_type_1};function C(t,r){var n=e.parseJsonText(t,r);return{config:J(n,n.parseDiagnostics,!1,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function T(t,r){var n=E(t,r);return e.isString(n)?e.parseJsonText(t,n):{fileName:t,parseDiagnostics:[n]}}function E(t,r){var n;try{n=r(t)}catch(r){return e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,r.message)}return void 0===n?e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0,t):n}function k(t){return e.arrayToMap(t,g)}e.parseBuildCommand=function(t){var r=h(D,t),n=r.options,i=r.watchOptions,a=r.fileNames,o=r.errors,s=n;return 0===a.length&&a.push("."),s.clean&&s.force&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","force")),s.clean&&s.verbose&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","verbose")),s.clean&&s.watch&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","watch")),s.watch&&s.dry&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:s,watchOptions:i,projects:a,errors:o}},e.getDiagnosticText=function(t){for(var r=[],n=1;n=0)return l.push(e.createCompilerDiagnostic(e.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0,r(r([],c,!0),[_],!1).join(" -> "))),{raw:t||j(n,l)};var p=t?function(t,r,n,i,a){e.hasProperty(t,"excludes")&&a.push(e.createCompilerDiagnostic(e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));var o,s=le(t.compilerOptions,n,a,i),c=de(t.typeAcquisition||t.typingOptions,n,a,i),l=function(e,t,r){return _e(R(),e,t,void 0,M,r)}(t.watchOptions,n,a);if(t.compileOnSave=function(t,r,n){if(!e.hasProperty(t,e.compileOnSaveCommandLineOption.name))return!1;var i=pe(e.compileOnSaveCommandLineOption,t.compileOnSave,r,n);return"boolean"==typeof i&&i}(t,n,a),t.extends)if(e.isString(t.extends)){var u=i?te(i,n):n;o=se(t.extends,r,u,a,e.createCompilerDiagnostic)}else a.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"extends","string"));return{raw:t,options:s,watchOptions:l,typeAcquisition:c,extendedConfigPath:o}}(t,i,a,s,l):function(t,r,n,i,a){var s,c,l,u,d,_=ce(i),p={onSetValidOptionKeyValueInParent:function(t,r,a){var o;switch(t){case"compilerOptions":o=_;break;case"watchOptions":o=l||(l={});break;case"typeAcquisition":o=s||(s=ue(i));break;case"typingOptions":o=c||(c=ue(i));break;default:e.Debug.fail("Unknown option")}o[r.name]=fe(r,n,a)},onSetValidOptionKeyValueInRoot:function(o,s,c,l){if("extends"!==o);else{var d=i?te(i,n):n;u=se(c,r,d,a,(function(r,n){return e.createDiagnosticForNodeInSourceFile(t,l,r,n)}))}},onSetUnknownOptionKeyValueInRoot:function(r,n,i,s){"excludes"===r&&a.push(e.createDiagnosticForNodeInSourceFile(t,n,e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)),e.find(o,(function(e){return e.name===r}))&&(d=e.append(d,n))}},f=J(t,a,!0,p);s||(s=c?void 0!==c.enableAutoDiscovery?{enable:c.enableAutoDiscovery,include:c.include,exclude:c.exclude}:c:ue(i));d&&f&&void 0===f.compilerOptions&&a.push(e.createDiagnosticForNodeInSourceFile(t,d[0],e.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,e.getTextOfPropertyName(d[0])));return{raw:f,options:_,watchOptions:l,typeAcquisition:s,extendedConfigPath:u}}(n,i,a,s,l);if((null===(d=p.options)||void 0===d?void 0:d.paths)&&(p.options.pathsBasePath=a),p.extendedConfigPath){c=c.concat([_]);var f=function(t,r,n,i,a,o){var s,c,l,u,d=n.useCaseSensitiveFileNames?r:e.toFileNameLowerCase(r);o&&(c=o.get(d))?(l=c.extendedResult,u=c.extendedConfig):(l=T(r,(function(e){return n.readFile(e)})),l.parseDiagnostics.length||(u=oe(void 0,l,n,e.getDirectoryPath(r),e.getBaseFileName(r),i,a,o)),o&&o.set(d,{extendedResult:l,extendedConfig:u}));t&&(t.extendedSourceFiles=[l.fileName],l.extendedSourceFiles&&(s=t.extendedSourceFiles).push.apply(s,l.extendedSourceFiles));if(l.parseDiagnostics.length)return void a.push.apply(a,l.parseDiagnostics);return u}(n,p.extendedConfigPath,i,c,l,u);if(f&&f.options){var m,g=f.raw,y=p.raw,h=function(t){!y[t]&&g[t]&&(y[t]=e.map(g[t],(function(t){return e.isRootedDiskPath(t)?t:e.combinePaths(m||(m=e.convertToRelativePath(e.getDirectoryPath(p.extendedConfigPath),a,e.createGetCanonicalFileName(i.useCaseSensitiveFileNames))),t)})))};h("include"),h("exclude"),h("files"),void 0===y.compileOnSave&&(y.compileOnSave=g.compileOnSave),p.options=e.assign({},f.options,p.options),p.watchOptions=p.watchOptions&&f.watchOptions?e.assign({},f.watchOptions,p.watchOptions):p.watchOptions||f.watchOptions}}return p}function se(t,r,n,i,a){if(t=e.normalizeSlashes(t),e.isRootedDiskPath(t)||e.startsWith(t,"./")||e.startsWith(t,"../")){var o=e.getNormalizedAbsolutePath(t,n);return r.fileExists(o)||e.endsWith(o,".json")||(o="".concat(o,".json"),r.fileExists(o))?o:void i.push(a(e.Diagnostics.File_0_not_found,t))}var s=e.nodeModuleNameResolver(t,e.combinePaths(n,"tsconfig.json"),{moduleResolution:e.ModuleResolutionKind.NodeJs},r,void 0,void 0,!0);if(s.resolvedModule)return s.resolvedModule.resolvedFileName;i.push(a(e.Diagnostics.File_0_not_found,t))}function ce(t){return t&&"jsconfig.json"===e.getBaseFileName(t)?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function le(t,r,n,i){var a=ce(i);return _e(L(),t,r,a,e.compilerOptionsDidYouMeanDiagnostics,n),i&&(a.configFilePath=e.normalizeSlashes(i)),a}function ue(t){return{enable:!!t&&"jsconfig.json"===e.getBaseFileName(t),include:[],exclude:[]}}function de(e,t,r,n){var i=ue(n),a=d(e);return _e(B(),a,t,i,N,r),i}function _e(t,r,n,i,a,o){if(r){for(var s in r){var c=t.get(s);c?(i||(i={}))[c.name]=pe(c,r[s],n,o):o.push(y(s,a,e.createCompilerDiagnostic))}return i}}function pe(t,r,n,i){if(K(t,r)){var a=t.type;if("list"===a&&e.isArray(r))return function(t,r,n,i){return e.filter(e.map(r,(function(e){return pe(t.element,e,n,i)})),(function(e){return!!t.listPreserveFalsyValues||!!e}))}(t,r,n,i);if(!e.isString(a))return ye(t,r,i);var o=ge(t,r,i);return ee(o)?o:me(t,n,o)}i.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t.name,V(t)))}function fe(t,r,n){if(!ee(n)){if("list"===t.type){var i=t;return i.element.isFilePath||!e.isString(i.element.type)?e.filter(e.map(n,(function(e){return fe(i.element,r,e)})),(function(e){return!!i.listPreserveFalsyValues||!!e})):n}return e.isString(t.type)?me(t,r,n):t.type.get(e.isString(n)?n.toLowerCase():n)}}function me(t,r,n){return t.isFilePath&&""===(n=e.getNormalizedAbsolutePath(n,r))&&(n="."),n}function ge(t,r,n){var i;if(!ee(r)){var a=null===(i=t.extraValidation)||void 0===i?void 0:i.call(t,r);if(!a)return r;n.push(e.createCompilerDiagnostic.apply(void 0,a))}}function ye(e,t,r){if(!ee(t)){var n=t.toLowerCase(),i=e.type.get(n);if(void 0!==i)return ge(e,i,r);r.push(_(e))}}e.convertToObject=j,e.convertToObjectWorker=U,e.convertToTSConfig=function(t,r,i){var a,o,s,c=e.createGetCanonicalFileName(i.useCaseSensitiveFileNames),l=e.map(e.filter(t.fileNames,(null===(o=null===(a=t.options.configFile)||void 0===a?void 0:a.configFileSpecs)||void 0===o?void 0:o.validatedIncludeSpecs)?function(t,r,n,i){if(!r)return e.returnTrue;var a=e.getFileMatcherPatterns(t,n,r,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=a.excludePattern&&e.getRegexFromPattern(a.excludePattern,i.useCaseSensitiveFileNames),s=a.includeFilePattern&&e.getRegexFromPattern(a.includeFilePattern,i.useCaseSensitiveFileNames);if(s)return o?function(e){return!(s.test(e)&&!o.test(e))}:function(e){return!s.test(e)};if(o)return function(e){return o.test(e)};return e.returnTrue}(r,t.options.configFile.configFileSpecs.validatedIncludeSpecs,t.options.configFile.configFileSpecs.validatedExcludeSpecs,i):e.returnTrue),(function(t){return e.getRelativePathFromFile(e.getNormalizedAbsolutePath(r,i.getCurrentDirectory()),e.getNormalizedAbsolutePath(t,i.getCurrentDirectory()),c)})),u=H(t.options,{configFilePath:e.getNormalizedAbsolutePath(r,i.getCurrentDirectory()),useCaseSensitiveFileNames:i.useCaseSensitiveFileNames}),d=t.watchOptions&&Q(t.watchOptions,w()),_=n(n({compilerOptions:n(n({},z(u)),{showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0}),watchOptions:d&&z(d),references:e.map(t.projectReferences,(function(e){return n(n({},e),{path:e.originalPath?e.originalPath:"",originalPath:void 0})})),files:e.length(l)?l:void 0},(null===(s=t.options.configFile)||void 0===s?void 0:s.configFileSpecs)?{include:G(t.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:t.options.configFile.configFileSpecs.validatedExcludeSpecs}:{}),{compileOnSave:!!t.compileOnSave||void 0});return _},e.getCompilerOptionsDiffValue=function(t,r){var n,i,a,s=X(t);return n=[],a=2,i=Array(a+1).join(" "),o.forEach((function(t){if(s.has(t.name)){var r=s.get(t.name),a=Ae(t);r!==a?n.push("".concat(i).concat(t.name,": ").concat(r)):e.hasProperty(e.defaultInitCompilerOptions,t.name)&&n.push("".concat(i).concat(t.name,": ").concat(a))}})),n.join(r)+r},e.generateTSConfig=function(t,r,n){var i=X(t);return function(){for(var t=e.createMultiMap(),s=0,c=e.optionDeclarations;s0)for(var b=function(t){if(e.fileExtensionIs(t,".json")){if(!o){var n=_.filter((function(t){return e.endsWith(t,".json")})),a=e.map(e.getRegularExpressionsForWildcards(n,r,"files"),(function(e){return"^".concat(e,"$")}));o=a?a.map((function(t){return e.getRegexFromPattern(t,i.useCaseSensitiveFileNames)})):e.emptyArray}if(-1!==e.findIndex(o,(function(e){return e.test(t)}))){var d=s(t);c.has(d)||u.has(d)||u.set(d,t)}return"continue"}if(function(t,r,n,i,a){var o=e.forEach(i,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(!o)return!1;for(var s=0,c=o;s=0;o--){var s=a[o];if(e.fileExtensionIs(t,s))return;var c=i(e.changeExtension(t,s));r.delete(c)}}(t,l,f,s);var p=s(t);c.has(p)||l.has(p)||l.set(p,t)},x=0,S=i.readDirectory(r,e.flatten(m),p,_,void 0);xr}function Se(t,r,n,i,a){var o=e.getRegularExpressionForWildcard(r,e.combinePaths(e.normalizePath(i),a),"exclude"),s=o&&e.getRegexFromPattern(o,n);return!!s&&(!!s.test(t)||!e.hasExtension(t)&&s.test(e.ensureTrailingDirectorySeparator(t)))}function De(t,r,n,i,a){return t.filter((function(t){if(!e.isString(t))return!1;var i=Ce(t,n);return void 0!==i&&r.push(o.apply(void 0,i)),void 0===i}));function o(t,r){var n=e.getTsConfigPropArrayElementValue(i,a,r);return n?e.createDiagnosticForNodeInSourceFile(i,n,t,r):e.createCompilerDiagnostic(t,r)}}function Ce(t,r){return r&&he.test(t)?[e.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:xe(t)?[e.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:void 0}function Te(t,r,n){var i=t.validatedIncludeSpecs,a=t.validatedExcludeSpecs,o=e.getRegularExpressionForWildcard(a,r,"exclude"),s=o&&new RegExp(o,n?"":"i"),c={};if(void 0!==i){for(var l=[],u=0,d=i;u0);var i={sourceFile:t.configFile,commandLine:{options:t}};r.setOwnMap(r.getOrCreateMapOfCacheRedirects(i)),null==n||n.setOwnMap(n.getOrCreateMapOfCacheRedirects(i))}r.setOwnOptions(t),null==n||n.setOwnOptions(t)}}function k(t,r,n){return{getOrCreateCacheForDirectory:function(i,a){var o=e.toPath(i,t,r);return T(n,a,o,(function(){return A()}))},clear:function(){n.clear()},update:function(e){E(e,n)}}}function A(){var t=new e.Map,r=new e.Map,n={get:function(e,r){return t.get(i(e,r))},set:function(e,r,a){return t.set(i(e,r),a),n},delete:function(e,r){return t.delete(i(e,r)),n},has:function(e,r){return t.has(i(e,r))},forEach:function(e){return t.forEach((function(t,n){var i=r.get(n),a=i[0],o=i[1];return e(t,a,o)}))},size:function(){return t.size}};return n;function i(e,t){var n=void 0===t?e:"".concat(t,"|").concat(e);return r.set(n,[e,t]),n}}function N(r,n,i,a,o){var s=function(r,n,i,a){var o,s=a.compilerOptions,c=s.baseUrl,l=s.paths,u=s.configFile;if(l&&!e.pathIsRelative(n)){return a.traceEnabled&&(c&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,c,n),t(a.host,e.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,n)),_e(r,n,e.getPathsBasePath(a.compilerOptions,a.host),l,(null==u?void 0:u.configFileSpecs)?(o=u.configFileSpecs).pathPatterns||(o.pathPatterns=e.tryParsePatterns(l)):void 0,i,!1,a)}}(r,n,a,o);return s?s.value:e.isExternalModuleNameRelative(n)?function(r,n,i,a,o){if(!o.compilerOptions.rootDirs)return;o.traceEnabled&&t(o.host,e.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,n);for(var s,c,l=e.normalizePath(e.combinePaths(i,n)),u=0,d=o.compilerOptions.rootDirs;u=0||c.indexOf(".")>=0||c.indexOf("node_modules")>=0)return!1;var u=e.combinePaths(t.packageDirectory,r),d=e.getNormalizedAbsolutePath(u,null===(s=(o=n.host).getCurrentDirectory)||void 0===s?void 0:s.call(o)),_=q(i,d,!1,n);if(_)return a=e.appendIfUnique(a,_,(function(e,t){return e.path===t.path})),!0}else if(Array.isArray(r))for(var p=0,f=r;p0;){var c=Z(e.getPathFromPathComponents(s),!1,o);if(c)return c;s.pop()}}function Z(r,n,i){var a,o,s,c=i.host,l=i.traceEnabled,u=e.combinePaths(r,"package.json");if(n)i.failedLookupLocations.push(u);else{var d=null===(a=i.packageJsonInfoCache)||void 0===a?void 0:a.getPackageJsonInfo(u);if(void 0!==d)return"boolean"!=typeof d?(l&&t(c,e.Diagnostics.File_0_exists_according_to_earlier_cached_lookups,u),d):(d&&l&&t(c,e.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void i.failedLookupLocations.push(u));var _=e.directoryProbablyExists(r,c);if(_&&c.fileExists(u)){var p=e.readJson(u,c);l&&t(c,e.Diagnostics.Found_package_json_at_0,u);var f={packageDirectory:r,packageJsonContent:p,versionPaths:g(p,i),resolvedEntrypoints:void 0};return null===(o=i.packageJsonInfoCache)||void 0===o||o.setPackageJsonInfo(u,f),f}_&&l&&t(c,e.Diagnostics.File_0_does_not_exist,u),null===(s=i.packageJsonInfoCache)||void 0===s||s.setPackageJsonInfo(u,_),i.failedLookupLocations.push(u)}}function ee(r,n,i,a,l,u){var d;if(l)switch(r){case c.JavaScript:case c.Json:case c.TsOnly:d=m(l,n,a);break;case c.TypeScript:d=f(l,n,a)||m(l,n,a);break;case c.DtsOnly:d=f(l,n,a);break;case c.TSConfig:d=function(e,t,r){return p(e,"tsconfig",t,r)}(l,n,a);break;default:return e.Debug.assertNever(r)}var _=function(r,n,i,a){var s=H(n,i,a);if(s){var u=function(t,r){var n=e.tryGetExtensionFromPath(r);return void 0!==n&&function(e,t){switch(e){case c.JavaScript:return".js"===t||".jsx"===t||".mjs"===t||".cjs"===t;case c.TSConfig:case c.Json:return".json"===t;case c.TypeScript:return".ts"===t||".tsx"===t||".mts"===t||".cts"===t||".d.ts"===t||".d.mts"===t||".d.cts"===t;case c.TsOnly:return".ts"===t||".tsx"===t||".mts"===t||".cts"===t;case c.DtsOnly:return".d.ts"===t||".d.mts"===t||".d.cts"===t}}(t,n)?{path:r,ext:n}:void 0}(r,s);if(u)return o(u);a.traceEnabled&&t(a.host,e.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it,s)}var d=r===c.DtsOnly?c.TypeScript:r,_=a.features;"module"!==(null==l?void 0:l.type)&&(a.features&=~v.EsmMode);var p=J(d,n,i,a,!1);return a.features=_,p},g=d?!e.directoryProbablyExists(e.getDirectoryPath(d),a.host):void 0,y=i||!e.directoryProbablyExists(n,a.host),h=e.combinePaths(n,r===c.TSConfig?"tsconfig":"index");if(u&&(!d||e.containsPath(n,d))){var b=e.getRelativePathFromDirectory(n,d||h,!1);a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,u.version,e.version,b);var x=_e(r,b,n,u.paths,void 0,_,g||y,a);if(x)return s(x.value)}var S=d&&s(_(r,d,g,a));return S||(a.features&v.EsmMode?void 0:z(r,h,y,a))}function te(t){var r=t.indexOf(e.directorySeparator);return"@"===t[0]&&(r=t.indexOf(e.directorySeparator,r+1)),-1===r?{packageName:t,rest:""}:{packageName:t.slice(0,r),rest:t.slice(r+1)}}function re(t){return e.every(e.getOwnKeys(t),(function(t){return e.startsWith(t,".")}))}function ne(r,n,i,a,o,s){if(r.packageJsonContent.exports){if("."===i){var c=void 0;if("string"==typeof r.packageJsonContent.exports||Array.isArray(r.packageJsonContent.exports)||"object"==typeof r.packageJsonContent.exports&&(u=r.packageJsonContent.exports,!e.some(e.getOwnKeys(u),(function(t){return e.startsWith(t,".")})))?c=r.packageJsonContent.exports:e.hasProperty(r.packageJsonContent.exports,".")&&(c=r.packageJsonContent.exports["."]),c)return oe(n,a,o,s,i,r,!1)(c,"",!1)}else if(re(r.packageJsonContent.exports)){if("object"!=typeof r.packageJsonContent.exports)return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0);var l=ae(n,a,o,s,i,r.packageJsonContent.exports,r,!1);if(l)return l}var u;return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),he(void 0)}}function ie(e,t){var r=e.indexOf("*"),n=t.indexOf("*"),i=-1===r?e.length:r+1,a=-1===n?t.length:n+1;return i>a?-1:a>i||-1===r?1:-1===n||e.length>t.length?-1:t.length>e.length?1:0}function ae(t,r,n,i,a,o,s,c){var l=oe(t,r,n,i,a,s,c);if(!e.endsWith(a,e.directorySeparator)&&-1===a.indexOf("*")&&e.hasProperty(o,a))return l(p=o[a],"",!1);for(var u=0,d=e.sort(e.filter(e.getOwnKeys(o),(function(t){return-1!==t.indexOf("*")||e.endsWith(t,"/")})),ie);u0&&!e.endsWith(_,"/"))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);if(!e.startsWith(_,"./")){if(u&&!e.startsWith(_,"../")&&!e.startsWith(_,"/")&&!e.isRootedDiskPath(_)){var m=f?_.replace(/\*/g,p):_+p;return he((T=L(n.features,m,l.packageDirectory+"/",n.compilerOptions,n.host,i,[r],o)).resolvedModule?{path:T.resolvedModule.resolvedFileName,extension:T.resolvedModule.extension,packageId:T.resolvedModule.packageId,originalPath:T.resolvedModule.originalPath}:void 0)}return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0)}var g=(e.pathIsRelative(_)?e.getPathComponents(_).slice(1):e.getPathComponents(_)).slice(1);if(g.indexOf("..")>=0||g.indexOf(".")>=0||g.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);var y=e.combinePaths(l.packageDirectory,_),h=e.getPathComponents(p);if(h.indexOf("..")>=0||h.indexOf(".")>=0||h.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);var v=N(f?y.replace(/\*/g,p):y+p),b=function(t,i,o,s){var u,d,_,p;if((r===c.TypeScript||r===c.JavaScript||r===c.Json)&&(n.compilerOptions.declarationDir||n.compilerOptions.outDir)&&-1===t.indexOf("/node_modules/")&&(!n.compilerOptions.configFile||e.startsWith(N(n.compilerOptions.configFile.fileName),l.packageDirectory))){var f=e.hostGetCanonicalFileName({useCaseSensitiveFileNames:F}),m=[];if(n.compilerOptions.rootDir||n.compilerOptions.composite&&n.compilerOptions.configFilePath){var g=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return[]}),(null===(d=(u=n.host).getCurrentDirectory)||void 0===d?void 0:d.call(u))||"",f));m.push(g)}else if(n.requestContainingDirectory){var y=N(e.combinePaths(n.requestContainingDirectory,"index.ts"));g=N(e.getCommonSourceDirectory(n.compilerOptions,(function(){return[y,N(o)]}),(null===(p=(_=n.host).getCurrentDirectory)||void 0===p?void 0:p.call(_))||"",f));m.push(g);for(var h=e.ensureTrailingDirectorySeparator(g);h&&h.length>1;){var v=e.getPathComponents(h);v.pop();var b=e.getPathFromPathComponents(v);m.unshift(b),h=e.ensureTrailingDirectorySeparator(b)}}m.length>1&&n.reportDiagnostic(e.createCompilerDiagnostic(s?e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate:e.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate,""===i?".":i,o));for(var x=0,S=m;x=0||se(n.conditions,D)){var C=_[D],T=d(C,p,f);if(T)return T}}return}if(!e.length(_))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),he(void 0);for(var E=0,k=_;Ei&&(i=u),1===i)return i}return i}break;case 262:var d=0;return e.forEachChild(t,(function(t){var n=o(t,r);switch(n){case 0:return;case 2:return void(d=2);case 1:return d=1,!0;default:e.Debug.assertNever(n)}})),d;case 261:return a(t,r);case 79:if(t.isInJSDocNamespace)return 0}return 1}(t,r);return r.set(n,i),i}function s(t,r){for(var n=t.propertyName||t.name,i=t.parent;i;){if(e.isBlock(i)||e.isModuleBlock(i)||e.isSourceFile(i)){for(var a=void 0,s=0,c=i.statements;sa)&&(a=u),1===a)return a}}if(void 0!==a)return a}i=i.parent}return 1}function c(t){return e.Debug.attachFlowNodeDebugInfo(t),t}(t=e.ModuleInstanceState||(e.ModuleInstanceState={}))[t.NonInstantiated=0]="NonInstantiated",t[t.Instantiated=1]="Instantiated",t[t.ConstEnumOnly=2]="ConstEnumOnly",e.getModuleInstanceState=a,function(e){e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor"}(i||(i={}));var l=function(){var t,i,o,s,l,p,f,m,g,y,h,v,b,x,S,D,C,T,E,k,A,N,w,F,P=!1,I=0,O={flags:1},M={flags:1},L=function(){return e.createBinaryExpressionTrampoline(t,r,n,i,a,void 0);function t(t,r){if(r){r.stackIndex++,e.setParent(t,s);var n=N;Ue(t);var i=s;s=t,r.skip=!1,r.inStrictModeStack[r.stackIndex]=n,r.parentStack[r.stackIndex]=i}else r={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};var a=t.operatorToken.kind;if(55===a||56===a||60===a||e.isLogicalOrCoalescingAssignmentOperator(a)){if(ue(t)){var o=Z();ve(t,o,o),h=ce(o)}else ve(t,S,D);r.skip=!0}return r}function r(e,t,r){if(!t.skip){var n=o(e);return 27===r.operatorToken.kind&&ge(e),n}}function n(e,t,r){t.skip||Re(e)}function i(e,t,r){if(!t.skip){var n=o(e);return 27===r.operatorToken.kind&&ge(e),n}}function a(t,r){if(!r.skip){var n=t.operatorToken.kind;if(e.isAssignmentOperator(n)&&!e.isAssignmentTarget(t))if(he(t.left),63===n&&207===t.left.kind)Y(t.left.expression)&&(h=oe(256,h,t))}var i=r.inStrictModeStack[r.stackIndex],a=r.parentStack[r.stackIndex];void 0!==i&&(N=i),void 0!==a&&(s=a),r.skip=!1,r.stackIndex--}function o(t){if(t&&e.isBinaryExpression(t)&&!e.isDestructuringAssignment(t))return t;Re(t)}}();function R(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(e.getSourceFileOfNode(r)||t,r,n,i,a,o)}return function(r,n){t=r,i=n,o=e.getEmitScriptTarget(i),N=function(t,r){return!(!e.getStrictOptionValue(r,"alwaysStrict")||t.isDeclarationFile)||!!t.externalModuleIndicator}(t,n),F=new e.Set,I=0,w=e.objectAllocator.getSymbolConstructor(),e.Debug.attachFlowNodeDebugInfo(O),e.Debug.attachFlowNodeDebugInfo(M),t.locals||(null===e.tracing||void 0===e.tracing||e.tracing.push("bind","bindSourceFile",{path:t.path},!0),Re(t),null===e.tracing||void 0===e.tracing||e.tracing.pop(),t.symbolCount=I,t.classifiableNames=F,function(){if(g){for(var r=l,n=m,i=f,a=s,o=h,u=0,_=g;u<_.length;u++){var p=_[u],y=p.parent.parent;l=e.findAncestor(y.parent,(function(e){return!!(1&Ce(e))}))||t,f=e.getEnclosingBlockScopeContainer(y)||t,h=c({flags:2}),s=p,Re(p.typeExpression);var v=e.getNameOfDeclaration(p);if((e.isJSDocEnumTag(p)||!p.fullName)&&v&&e.isPropertyAccessEntityNameExpression(v.parent)){var b=Ze(v.parent);if(b){$e(t.symbol,v.parent,b,!!e.findAncestor(v,(function(t){return e.isPropertyAccessExpression(t)&&"prototype"===t.name.escapedText})),!1);var x=l;switch(e.getAssignmentDeclarationPropertyAccessKind(v.parent)){case 1:case 2:l=e.isExternalOrCommonJsModule(t)?t:void 0;break;case 4:l=v.parent.expression;break;case 3:l=v.parent.expression.name;break;case 5:l=d(t,v.parent.expression)?t:e.isPropertyAccessExpression(v.parent.expression)?v.parent.expression.name:v.parent.expression;break;case 0:return e.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}l&&K(p,524288,788968),l=x}}else e.isJSDocEnumTag(p)||!p.fullName||79===p.fullName.kind?(s=p.parent,we(p,524288,788968)):Re(p.fullName)}l=r,m=n,f=i,s=a,h=o}}()),t=void 0,i=void 0,o=void 0,s=void 0,l=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=!1,h=void 0,v=void 0,b=void 0,x=void 0,S=void 0,D=void 0,C=void 0,E=void 0,k=!1,P=!1,A=0};function B(e,t){return I++,new w(e,t)}function J(t,r,n){t.flags|=n,r.symbol=t,t.declarations=e.appendIfUnique(t.declarations,r),1955&n&&!t.exports&&(t.exports=e.createSymbolTable()),6240&n&&!t.members&&(t.members=e.createSymbolTable()),t.constEnumOnlyModule&&304&t.flags&&(t.constEnumOnlyModule=!1),111551&n&&e.setValueDeclaration(t,r)}function j(t){if(271===t.kind)return t.isExportEquals?"export=":"default";var r=e.getNameOfDeclaration(t);if(r){if(e.isAmbientModule(t)){var n=e.getTextOfIdentifierOrLiteral(r);return e.isGlobalScopeAugmentation(t)?"__global":'"'.concat(n,'"')}if(162===r.kind){var i=r.expression;if(e.isStringOrNumericLiteralLike(i))return e.escapeLeadingUnderscores(i.text);if(e.isSignedNumericLiteral(i))return e.tokenToString(i.operator)+i.operand.text;e.Debug.fail("Only computed properties with literal names have declaration names")}if(e.isPrivateIdentifier(r)){var a=e.getContainingClass(t);if(!a)return;var o=a.symbol;return e.getSymbolNameForPrivateIdentifier(o,r.escapedText)}return e.isPropertyNameLiteral(r)?e.getEscapedTextOfIdentifierOrLiteral(r):void 0}switch(t.kind){case 171:return"__constructor";case 179:case 174:case 323:return"__call";case 180:case 175:return"__new";case 176:return"__index";case 272:return"__export";case 305:return"export=";case 221:if(2===e.getAssignmentDeclarationKind(t))return"export=";e.Debug.fail("Unknown binary declaration kind");break;case 317:return e.isJSDocConstructSignature(t)?"__new":"__call";case 164:return e.Debug.assert(317===t.parent.kind,"Impossible parameter parent kind",(function(){return"parent is: ".concat(e.SyntaxKind?e.SyntaxKind[t.parent.kind]:t.parent.kind,", expected JSDocFunctionType")})),"arg"+t.parent.parameters.indexOf(t)}}function U(t){return e.isNamedDeclaration(t)?e.declarationNameToString(t.name):e.unescapeLeadingUnderscores(e.Debug.checkDefined(j(t)))}function V(n,i,a,o,s,c,l){e.Debug.assert(l||!e.hasDynamicName(a));var u,d=e.hasSyntacticModifier(a,512)||e.isExportSpecifier(a)&&"default"===a.name.escapedText,_=l?"__computed":d&&i?"default":j(a);if(void 0===_)u=B(0,"__missing");else if(u=n.get(_),2885600&o&&F.add(_),u){if(c&&!u.isReplaceableByMethod)return u;if(u.flags&s)if(u.isReplaceableByMethod)n.set(_,u=B(0,_));else if(!(3&o&&67108864&u.flags)){e.isNamedDeclaration(a)&&e.setParent(a.name,a);var p=2&u.flags?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,f=!0;(384&u.flags||384&o)&&(p=e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,f=!1);var m=!1;e.length(u.declarations)&&(d||u.declarations&&u.declarations.length&&271===a.kind&&!a.isExportEquals)&&(p=e.Diagnostics.A_module_cannot_have_multiple_default_exports,f=!1,m=!0);var g=[];e.isTypeAliasDeclaration(a)&&e.nodeIsMissing(a.type)&&e.hasSyntacticModifier(a,1)&&2887656&u.flags&&g.push(R(a,e.Diagnostics.Did_you_mean_0,"export type { ".concat(e.unescapeLeadingUnderscores(a.name.escapedText)," }")));var y=e.getNameOfDeclaration(a)||a;e.forEach(u.declarations,(function(r,n){var i=e.getNameOfDeclaration(r)||r,a=R(i,p,f?U(r):void 0);t.bindDiagnostics.push(m?e.addRelatedInfo(a,R(y,0===n?e.Diagnostics.Another_export_default_is_here:e.Diagnostics.and_here)):a),m&&g.push(R(i,e.Diagnostics.The_first_export_default_is_here))}));var h=R(y,p,f?U(a):void 0);t.bindDiagnostics.push(e.addRelatedInfo.apply(void 0,r([h],g,!1))),u=B(0,_)}}else n.set(_,u=B(0,_)),c&&(u.isReplaceableByMethod=!0);return J(u,a,o),u.parent?e.Debug.assert(u.parent===i,"Existing symbol parent should match new one"):u.parent=i,u}function K(t,r,n){var i=!!(1&e.getCombinedModifierFlags(t))||function(t){t.parent&&e.isModuleDeclaration(t)&&(t=t.parent);if(!e.isJSDocTypeAlias(t))return!1;if(!e.isJSDocEnumTag(t)&&t.fullName)return!0;var r=e.getNameOfDeclaration(t);return!!r&&(!(!e.isPropertyAccessEntityNameExpression(r.parent)||!Ze(r.parent))||!!(e.isDeclaration(r.parent)&&1&e.getCombinedModifierFlags(r.parent)))}(t);if(2097152&r)return 275===t.kind||265===t.kind&&i?V(l.symbol.exports,l.symbol,t,r,n):V(l.locals,void 0,t,r,n);if(e.isJSDocTypeAlias(t)&&e.Debug.assert(e.isInJSFile(t)),!e.isAmbientModule(t)&&(i||64&l.flags)){if(!l.locals||e.hasSyntacticModifier(t,512)&&!j(t))return V(l.symbol.exports,l.symbol,t,r,n);var a=111551&r?1048576:0,o=V(l.locals,void 0,t,a,n);return o.exportSymbol=V(l.symbol.exports,l.symbol,t,r,n),t.localSymbol=o,o}return V(l.locals,void 0,t,r,n)}function z(e){G(e,(function(e){return 256===e.kind?Re(e):void 0})),G(e,(function(e){return 256!==e.kind?Re(e):void 0}))}function G(t,r){void 0===r&&(r=Re),void 0!==t&&e.forEach(t,r)}function q(t){e.forEachChild(t,Re,G)}function W(t){var r=P;if(P=!1,function(t){if(!(1&h.flags))return!1;if(h===O){var r=e.isStatementButNotDeclaration(t)&&236!==t.kind||257===t.kind||261===t.kind&&function(t){var r=a(t);return 1===r||2===r&&e.shouldPreserveConstEnums(i)}(t);if(r&&(h=M,!i.allowUnreachableCode)){var n=e.unreachableCodeIsError(i)&&!(16777216&t.flags)&&(!e.isVariableStatement(t)||!!(3&e.getCombinedNodeFlags(t.declarationList))||t.declarationList.declarations.some((function(e){return!!e.initializer})));!function(t,r){if(e.isStatement(t)&&u(t)&&e.isBlock(t.parent)){var n=t.parent.statements,i=e.sliceAfter(n,t);e.getRangesWhere(i,u,(function(e,t){return r(i[e],i[t-1])}))}else r(t,t)}(t,(function(t,r){return Le(n,t,r,e.Diagnostics.Unreachable_code_detected)}))}}return!0}(t))return q(t),Be(t),void(P=r);switch(t.kind>=237&&t.kind<=253&&!i.allowUnreachableCode&&(t.flowNode=h),t.kind){case 241:!function(e){var t=fe(e,ee()),r=Z(),n=Z();ne(t,h),h=t,_e(e.expression,r,n),h=ce(r),pe(e.statement,n,t),ne(t,h),h=ce(n)}(t);break;case 240:!function(e){var t=ee(),r=fe(e,Z()),n=Z();ne(t,h),h=t,pe(e.statement,n,r),ne(r,h),h=ce(r),_e(e.expression,t,n),h=ce(n)}(t);break;case 242:!function(e){var t=fe(e,ee()),r=Z(),n=Z();Re(e.initializer),ne(t,h),h=t,_e(e.condition,r,n),h=ce(r),pe(e.statement,n,t),Re(e.incrementor),ne(t,h),h=ce(n)}(t);break;case 243:case 244:!function(e){var t=fe(e,ee()),r=Z();Re(e.expression),ne(t,h),h=t,244===e.kind&&Re(e.awaitModifier);ne(r,h),Re(e.initializer),255!==e.initializer.kind&&he(e.initializer);pe(e.statement,r,t),ne(t,h),h=ce(r)}(t);break;case 239:!function(e){var t=Z(),r=Z(),n=Z();_e(e.expression,t,r),h=ce(t),Re(e.thenStatement),ne(n,h),h=ce(r),Re(e.elseStatement),ne(n,h),h=ce(n)}(t);break;case 247:case 251:!function(e){Re(e.expression),247===e.kind&&(k=!0,x&&ne(x,h));h=O}(t);break;case 246:case 245:!function(e){if(Re(e.label),e.label){var t=function(e){for(var t=E;t;t=t.next)if(t.name===e)return t;return}(e.label.escapedText);t&&(t.referenced=!0,me(e,t.breakTarget,t.continueTarget))}else me(e,v,b)}(t);break;case 252:!function(t){var r=x,n=C,i=Z(),a=Z(),o=Z();t.finallyBlock&&(x=a);ne(o,h),C=o,Re(t.tryBlock),ne(i,h),t.catchClause&&(h=ce(o),ne(o=Z(),h),C=o,Re(t.catchClause),ne(i,h));if(x=r,C=n,t.finallyBlock){var s=Z();s.antecedents=e.concatenate(e.concatenate(i.antecedents,o.antecedents),a.antecedents),h=s,Re(t.finallyBlock),1&h.flags?h=O:(x&&a.antecedents&&ne(x,te(s,a.antecedents,h)),C&&o.antecedents&&ne(C,te(s,o.antecedents,h)),h=i.antecedents?te(s,i.antecedents,h):O)}else h=ce(i)}(t);break;case 249:!function(t){var r=Z();Re(t.expression);var n=v,i=T;v=r,T=h,Re(t.caseBlock),ne(r,h);var a=e.forEach(t.caseBlock.clauses,(function(e){return 290===e.kind}));t.possiblyExhaustive=!a&&!r.antecedents,a||ne(r,ae(T,t,0,0));v=n,T=i,h=ce(r)}(t);break;case 263:!function(e){for(var t=e.clauses,r=H(e.parent.expression),n=O,a=0;a=117&&r.originalKeywordKind<=125?t.bindDiagnostics.push(R(r,function(r){if(e.getContainingClass(r))return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode;if(t.externalModuleIndicator)return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode;return e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(r),e.declarationNameToString(r))):132===r.originalKeywordKind?e.isExternalModule(t)&&e.isInTopLevelContext(r)?t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,e.declarationNameToString(r))):32768&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))):125===r.originalKeywordKind&&8192&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))))}function Pe(r,n){if(n&&79===n.kind){var i=n;if(function(t){return e.isIdentifier(t)&&("eval"===t.escapedText||"arguments"===t.escapedText)}(i)){var a=e.getErrorSpanForNode(t,n);t.bindDiagnostics.push(e.createFileDiagnostic(t,a.start,a.length,function(r){if(e.getContainingClass(r))return e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode;if(t.externalModuleIndicator)return e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;return e.Diagnostics.Invalid_use_of_0_in_strict_mode}(r),e.idText(i)))}}}function Ie(e){N&&Pe(e,e.name)}function Oe(r){if(o<2&&305!==f.kind&&261!==f.kind&&!e.isFunctionLikeOrClassStaticBlockDeclaration(f)){var n=e.getErrorSpanForNode(t,r);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}(r)))}}function Me(r,n,i,a,o){var s=e.getSpanOfTokenAtPosition(t,r.pos);t.bindDiagnostics.push(e.createFileDiagnostic(t,s.start,s.length,n,i,a,o))}function Le(r,i,a,o){!function(r,i,a){var o=e.createFileDiagnostic(t,i.pos,i.end-i.pos,a);r?t.bindDiagnostics.push(o):t.bindSuggestionDiagnostics=e.append(t.bindSuggestionDiagnostics,n(n({},o),{category:e.DiagnosticCategory.Suggestion}))}(r,{pos:e.getTokenPosOfNode(i,t),end:a.end},o)}function Re(r){if(r){e.setParent(r,s),e.tracing&&(r.tracingPath=t.path);var n=N;if(Ue(r),r.kind>160){var i=s;s=r;var a=Ce(r);0===a?W(r):function(t,r){var n=l,i=p,a=f;if(1&r?(214!==t.kind&&(p=l),l=f=t,32&r&&(l.locals=e.createSymbolTable()),Te(l)):2&r&&((f=t).locals=void 0),4&r){var o=h,s=v,u=b,d=x,_=C,m=E,g=k,S=16&r&&!e.hasSyntacticModifier(t,256)&&!t.asteriskToken&&!!e.getImmediatelyInvokedFunctionExpression(t)||170===t.kind;S||(h=c({flags:2}),144&r&&(h.node=t)),x=S||171===t.kind||e.isInJSFile(t)&&(256===t.kind||213===t.kind)?Z():void 0,C=void 0,v=void 0,b=void 0,E=void 0,k=!1,W(t),t.flags&=-2817,!(1&h.flags)&&8&r&&e.nodeIsPresent(t.body)&&(t.flags|=256,k&&(t.flags|=512),t.endFlowNode=h),305===t.kind&&(t.flags|=A,t.endFlowNode=h),x&&(ne(x,h),h=ce(x),(171===t.kind||170===t.kind||e.isInJSFile(t)&&(256===t.kind||213===t.kind))&&(t.returnFlowNode=h)),S||(h=o),v=s,b=u,x=d,C=_,E=m,k=g}else 64&r?(y=!1,W(t),t.flags=y?128|t.flags:-129&t.flags):W(t);l=n,p=i,f=a}(r,a),s=i}else{i=s;1===r.kind&&(s=r),Be(r),s=i}N=n}}function Be(t){if(e.hasJSDocNodes(t))if(e.isInJSFile(t))for(var r=0,n=t.jsDoc;r=2&&(e.isDeclarationStatement(t.statement)||e.isVariableStatement(t.statement))&&Me(t.label,e.Diagnostics.A_label_is_not_allowed_here)}(r);case 192:return void(y=!0);case 177:break;case 163:return function(t){if(e.isJSDocTemplateTag(t.parent)){var r=e.getEffectiveContainerForJSDocTemplateTag(t.parent);r?(r.locals||(r.locals=e.createSymbolTable()),V(r.locals,void 0,t,262144,526824)):Ee(t,262144,526824)}else if(190===t.parent.kind){var n=function(t){var r=e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&t.parent.extendsType===t}));return r&&r.parent}(t.parent);n?(n.locals||(n.locals=e.createSymbolTable()),V(n.locals,void 0,t,262144,526824)):Ne(t,262144,j(t))}else Ee(t,262144,526824)}(r);case 164:return it(r);case 254:return nt(r);case 203:return r.flowNode=h,nt(r);case 167:case 166:return function(e){return at(e,4|(e.questionToken?16777216:0),0)}(r);case 296:case 297:return at(r,4,0);case 299:return at(r,8,900095);case 174:case 175:case 176:return Ee(r,131072,0);case 169:case 168:return at(r,8192|(r.questionToken?16777216:0),e.isObjectLiteralMethod(r)?0:103359);case 256:return function(r){t.isDeclarationFile||16777216&r.flags||e.isAsyncFunction(r)&&(A|=2048);Ie(r),N?(Oe(r),we(r,16,110991)):Ee(r,16,110991)}(r);case 171:return Ee(r,16384,0);case 172:return at(r,32768,46015);case 173:return at(r,65536,78783);case 179:case 317:case 323:case 180:return function(t){var r=B(131072,j(t));J(r,t,131072);var n=B(2048,"__type");J(n,t,2048),n.members=e.createSymbolTable(),n.members.set(r.escapedName,r)}(r);case 182:case 322:case 195:return function(e){return Ne(e,2048,"__type")}(r);case 332:return function(t){q(t);var r=e.getHostSignatureFromJSDoc(t);r&&169!==r.kind&&J(r.symbol,r,32)}(r);case 205:return function(t){var r;if(function(e){e[e.Property=1]="Property",e[e.Accessor=2]="Accessor"}(r||(r={})),N&&!e.isAssignmentTarget(t))for(var n=new e.Map,i=0,a=t.properties;i1&&2097152&v.flags&&(t=e.createSymbolTable()).set("export=",v);return I(t),k(d);function b(e){return!!e&&79===e.kind}function x(t){return e.isVariableStatement(t)?e.filter(e.map(t.declarationList.declarations,e.getNameOfDeclaration),b):e.filter([e.getNameOfDeclaration(t)],b)}function D(t){var n=e.find(t,e.isExportAssignment),i=e.findIndex(t,e.isModuleDeclaration),a=-1!==i?t[i]:void 0;if(a&&n&&n.isExportEquals&&e.isIdentifier(n.expression)&&e.isIdentifier(a.name)&&e.idText(a.name)===e.idText(n.expression)&&a.body&&e.isModuleBlock(a.body)){var o=e.filter(t,(function(t){return!!(1&e.getEffectiveModifierFlags(t))})),s=a.name,c=a.body;if(e.length(o)&&(a=e.factory.updateModuleDeclaration(a,a.decorators,a.modifiers,a.name,c=e.factory.updateModuleBlock(c,e.factory.createNodeArray(r(r([],a.body.statements,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.map(e.flatMap(o,(function(e){return x(e)})),(function(t){return e.factory.createExportSpecifier(!1,void 0,t)}))),void 0)],!1)))),t=r(r(r([],t.slice(0,i),!0),[a],!1),t.slice(i+1),!0)),!e.find(t,(function(t){return t!==a&&e.nodeHasName(t,s)}))){d=[];var l=!e.some(c.statements,(function(t){return e.hasSyntacticModifier(t,1)||e.isExportAssignment(t)||e.isExportDeclaration(t)}));e.forEach(c.statements,(function(e){q(e,l?1:0)})),t=r(r([],e.filter(t,(function(e){return e!==a&&e!==n})),!0),d,!0)}}return t}function C(t){var n=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(n)>1){var i=e.filter(t,(function(t){return!e.isExportDeclaration(t)||!!t.moduleSpecifier||!t.exportClause}));t=r(r([],i,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(n,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),void 0)],!1)}var a=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(a)>1){var o=e.group(a,(function(t){return e.isStringLiteral(t.moduleSpecifier)?">"+t.moduleSpecifier.text:">"}));if(o.length!==a.length)for(var s=function(n){n.length>1&&(t=r(r([],e.filter(t,(function(e){return-1===n.indexOf(e)})),!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(n,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),n[0].moduleSpecifier)],!1))},c=0,l=o;c=0){var n=t[r],i=e.mapDefined(n.exportClause.elements,(function(r){if(!r.propertyName){var n=e.indicesOf(t),i=e.filter(n,(function(n){return e.nodeHasName(t[n],r.name)}));if(e.length(i)&&e.every(i,(function(e){return A(t[e])}))){for(var a=0,o=i;a0&&e.isSingleOrDoubleQuote(a.charCodeAt(0))?e.stripQuotes(a):a}return"default"===r?r="_default":"export="===r&&(r="_exports"),r=e.isIdentifierText(r,G)&&!e.isStringANonContextualKeyword(r)?r:"_"+r.replace(/[^a-zA-Z0-9]/g,"_")}function ve(e,t){var r=M(e);return i.remappedSymbolNames.has(r)?i.remappedSymbolNames.get(r):(t=he(e,t),i.remappedSymbolNames.set(r,t),t)}}(t,i,u)}))}};function a(r,n,i,a){var s,c;e.Debug.assert(void 0===r||0==(8&r.flags));var l={enclosingDeclaration:r,flags:n||0,tracker:i&&i.trackSymbol?i:{trackSymbol:function(){return!1},moduleResolverHost:134217728&n?{getCommonSourceDirectory:t.getCommonSourceDirectory?function(){return t.getCommonSourceDirectory()}:function(){return""},getCurrentDirectory:function(){return t.getCurrentDirectory()},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getPackageJsonInfoCache)||void 0===e?void 0:e.call(t)},useCaseSensitiveFileNames:e.maybeBind(t,t.useCaseSensitiveFileNames),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},fileExists:function(e){return t.fileExists(e)},getFileIncludeReasons:function(){return t.getFileIncludeReasons()},readFile:t.readFile?function(e){return t.readFile(e)}:void 0}:void 0},encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0};l.tracker=o(l,l.tracker);var u=a(l);return l.truncating&&1&l.flags&&(null===(c=null===(s=l.tracker)||void 0===s?void 0:s.reportTruncationError)||void 0===c||c.call(s)),l.encounteredError?void 0:u}function o(e,t){var r=t.trackSymbol;return n(n({},t),{reportCyclicStructureError:i(t.reportCyclicStructureError),reportInaccessibleThisError:i(t.reportInaccessibleThisError),reportInaccessibleUniqueSymbolError:i(t.reportInaccessibleUniqueSymbolError),reportLikelyUnsafeImportRequiredError:i(t.reportLikelyUnsafeImportRequiredError),reportNonlocalAugmentation:i(t.reportNonlocalAugmentation),reportPrivateInBaseOfClassExpression:i(t.reportPrivateInBaseOfClassExpression),reportNonSerializableProperty:i(t.reportNonSerializableProperty),trackSymbol:r&&function(){for(var t=[],n=0;n(1&t.flags?e.noTruncationMaximumTruncationLength:e.defaultMaximumTruncationLength)}function l(t,r){i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();var n=8388608&r.flags;if(r.flags&=-8388609,!t)return 262144&r.flags?(r.approximateLength+=3,e.factory.createKeywordTypeNode(130)):void(r.encounteredError=!0);if(536870912&r.flags||(t=nl(t)),1&t.flags)return t.aliasSymbol?e.factory.createTypeReferenceNode(k(t.aliasSymbol),f(t.aliasTypeArguments,r)):t===je?e.addSyntheticLeadingComment(e.factory.createKeywordTypeNode(130),3,"unresolved"):(r.approximateLength+=3,e.factory.createKeywordTypeNode(t===Ve?138:130));if(2&t.flags)return e.factory.createKeywordTypeNode(155);if(4&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(150);if(8&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(147);if(64&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(158);if(16&t.flags&&!t.aliasSymbol)return r.approximateLength+=7,e.factory.createKeywordTypeNode(133);if(1024&t.flags&&!(1048576&t.flags)){var a=_a(t.symbol),o=A(a,r,788968);if(Is(a)===t)return o;var c=e.symbolName(t.symbol);return e.isIdentifierText(c,0)?G(o,e.factory.createTypeReferenceNode(c,void 0)):e.isImportTypeNode(o)?(o.isTypeOf=!0,e.factory.createIndexedAccessTypeNode(o,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c)))):e.isTypeReferenceNode(o)?e.factory.createIndexedAccessTypeNode(e.factory.createTypeQueryNode(o.typeName),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c))):e.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}if(1056&t.flags)return A(t.symbol,r,788968);if(128&t.flags)return r.approximateLength+=t.value.length+2,e.factory.createLiteralTypeNode(e.setEmitFlags(e.factory.createStringLiteral(t.value,!!(268435456&r.flags)),16777216));if(256&t.flags){var _=t.value;return r.approximateLength+=(""+_).length,e.factory.createLiteralTypeNode(_<0?e.factory.createPrefixUnaryExpression(40,e.factory.createNumericLiteral(-_)):e.factory.createNumericLiteral(_))}if(2048&t.flags)return r.approximateLength+=e.pseudoBigIntToString(t.value).length+1,e.factory.createLiteralTypeNode(e.factory.createBigIntLiteral(t.value));if(512&t.flags)return r.approximateLength+=t.intrinsicName.length,e.factory.createLiteralTypeNode("true"===t.intrinsicName?e.factory.createTrue():e.factory.createFalse());if(8192&t.flags){if(!(1048576&r.flags)){if(Ma(t.symbol,r.enclosingDeclaration))return r.approximateLength+=6,A(t.symbol,r,111551);r.tracker.reportInaccessibleUniqueSymbolError&&r.tracker.reportInaccessibleUniqueSymbolError()}return r.approximateLength+=13,e.factory.createTypeOperatorNode(154,e.factory.createKeywordTypeNode(151))}if(16384&t.flags)return r.approximateLength+=4,e.factory.createKeywordTypeNode(114);if(32768&t.flags)return r.approximateLength+=9,e.factory.createKeywordTypeNode(153);if(65536&t.flags)return r.approximateLength+=4,e.factory.createLiteralTypeNode(e.factory.createNull());if(131072&t.flags)return r.approximateLength+=5,e.factory.createKeywordTypeNode(143);if(4096&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(151);if(67108864&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(148);if(e.isThisTypeParameter(t))return 4194304&r.flags&&(r.encounteredError||32768&r.flags||(r.encounteredError=!0),r.tracker.reportInaccessibleThisError&&r.tracker.reportInaccessibleThisError()),r.approximateLength+=4,e.factory.createThisTypeNode();if(!n&&t.aliasSymbol&&(16384&r.flags||Oa(t.aliasSymbol,r.enclosingDeclaration))){var h=f(t.aliasTypeArguments,r);return!Ta(t.aliasSymbol.escapedName)||32&t.aliasSymbol.flags?A(t.aliasSymbol,r,788968,h):e.factory.createTypeReferenceNode(e.factory.createIdentifier(""),h)}var v=e.getObjectFlags(t);if(4&v)return e.Debug.assert(!!(524288&t.flags)),t.node?V(t,z):z(t);if(262144&t.flags||3&v){if(262144&t.flags&&e.contains(r.inferTypeParameters,t)){r.approximateLength+=e.symbolName(t.symbol).length+6;var b=void 0,x=Jc(t);if(x){var S=ru(t,!0);S&&vp(x,S)||(r.approximateLength+=9,b=x&&l(x,r))}return e.factory.createInferTypeNode(y(t,r,b))}if(4&r.flags&&262144&t.flags&&!Oa(t.symbol,r.enclosingDeclaration)){var D=w(t,r);return r.approximateLength+=e.idText(D).length,e.factory.createTypeReferenceNode(e.factory.createIdentifier(e.idText(D)),void 0)}if(t.symbol)return A(t.symbol,r,788968);var C=(t===Pt||t===It)&&d&&d.symbol?(t===It?"sub-":"super-")+e.symbolName(d.symbol):"?";return e.factory.createTypeReferenceNode(e.factory.createIdentifier(C),void 0)}if(1048576&t.flags&&t.origin&&(t=t.origin),3145728&t.flags){var T=1048576&t.flags?function(e){for(var t=[],r=0,n=0;n0?1048576&t.flags?e.factory.createUnionTypeNode(E):e.factory.createIntersectionTypeNode(E):void(r.encounteredError||262144&r.flags||(r.encounteredError=!0))}if(48&v)return e.Debug.assert(!!(524288&t.flags)),U(t);if(4194304&t.flags){var N=t.type;r.approximateLength+=6;var F=l(N,r);return e.factory.createTypeOperatorNode(140,F)}if(134217728&t.flags){var P=t.texts,I=t.types,L=e.factory.createTemplateHead(P[0]),R=e.factory.createNodeArray(e.map(I,(function(t,n){return e.factory.createTemplateLiteralTypeSpan(l(t,r),(n10)return u(r);r.symbolDepth.set(c,_+1)}r.visitedTypes.add(o);var f=r.approximateLength,m=n(t),g=r.approximateLength-f;return r.reportedDiagnostic||r.encounteredError||(r.truncating&&(m.truncating=!0),m.addedLength=g,null===(a=null==l?void 0:l.serializedTypes)||void 0===a||a.set(d,m)),r.visitedTypes.delete(o),c&&r.symbolDepth.set(c,_),m;function y(t,r,n,i,a){return t&&0===t.length?e.setTextRange(e.factory.createNodeArray(void 0,t.hasTrailingComma),t):e.visitNodes(t,r,n,i,a)}}function K(t){if(Pc(t)||t.containsError)return function(t){e.Debug.assert(!!(524288&t.flags));var n,i,a=t.declaration.readonlyToken?e.factory.createToken(t.declaration.readonlyToken.kind):void 0,o=t.declaration.questionToken?e.factory.createToken(t.declaration.questionToken.kind):void 0;if(kc(t)){if(!(262144&Ac(t).flags)&&4&r.flags){var s=w(Ca(Wn(262144,"T")),r);i=e.factory.createTypeReferenceNode(s)}n=e.factory.createTypeOperatorNode(140,i||l(Ac(t),r))}else n=l(Dc(t),r);var c=y(Sc(t),r,n),u=t.declaration.nameType?l(Cc(t),r):void 0,d=l(am(Tc(t),!!(4&Nc(t))),r),_=e.factory.createMappedTypeNode(a,c,u,o,d,void 0);r.approximateLength+=10;var p=e.setEmitFlags(_,1);return kc(t)&&!(262144&Ac(t).flags)&&4&r.flags?e.factory.createConditionalTypeNode(l(Ac(t),r),e.factory.createInferTypeNode(e.factory.createTypeParameterDeclaration(void 0,e.factory.cloneNode(i.typeName))),p,e.factory.createKeywordTypeNode(143)):p}(t);var n=Ic(t);if(!n.properties.length&&!n.indexInfos.length){if(!n.callSignatures.length&&!n.constructSignatures.length)return r.approximateLength+=2,e.setEmitFlags(e.factory.createTypeLiteralNode(void 0),1);if(1===n.callSignatures.length&&!n.constructSignatures.length)return g(n.callSignatures[0],179,r);if(1===n.constructSignatures.length&&!n.callSignatures.length)return g(n.constructSignatures[0],180,r)}var i=e.filter(n.constructSignatures,(function(e){return!!(4&e.flags)}));if(e.some(i)){var a=e.map(i,Hl);return n.callSignatures.length+(n.constructSignatures.length-i.length)+n.indexInfos.length+(2048&r.flags?e.countWhere(n.properties,(function(e){return!(4194304&e.flags)})):e.length(n.properties))&&a.push(function(t){if(0===t.constructSignatures.length)return t;if(t.objectTypeWithoutAbstractConstructSignatures)return t.objectTypeWithoutAbstractConstructSignatures;var r=e.filter(t.constructSignatures,(function(e){return!(4&e.flags)}));if(t.constructSignatures===r)return t;var n=Na(t.symbol,t.members,t.callSignatures,e.some(r)?r:e.emptyArray,t.indexInfos);return t.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(n)),l(Td(a),r)}var o=r.flags;r.flags|=4194304;var c=function(t){if(s(r))return[e.factory.createPropertySignature(void 0,"...",void 0,void 0)];for(var n=[],i=0,a=t.callSignatures;i0){var h=(t.target.typeParameters||e.emptyArray).length;y=f(n.slice(S,h),r)}D=r.flags;r.flags|=16;var v=A(t.symbol,r,788968,y);return r.flags=D,c?G(c,v):v}if(n=e.sameMap(n,(function(e,r){return am(e,!!(2&t.target.elementFlags[r]))})),n.length>0){var b=_u(t),x=f(n.slice(0,b),r);if(x){if(t.target.labeledElementDeclarations)for(var S=0;S2)return[l(t[0],r),e.factory.createTypeReferenceNode("... ".concat(t.length-2," more ..."),void 0),l(t[t.length-1],r)]}for(var i=!(64&r.flags)?e.createUnderscoreEscapedMultiMap():void 0,a=[],o=0,c=0,u=t;c0)),a}function D(t,r){var n;return 524384&fC(t).flags&&(n=e.factory.createNodeArray(e.map(ps(t),(function(e){return h(e,r)})))),n}function C(t,r,n){var i;e.Debug.assert(t&&0<=r&&r1?N(l,l.length-1,1):void 0,_=i||C(l,0,r),p=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),f=e.getSourceFileOfModule(l[0]),m=void 0,g=void 0;if(e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Node16&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.NodeNext||(null==f?void 0:f.impliedNodeFormat)===e.ModuleKind.ESNext&&f.impliedNodeFormat!==(null==p?void 0:p.impliedNodeFormat)&&(m=E(l[0],r,e.ModuleKind.ESNext),g=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral("import"))]))),null===(o=(a=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===o||o.call(a)),m||(m=E(l[0],r)),!(67108864&r.flags)&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Classic&&m.indexOf("/node_modules/")>=0){var y=m;if(e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.NodeNext){var h=(null==p?void 0:p.impliedNodeFormat)===e.ModuleKind.ESNext?e.ModuleKind.CommonJS:e.ModuleKind.ESNext;(m=E(l[0],r,h)).indexOf("/node_modules/")>=0?m=y:(g=e.factory.createImportTypeAssertionContainer(e.factory.createAssertClause(e.factory.createNodeArray([e.factory.createAssertEntry(e.factory.createStringLiteral("resolution-mode"),e.factory.createStringLiteral(h===e.ModuleKind.ESNext?"import":"require"))]))),null===(c=(s=r.tracker).reportImportTypeNodeResolutionModeOverride)||void 0===c||c.call(s))}g||(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(y))}var v=e.factory.createLiteralTypeNode(e.factory.createStringLiteral(m));if(r.tracker.trackExternalModuleSymbolOfImportTypeNode&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l[0]),r.approximateLength+=m.length+10,!d||e.isEntityName(d)){if(d)(k=e.isIdentifier(d)?d:d.right).typeArguments=void 0;return e.factory.createImportTypeNode(v,g,d,_,u)}var b=T(d),S=b.objectType.typeName;return e.factory.createIndexedAccessTypeNode(e.factory.createImportTypeNode(v,g,S,_,u),b.indexType)}var D=N(l,l.length-1,0);if(e.isIndexedAccessTypeNode(D))return D;if(u)return e.factory.createTypeQueryNode(D);var k,A=(k=e.isIdentifier(D)?D:D.right).typeArguments;return k.typeArguments=void 0,e.factory.createTypeReferenceNode(D,A);function N(t,n,a){var o,s=n===t.length-1?i:C(t,n,r),c=t[n],l=t[n-1];if(0===n)r.flags|=16777216,o=io(c,r),r.approximateLength+=(o?o.length:0)+1,r.flags^=16777216;else if(l&&oa(l)){var u=oa(l);e.forEachEntry(u,(function(t,r){if(ga(t,c)&&!Gs(r)&&"export="!==r)return o=e.unescapeLeadingUnderscores(r),!0}))}if(void 0===o){var d=e.firstDefined(c.declarations,e.getNameOfDeclaration);if(d&&e.isComputedPropertyName(d)&&e.isEntityName(d.expression)){var _=N(t,n-1,a);return e.isEntityName(_)?e.factory.createIndexedAccessTypeNode(e.factory.createParenthesizedType(e.factory.createTypeQueryNode(_)),e.factory.createTypeQueryNode(d.expression)):_}o=io(c,r)}if(r.approximateLength+=o.length+1,!(16&r.flags)&&l&&$s(l)&&$s(l).get(c.escapedName)&&ga($s(l).get(c.escapedName),c)){_=N(t,n-1,a);return e.isIndexedAccessTypeNode(_)?e.factory.createIndexedAccessTypeNode(_,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o))):e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(_,s),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o)))}var p=e.setEmitFlags(e.factory.createIdentifier(o,s),16777216);if(p.symbol=c,n>a){_=N(t,n-1,a);return e.isEntityName(_)?e.factory.createQualifiedName(_,p):e.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable")}return p}}function N(e,t,r){var n=li(t.enclosingDeclaration,e,788968,void 0,e,!1);return!!n&&!(262144&n.flags&&n===r.symbol)}function w(t,r){var n,i;if(4&r.flags&&r.typeParameterNames){var a=r.typeParameterNames.get(ud(t));if(a)return a}var o=F(t.symbol,r,788968,!0);if(!(79&o.kind))return e.factory.createIdentifier("(Missing type parameter)");if(4&r.flags){for(var s=o.escapedText,c=(null===(n=r.typeParameterNamesByTextNextNameCount)||void 0===n?void 0:n.get(s))||0,l=s;(null===(i=r.typeParameterNamesByText)||void 0===i?void 0:i.has(l))||N(l,r,t);)c++,l="".concat(s,"_").concat(c);l!==s&&(o=e.factory.createIdentifier(l,o.typeArguments)),(r.typeParameterNamesByTextNextNameCount||(r.typeParameterNamesByTextNextNameCount=new e.Map)).set(s,c),(r.typeParameterNames||(r.typeParameterNames=new e.Map)).set(ud(t),o),(r.typeParameterNamesByText||(r.typeParameterNamesByText=new e.Set)).add(s)}return o}function F(t,r,n,i){var a=x(t,r,n);return!i||1===a.length||r.encounteredError||65536&r.flags||(r.encounteredError=!0),function t(n,i){var a=C(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=io(o,r);0===i&&(r.flags^=16777216);var c=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return c.symbol=o,i>0?e.factory.createQualifiedName(t(n,i-1),c):c}(a,a.length-1)}function P(t,r,n){var i=x(t,r,n);return function t(n,i){var a=C(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=io(o,r);0===i&&(r.flags^=16777216);var c=s.charCodeAt(0);if(e.isSingleOrDoubleQuote(c)&&e.some(o.declarations,Va))return e.factory.createStringLiteral(E(o,r));var l=35===c?s.length>1&&e.isIdentifierStart(s.charCodeAt(1),G):e.isIdentifierStart(c,G);if(0===i||l){var u=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return u.symbol=o,i>0?e.factory.createPropertyAccessExpression(t(n,i-1),u):u}91===c&&(s=s.substring(1,s.length-1),c=s.charCodeAt(0));var d=void 0;return!e.isSingleOrDoubleQuote(c)||8&o.flags?""+ +s===s&&(d=e.factory.createNumericLiteral(+s)):d=e.factory.createStringLiteral(e.stripQuotes(s).replace(/\\./g,(function(e){return e.substring(1)})),39===c),d||((d=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216)).symbol=o),e.factory.createElementAccessExpression(t(n,i-1),d)}(i,i.length-1)}function I(t){var r=e.getNameOfDeclaration(t);return!!r&&e.isStringLiteral(r)}function L(t){var r=e.getNameOfDeclaration(t);return!!(r&&e.isStringLiteral(r)&&(r.singleQuote||!e.nodeIsSynthesized(r)&&e.startsWith(e.getTextOfNode(r,!1),"'")))}function R(t,r){var n=!!e.length(t.declarations)&&e.every(t.declarations,L),i=function(t,r,n){var i=ri(t).nameType;if(i){if(384&i.flags){var a=""+i.value;return e.isIdentifierText(a,e.getEmitScriptTarget(z))||e.isNumericLiteralName(a)?e.isNumericLiteralName(a)&&e.startsWith(a,"-")?e.factory.createComputedPropertyName(e.factory.createNumericLiteral(+a)):e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(z)):e.factory.createStringLiteral(a,!!n)}if(8192&i.flags)return e.factory.createComputedPropertyName(P(i.symbol,r,111551))}}(t,r,n);if(i)return i;var a=e.unescapeLeadingUnderscores(t.escapedName),o=!!e.length(t.declarations)&&e.every(t.declarations,I);return e.createPropertyNameNodeForIdentifierOrLiteral(a,e.getEmitScriptTarget(z),n,o)}function B(t,r){return t.declarations&&e.find(t.declarations,(function(t){return!(!e.getEffectiveTypeAnnotationNode(t)||r&&!e.findAncestor(t,(function(e){return e===r})))}))}function J(t,r){return!(4&e.getObjectFlags(r))||!e.isTypeReferenceNode(t)||e.length(t.typeArguments)>=Al(r.target.typeParameters)}function j(t,r,n,i,a,o){if(!mo(r)&&i){var s=B(n,i);if(s&&!e.isFunctionLikeDeclaration(s)&&!e.isGetAccessorDeclaration(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(function(t,r,n){var i=J_(t);if(i===n)return!0;if(e.isParameter(r)&&r.questionToken)return Cg(n,524288)===i;return!1}(c,s,r)&&J(c,r)){var u=V(t,c,a,o);if(u)return u}}}var d=t.flags;8192&r.flags&&r.symbol===n&&(!t.enclosingDeclaration||e.some(n.declarations,(function(r){return e.getSourceFileOfNode(r)===e.getSourceFileOfNode(t.enclosingDeclaration)})))&&(t.flags|=1048576);var _=l(r,t);return t.flags=d,_}function U(t,r,n){var i,a,o=!1,s=e.getFirstIdentifier(t);if(e.isInJSFile(t)&&(e.isExportsIdentifier(s)||e.isModuleExportsAccessExpression(s.parent)||e.isQualifiedName(s.parent)&&e.isModuleIdentifier(s.parent.left)&&e.isExportsIdentifier(s.parent.right)))return{introducesError:o=!0,node:t};var c=Wi(s,67108863,!0,!0);if(c&&(0!==Ba(c,r.enclosingDeclaration,67108863,!1).accessibility?o=!0:(null===(a=null===(i=r.tracker)||void 0===i?void 0:i.trackSymbol)||void 0===a||a.call(i,c,r.enclosingDeclaration,67108863),null==n||n(c)),e.isIdentifier(t))){var l=Is(c),u=262144&c.flags&&!Oa(l.symbol,r.enclosingDeclaration)?w(l,r):e.factory.cloneNode(t);return u.symbol=c,{introducesError:o,node:e.setEmitFlags(e.setOriginalNode(u,t),16777216)}}return{introducesError:o,node:t}}function V(r,n,a,o){i&&i.throwIfCancellationRequested&&i.throwIfCancellationRequested();var s=!1,c=e.getSourceFileOfNode(n),u=e.visitNode(n,(function n(i){if(e.isJSDocAllType(i)||319===i.kind)return e.factory.createKeywordTypeNode(130);if(e.isJSDocUnknownType(i))return e.factory.createKeywordTypeNode(155);if(e.isJSDocNullableType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,n),e.factory.createLiteralTypeNode(e.factory.createNull())]);if(e.isJSDocOptionalType(i))return e.factory.createUnionTypeNode([e.visitNode(i.type,n),e.factory.createKeywordTypeNode(153)]);if(e.isJSDocNonNullableType(i))return e.visitNode(i.type,n);if(e.isJSDocVariadicType(i))return e.factory.createArrayTypeNode(e.visitNode(i.type,n));if(e.isJSDocTypeLiteral(i))return e.factory.createTypeLiteralNode(e.map(i.jsDocPropertyTags,(function(t){var a=e.isIdentifier(t.name)?t.name:t.name.right,o=po(J_(i),a.escapedText),s=o&&t.typeExpression&&J_(t.typeExpression.type)!==o?l(o,r):void 0;return e.factory.createPropertySignature(void 0,a,t.isBracketed||t.typeExpression&&e.isJSDocOptionalType(t.typeExpression.type)?e.factory.createToken(57):void 0,s||t.typeExpression&&e.visitNode(t.typeExpression.type,n)||e.factory.createKeywordTypeNode(130))})));if(e.isTypeReferenceNode(i)&&e.isIdentifier(i.typeName)&&""===i.typeName.escapedText)return e.setOriginalNode(e.factory.createKeywordTypeNode(130),i);if((e.isExpressionWithTypeArguments(i)||e.isTypeReferenceNode(i))&&e.isJSDocIndexSignature(i))return e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,e.visitNode(i.typeArguments[0],n))],e.visitNode(i.typeArguments[1],n))]);if(e.isJSDocFunctionType(i)){var u;return e.isJSDocConstructSignature(i)?e.factory.createConstructorTypeNode(i.modifiers,e.visitNodes(i.typeParameters,n),e.mapDefined(i.parameters,(function(t,r){return t.name&&e.isIdentifier(t.name)&&"new"===t.name.escapedText?void(u=t.type):e.factory.createParameterDeclaration(void 0,void 0,m(t),g(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(u||i.type,n)||e.factory.createKeywordTypeNode(130)):e.factory.createFunctionTypeNode(e.visitNodes(i.typeParameters,n),e.map(i.parameters,(function(t,r){return e.factory.createParameterDeclaration(void 0,void 0,m(t),g(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(i.type,n)||e.factory.createKeywordTypeNode(130))}if(e.isTypeReferenceNode(i)&&e.isInJSDoc(i)&&(!J(i,J_(i))||Eu(i)||Pe===hu(i,788968,!0)))return e.setOriginalNode(l(J_(i),r),i);if(e.isLiteralImportTypeNode(i)){var d=ni(i).resolvedSymbol;return!e.isInJSDoc(i)||!d||(i.isTypeOf||788968&d.flags)&&e.length(i.typeArguments)>=Al(ps(d))?e.factory.updateImportTypeNode(i,e.factory.updateLiteralTypeNode(i.argument,function(n,i){if(o){if(r.tracker&&r.tracker.moduleResolverHost){var a=KT(n);if(a){var s={getCanonicalFileName:e.createGetCanonicalFileName(!!t.useCaseSensitiveFileNames),getCurrentDirectory:function(){return r.tracker.moduleResolverHost.getCurrentDirectory()},getCommonSourceDirectory:function(){return r.tracker.moduleResolverHost.getCommonSourceDirectory()}},c=e.getResolvedExternalModuleName(s,a);return e.factory.createStringLiteral(c)}}}else if(r.tracker&&r.tracker.trackExternalModuleSymbolOfImportTypeNode){var l=Xi(i,i,void 0);l&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l)}return i}(i,i.argument.literal)),i.qualifier,e.visitNodes(i.typeArguments,n,e.isTypeNode),i.isTypeOf):e.setOriginalNode(l(J_(i),r),i)}if(e.isEntityName(i)||e.isEntityNameExpression(i)){var _=U(i,r,a),p=_.introducesError,f=_.node;if(s=s||p,f!==i)return f}c&&e.isTupleTypeNode(i)&&e.getLineAndCharacterOfPosition(c,i.pos).line===e.getLineAndCharacterOfPosition(c,i.end).line&&e.setEmitFlags(i,1);return e.visitEachChild(i,n,e.nullTransformationContext);function m(t){return t.dotDotDotToken||(t.type&&e.isJSDocVariadicType(t.type)?e.factory.createToken(25):void 0)}function g(t,r){return t.name&&e.isIdentifier(t.name)&&"this"===t.name.escapedText?"this":m(t)?"args":"arg".concat(r)}}));if(!s)return u===n?e.setTextRange(e.factory.cloneNode(n),n):u}}(),ce=e.createSymbolTable(),le=Wn(4,"undefined");le.declarations=[];var ue=Wn(1536,"globalThis",8);ue.exports=ce,ue.declarations=[],ce.set(ue.escapedName,ue);var de,_e=Wn(4,"arguments"),pe=Wn(4,"require"),fe={getNodeCount:function(){return e.sum(t.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(t.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(t.getSourceFiles(),"symbolCount")+x},getTypeCount:function(){return b},getInstantiationCount:function(){return T},getRelationCacheSizes:function(){return{assignable:Nn.size,identity:Fn.size,subtype:kn.size,strictSubtype:An.size}},isUndefinedSymbol:function(e){return e===le},isArgumentsSymbol:function(e){return e===_e},isUnknownSymbol:function(e){return e===Pe},getMergedSymbol:ua,getDiagnostics:qC,getGlobalDiagnostics:function(){return WC(),Dn.getGlobalDiagnostics()},getRecursionIdentity:hf,getUnmatchedProperties:Bm,getTypeOfSymbolAtLocation:function(t,r){var n=e.getParseTreeNode(r);return n?function(t,r){if(t=t.exportSymbol||t,(79===r.kind||80===r.kind)&&(e.isRightSideOfQualifiedNameOrPropertyAccess(r)&&(r=r.parent),e.isExpressionNode(r)&&(!e.isAssignmentTarget(r)||e.isWriteAccess(r)))){var n=aS(r);if(ya(ni(r).resolvedSymbol)===t)return n}if(e.isDeclarationName(r)&&e.isSetAccessor(r.parent)&&Ho(r.parent))return $o(r.parent.symbol);return os(t)}(t,n):Je},getTypeOfSymbol:as,getSymbolsOfParameterPropertyDeclaration:function(t,r){var n=e.getParseTreeNode(t,e.isParameter);return void 0===n?e.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):function(t,r){var n=t.parent,i=t.parent.parent,a=ai(n.locals,r,111551),o=ai($s(i.symbol),r,111551);if(a&&o)return[a,o];return e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,e.escapeLeadingUnderscores(r))},getDeclaredTypeOfSymbol:Is,getPropertiesOfType:Rc,getPropertyOfType:function(t,r){return cl(t,e.escapeLeadingUnderscores(r))},getPrivateIdentifierPropertyOfType:function(t,r,n){var i=e.getParseTreeNode(n);if(i){var a=sv(e.escapeLeadingUnderscores(r),i);return a?uv(t,a):void 0}},getTypeOfPropertyOfType:function(t,r){return po(t,e.escapeLeadingUnderscores(r))},getIndexInfoOfType:function(e,t){return gl(e,0===t?$e:Ye)},getIndexInfosOfType:ml,getSignaturesOfType:ul,getIndexTypeOfType:function(e,t){return yl(e,0===t?$e:Ye)},getIndexType:function(e){return Md(e)},getBaseTypes:xs,getBaseTypeOfLiteralType:Rf,getWidenedType:gm,getTypeFromTypeNode:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r?J_(r):Je},getParameterType:Qb,getParameterIdentifierNameAtPosition:function(e,t){var r;if(317===(null===(r=e.declaration)||void 0===r?void 0:r.kind))return;var n=e.parameters.length-(j(e)?1:0);if(t>",0,Le),Ir=tc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),Or=tc(void 0,void 0,void 0,e.emptyArray,Je,void 0,0,0),Mr=tc(void 0,void 0,void 0,e.emptyArray,Le,void 0,0,0),Lr=tc(void 0,void 0,void 0,e.emptyArray,ct,void 0,0,0),Rr=$l(Ye,$e,!0),Br=new e.Map,Jr={get yieldType(){return e.Debug.fail("Not supported")},get returnType(){return e.Debug.fail("Not supported")},get nextType(){return e.Debug.fail("Not supported")}},jr=FD(Le,Le,Le),Ur=FD(Le,Le,Ke),Vr=FD(st,Le,Ge),Kr={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return fr||(fr=Mu("AsyncIterator",3,e))||kt},getGlobalIterableType:function(e){return pr||(pr=Mu("AsyncIterable",1,e))||kt},getGlobalIterableIteratorType:function(e){return mr||(mr=Mu("AsyncIterableIterator",1,e))||kt},getGlobalGeneratorType:function(e){return gr||(gr=Mu("AsyncGenerator",3,e))||kt},resolveIterationType:RS,mustHaveANextMethodDiagnostic:e.Diagnostics.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},zr={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return cr||(cr=Mu("Iterator",3,e))||kt},getGlobalIterableType:zu,getGlobalIterableIteratorType:function(e){return lr||(lr=Mu("IterableIterator",1,e))||kt},getGlobalGeneratorType:function(e){return ur||(ur=Mu("Generator",3,e))||kt},resolveIterationType:function(e,t){return e},mustHaveANextMethodDiagnostic:e.Diagnostics.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Gr=new e.Map,qr=!1,Wr=new e.Map,Hr=0,Qr=0,Xr=0,$r=!1,Yr=0,Zr=F_(""),en=P_(0),tn=I_({negative:!1,base10Value:"0"}),rn=[],nn=[],an=[],on=0,sn=[],cn=[],ln=[],un=[],dn=[],_n=[],pn=[],fn=[],mn=[],gn=[],yn=[],hn=[],vn=[],bn=[],xn=[],Sn=[],Dn=e.createDiagnosticCollection(),Cn=e.createDiagnosticCollection(),Tn=new e.Map(e.getEntries({string:$e,number:Ye,bigint:Ze,boolean:it,symbol:at,undefined:Ge})),En=yd(e.arrayFrom(D.keys(),F_)),kn=new e.Map,An=new e.Map,Nn=new e.Map,wn=new e.Map,Fn=new e.Map,Pn=new e.Map,In=e.createSymbolTable();In.set(le.escapedName,le);var On=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===z.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(var r=0,n=t.getSourceFiles();r=5||e.some(o.relatedInformation,(function(t){return 0===e.compareDiagnostics(t,s)||0===e.compareDiagnostics(t,i)})))return"continue";e.addRelatedInfo(o,e.length(o.relatedInformation)?s:i)},c=0,l=i||e.emptyArray;c1)}function ri(e){if(33554432&e.flags)return e;var t=M(e);return cn[t]||(cn[t]=new P)}function ni(e){var t=O(e);return ln[t]||(ln[t]=new I)}function ii(t){return 305===t.kind&&!e.isExternalOrCommonJsModule(t)}function ai(t,r,n){if(n){var i=ua(t.get(r));if(i){if(e.Debug.assert(0==(1&e.getCheckFlags(i)),"Should never get an instantiated symbol here."),i.flags&n)return i;if(2097152&i.flags){var a=Ji(i);if(a===Pe||a.flags&n)return i}}}}function oi(r,n){var i=e.getSourceFileOfNode(r),a=e.getSourceFileOfNode(n),o=e.getEnclosingBlockScopeContainer(r);if(i!==a){if(q&&(i.externalModuleIndicator||a.externalModuleIndicator)||!e.outFile(z)||og(n)||16777216&r.flags)return!0;if(l(n,r))return!0;var s=t.getSourceFiles();return s.indexOf(i)<=s.indexOf(a)}if(r.pos<=n.pos&&(!e.isPropertyDeclaration(r)||!e.isThisProperty(n.parent)||r.initializer||r.exclamationToken)){if(203===r.kind){var c=e.getAncestor(n,203);return c?e.findAncestor(c,e.isBindingElement)!==e.findAncestor(r,e.isBindingElement)||r.pos=i&&c.pos<=a){var l=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);if(e.setParent(l.expression,l),e.setParent(l,c),l.flowNode=c.returnFlowNode,!(32768&Qf(my(l,r,Zf(r)))))return!0}}return!1}(a,as(da(r)),e.filter(r.parent.members,e.isClassStaticBlockDeclaration),r.parent.pos,n.pos))return!0}}else{if(!(167===r.kind&&!e.isStatic(r))||e.getContainingClass(t)!==e.getContainingClass(r))return!0}return!1}))}function u(t,r,n){if(r.end>t.end)return!1;var i=e.findAncestor(r,(function(r){if(r===t)return"quit";switch(r.kind){case 214:return!0;case 167:return!n||!(e.isPropertyDeclaration(t)&&r.parent===t.parent||e.isParameterPropertyDeclaration(t,t.parent)&&r.parent===t.parent.parent)||"quit";case 235:switch(r.parent.kind){case 172:case 169:case 173:return!0;default:return!1}default:return!1}}));return void 0===i}}function si(t,r,n){var i=e.getEmitScriptTarget(z),a=r;if(e.isParameter(n)&&a.body&&t.valueDeclaration&&t.valueDeclaration.pos>=a.body.pos&&t.valueDeclaration.end<=a.body.end&&i>=2){var o=ni(a);return void 0===o.declarationRequiresScopeChange&&(o.declarationRequiresScopeChange=e.forEach(a.parameters,(function(e){return s(e.name)||!!e.initializer&&s(e.initializer)}))||!1),!o.declarationRequiresScopeChange}return!1;function s(t){switch(t.kind){case 214:case 213:case 256:case 171:return!1;case 169:case 172:case 173:case 296:return s(t.name);case 167:return e.hasStaticModifier(t)?i<99||!W:s(t.name);default:return e.isNullishCoalesce(t)||e.isOptionalChain(t)?i<7:e.isBindingElement(t)&&t.dotDotDotToken&&e.isObjectBindingPattern(t.parent)?i<4:!e.isTypeNode(t)&&(e.forEachChild(t,s)||!1)}}}function ci(t){return e.isAssertionExpression(t)&&e.isConstTypeReference(t.type)||e.isJSDocTypeTag(t)&&e.isConstTypeReference(t.typeExpression)}function li(e,t,r,n,i,a,o,s){return void 0===o&&(o=!1),void 0===s&&(s=!0),ui(e,t,r,n,i,a,o,s,ai)}function ui(t,r,n,i,a,o,s,c,l){var u,d,_,p,f,m,y,h,v,b=t,x=!1,S=t,D=!1;e:for(;t;){if("const"===r&&ci(t))return;if(t.locals&&!ii(t)&&(p=l(t.locals,r,n))){var C=!0;if(e.isFunctionLike(t)&&f&&f!==t.body?(n&p.flags&788968&&320!==f.kind&&(C=!!(262144&p.flags)&&(f===t.type||164===f.kind||340===f.kind||341===f.kind||163===f.kind)),n&p.flags&3&&(si(p,t,f)?C=!1:1&p.flags&&(C=164===f.kind||f===t.type&&!!e.findAncestor(p.valueDeclaration,e.isParameter)))):189===t.kind&&(C=f===t.trueType),C)break e;p=void 0}switch(x=x||_i(t,f),t.kind){case 305:if(!e.isExternalOrCommonJsModule(t))break;D=!0;case 261:var T=(null===(u=da(t))||void 0===u?void 0:u.exports)||V;if(305===t.kind||e.isModuleDeclaration(t)&&16777216&t.flags&&!e.isGlobalScopeAugmentation(t)){if(p=T.get("default")){var E=e.getLocalSymbolForExportDefault(p);if(E&&p.flags&n&&E.escapedName===r)break e;p=void 0}var k=T.get(r);if(k&&2097152===k.flags&&(e.getDeclarationOfKind(k,275)||e.getDeclarationOfKind(k,274)))break}if("default"!==r&&(p=l(T,r,2623475&n))){if(!e.isSourceFile(t)||!t.commonJsModuleIndicator||(null===(d=p.declarations)||void 0===d?void 0:d.some(e.isJSDocTypeAlias)))break e;p=void 0}break;case 260:if(p=l((null===(_=da(t))||void 0===_?void 0:_.exports)||V,r,8&n))break e;break;case 167:if(!e.isStatic(t)){var A=va(t.parent);A&&A.locals&&l(A.locals,r,111551&n)&&(y=t)}break;case 257:case 226:case 258:if(p=l(da(t).members||V,r,788968&n)){if(!mi(p,t)){p=void 0;break}if(f&&e.isStatic(f))return void jn(S,e.Diagnostics.Static_members_cannot_reference_class_type_parameters);break e}if(226===t.kind&&32&n){var N=t.name;if(N&&r===N.escapedText){p=t.symbol;break e}}break;case 228:if(f===t.expression&&94===t.parent.token){var w=t.parent.parent;if(e.isClassLike(w)&&(p=l(da(w).members,r,788968&n)))return void(i&&jn(S,e.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters))}break;case 162:if(v=t.parent.parent,(e.isClassLike(v)||258===v.kind)&&(p=l(da(v).members,r,788968&n)))return void jn(S,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);break;case 214:if(e.getEmitScriptTarget(z)>=2)break;case 169:case 171:case 172:case 173:case 256:if(3&n&&"arguments"===r){p=_e;break e}break;case 213:if(3&n&&"arguments"===r){p=_e;break e}if(16&n){var F=t.name;if(F&&r===F.escapedText){p=t.symbol;break e}}break;case 165:t.parent&&164===t.parent.kind&&(t=t.parent),t.parent&&(e.isClassElement(t.parent)||257===t.parent.kind)&&(t=t.parent);break;case 345:case 338:case 339:var P=e.getJSDocRoot(t);P&&(t=P.parent);break;case 164:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&(h||(h=t));break;case 203:f&&(f===t.initializer||f===t.name&&e.isBindingPattern(f))&&e.isParameterDeclaration(t)&&!h&&(h=t);break;case 190:if(262144&n){var I=t.typeParameter.name;if(I&&r===I.escapedText){p=t.typeParameter.symbol;break e}}}pi(t)&&(m=t),f=t,t=e.isJSDocTemplateTag(t)?e.getEffectiveContainerForJSDocTemplateTag(t)||t.parent:(e.isJSDocParameterTag(t)||e.isJSDocReturnTag(t))&&e.getHostSignatureFromJSDoc(t)||t.parent}if(!o||!p||m&&p===m.symbol||(p.isReferenced|=n),!p){if(f&&(e.Debug.assert(305===f.kind),f.commonJsModuleIndicator&&"exports"===r&&n&f.symbol.flags))return f.symbol;s||(p=l(ce,r,n))}if(!p&&b&&e.isInJSFile(b)&&b.parent&&e.isRequireCall(b.parent,!1))return pe;if(p){if(!y||99===e.getEmitScriptTarget(z)&&W)return i&&g((function(){if(S&&(2&n||(32&n||384&n)&&111551==(111551&n))){var t=ya(p);(2&t.flags||32&t.flags||384&t.flags)&&function(t,r){var n;if(e.Debug.assert(!!(2&t.flags||32&t.flags||384&t.flags)),67108881&t.flags&&32&t.flags)return;var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isBlockOrCatchScoped(t)||e.isClassLike(t)||260===t.kind}));if(void 0===i)return e.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(16777216&i.flags||oi(i,r))){var a=void 0,o=e.declarationNameToString(e.getNameOfDeclaration(i));2&t.flags?a=jn(r,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,o):32&t.flags?a=jn(r,e.Diagnostics.Class_0_used_before_its_declaration,o):256&t.flags?a=jn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o):(e.Debug.assert(!!(128&t.flags)),e.shouldPreserveConstEnums(z)&&(a=jn(r,e.Diagnostics.Enum_0_used_before_its_declaration,o))),a&&e.addRelatedInfo(a,e.createDiagnosticForNode(i,e.Diagnostics._0_is_declared_here,o))}}(t,S)}if(p&&D&&111551==(111551&n)&&!(8388608&b.flags)){var i=ua(p);e.length(i.declarations)&&e.every(i.declarations,(function(t){return e.isNamespaceExportDeclaration(t)||e.isSourceFile(t)&&!!t.symbol.globalExports}))&&Vn(!z.allowUmdGlobalAccess,S,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,e.unescapeLeadingUnderscores(r))}if(p&&h&&!x&&111551==(111551&n)){var a=ua(Ys(p)),o=e.getRootDeclaration(h);a===da(h)?jn(S,e.Diagnostics.Parameter_0_cannot_reference_itself,e.declarationNameToString(h.name)):a.valueDeclaration&&a.valueDeclaration.pos>h.pos&&o.parent.locals&&l(o.parent.locals,a.escapedName,n)===a&&jn(S,e.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it,e.declarationNameToString(h.name),e.declarationNameToString(S))}if(p&&S&&111551&n&&2097152&p.flags&&!(111551&p.flags)&&!e.isValidTypeOnlyAliasUseSite(S)){var s=Vi(p);if(s){var c=275===s.kind?e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,u=e.unescapeLeadingUnderscores(r);di(jn(S,c,u),s,u)}}})),p;var O=y.name;jn(S,e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(O),fi(a))}else i&&g((function(){if(!(S&&(function(t,r,n){if(!e.isIdentifier(t)||t.escapedText!==r||XC(t)||og(t))return!1;var i=e.getThisContainer(t,!1),a=i;for(;a;){if(e.isClassLike(a.parent)){var o=da(a.parent);if(!o)break;if(cl(as(o),r))return jn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,fi(n),Ga(o)),!0;if(a===i&&!e.isStatic(a))if(cl(Is(o).thisType,r))return jn(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,fi(n)),!0}a=a.parent}return!1}(S,r,a)||gi(S)||function(t,r,n){var i=1920|(e.isInJSFile(t)?111551:0);if(n===i){var a=Bi(li(t,r,788968&~i,void 0,void 0,!1)),o=t.parent;if(a){if(e.isQualifiedName(o)){e.Debug.assert(o.left===t,"Should only be resolving left side of qualified name as a namespace");var s=o.right.escapedText;if(cl(Is(a),s))return jn(o,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,e.unescapeLeadingUnderscores(r),e.unescapeLeadingUnderscores(s)),!0}return jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,e.unescapeLeadingUnderscores(r)),!0}}return!1}(S,r,n)||function(t,r){if(hi(r)&&275===t.parent.kind)return jn(t,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,r),!0;return!1}(S,r)||function(t,r,n){if(111551&n){if(hi(r))return jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,e.unescapeLeadingUnderscores(r)),!0;var i=Bi(li(t,r,788544,void 0,void 0,!1));if(i&&!(1024&i.flags)){var a=e.unescapeLeadingUnderscores(r);return!function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return!0}return!1}(r)?!function(t,r){var n=e.findAncestor(t.parent,(function(t){return!e.isComputedPropertyName(t)&&!e.isPropertySignature(t)&&(e.isTypeLiteralNode(t)||"quit")}));if(n&&1===n.members.length){var i=Is(r);return!!(1048576&i.flags)&&Fx(i,384,!0)}return!1}(t,i)?jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,a):jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,a,"K"===a?"P":"K"):jn(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,a),!0}}return!1}(S,r,n)||function(t,r,n){if(111127&n){if(Bi(li(t,r,1024,void 0,void 0,!1)))return jn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_value,e.unescapeLeadingUnderscores(r)),!0}else if(788544&n){if(Bi(li(t,r,1536,void 0,void 0,!1)))return jn(t,e.Diagnostics.Cannot_use_namespace_0_as_a_type,e.unescapeLeadingUnderscores(r)),!0}return!1}(S,r,n)||function(t,r,n){if(788584&n){var i=Bi(li(t,r,111127,void 0,void 0,!1));if(i&&!(1920&i.flags))return jn(t,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.unescapeLeadingUnderscores(r)),!0}return!1}(S,r,n)))){var t=void 0;if(c&&on<10)if((null==(t=Dv(b,r,n))?void 0:t.valueDeclaration)&&e.isAmbientModule(t.valueDeclaration)&&e.isGlobalScopeAugmentation(t.valueDeclaration)&&(t=void 0),t){var o=Ga(t),s=pv(b,t,!1),l=1920===n||a&&"string"!=typeof a&&e.nodeIsSynthesized(a)?e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1:s?e.Diagnostics.Could_not_find_name_0_Did_you_mean_1:e.Diagnostics.Cannot_find_name_0_Did_you_mean_1,u=Jn(S,l,fi(a),o);Un(!s,u),t.valueDeclaration&&e.addRelatedInfo(u,e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_is_declared_here,o))}if(!t&&a){var d=function(t){for(var r=fi(t),n=e.getScriptTargetFeatures(),i=e.getOwnKeys(n),a=0,o=i;a=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop",d=i.exports.get("export=").valueDeclaration,_=jn(t.name,e.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag,Ga(i),u);d&&e.addRelatedInfo(_,e.createDiagnosticForNode(d,e.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,u))}else!function(t,r){var n,i,a;if(null===(n=t.exports)||void 0===n?void 0:n.has(r.symbol.escapedName))jn(r.name,e.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,Ga(t),Ga(r.symbol));else{var o=jn(r.name,e.Diagnostics.Module_0_has_no_default_export,Ga(t)),s=null===(i=t.exports)||void 0===i?void 0:i.get("__export");if(s){var c=null===(a=s.declarations)||void 0===a?void 0:a.find((function(t){var r,n;return!!(e.isExportDeclaration(t)&&t.moduleSpecifier&&(null===(n=null===(r=Qi(t,t.moduleSpecifier))||void 0===r?void 0:r.exports)||void 0===n?void 0:n.has("default")))}));c&&e.addRelatedInfo(o,e.createDiagnosticForNode(c,e.Diagnostics.export_Asterisk_does_not_re_export_a_default))}}}(i,t);return ji(t,a,void 0,!1),a}}function Pi(t,n,i){var a,o;void 0===i&&(i=!1);var s=e.getExternalModuleRequireArgument(t)||t.moduleSpecifier,c=Qi(t,s),l=!e.isPropertyAccessExpression(n)&&n.propertyName||n.name;if(e.isIdentifier(l)){var u=ea(c,s,!1,"default"===l.escapedText&&!(!z.allowSyntheticDefaultImports&&!e.getESModuleInterop(z)));if(u&&l.escapedText){if(e.isShorthandAmbientModuleSymbol(c))return c;var d=void 0;d=c&&c.exports&&c.exports.get("export=")?cl(as(u),l.escapedText,!0):function(e,t){if(3&e.flags){var r=e.valueDeclaration.type;if(r)return Bi(cl(J_(r),t))}}(u,l.escapedText),d=Bi(d,i);var _=function(e,t,r,n){if(1536&e.flags){var i=oa(e).get(t.escapedText),a=Bi(i,n);return ji(r,i,a,!1),a}}(u,l,n,i);if(void 0===_&&"default"===l.escapedText){var p=null===(a=c.declarations)||void 0===a?void 0:a.find(e.isSourceFile);(Ni(s)||wi(p,c,i,s))&&(_=Zi(c,i)||Bi(c,i))}var f=_&&d&&_!==d?function(t,r){if(t===Pe&&r===Pe)return Pe;if(790504&t.flags)return t;var n=Wn(t.flags|r.flags,t.escapedName);return n.declarations=e.deduplicate(e.concatenate(t.declarations,r.declarations),e.equateValues),n.parent=t.parent||r.parent,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),r.members&&(n.members=new e.Map(r.members)),t.exports&&(n.exports=new e.Map(t.exports)),n}(d,_):_||d;if(!f){var m=qi(c,t),g=e.declarationNameToString(l),y=Cv(l,u);if(void 0!==y){var h=Ga(y),v=jn(l,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,m,g,h);y.valueDeclaration&&e.addRelatedInfo(v,e.createDiagnosticForNode(y.valueDeclaration,e.Diagnostics._0_is_declared_here,h))}else(null===(o=c.exports)||void 0===o?void 0:o.has("default"))?jn(l,e.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,m,g):function(t,n,i,a,o){var s,c,l=null===(c=null===(s=a.valueDeclaration)||void 0===s?void 0:s.locals)||void 0===c?void 0:c.get(n.escapedText),u=a.exports;if(l){var d=null==u?void 0:u.get("export=");if(d)ga(d,l)?function(t,r,n,i){if(q>=e.ModuleKind.ES2015){jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n)}else{if(e.isInJSFile(t))jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n);else jn(r,e.getESModuleInterop(z)?e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,i)}}(t,n,i,o):jn(n,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);else{var _=u?e.find(Sl(u),(function(e){return!!ga(e,l)})):void 0,p=_?jn(n,e.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2,o,i,Ga(_)):jn(n,e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported,o,i);l.declarations&&e.addRelatedInfo.apply(void 0,r([p],e.map(l.declarations,(function(t,r){return e.createDiagnosticForNode(t,0===r?e.Diagnostics._0_is_declared_here:e.Diagnostics.and_here,i)})),!1))}}else jn(n,e.Diagnostics.Module_0_has_no_exported_member_1,o,i)}(t,l,g,c,m)}return f}}}function Ii(t){if(e.isVariableDeclaration(t)&&t.initializer&&e.isPropertyAccessExpression(t.initializer))return t.initializer}function Oi(e,t,r){var n=e.parent.parent.moduleSpecifier?Pi(e.parent.parent,e,r):Wi(e.propertyName||e.name,t,!1,r);return ji(e,void 0,n,!1),n}function Mi(t,r){if(e.isClassExpression(t))return zx(t).symbol;if(e.isEntityName(t)||e.isEntityNameExpression(t)){var n=Wi(t,901119,!0,r);return n||(zx(t),ni(t).resolvedSymbol)}}function Li(t,r){switch(void 0===r&&(r=!1),t.kind){case 265:case 254:return Ci(t,r);case 267:return Fi(t,r);case 268:return function(e,t){var r=e.parent.parent.moduleSpecifier,n=Qi(e,r),i=ea(n,r,t,!1);return ji(e,n,i,!1),i}(t,r);case 274:return function(e,t){var r=e.parent.moduleSpecifier,n=r&&Qi(e,r),i=r&&ea(n,r,t,!1);return ji(e,n,i,!1),i}(t,r);case 270:case 203:return function(t,r){var n=e.isBindingElement(t)?e.getRootDeclaration(t):t.parent.parent.parent,i=Ii(n),a=Pi(n,i||t,r),o=t.propertyName||t.name;return i&&a&&e.isIdentifier(o)?Bi(cl(as(a),o.escapedText),r):(ji(t,void 0,a,!1),a)}(t,r);case 275:return Oi(t,901119,r);case 271:case 221:return function(t,r){var n=Mi(e.isExportAssignment(t)?t.expression:t.right,r);return ji(t,void 0,n,!1),n}(t,r);case 264:return function(e,t){var r=Zi(e.parent.symbol,t);return ji(e,void 0,r,!1),r}(t,r);case 297:return Wi(t.name,901119,!0,r);case 296:return function(e,t){return Mi(e.initializer,t)}(t,r);case 207:case 206:return function(t,r){if(e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind)return Mi(t.parent.right,r)}(t,r);default:return e.Debug.fail()}}function Ri(e,t){return void 0===t&&(t=901119),!!e&&(2097152==(e.flags&(2097152|t))||!!(2097152&e.flags&&67108864&e.flags))}function Bi(e,t){return!t&&Ri(e)?Ji(e):e}function Ji(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=ri(t);if(r.aliasTarget)r.aliasTarget===Ie&&(r.aliasTarget=Pe);else{r.aliasTarget=Ie;var n=xi(t);if(!n)return e.Debug.fail();var i=Li(n);r.aliasTarget===Ie?r.aliasTarget=i||Pe:jn(n,e.Diagnostics.Circular_definition_of_import_alias_0,Ga(t))}return r.aliasTarget}function ji(t,r,n,i){if(!t||e.isPropertyAccessExpression(t))return!1;var a=da(t);if(e.isTypeOnlyImportOrExportDeclaration(t))return ri(a).typeOnlyDeclaration=t,!0;var o=ri(a);return Ui(o,r,i)||Ui(o,n,i)}function Ui(t,r,n){var i,a,o;if(r&&(void 0===t.typeOnlyDeclaration||n&&!1===t.typeOnlyDeclaration)){var s=null!==(a=null===(i=r.exports)||void 0===i?void 0:i.get("export="))&&void 0!==a?a:r,c=s.declarations&&e.find(s.declarations,e.isTypeOnlyImportOrExportDeclaration);t.typeOnlyDeclaration=null!==(o=null!=c?c:ri(s).typeOnlyDeclaration)&&void 0!==o&&o}return!!t.typeOnlyDeclaration}function Vi(e){if(2097152&e.flags)return ri(e).typeOnlyDeclaration||void 0}function Ki(e){var t=da(e),r=Ji(t);r&&((r===Pe||111551&r.flags&&!bT(r)&&!Vi(t))&&zi(t))}function zi(t){var r=ri(t);if(!r.referenced){r.referenced=!0;var n=xi(t);if(!n)return e.Debug.fail();if(e.isInternalModuleImportEqualsDeclaration(n)){var i=Bi(t);(i===Pe||111551&i.flags)&&zx(n.moduleReference)}}}function Gi(t,r){return 79===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),79===t.kind||161===t.parent.kind?Wi(t,1920,!1,r):(e.Debug.assert(265===t.parent.kind),Wi(t,901119,!1,r))}function qi(e,t){return e.parent?qi(e.parent,t)+"."+Ga(e):Ga(e,t,void 0,20)}function Wi(t,r,n,i,a){if(!e.nodeIsMissing(t)){var o,s=1920|(e.isInJSFile(t)?111551&r:0);if(79===t.kind){var c=r===s||e.nodeIsSynthesized(t)?e.Diagnostics.Cannot_find_namespace_0:ig(e.getFirstIdentifier(t)),l=e.isInJSFile(t)&&!e.nodeIsSynthesized(t)?function(t,r){if(Cu(t.parent)){var n=function(t){var r=e.findAncestor(t,(function(t){return e.isJSDocNode(t)||8388608&t.flags?e.isJSDocTypeAlias(t):"quit"}));if(r)return;var n=e.getJSDocHost(t);if(n&&e.isExpressionStatement(n)&&e.isPrototypePropertyAssignment(n.expression)){if(a=da(n.expression.left))return Hi(a)}if(n&&e.isFunctionExpression(n)&&e.isPrototypePropertyAssignment(n.parent)&&e.isExpressionStatement(n.parent.parent)){if(a=da(n.parent.left))return Hi(a)}if(n&&(e.isObjectLiteralMethod(n)||e.isPropertyAssignment(n))&&e.isBinaryExpression(n.parent.parent)&&6===e.getAssignmentDeclarationKind(n.parent.parent)){if(a=da(n.parent.parent.left))return Hi(a)}var i=e.getEffectiveJSDocHost(t);if(i&&e.isFunctionLike(i)){var a;return(a=da(i))&&a.valueDeclaration}}(t.parent);if(n)return li(n,t.escapedText,r,void 0,t,!0)}}(t,r):void 0;if(!(o=ua(li(a||t,t.escapedText,r,n||l?void 0:c,t,!0,!1))))return ua(l)}else{if(161!==t.kind&&206!==t.kind)throw e.Debug.assertNever(t,"Unknown entity name kind.");var u=161===t.kind?t.left:t.expression,d=161===t.kind?t.right:t.name,_=Wi(u,s,n,!1,a);if(!_||e.nodeIsMissing(d))return;if(_===Pe)return _;if(_.valueDeclaration&&e.isInJSFile(_.valueDeclaration)&&e.isVariableDeclaration(_.valueDeclaration)&&_.valueDeclaration.initializer&&Ob(_.valueDeclaration.initializer)){var p=_.valueDeclaration.initializer.arguments[0],f=Qi(p,p);if(f){var m=Zi(f);m&&(_=m)}}if(!(o=ua(ai(oa(_),d.escapedText,r)))){if(!n){var g=qi(_),y=e.declarationNameToString(d),h=Cv(d,_);if(h)return void jn(d,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,g,y,Ga(h));var v=e.isQualifiedName(t)&&function(t){for(;e.isQualifiedName(t.parent);)t=t.parent;return t}(t),b=Bt&&788968&r&&v&&!e.isTypeOfExpression(v.parent)&&function(t){var r=e.getFirstIdentifier(t),n=li(r,r.escapedText,111551,void 0,r,!0);if(n){for(;e.isQualifiedName(r.parent);){if(!(n=cl(as(n),r.parent.right.escapedText)))return;r=r.parent}return n}}(v);if(b)return void jn(v,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.entityNameToString(v));if(1920&r&&e.isQualifiedName(t.parent)){var x=ua(ai(oa(_),d.escapedText,788968));if(x)return void jn(t.parent.right,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,Ga(x),e.unescapeLeadingUnderscores(t.parent.right.escapedText))}jn(d,e.Diagnostics.Namespace_0_has_no_exported_member_1,g,y)}return}}return e.Debug.assert(0==(1&e.getCheckFlags(o)),"Should never get an instantiated symbol here."),!e.nodeIsSynthesized(t)&&e.isEntityName(t)&&(2097152&o.flags||271===t.parent.kind)&&ji(e.getAliasDeclarationFromName(t),o,void 0,!0),o.flags&r||i?o:Ji(o)}}function Hi(t){var r=t.parent.valueDeclaration;if(r)return(e.isAssignmentDeclaration(r)?e.getAssignedExpandoInitializer(r):e.hasOnlyExpressionInitializer(r)?e.getDeclaredExpandoInitializer(r):void 0)||r}function Qi(t,r,n){var i=e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;return Xi(t,r,n?void 0:i)}function Xi(t,r,n,i){return void 0===i&&(i=!1),e.isStringLiteralLike(r)?$i(t,r.text,n,r,i):void 0}function $i(r,n,i,a,o){var s,c,l,u,d,_,p,f;(void 0===o&&(o=!1),e.startsWith(n,"@types/"))&&jn(a,P=e.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,e.removePrefix(n,"@types/"),n);var m=Cl(n,!0);if(m)return m;var g=e.getSourceFileOfNode(r),y=e.isStringLiteralLike(r)?r:(null===(s=e.findAncestor(r,e.isImportCall))||void 0===s?void 0:s.arguments[0])||(null===(c=e.findAncestor(r,e.isImportDeclaration))||void 0===c?void 0:c.moduleSpecifier)||(null===(l=e.findAncestor(r,e.isExternalModuleImportEqualsDeclaration))||void 0===l?void 0:l.moduleReference.expression)||(null===(u=e.findAncestor(r,e.isExportDeclaration))||void 0===u?void 0:u.moduleSpecifier)||(null===(d=e.isModuleDeclaration(r)?r:r.parent&&e.isModuleDeclaration(r.parent)&&r.parent.name===r?r.parent:void 0)||void 0===d?void 0:d.name)||(null===(_=e.isLiteralImportTypeNode(r)?r:void 0)||void 0===_?void 0:_.argument.literal),h=y&&e.isStringLiteralLike(y)?e.getModeForUsageLocation(g,y):g.impliedNodeFormat,v=e.getResolvedModule(g,n,h),b=v&&e.getResolutionDiagnostic(z,v),x=v&&(!b||b===e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)&&t.getSourceFile(v.resolvedFileName);if(x){if(b&&jn(a,b,n,v.resolvedFileName),x.symbol){if(v.isExternalLibraryImport&&!e.resolutionExtensionIsTSOrJson(v.extension)&&Yi(!1,a,v,n),e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.NodeNext){var S=g.impliedNodeFormat===e.ModuleKind.CommonJS&&!e.findAncestor(r,e.isImportCall)||!!e.findAncestor(r,e.isImportEqualsDeclaration),D=e.findAncestor(r,(function(t){return e.isImportTypeNode(t)||e.isExportDeclaration(t)||e.isImportDeclaration(t)})),C=D&&e.isImportTypeNode(D)?null===(p=D.assertions)||void 0===p?void 0:p.assertClause:null==D?void 0:D.assertClause;S&&x.impliedNodeFormat===e.ModuleKind.ESNext&&!e.getResolutionModeOverrideForClause(C)&&jn(a,e.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead,n)}return ua(x.symbol)}i&&jn(a,e.Diagnostics.File_0_is_not_a_module,x.fileName)}else{if(Lt){var T=e.findBestPatternMatch(Lt,(function(e){return e.pattern}),n);if(T){var E=Rt&&Rt.get(n);return ua(E?E:T.symbol)}}if(v&&!e.resolutionExtensionIsTSOrJson(v.extension)&&void 0===b||b===e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type)o?jn(a,P=e.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,v.resolvedFileName):Yi(Z&&!!i,a,v,n);else if(i){if(v){var k=t.getProjectReferenceRedirect(v.resolvedFileName);if(k)return void jn(a,e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,k,v.resolvedFileName)}if(b)jn(a,b,n,v.resolvedFileName);else{var A=e.tryExtractTSExtension(n),N=e.pathIsRelative(n)&&!e.hasExtension(n),w=e.getEmitModuleResolutionKind(z),F=w===e.ModuleResolutionKind.Node16||w===e.ModuleResolutionKind.NodeNext;if(A){var P=e.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead,I=e.removeExtension(n,A);q>=e.ModuleKind.ES2015&&(I+=".mts"===A?".mjs":".cts"===A?".cjs":".js"),jn(a,P,A,I)}else if(!z.resolveJsonModule&&e.fileExtensionIs(n,".json")&&e.getEmitModuleResolutionKind(z)!==e.ModuleResolutionKind.Classic&&e.hasJsonModuleEmitEnabled(z))jn(a,e.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(h===e.ModuleKind.ESNext&&F&&N){var O=e.getNormalizedAbsolutePath(n,e.getDirectoryPath(g.path)),M=null===(f=On.find((function(e){var r=e[0];return e[1],t.fileExists(O+r)})))||void 0===f?void 0:f[1];M?jn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0,n+M):jn(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path)}else jn(a,i,n)}}}}function Yi(t,r,n,i){var a,o=n.packageId,s=n.resolvedFileName,c=!e.isExternalModuleNameRelative(i)&&o?(a=o.name,f().has(e.getTypesPackageName(a))?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,o.name,e.mangleScopedPackageName(o.name)):function(e){return!!f().get(e)}(o.name)?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,o.name,i):e.chainDiagnosticMessages(void 0,e.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,i,e.mangleScopedPackageName(o.name))):void 0;Vn(t,r,e.chainDiagnosticMessages(c,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,i,s))}function Zi(t,r){if(null==t?void 0:t.exports){var n=function(t,r){if(!t||t===Pe||t===r||1===r.exports.size||2097152&t.flags)return t;var n=ri(t);if(n.cjsExportMerged)return n.cjsExportMerged;var i=33554432&t.flags?t:Xn(t);i.flags=512|i.flags,void 0===i.exports&&(i.exports=e.createSymbolTable());return r.exports.forEach((function(e,t){"export="!==t&&i.exports.set(t,i.exports.has(t)?$n(i.exports.get(t),e):e)})),ri(i).cjsExportMerged=i,n.cjsExportMerged=i}(ua(Bi(t.exports.get("export="),r)),ua(t));return ua(n)||t}}function ea(t,r,n,i){var a,o=Zi(t,n);if(!n&&o){if(!(i||1539&o.flags||e.getDeclarationOfKind(o,305))){var s=q>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop";return jn(r,e.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,s),o}var c=r.parent;if(e.isImportDeclaration(c)&&e.getNamespaceDeclarationNode(c)||e.isImportCall(c)){var l=e.isImportCall(c)?c.arguments[0]:c.moduleSpecifier,u=as(o),d=Pb(u,o,t,l);if(d)return ta(o,d,c);var _=null===(a=null==t?void 0:t.declarations)||void 0===a?void 0:a.find(e.isSourceFile),p=_&&Ai(ki(l),_.impliedNodeFormat);if(e.getESModuleInterop(z)||p){var f=ll(u,0);if(f&&f.length||(f=ll(u,1)),f&&f.length||cl(u,"default",!0)||p)return ta(o,Ib(u,o,t,l),c)}}}return o}function ta(t,r,n){var i=Wn(t.flags,t.escapedName);i.declarations=t.declarations?t.declarations.slice():[],i.parent=t.parent,i.target=t,i.originatingImport=n,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(i.constEnumOnlyModule=!0),t.members&&(i.members=new e.Map(t.members)),t.exports&&(i.exports=new e.Map(t.exports));var a=Ic(r);return i.type=Na(i,a.members,e.emptyArray,e.emptyArray,a.indexInfos),i}function ra(e){return void 0!==e.exports.get("export=")}function na(e){return Sl(sa(e))}function ia(e,t){var r=sa(t);if(r)return r.get(e)}function aa(t){return!(131068&t.flags||1&e.getObjectFlags(t)||Sf(t)||Vf(t))}function oa(e){return 6256&e.flags?Xs(e,"resolvedExports"):1536&e.flags?sa(e):e.exports||V}function sa(e){var t=ri(e);return t.resolvedExports||(t.resolvedExports=la(e))}function ca(t,r,n,i){r&&r.forEach((function(r,a){if("default"!==a){var o=t.get(a);if(o){if(n&&i&&o&&Bi(o)!==Bi(r)){var s=n.get(a);s.exportsWithDuplicate?s.exportsWithDuplicate.push(i):s.exportsWithDuplicate=[i]}}else t.set(a,r),n&&i&&n.set(a,{specifierText:e.getTextOfNode(i.moduleSpecifier)})}}))}function la(t){var r=[];return function t(n){if(!(n&&n.exports&&e.pushIfUnique(r,n)))return;var i=new e.Map(n.exports),a=n.exports.get("__export");if(a){var o=e.createSymbolTable(),s=new e.Map;if(a.declarations)for(var c=0,l=a.declarations;c=d?u.substr(0,d-"...".length)+"...":u}function Ha(e,t){var r=Xa(e.symbol)?Wa(e,e.symbol.valueDeclaration):Wa(e),n=Xa(t.symbol)?Wa(t,t.symbol.valueDeclaration):Wa(t);return r===n&&(r=Qa(e),n=Qa(t)),[r,n]}function Qa(e){return Wa(e,void 0,64)}function Xa(t){return t&&!!t.valueDeclaration&&e.isExpression(t.valueDeclaration)&&!mp(t.valueDeclaration)}function $a(e){return void 0===e&&(e=0),814775659&e}function Ya(t){return!!(t.symbol&&32&t.symbol.flags&&(t===Cs(t.symbol)||524288&t.flags&&16777216&e.getObjectFlags(t)))}function Za(t,r,n,i){return void 0===n&&(n=16384),i?a(i).getText():e.usingSingleLineStringWriter(a);function a(i){var a=e.factory.createTypePredicateNode(2===t.kind||3===t.kind?e.factory.createToken(128):void 0,1===t.kind||3===t.kind?e.factory.createIdentifier(t.parameterName):e.factory.createThisTypeNode(),t.type&&se.typeToTypeNode(t.type,r,70222336|$a(n))),o=e.createPrinter({removeComments:!0}),s=r&&e.getSourceFileOfNode(r);return o.writeNode(4,a,s,i),i}}function eo(e){return 8===e?"private":16===e?"protected":"public"}function to(t){return t&&t.parent&&262===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function ro(t){return 305===t.kind||e.isAmbientModule(t)}function no(t,r){var n=ri(t).nameType;if(n){if(384&n.flags){var i=""+n.value;return e.isIdentifierText(i,e.getEmitScriptTarget(z))||e.isNumericLiteralName(i)?e.isNumericLiteralName(i)&&e.startsWith(i,"-")?"[".concat(i,"]"):i:'"'.concat(e.escapeString(i,34),'"')}if(8192&n.flags)return"[".concat(io(n.symbol,r),"]")}}function io(t,r){if(r&&"default"===t.escapedName&&!(16384&r.flags)&&(!(16777216&r.flags)||!t.declarations||r.enclosingDeclaration&&e.findAncestor(t.declarations[0],ro)!==e.findAncestor(r.enclosingDeclaration,ro)))return"default";if(t.declarations&&t.declarations.length){var n=e.firstDefined(t.declarations,(function(t){return e.getNameOfDeclaration(t)?t:void 0})),i=n&&e.getNameOfDeclaration(n);if(n&&i){if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n))return e.symbolName(t);if(e.isComputedPropertyName(i)&&!(4096&e.getCheckFlags(t))){var a=ri(t).nameType;if(a&&384&a.flags){var o=no(t,r);if(void 0!==o)return o}}return e.declarationNameToString(i)}if(n||(n=t.declarations[0]),n.parent&&254===n.parent.kind)return e.declarationNameToString(n.parent.name);switch(n.kind){case 226:case 213:case 214:return!r||r.encounteredError||131072&r.flags||(r.encounteredError=!0),226===n.kind?"(Anonymous class)":"(Anonymous function)"}}var s=no(t,r);return void 0!==s?s:e.symbolName(t)}function ao(t){if(t){var r=ni(t);return void 0===r.isVisible&&(r.isVisible=!!function(){switch(t.kind){case 338:case 345:case 339:return!!(t.parent&&t.parent.parent&&t.parent.parent.parent&&e.isSourceFile(t.parent.parent.parent));case 203:return ao(t.parent.parent);case 254:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return!1;case 261:case 257:case 258:case 259:case 256:case 260:case 265:if(e.isExternalModuleAugmentation(t))return!0;var r=_o(t);return 1&e.getCombinedModifierFlags(t)||265!==t.kind&&305!==r.kind&&16777216&r.flags?ao(r):ii(r);case 167:case 166:case 172:case 173:case 169:case 168:if(e.hasEffectiveModifier(t,24))return!1;case 171:case 175:case 174:case 176:case 164:case 262:case 179:case 180:case 182:case 178:case 183:case 184:case 187:case 188:case 191:case 197:return ao(t.parent);case 267:case 268:case 270:return!1;case 163:case 305:case 264:return!0;default:return!1}}()),r.isVisible}return!1}function oo(t,r){var n,i,a;return t.parent&&271===t.parent.kind?n=li(t,t.escapedText,2998271,void 0,t,!1):275===t.parent.kind&&(n=Oi(t.parent,2998271)),n&&((a=new e.Set).add(M(n)),function t(n){e.forEach(n,(function(n){var o=bi(n)||n;if(r?ni(n).isVisible=!0:(i=i||[],e.pushIfUnique(i,o)),e.isInternalModuleImportEqualsDeclaration(n)){var s=n.moduleReference,c=li(n,e.getFirstIdentifier(s).escapedText,901119,void 0,void 0,!1);c&&a&&e.tryAddToSet(a,M(c))&&t(c.declarations)}}))}(n.declarations)),i}function so(e,t){var r=co(e,t);if(r>=0){for(var n=rn.length,i=r;i=0;r--){if(lo(rn[r],an[r]))return-1;if(rn[r]===e&&an[r]===t)return r}return-1}function lo(t,r){switch(r){case 0:return!!ri(t).type;case 5:return!!ni(t).resolvedEnumType;case 2:return!!ri(t).declaredType;case 1:return!!t.resolvedBaseConstructorType;case 3:return!!t.resolvedReturnType;case 4:return!!t.immediateBaseConstraint;case 6:return!!t.resolvedTypeArguments;case 7:return!!t.baseTypesResolved;case 8:return!!ri(t).writeType}return e.Debug.assertNever(r)}function uo(){return rn.pop(),an.pop(),nn.pop()}function _o(t){return e.findAncestor(e.getRootDeclaration(t),(function(e){switch(e.kind){case 254:case 255:case 270:case 269:case 268:case 267:return!1;default:return!0}})).parent}function po(e,t){var r=cl(e,t);return r?as(r):void 0}function fo(e){return e&&0!=(1&e.flags)}function mo(e){return e===Je||!!(1&e.flags&&e.aliasSymbol)}function go(e,t){if(0!==t)return Ao(e,!1,t);var r=da(e);return r&&ri(r).type||Ao(e,!1,t)}function yo(t,n,i){if(131072&(t=zg(t,(function(e){return!(98304&e.flags)}))).flags)return Dt;if(1048576&t.flags)return Wg(t,(function(e){return yo(e,n,i)}));for(var a=yd(e.map(n,wd)),o=[],s=[],c=0,l=Rc(t);c=2?(i=Le,Wu(zu(!0),[i])):Qt;var c=e.map(a,(function(t){return e.isOmittedExpression(t)?Le:Jo(t,r,n)})),l=e.findLastIndex(a,(function(t){return!(t===s||e.isOmittedExpression(t)||ph(t))}),a.length-1)+1,u=e.map(a,(function(e,t){return e===s?4:t>=l?2:1})),d=rd(c,u);return r&&((d=lu(d)).pattern=t,d.objectFlags|=131072),d}function Uo(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),201===t.kind?function(t,r,n){var i,a=e.createSymbolTable(),o=131200;e.forEach(t.elements,(function(e){var t=e.propertyName||e.name;if(e.dotDotDotToken)i=$l($e,Le,!1);else{var s=wd(t);if(Ks(s)){var c=Hs(s),l=Wn(4|(e.initializer?16777216:0),c);l.type=Jo(e,r,n),l.bindingElement=e,a.set(l.escapedName,l)}else o|=512}}));var s=Na(void 0,a,e.emptyArray,e.emptyArray,i?[i]:e.emptyArray);return s.objectFlags|=o,r&&(s.pattern=t,s.objectFlags|=131072),s}(t,r,n):jo(t,r,n)}function Vo(e,t){return zo(Ao(e,!0,0),e,t)}function Ko(e){var t,r=da(e),n=(t=!1,er||(er=Pu("SymbolConstructor",t)));return n&&r&&r===n}function zo(t,r,n){return t?(4096&t.flags&&Ko(r.parent)&&(t=M_(r)),n&&bm(r,t),8192&t.flags&&(e.isBindingElement(r)||!r.type)&&t.symbol!==da(r)&&(t=at),gm(t)):(t=e.isParameter(r)&&r.dotDotDotToken?Qt:Le,n&&(Go(r)||vm(r,t)),t)}function Go(t){var r=e.getRootDeclaration(t);return kS(164===r.kind?r.parent:r)}function qo(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return J_(r)}function Wo(t){var r=ri(t);if(!r.type){var n=function(t){if(4194304&t.flags)return(r=Is(_a(t))).typeParameters?cu(r,e.map(r.typeParameters,(function(e){return Le}))):r;var r;if(t===pe)return Le;if(134217728&t.flags&&t.valueDeclaration){var n=da(e.getSourceFileOfNode(t.valueDeclaration)),i=Wn(n.flags,"exports");i.declarations=n.declarations?n.declarations.slice():[],i.parent=t,i.target=n,n.valueDeclaration&&(i.valueDeclaration=n.valueDeclaration),n.members&&(i.members=new e.Map(n.members)),n.exports&&(i.exports=new e.Map(n.exports));var a=e.createSymbolTable();return a.set("exports",i),Na(t,a,e.emptyArray,e.emptyArray,e.emptyArray)}e.Debug.assertIsDefined(t.valueDeclaration);var o,s=t.valueDeclaration;if(e.isCatchClauseVariableDeclarationOrBindingElement(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(void 0===c)return te?Ke:Le;var l=nT(c);return fo(l)||l===Ke?l:Je}if(e.isSourceFile(s)&&e.isJsonSourceFile(s))return s.statements.length?gm(Bf(cS(s.statements[0].expression))):Dt;if(e.isAccessor(s))return Xo(t);if(!so(t,0))return 512&t.flags&&!(67108864&t.flags)?Zo(t):rs(t);if(271===s.kind)o=zo(qo(s)||zx(s.expression),s);else if(e.isBinaryExpression(s)||e.isInJSFile(s)&&(e.isCallExpression(s)||(e.isPropertyAccessExpression(s)||e.isBindableStaticElementAccessExpression(s))&&e.isBinaryExpression(s.parent)))o=Oo(t);else if(e.isPropertyAccessExpression(s)||e.isElementAccessExpression(s)||e.isIdentifier(s)||e.isStringLiteralLike(s)||e.isNumericLiteral(s)||e.isClassDeclaration(s)||e.isFunctionDeclaration(s)||e.isMethodDeclaration(s)&&!e.isObjectLiteralMethod(s)||e.isMethodSignature(s)||e.isSourceFile(s)){if(9136&t.flags)return Zo(t);o=e.isBinaryExpression(s.parent)?Oo(t):qo(s)||Le}else if(e.isPropertyAssignment(s))o=qo(s)||$x(s);else if(e.isJsxAttribute(s))o=qo(s)||Th(s);else if(e.isShorthandPropertyAssignment(s))o=qo(s)||Xx(s.name,0);else if(e.isObjectLiteralMethod(s))o=qo(s)||Yx(s,0);else if(e.isParameter(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isVariableDeclaration(s)||e.isBindingElement(s)||e.isJSDocPropertyLikeTag(s))o=Vo(s,!0);else if(e.isEnumDeclaration(s))o=Zo(t);else{if(!e.isEnumMember(s))return e.Debug.fail("Unhandled declaration kind! "+e.Debug.formatSyntaxKind(s.kind)+" for "+e.Debug.formatSymbol(t));o=es(t)}if(!uo())return 512&t.flags&&!(67108864&t.flags)?Zo(t):rs(t);return o}(t);r.type||(r.type=n)}return r.type}function Ho(t){if(t)return 172===t.kind?e.getEffectiveReturnTypeNode(t):e.getEffectiveSetAccessorTypeAnnotationNode(t)}function Qo(e){var t=Ho(e);return t&&J_(t)}function Xo(t){var r=ri(t);if(!r.type){if(!so(t,0))return Je;var n=e.getDeclarationOfKind(t,172),i=e.getDeclarationOfKind(t,173),a=n&&e.isInJSFile(n)&&To(n)||Qo(n)||Qo(i)||n&&n.body&&dx(n);a||(i&&!kS(i)?Vn(Z,i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,Ga(t)):n&&!kS(n)&&Vn(Z,n,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,Ga(t)),a=Le),uo()||(Ho(n)?jn(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)):Ho(i)?jn(i,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)):n&&Z&&jn(n,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,Ga(t)),a=Le),r.type=a}return r.type}function $o(t){var r=ri(t);if(!r.writeType){if(!so(t,8))return Je;var n=e.getDeclarationOfKind(t,173),i=Qo(n);uo()||(Ho(n)&&jn(n,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)),i=Le),r.writeType=i||Xo(t)}return r.writeType}function Yo(t){var r=vs(Cs(t));return 8650752&r.flags?r:2097152&r.flags?e.find(r.types,(function(e){return!!(8650752&e.flags)})):void 0}function Zo(t){var r=ri(t),n=r;if(!r.type){var i=t.valueDeclaration&&Eb(t.valueDeclaration,!1);if(i){var a=Tb(t,i);a&&(t=r=a)}n.type=r.type=function(t){var r=t.valueDeclaration;if(1536&t.flags&&e.isShorthandAmbientModuleSymbol(t))return Le;if(r&&(221===r.kind||e.isAccessExpression(r)&&221===r.parent.kind))return Oo(t);if(512&t.flags&&r&&e.isSourceFile(r)&&r.commonJsModuleIndicator){var n=Zi(t);if(n!==t){if(!so(t,0))return Je;var i=ua(t.exports.get("export=")),a=Oo(i,i===n?void 0:n);return uo()?a:rs(t)}}var o=Da(16,t);if(32&t.flags){var s=Yo(t);return s?Td([o,s]):o}return Q&&16777216&t.flags?Zf(o):o}(t)}return r.type}function es(e){var t=ri(e);return t.type||(t.type=Fs(e))}function ts(t){var r=ri(t);if(!r.type){var n=Ji(t),i=t.declarations&&Li(xi(t),!0),a=e.firstDefined(null==i?void 0:i.declarations,(function(t){return e.isExportAssignment(t)?qo(t):void 0}));r.type=(null==i?void 0:i.declarations)&&BC(i.declarations)&&t.declarations.length?function(t){var r=e.getSourceFileOfNode(t.declarations[0]),n=e.unescapeLeadingUnderscores(t.escapedName),i=t.declarations.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&e.isModuleExportsAccessExpression(t.expression)})),a=i?e.factory.createPropertyAccessExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("module"),e.factory.createIdentifier("exports")),n):e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),n);return i&&e.setParent(a.expression.expression,a.expression),e.setParent(a.expression,a),e.setParent(a,r),a.flowNode=r.endFlowNode,my(a,Re,Ge)}(i):BC(t.declarations)?Re:a||(111551&n.flags?as(n):Je)}return r.type}function rs(t){var r=t.valueDeclaration;return e.getEffectiveTypeAnnotationNode(r)?(jn(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ga(t)),Je):(Z&&(164!==r.kind||r.initializer)&&jn(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,Ga(t)),Le)}function ns(t){var r=ri(t);return r.type||(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.type=1048576&r.deferralParent.flags?yd(r.deferralConstituents):Td(r.deferralConstituents)),r.type}function is(t){var r=e.getCheckFlags(t);return 4&t.flags?2&r?65536&r?function(t){var r=ri(t);return!r.writeType&&r.deferralWriteConstituents&&(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.writeType=1048576&r.deferralParent.flags?yd(r.deferralWriteConstituents):Td(r.deferralWriteConstituents)),r.writeType}(t)||ns(t):t.writeType||t.type:as(t):98304&t.flags?1&r?function(e){var t=ri(e);return t.writeType||(t.writeType=up(is(t.target),t.mapper))}(t):$o(t):as(t)}function as(t){var r=e.getCheckFlags(t);return 65536&r?ns(t):1&r?function(e){var t=ri(e);return t.type||(t.type=up(as(t.target),t.mapper))}(t):262144&r?function(t){if(!t.type){var r=t.mappedType;if(!so(t,0))return r.containsError=!0,Je;var n=up(Tc(r.target||r),Z_(r.mapper,Sc(r),t.keyType)),i=Q&&16777216&t.flags&&!Nx(n,49152)?Zf(n,!0):524288&t.checkFlags?sm(n):n;uo()||(jn(u,e.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1,Ga(t),Wa(r)),i=Je),t.type=i}return t.type}(t):8192&r?function(e){var t=ri(e);t.type||(t.type=Rm(e.propertyType,e.mappedType,e.constraintType));return t.type}(t):7&t.flags?Wo(t):9136&t.flags?Zo(t):8&t.flags?es(t):98304&t.flags?Xo(t):2097152&t.flags?ts(t):Je}function os(e){return am(as(e),!!(16777216&e.flags))}function ss(t,r){return void 0!==t&&void 0!==r&&0!=(4&e.getObjectFlags(t))&&t.target===r}function cs(t){return 4&e.getObjectFlags(t)?t.target:t}function ls(t,r){return function t(n){if(7&e.getObjectFlags(n)){var i=cs(n);return i===r||e.some(xs(i),t)}if(2097152&n.flags)return e.some(n.types,t);return!1}(t)}function us(t,r){for(var n=0,i=r;n0)return!0;if(8650752&e.flags){var t=zc(e);return!!t&&fs(t)}return!1}function gs(t){var r=e.getClassLikeDeclarationOfSymbol(t.symbol);return r&&e.getEffectiveBaseTypeNode(r)}function ys(t,r,n){var i=e.length(r),a=e.isInJSFile(n);return e.filter(ul(t,1),(function(t){return(a||i>=Al(t.typeParameters))&&i<=e.length(t.typeParameters)}))}function hs(t,r,n){var i=ys(t,r,n),a=e.map(r,J_);return e.sameMap(i,(function(t){return e.some(t.typeParameters)?Vl(t,a,e.isInJSFile(n)):t}))}function vs(t){if(!t.resolvedBaseConstructorType){var r=e.getClassLikeDeclarationOfSymbol(t.symbol),n=r&&e.getEffectiveBaseTypeNode(r),i=gs(t);if(!i)return t.resolvedBaseConstructorType=Ge;if(!so(t,1))return Je;var a=cS(i.expression);if(n&&i!==n&&(e.Debug.assert(!n.typeArguments),cS(n.expression)),2621440&a.flags&&Ic(a),!uo())return jn(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,Ga(t.symbol)),t.resolvedBaseConstructorType=Je;if(!(1&a.flags||a===Xe||ms(a))){var o=jn(i.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,Wa(a));if(262144&a.flags){var s=nu(a),c=Ke;if(s){var l=ul(s,1);l[0]&&(c=Bl(l[0]))}a.symbol.declarations&&e.addRelatedInfo(o,e.createDiagnosticForNode(a.symbol.declarations[0],e.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,Ga(a.symbol),Wa(c)))}return t.resolvedBaseConstructorType=Je}t.resolvedBaseConstructorType=a}return t.resolvedBaseConstructorType}function bs(t,r){jn(t,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Wa(r,void 0,2))}function xs(t){if(!t.baseTypesResolved){if(so(t,7)&&(8&t.objectFlags?t.resolvedBaseTypes=[Ss(t)]:96&t.symbol.flags?(32&t.symbol.flags&&function(t){t.resolvedBaseTypes=e.resolvingEmptyArray;var r=Yc(vs(t));if(!(2621441&r.flags))return t.resolvedBaseTypes=e.emptyArray;var n,i=gs(t),a=r.symbol?Is(r.symbol):void 0;if(r.symbol&&32&r.symbol.flags&&function(e){var t=e.outerTypeParameters;if(t){var r=t.length-1,n=du(e);return t[r].symbol!==n[r].symbol}return!0}(a))n=pu(i,r.symbol);else if(1&r.flags)n=r;else{var o=hs(r,i.typeArguments,i);if(!o.length)return jn(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments),t.resolvedBaseTypes=e.emptyArray;n=Bl(o[0])}if(mo(n))return t.resolvedBaseTypes=e.emptyArray;var s=nl(n);if(!Ds(s)){var c=sl(void 0,n),l=e.chainDiagnosticMessages(c,e.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,Wa(s));return Dn.add(e.createDiagnosticForNodeFromMessageChain(i.expression,l)),t.resolvedBaseTypes=e.emptyArray}if(t===s||ls(s,t))return jn(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Wa(t,void 0,2)),t.resolvedBaseTypes=e.emptyArray;t.resolvedBaseTypes===e.resolvingEmptyArray&&(t.members=void 0);t.resolvedBaseTypes=[s]}(t),64&t.symbol.flags&&function(t){if(t.resolvedBaseTypes=t.resolvedBaseTypes||e.emptyArray,t.symbol.declarations)for(var r=0,n=t.symbol.declarations;r0)return;for(var i=1;i1&&(n=void 0===n?i:-1);for(var a=0,o=t[i];a1){var u=s.thisParameter,d=e.forEach(c,(function(e){return e.thisParameter}));if(d)u=lm(d,Td(e.mapDefined(c,(function(e){return e.thisParameter&&as(e.thisParameter)}))));(l=nc(s,c)).thisParameter=u}(r||(r=[])).push(l)}}}}if(!e.length(r)&&-1!==n){for(var _=t[void 0!==n?n:0],p=_.slice(),f=function(t){if(t!==_){var r=t[0];if(e.Debug.assert(!!r,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),p=r.typeParameters&&e.some(p,(function(e){return!!e.typeParameters&&!lc(r.typeParameters,e.typeParameters)}))?void 0:e.map(p,(function(t){return function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=G_(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Yb(e),i=Yb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=ex(e)||ex(t),l=c&&!ex(a),u=new Array(s+(l?1:0)),d=0;d=Zb(a)&&d>=Zb(o),y=d>=n?void 0:Gb(e,d),h=d>=i?void 0:Gb(t,d),v=Wn(1|(g&&!m?16777216:0),(y===h?y:y?h?void 0:y:h)||"arg".concat(d));v.type=m?Qu(f):f,u[d]=v}if(l){var b=Wn(1,"args");b.type=Qu(Qb(o,s)),o===t&&(b.type=up(b.type,r)),u[s]=b}return u}(t,r,n),s=function(e,t,r){if(!e||!t)return e||t;var n=Td([as(e),up(as(t),r)]);return lm(e,n)}(t.thisParameter,r.thisParameter,n),c=Math.max(t.minArgumentCount,r.minArgumentCount),l=tc(a,i,s,o,void 0,void 0,c,39&(t.flags|r.flags));l.compositeKind=1048576,l.compositeSignatures=e.concatenate(2097152!==t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(l.mapper=2097152!==t.compositeKind&&t.mapper&&t.compositeSignatures?$_(t.mapper,n):n);return l}(t,r)})),!p)return"break"}},m=0,g=t;m0})),n=e.map(t,fs);if(r>0&&r===e.countWhere(n,(function(e){return e}))){var i=n.indexOf(!0);n[i]=!1}return n}function pc(t){for(var r,n,i,a=t.types,o=_c(a),s=e.countWhere(o,(function(e){return e})),c=function(c){var l=t.types[c];if(!o[c]){var u=ul(l,1);u.length&&s>0&&(u=e.map(u,(function(e){var t=rc(e);return t.resolvedReturnType=function(e,t,r,n){for(var i=[],a=0;a=p&&c<=f){var m=f?zl(_,Nl(s,_.typeParameters,p,o)):rc(_);m.typeParameters=t.localTypeParameters,m.resolvedReturnType=t,m.flags=i?4|m.flags:-5&m.flags,l.push(m)}}return l}(_)),t.constructSignatures=a}}}function yc(e,t,r){return up(e,G_([t.indexType,t.objectType],[P_(0),rd([r])]))}function hc(t){if(4194304&t.flags){var r=Yc(t.type);return Kf(r)?sd(r):Md(r)}if(16777216&t.flags){if(t.root.isDistributive){var n=t.checkType,i=hc(n);if(i!==n)return lp(t,Y_(t.root.checkType,i,t.mapper))}return t}return 1048576&t.flags?Wg(t,hc):2097152&t.flags?Td(e.sameMap(t.types,hc)):t}function vc(t){return 4096&e.getCheckFlags(t)}function bc(e,t,r,n){for(var i=0,a=Rc(e);i2?(P.checkFlags|=65536,P.deferralParent=t,P.deferralConstituents=T,P.deferralWriteConstituents=D):(P.type=l?yd(T):Td(T),D&&(P.writeType=l?yd(D):Td(D))),P}}function tl(t,r,n){var i,a,o=(null===(i=t.propertyCacheWithoutObjectFunctionPropertyAugment)||void 0===i?void 0:i.get(r))||!n?null===(a=t.propertyCache)||void 0===a?void 0:a.get(r):void 0;o||(o=el(t,r,n))&&(n?t.propertyCacheWithoutObjectFunctionPropertyAugment||(t.propertyCacheWithoutObjectFunctionPropertyAugment=e.createSymbolTable()):t.propertyCache||(t.propertyCache=e.createSymbolTable())).set(r,o);return o}function rl(t,r,n){var i=tl(t,r,n);return!i||16&e.getCheckFlags(i)?void 0:i}function nl(t){return 1048576&t.flags&&16777216&t.objectFlags?t.resolvedReducedType||(t.resolvedReducedType=function(t){var r=e.sameMap(t.types,nl);if(r===t.types)return t;var n=yd(r);1048576&n.flags&&(n.resolvedReducedType=n);return n}(t)):2097152&t.flags?(16777216&t.objectFlags||(t.objectFlags|=16777216|(e.some(Lc(t),il)?33554432:0)),33554432&t.objectFlags?st:t):t}function il(e){return al(e)||ol(e)}function al(t){return!(16777216&t.flags||192!=(131264&e.getCheckFlags(t))||!(131072&as(t).flags))}function ol(t){return!t.valueDeclaration&&!!(1024&e.getCheckFlags(t))}function sl(t,r){if(2097152&r.flags&&33554432&e.getObjectFlags(r)){var n=e.find(Lc(r),al);if(n)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,Wa(r,void 0,536870912),Ga(n));var i=e.find(Lc(r),ol);if(i)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,Wa(r,void 0,536870912),Ga(i))}return t}function cl(e,t,r){if(524288&(e=Zc(e)).flags){var n=Ic(e),i=n.members.get(t);if(i&&ha(i))return i;if(r)return;var a=n===At?Jt:n.callSignatures.length?jt:n.constructSignatures.length?Ut:void 0;if(a){var o=Mc(a,t);if(o)return o}return Mc(Bt,t)}if(3145728&e.flags)return rl(e,t,r)}function ll(t,r){if(3670016&t.flags){var n=Ic(t);return 0===r?n.callSignatures:n.constructSignatures}return e.emptyArray}function ul(e,t){return ll(Zc(e),t)}function dl(t,r){return e.find(t,(function(e){return e.keyType===r}))}function _l(t,r){for(var n,i,a,o=0,s=t;o=0),n>=Zb(r,3)}var i=e.getImmediatelyInvokedFunctionExpression(t.parent);return!!i&&(!t.type&&!t.dotDotDotToken&&t.parent.parameters.indexOf(t)>=i.arguments.length)}function El(t){if(!e.isJSDocPropertyLikeTag(t))return!1;var r=t.isBracketed,n=t.typeExpression;return r||!!n&&316===n.type.kind}function kl(e,t,r,n){return{kind:e,parameterName:t,parameterIndex:r,type:n}}function Al(t){var r,n=0;if(t)for(var i=0;i=n&&o<=a){for(var s=t?t.slice():[],c=o;cl.arguments.length&&!f||Dl(_)||(o=i.length)}if((172===t.kind||173===t.kind)&&Ws(t)&&(!c||!s)){var m=172===t.kind?173:172,g=e.getDeclarationOfKind(da(t),m);g&&(s=(r=sE(g))&&r.symbol)}var y=171===t.kind?Cs(ua(t.parent.symbol)):void 0,h=y?y.localTypeParameters:xl(t);(e.hasRestParameter(t)||e.isInJSFile(t)&&function(t,r){if(e.isJSDocSignature(t)||!Pl(t))return!1;var n=e.lastOrUndefined(t.parameters),i=n?e.getJSDocParameterTags(n):e.getJSDocTags(t).filter(e.isJSDocParameterTag),a=e.firstDefined(i,(function(t){return t.typeExpression&&e.isJSDocVariadicType(t.typeExpression.type)?t.typeExpression.type:void 0})),o=Wn(3,"args",32768);a?o.type=Qu(J_(a.type)):(o.checkFlags|=65536,o.deferralParent=st,o.deferralConstituents=[Qt],o.deferralWriteConstituents=[Qt]);a&&r.pop();return r.push(o),!0}(t,i))&&(a|=1),(e.isConstructorTypeNode(t)&&e.hasSyntacticModifier(t,128)||e.isConstructorDeclaration(t)&&e.hasSyntacticModifier(t.parent,128))&&(a|=4),n.resolvedSignature=tc(t,h,s,i,void 0,void 0,o,a)}return n.resolvedSignature}function Fl(t){if(e.isInJSFile(t)&&e.isFunctionLikeDeclaration(t)){var r=e.getJSDocTypeTag(t);return(null==r?void 0:r.typeExpression)&&Kv(J_(r.typeExpression))}}function Pl(t){var r=ni(t);return void 0===r.containsArgumentsReference&&(8192&r.flags?r.containsArgumentsReference=!0:r.containsArgumentsReference=function t(r){if(!r)return!1;switch(r.kind){case 79:return r.escapedText===_e.escapedName&&RT(r)===_e;case 167:case 169:case 172:case 173:return 162===r.name.kind&&t(r.name);case 206:case 207:return t(r.expression);case 296:return t(r.initializer);default:return!e.nodeStartsNewLexicalEnvironment(r)&&!e.isPartOfTypeNode(r)&&!!e.forEachChild(r,t)}}(t.body)),r.containsArgumentsReference}function Il(t){if(!t||!t.declarations)return e.emptyArray;for(var r=[],n=0;n0&&i.body){var a=t.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)continue}r.push(wl(i))}}return r}function Ol(e){var t=Qi(e,e);if(t){var r=Zi(t);if(r)return as(r)}return Le}function Ml(e){if(e.thisParameter)return as(e.thisParameter)}function Ll(t){if(!t.resolvedTypePredicate){if(t.target){var r=Ll(t.target);t.resolvedTypePredicate=r?(o=r,s=t.mapper,kl(o.kind,o.parameterName,o.parameterIndex,up(o.type,s))):Pr}else if(t.compositeSignatures)t.resolvedTypePredicate=function(e,t){for(var r,n=[],i=0,a=e;i=0}function Ul(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]),r=Vf(t)?Gf(t):t;return r&&yl(r,Ye)}}function Vl(e,t,r,n){var i=Kl(e,Nl(t,e.typeParameters,Al(e.typeParameters),r));if(n){var a=zv(Bl(i));if(a){var o=rc(a);o.typeParameters=n;var s=rc(i);return s.resolvedReturnType=Hl(o),s}}return i}function Kl(t,r){var n=t.instantiations||(t.instantiations=new e.Map),i=au(r),a=n.get(i);return a||n.set(i,a=zl(t,r)),a}function zl(e,t){return tp(e,function(e,t){return G_(e.typeParameters,t)}(e,t),!0)}function Gl(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return tp(e,X_(e.typeParameters),!0)}(e)):e}function ql(t){return t.typeParameters?t.canonicalSignatureCache||(t.canonicalSignatureCache=function(t){return Vl(t,e.map(t.typeParameters,(function(e){return e.target&&!Jc(e.target)?e.target:e})),e.isInJSFile(t.declaration))}(t)):t}function Wl(t){var r=t.typeParameters;if(r){if(t.baseSignatureCache)return t.baseSignatureCache;for(var n=X_(r),i=G_(r,e.map(r,(function(e){return Jc(e)||Ke}))),a=e.map(r,(function(e){return up(e,i)||Ke})),o=0;o1&&(t+=":"+a),n+=a}return t}function ou(e,t){return e?"@".concat(M(e))+(t?":".concat(au(t)):""):""}function su(t,r){for(var n=0,i=0,a=t;ii.length)){var c=s&&e.isExpressionWithTypeArguments(t)&&!e.isJSDocAugmentsTag(t.parent);if(jn(t,o===i.length?c?e.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_1_type_argument_s:c?e.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Wa(n,void 0,2),o,i.length),!s)return Je}return 178===t.kind&&Zu(t,e.length(t.typeArguments)!==i.length)?uu(n,t,void 0):cu(n,e.concatenate(n.outerTypeParameters,Nl(Au(t),i,o,s)))}return Tu(t,r)?n:Je}function fu(t,r,n,i){var a=Is(t);if(a===Ve&&F.has(t.escapedName)&&r&&1===r.length)return Jd(t,r[0]);var o=ri(t),s=o.typeParameters,c=au(r)+ou(n,i),l=o.instantiations.get(c);return l||o.instantiations.set(c,l=dp(a,G_(s,Nl(r,s,Al(s),e.isInJSFile(t.valueDeclaration))),n,i)),l}function mu(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias);return!(!n||!e.getContainingFunction(n))}function gu(e){return e.parent?"".concat(gu(e.parent),".").concat(e.escapedName):e.escapedName}function yu(e){var t=(161===e.kind?e.right:206===e.kind?e.name:e).escapedText;if(t){var r=161===e.kind?yu(e.left):206===e.kind?yu(e.expression):void 0,n=r?"".concat(gu(r),".").concat(t):t,i=Oe.get(n);return i||(Oe.set(n,i=Wn(524288,t,1048576)),i.parent=r,i.declaredType=je),i}return Pe}function hu(t,r,n){var i=function(t){switch(t.kind){case 178:return t.typeName;case 228:var r=t.expression;if(e.isEntityNameExpression(r))return r}}(t);if(!i)return Pe;var a=Wi(i,r,n);return a&&a!==Pe?a:n?Pe:yu(i)}function vu(t,r){if(r===Pe)return Je;if(r=function(t){var r=t.valueDeclaration;if(r&&e.isInJSFile(r)&&!(524288&t.flags)&&!e.getExpandoInitializer(r,!1)){var n=e.isVariableDeclaration(r)?e.getDeclaredExpandoInitializer(r):e.getAssignedExpandoInitializer(r);if(n){var i=da(n);if(i)return Tb(i,t)}}}(r)||r,96&r.flags)return pu(t,r);if(524288&r.flags)return function(t,r){if(1048576&e.getCheckFlags(r)){var n=Au(t),i=ou(r,n),a=Me.get(i);return a||((a=Sa(1,"error")).aliasSymbol=r,a.aliasTypeArguments=n,Me.set(i,a)),a}var o=Is(r),s=ri(r).typeParameters;if(s){var c=e.length(t.typeArguments),l=Al(s);if(cs.length)return jn(t,l===s.length?e.Diagnostics.Generic_type_0_requires_1_type_argument_s:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ga(r),l,s.length),Je;var u=v_(t),d=!u||!mu(r)&&mu(u)?void 0:u;return fu(r,Au(t),d,b_(d))}return Tu(t,r)?o:Je}(t,r);var n=Os(r);if(n)return Tu(t,r)?N_(n):Je;if(111551&r.flags&&Cu(t)){var i=function(e,t){var r=ni(e);if(!r.resolvedJSDocType){var n=as(t),i=n;if(t.valueDeclaration){var a=200===e.kind&&e.qualifier;n.symbol&&n.symbol!==t&&a&&(i=vu(e,n.symbol))}r.resolvedJSDocType=i}return r.resolvedJSDocType}(t,r);return i||(hu(t,788968),as(r))}return Je}function bu(e,t){if(3&t.flags||t===e)return e;var r="".concat(ud(e),">").concat(ud(t)),n=ke.get(r);if(n)return n;var i=ba(33554432);return i.baseType=e,i.substitute=t,ke.set(r,i),i}function xu(e){return 184===e.kind&&1===e.elements.length}function Su(e,t,r){return xu(t)&&xu(r)?Su(e,t.elements[0],r.elements[0]):o_(J_(t))===o_(e)?J_(r):void 0}function Du(t,r){for(var n,i=!0;r&&!e.isStatement(r)&&320!==r.kind;){var a=r.parent;if(164===a.kind&&(i=!i),(i||8650752&t.flags)&&189===a.kind&&r===a.trueType)(s=Su(t,a.checkType,a.extendsType))&&(n=e.append(n,s));else if(262144&t.flags&&195===a.kind&&r===a.type){var o=J_(a);if(Sc(o)===o_(t)){var s,c=ip(o);if(c)(s=Jc(c))&&Kg(s,Cf)&&(n=e.append(n,yd([Ye,ht])))}}r=a}return n?bu(t,Td(e.append(n,t))):t}function Cu(e){return!!(8388608&e.flags)&&(178===e.kind||200===e.kind)}function Tu(t,r){return!t.typeArguments||(jn(t,e.Diagnostics.Type_0_is_not_generic,r?Ga(r):t.typeName?e.declarationNameToString(t.typeName):l),!1)}function Eu(t){if(e.isIdentifier(t.typeName)){var r=t.typeArguments;switch(t.typeName.escapedText){case"String":return Tu(t),$e;case"Number":return Tu(t),Ye;case"Boolean":return Tu(t),it;case"Void":return Tu(t),ot;case"Undefined":return Tu(t),Ge;case"Null":return Tu(t),Qe;case"Function":case"function":return Tu(t),Jt;case"array":return r&&r.length||Z?void 0:Qt;case"promise":return r&&r.length||Z?void 0:cx(Le);case"Object":if(r&&2===r.length){if(e.isJSDocIndexSignature(t)){var n=J_(r[0]),i=J_(r[1]),a=n===$e||n===Ye?[$l(n,i,!1)]:e.emptyArray;return Na(void 0,V,e.emptyArray,e.emptyArray,a)}return Le}return Tu(t),Z?void 0:Le}}}function ku(t){var r=ni(t);if(!r.resolvedType){if(e.isConstTypeReference(t)&&e.isAssertionExpression(t.parent))return r.resolvedSymbol=Pe,r.resolvedType=zx(t.parent.expression);var n=void 0,i=void 0,a=788968;Cu(t)&&((i=Eu(t))||((n=hu(t,a,!0))===Pe?n=hu(t,900095):hu(t,a),i=vu(t,n))),i||(i=vu(t,n=hu(t,a))),r.resolvedSymbol=n,r.resolvedType=i}return r.resolvedType}function Au(t){return e.map(t.typeArguments,J_)}function Nu(e){var t=ni(e);if(!t.resolvedType){var r=Jb(e);t.resolvedType=N_(gm(r))}return t.resolvedType}function wu(t,r){function n(e){var t=e.declarations;if(t)for(var r=0,n=t;r=0)return kd(e.map(r,(function(e,r){return 8&t.elementFlags[r]?e:Ke})))?Wg(r[o],(function(n){return ad(t,e.replaceElement(r,o,n))})):Je}for(var s=[],c=[],l=[],d=-1,_=-1,p=-1,f=function(o){var c=r[o],l=t.elementFlags[o];if(8&l)if(58982400&c.flags||Pc(c))h(c,8,null===(n=t.labeledElementDeclarations)||void 0===n?void 0:n[o]);else if(Vf(c)){var d=du(c);if(d.length+s.length>=1e4)return jn(u,e.isPartOfTypeNode(u)?e.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent:e.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent),{value:Je};e.forEach(d,(function(e,t){var r;return h(e,c.target.elementFlags[t],null===(r=c.target.labeledElementDeclarations)||void 0===r?void 0:r[t])}))}else h(kf(c)&&yl(c,Ye)||Je,4,null===(i=t.labeledElementDeclarations)||void 0===i?void 0:i[o]);else h(c,l,null===(a=t.labeledElementDeclarations)||void 0===a?void 0:a[o])},m=0;m=0&&_i.fixedLength?function(e){var t=Gf(e);return t&&Qu(t)}(t)||rd(e.emptyArray):rd(du(t).slice(r,a),i.elementFlags.slice(r,a),!1,i.labeledElementDeclarations&&i.labeledElementDeclarations.slice(r,a))}function sd(t){return yd(e.append(e.arrayOf(t.target.fixedLength,(function(e){return F_(""+e)})),Md(t.target.readonly?Kt:Vt)))}function cd(t,r){var n=e.findIndex(t.elementFlags,(function(e){return!(e&r)}));return n>=0?n:t.elementFlags.length}function ld(t,r){return t.elementFlags.length-e.findLastIndex(t.elementFlags,(function(e){return!(e&r)}))-1}function ud(e){return e.id}function dd(t,r){return e.binarySearch(t,r,ud,e.compareValues)>=0}function _d(t,r){var n=e.binarySearch(t,r,ud,e.compareValues);return n<0&&(t.splice(~n,0,r),!0)}function pd(t,r,n){var i=n.flags;if(1048576&i)return fd(t,r|(function(e){return!!(1048576&e.flags&&(e.aliasSymbol||e.origin))}(n)?1048576:0),n.types);if(!(131072&i))if(r|=205258751&i,465829888&i&&(r|=33554432),n===Be&&(r|=8388608),!Q&&98304&i)65536&e.getObjectFlags(n)||(r|=4194304);else{var a=t.length,o=a&&n.id>t[a-1].id?~a:e.binarySearch(t,n,ud,e.compareValues);o<0&&t.splice(~o,0,n)}return r}function fd(e,t,r){for(var n=0,i=r;n=0&&dd(o,Ge)&&e.orderedRemoveItemAt(o,c)}if((402664320&s||16384&s&&32768&s)&&function(t,r,n){for(var i=t.length;i>0;){var a=t[--i],o=a.flags;(402653312&o&&4&r||256&o&&8&r||2048&o&&64&r||8192&o&&4096&r||n&&32768&o&&16384&r||w_(a)&&dd(t,a.regularType))&&e.orderedRemoveItemAt(t,i)}}(o,s,!!(2&r)),128&s&&134217728&s&&function(t){var r=e.filter(t,qd);if(r.length)for(var n=t.length,i=function(){n--;var i=t[n];128&i.flags&&e.some(r,(function(e){return Gm(i,e)}))&&e.orderedRemoveItemAt(t,n)};n>0;)i()}(o),2===r&&(o=function(t,r){if(t.length<2)return t;var n=au(t),i=Ae.get(n);if(i)return i;for(var a=r&&e.some(t,(function(e){return!!(524288&e.flags)&&!Pc(e)&&Up(Ic(e))})),o=t.length,s=o,c=0;s>0;){var l=t[--s];if(a||469499904&l.flags)for(var d=61603840&l.flags?e.find(Rc(l),(function(e){return Of(as(e))})):void 0,_=d&&N_(as(d)),p=0,f=t;p1e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","removeSubtypes_DepthLimit",{typeIds:t.map((function(e){return e.id}))}),void jn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(c++,d&&61603840&m.flags){var g=po(m,d.escapedName);if(g&&Of(g)&&N_(g)!==_)continue}if(Wp(l,m,An)&&(!(1&e.getObjectFlags(cs(l)))||!(1&e.getObjectFlags(cs(m)))||Tp(l,m))){e.orderedRemoveItemAt(t,s);break}}}}return Ae.set(n,t),t}(o,!!(524288&s)),!o))return Je;if(0===o.length)return 65536&s?4194304&s?Qe:Xe:32768&s?4194304&s?Ge:qe:st}if(!a&&1048576&s){var l=[];md(l,t);for(var d=[],_=function(t){e.some(l,(function(e){return dd(e.types,t)}))||d.push(t)},p=0,f=o;p0;){var i=t[--r];if(134217728&i.flags)for(var a=0,o=n;a0;){var i=t[--n];(4&i.flags&&402653312&r||8&i.flags&&256&r||64&i.flags&&2048&r||4096&i.flags&&8192&r)&&e.orderedRemoveItemAt(t,n)}}(o,a),16777216&a&&524288&a&&e.orderedRemoveItemAt(o,e.findIndex(o,Kp)),262144&a&&(o[o.indexOf(Ge)]=He),0===o.length)return Ke;if(1===o.length)return o[0];var s=au(o)+ou(r,n),c=ve.get(s);if(!c){if(1048576&a)if(function(t){var r,n=e.findIndex(t,(function(t){return!!(32768&e.getObjectFlags(t))}));if(n<0)return!1;for(var i=n+1;i=0;o--)if(1048576&e[o].flags){var s=e[o].types,c=s.length;i[o]=s[a%c],a=Math.floor(a/c)}var l=Td(i);131072&l.flags||r.push(l)}return r}(o);c=yd(u,1,r,n,e.some(u,(function(e){return!!(2097152&e.flags)}))?gd(2097152,o):void 0)}else c=function(e,t,r){var n=ba(2097152);return n.objectFlags=su(e,98304),n.types=e,n.aliasSymbol=t,n.aliasTypeArguments=r,n}(o,r,n);ve.set(s,c)}return c}function Ed(t){return e.reduceLeft(t,(function(e,t){return 1048576&t.flags?e*t.types.length:131072&t.flags?0:e}),1)}function kd(t){var r=Ed(t);return!(r>=1e5)||(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkCrossProductUnion_DepthLimit",{typeIds:t.map((function(e){return e.id})),size:r}),jn(u,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent),!1)}function Ad(e,t){var r=ba(4194304);return r.type=e,r.stringsOnly=t,r}function Nd(e,t){return t?e.resolvedStringIndexType||(e.resolvedStringIndexType=Ad(e,!0)):e.resolvedIndexType||(e.resolvedIndexType=Ad(e,!1))}function wd(t){return e.isPrivateIdentifier(t)?st:e.isIdentifier(t)?F_(e.unescapeLeadingUnderscores(t.escapedText)):N_(e.isComputedPropertyName(t)?yh(t):cS(t))}function Fd(t,r,n){if(n||!(24&e.getDeclarationModifierFlagsFromSymbol(t))){var i=ri(Ys(t)).nameType;if(!i){var a=e.getNameOfDeclaration(t.valueDeclaration);i="default"===t.escapedName?F_("default"):a&&wd(a)||(e.isKnownSymbol(t)?void 0:F_(e.symbolName(t)))}if(i&&i.flags&r)return i}return st}function Pd(t,r){return!!(t.flags&r||2097152&t.flags&&e.some(t.types,(function(e){return Pd(e,r)})))}function Id(t,r,n){var i=n&&(7&e.getObjectFlags(t)||t.aliasSymbol)?function(e){var t=xa(4194304);return t.type=e,t}(t):void 0,a=e.map(Rc(t),(function(e){return Fd(e,r)})),o=e.map(ml(t),(function(e){return e!==Rr&&Pd(e.keyType,r)?e.keyType===$e&&8&r?pt:e.keyType:st}));return yd(e.concatenate(a,o),1,void 0,void 0,i)}function Od(t){return e.some(t.types,(function(e){var t=function(e){return 262143&e.flags?e:e.uniqueLiteralFilledInstantiation||(e.uniqueLiteralFilledInstantiation=up(e,St))}(e);return nl(t)!==t}))}function Md(t,r,n){return void 0===r&&(r=re),1048576&(t=nl(t)).flags?Od(t)?Nd(t,r):Td(e.map(t.types,(function(e){return Md(e,r,n)}))):2097152&t.flags?yd(e.map(t.types,(function(e){return Md(e,r,n)}))):58982400&t.flags||Kf(t)||Pc(t)&&(a=Sc(i=t),!function t(r){return!!(68157439&r.flags)||(16777216&r.flags?r.root.isDistributive&&r.checkType===a:137363456&r.flags?e.every(r.types,t):8388608&r.flags?t(r.objectType)&&t(r.indexType):33554432&r.flags?t(r.substitute):!!(268435456&r.flags)&&t(r.type))}(Cc(i)||a))?Nd(t,r):32&e.getObjectFlags(t)?function(e,t,r){var n=Sc(e),i=Dc(e),a=Cc(e.target||e);if(!a&&!r)return i;var o=[];if(kc(e)){if(Qd(i))return Nd(e,t);bc(Yc(Ac(e)),8576,t,c)}else Ug(hc(i),c);Qd(i)&&Ug(i,c);var s=r?zg(yd(o),(function(e){return!(5&e.flags)})):yd(o);return 1048576&s.flags&&1048576&i.flags&&au(s.types)===au(i.types)?i:s;function c(t){var r=a?up(a,Z_(e.mapper,n,t)):t;o.push(r===$e?pt:r)}}(t,r,n):t===Be?Be:2&t.flags?st:131073&t.flags?mt:Id(t,(n?128:402653316)|(r?0:12584),r===re&&!n);var i,a}function Ld(e){if(re)return e;var t=(xr||(xr=Iu("Extract",2,!0)||Pe),xr===Pe?void 0:xr);return t?fu(t,[e,$e]):$e}function Rd(t,r){var n=e.findIndex(r,(function(e){return!!(1179648&e.flags)}));if(n>=0)return kd(r)?Wg(r[n],(function(i){return Rd(t,e.replaceElement(r,n,i))})):Je;if(e.contains(r,Be))return Be;var i=[],a=[],o=t[0];if(!function t(r,n){for(var s=e.isArray(r),c=0;c=0){if(a&&Kg(r,(function(e){return!e.target.hasRestElement}))&&!(16&o)){var _=zd(a);Vf(r)?jn(_,e.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,Wa(r),_u(r),e.unescapeLeadingUnderscores(l)):jn(_,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Wa(r))}return b(gl(r,Ye)),Wg(r,(function(e){var t=Gf(e)||Ge;return 1&o?yd([t,Ge]):t}))}}if(!(98304&n.flags)&&wx(n,402665900)){if(131073&r.flags)return r;var p=vl(r,n)||gl(r,$e);if(p)return 2&o&&p.keyType!==Ye?void(c&&jn(c,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Wa(n),Wa(t))):a&&p.keyType===$e&&!wx(n,12)?(jn(_=zd(a),e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Wa(n)),1&o?yd([p.type,Ge]):p.type):(b(p),1&o?yd([p.type,Ge]):p.type);if(131072&n.flags)return st;if(jd(r))return Le;if(c&&!Px(r)){if($m(r)){if(Z&&384&n.flags)return Dn.add(e.createDiagnosticForNode(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Wa(r))),Ge;if(12&n.flags){var f=e.map(r.properties,(function(e){return as(e)}));return yd(e.append(f,Ge))}}if(r.symbol===ue&&void 0!==l&&ue.exports.has(l)&&418&ue.exports.get(l).flags)jn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Wa(r));else if(Z&&!z.suppressImplicitAnyIndexErrors&&!(128&o))if(void 0!==l&&hv(l,r)){var m=Wa(r);jn(c,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,m,m+"["+e.getTextOfNode(c.argumentExpression)+"]")}else if(yl(r,Ye))jn(c.argumentExpression,e.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else{var g=void 0;if(void 0!==l&&(g=Sv(l,r)))void 0!==g&&jn(c.argumentExpression,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,l,Wa(r),g);else{var y=function(t,r,n){function i(e){var r=Mc(t,e);if(r){var i=Kv(as(r));return!!i&&Zb(i)>=1&&Cp(n,Qb(i,0))}return!1}var a=e.isAssignmentTarget(r)?"set":"get";if(!i(a))return;var o=e.tryGetPropertyAccessOrIdentifierToString(r.expression);void 0===o?o=a:o+="."+a;return o}(r,c,n);if(void 0!==y)jn(c,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,Wa(r),y);else{var h=void 0;if(1024&n.flags)h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+Wa(n)+"]",Wa(r));else if(8192&n.flags){var v=qi(n.symbol,c);h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+v+"]",Wa(r))}else 128&n.flags||256&n.flags?h=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Wa(r)):12&n.flags&&(h=e.chainDiagnosticMessages(void 0,e.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,Wa(n),Wa(r)));h=e.chainDiagnosticMessages(h,e.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,Wa(i),Wa(r)),Dn.add(e.createDiagnosticForNodeFromMessageChain(c,h))}}}return}}if(jd(r))return Le;if(a){_=zd(a);384&n.flags?jn(_,e.Diagnostics.Property_0_does_not_exist_on_type_1,""+n.value,Wa(r)):12&n.flags?jn(_,e.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1,Wa(r),Wa(n)):jn(_,e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Wa(n))}return fo(n)?n:void 0;function b(t){t&&t.isReadonly&&c&&(e.isAssignmentTarget(c)||e.isDeleteTarget(c))&&jn(c,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Wa(r))}}function zd(e){return 207===e.kind?e.argumentExpression:194===e.kind?e.indexType:162===e.kind?e.expression:e}function Gd(e){return!!(77&e.flags)}function qd(t){return!!(134217728&t.flags)&&e.every(t.types,Gd)}function Wd(e){return!!Xd(e)}function Hd(e){return!!(4194304&Xd(e))}function Qd(e){return!!(8388608&Xd(e))}function Xd(t){return 3145728&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|e.reduceLeft(t.types,(function(e,t){return e|Xd(t)}),0)),12582912&t.objectFlags):33554432&t.flags?(2097152&t.objectFlags||(t.objectFlags|=2097152|Xd(t.substitute)|Xd(t.baseType)),12582912&t.objectFlags):(58982400&t.flags||Pc(t)||Kf(t)?4194304:0)|(465829888&t.flags&&!qd(t)?8388608:0)}function $d(t,r){return 8388608&t.flags?function(t,r){var n=r?"simplifiedForWriting":"simplifiedForReading";if(t[n])return t[n]===wt?t:t[n];t[n]=wt;var i=$d(t.objectType,r),a=$d(t.indexType,r),o=function(t,r,n){if(1048576&r.flags){var i=e.map(r.types,(function(e){return $d(t_(t,e),n)}));return n?Td(i):yd(i)}}(i,a,r);if(o)return t[n]=o;if(!(465829888&a.flags)){var s=Yd(i,a,r);if(s)return t[n]=s}if(Kf(i)&&296&a.flags){var c=qf(i,8&a.flags?0:i.target.fixedLength,0,r);if(c)return t[n]=c}if(Pc(i)){var l=Cc(i);if(!l||Cp(l,Sc(i)))return t[n]=Wg(e_(i,t.indexType),(function(e){return $d(e,r)}))}return t[n]=t}(t,r):16777216&t.flags?function(e,t){var r=e.checkType,n=e.extendsType,i=__(e),a=p_(e);if(131072&a.flags&&o_(i)===o_(r)){if(1&r.flags||Cp(pp(r),pp(n)))return $d(i,t);if(Zd(r,n))return st}else if(131072&i.flags&&o_(a)===o_(r)){if(!(1&r.flags)&&Cp(pp(r),pp(n)))return st;if(1&r.flags||Zd(r,n))return $d(a,t)}return e}(t,r):t}function Yd(t,r,n){if(3145728&t.flags){var i=e.map(t.types,(function(e){return $d(t_(e,r),n)}));return 2097152&t.flags||n?Td(i):yd(i)}}function Zd(e,t){return!!(131072&yd([dc(e,t),st]).flags)}function e_(e,t){var r=G_([Sc(e)],[t]),n=$_(e.mapper,r);return up(Tc(e),n)}function t_(e,t,r,n,i,a){return void 0===r&&(r=0),n_(e,t,r,n,i,a)||(n?Je:Ke)}function r_(t,r){return Kg(t,(function(t){if(384&t.flags){var n=Hs(t);if(e.isNumericLiteralName(n)){var i=+n;return i>=0&&i=5e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","instantiateType_DepthLimit",{typeId:t.id,instantiationDepth:k,instantiationCount:E}),jn(u,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),Je;T++,E++,k++;var a=function(t,r,n,i){var a=t.flags;if(262144&a)return q_(t,r);if(524288&a){var o=t.objectFlags;if(52&o){if(4&o&&!t.node){var s=t.resolvedTypeArguments,c=V_(s,r);return c!==s?id(t.target,c):t}return 1024&o?function(t,r){var n=up(t.mappedType,r);if(!(32&e.getObjectFlags(n)))return t;var i=up(t.constraintType,r);if(!(4194304&i.flags))return t;var a=Mm(up(t.source,r),n,i);if(a)return a;return t}(t,r):function(t,r,n,i){var a=4&t.objectFlags||8388608&t.objectFlags?t.node:t.symbol.declarations[0],o=ni(a),s=4&t.objectFlags?o.resolvedType:64&t.objectFlags?t.target:t,c=o.outerTypeParameters;if(!c){var l=ds(a,!0);if(Cb(a)){var u=xl(a);l=e.addRange(l,u)}c=l||e.emptyArray;var d=8388612&t.objectFlags?[a]:t.symbol.declarations;c=(8388612&s.objectFlags||8192&s.symbol.flags||2048&s.symbol.flags)&&!s.aliasTypeArguments?e.filter(c,(function(t){return e.some(d,(function(e){return np(t,e)}))})):c,o.outerTypeParameters=c}if(c.length){var _=$_(t.mapper,r),p=e.map(c,(function(e){return q_(e,_)})),f=n||t.aliasSymbol,m=n?i:V_(t.aliasTypeArguments,r),g=au(p)+ou(f,m);s.instantiations||(s.instantiations=new e.Map,s.instantiations.set(au(c)+ou(s.aliasSymbol,s.aliasTypeArguments),s));var y=s.instantiations.get(g);if(!y){var h=G_(c,p);y=4&s.objectFlags?uu(t.target,t.node,h,f,m):32&s.objectFlags?ap(s,h,f,m):cp(s,h,f,m),s.instantiations.set(g,y)}return y}return t}(t,r,n,i)}return t}if(3145728&a){var l=1048576&t.flags?t.origin:void 0,u=l&&3145728&l.flags?l.types:t.types,d=V_(u,r);if(d===u&&n===t.aliasSymbol)return t;var _=n||t.aliasSymbol,p=n?i:V_(t.aliasTypeArguments,r);return 2097152&a||l&&2097152&l.flags?Td(d,_,p):yd(d,1,_,p)}if(4194304&a)return Md(up(t.type,r));if(134217728&a)return Rd(t.texts,V_(t.types,r));if(268435456&a)return Jd(t.symbol,up(t.type,r));if(8388608&a){_=n||t.aliasSymbol,p=n?i:V_(t.aliasTypeArguments,r);return t_(up(t.objectType,r),up(t.indexType,r),t.accessFlags,void 0,_,p)}if(16777216&a)return lp(t,$_(t.mapper,r),n,i);if(33554432&a){var f=up(t.baseType,r);if(8650752&f.flags)return bu(f,up(t.substitute,r));var m=up(t.substitute,r);return 3&m.flags||Cp(pp(f),pp(m))?f:m}return t}(t,r,n,i);return k--,a}function _p(e){return 262143&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=up(e,bt))}function pp(e){return 262143&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=up(e,vt),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function fp(e,t){return $l(e.keyType,up(e.type,t),e.isReadonly,e.declaration)}function mp(t){switch(e.Debug.assert(169!==t.kind||e.isObjectLiteralMethod(t)),t.kind){case 213:case 214:case 169:case 256:return gp(t);case 205:return e.some(t.properties,mp);case 204:return e.some(t.elements,mp);case 222:return mp(t.whenTrue)||mp(t.whenFalse);case 221:return(56===t.operatorToken.kind||60===t.operatorToken.kind)&&(mp(t.left)||mp(t.right));case 296:return mp(t.initializer);case 212:return mp(t.expression);case 286:return e.some(t.properties,mp)||e.isJsxOpeningElement(t.parent)&&e.some(t.parent.parent.children,mp);case 285:var r=t.initializer;return!!r&&mp(r);case 288:var n=t.expression;return!!n&&mp(n)}return!1}function gp(t){return(!e.isFunctionDeclaration(t)||e.isInJSFile(t)&&!!To(t))&&(e.hasContextSensitiveParameters(t)||function(t){return!t.typeParameters&&!e.getEffectiveReturnTypeNode(t)&&!!t.body&&235!==t.body.kind&&mp(t.body)}(t))}function yp(t){return(e.isInJSFile(t)&&e.isFunctionDeclaration(t)||e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t))&&gp(t)}function hp(t){if(524288&t.flags){var r=Ic(t);if(r.constructSignatures.length||r.callSignatures.length){var n=Da(16,t.symbol);return n.members=r.members,n.properties=r.properties,n.callSignatures=e.emptyArray,n.constructSignatures=e.emptyArray,n.indexInfos=e.emptyArray,n}}else if(2097152&t.flags)return Td(e.map(t.types,hp));return t}function vp(e,t){return Wp(e,t,Fn)}function bp(e,t){return Wp(e,t,Fn)?-1:0}function xp(e,t){return Wp(e,t,Nn)?-1:0}function Sp(e,t){return Wp(e,t,kn)?-1:0}function Dp(e,t){return Wp(e,t,kn)}function Cp(e,t){return Wp(e,t,Nn)}function Tp(t,r){return 1048576&t.flags?e.every(t.types,(function(e){return Tp(e,r)})):1048576&r.flags?e.some(r.types,(function(e){return Tp(t,e)})):58982400&t.flags?Tp(zc(t)||Ke,r):r===Bt?!!(67633152&t.flags):r===Jt?!!(524288&t.flags)&&Sg(t):ls(t,cs(r))||Sf(r)&&!Df(r)&&Tp(t,Kt)}function Ep(e,t){return Wp(e,t,wn)}function kp(e,t){return Ep(e,t)||Ep(t,e)}function Ap(e,t,r,n,i,a){return Xp(e,t,Nn,r,n,i,a)}function Np(e,t,r,n,i,a){return wp(e,t,Nn,r,n,i,a,void 0)}function wp(e,t,r,n,i,a,o,s){return!!Wp(e,t,r)||(!n||!Pp(i,e,t,r,a,o,s))&&Xp(e,t,r,n,a,o,s)}function Fp(t){return!!(16777216&t.flags||2097152&t.flags&&e.some(t.types,Fp))}function Pp(t,r,i,o,s,c,l){if(!t||Fp(i))return!1;if(!Xp(r,i,o,void 0)&&function(t,r,n,i,a,o,s){for(var c=ul(r,0),l=ul(r,1),u=0,d=[l,c];u1,h=zg(m,Pf),v=zg(m,(function(e){return!Pf(e)}));if(y){if(h!==st){var b=rd(Eh(d,0)),x=function(t,r){var n,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:if(!e.length(t.children))return[2];n=0,i=0,a.label=1;case 1:return il:Zb(t)>l))return 0;t.typeParameters&&t.typeParameters!==r.typeParameters&&(t=qv(t,r=ql(r),void 0,s));var u=Yb(t),d=rx(t),_=rx(r);(d||_)&&up(d||_,c);var p=r.declaration?r.declaration.kind:0,f=!(3&n)&&X&&169!==p&&168!==p&&171!==p,m=-1,g=Ml(t);if(g&&g!==ot){var y=Ml(r);if(y){if(!(D=!f&&s(g,y,!1)||s(y,g,i)))return i&&a(e.Diagnostics.The_this_types_of_each_signature_are_incompatible),0;m&=D}}for(var h=d||_?Math.min(u,l):Math.max(u,l),v=d||_?h-1:-1,b=0;b=Zb(t)&&b0||lT(l)),m=!!(2048&e.getObjectFlags(l));if(f&&!function(e,t,r){for(var n=0,i=Rc(e);n0&&j(Bl(h[0]),u,1,!1)||v.length>0&&j(Bl(v[0]),u,1,!1)?L(e.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,g,y):L(e.Diagnostics.Type_0_has_no_properties_in_common_with_type_1,g,y)}return 0}V(l,u);var b=1048576&l.flags&&l.types.length<4&&!(1048576&u.flags)||1048576&u.flags&&u.types.length<4&&!(469499904&l.flags)?K(l,u,o,c):H(l,u,o,c,n);if(b&&!C&&(2097152&u.flags&&(p||f)||x_(u)&&!Cf(u)&&2097152&l.flags&&3670016&Yc(l).flags&&!e.some(l.types,(function(t){return!!(262144&e.getObjectFlags(t))})))&&(C=!0,b&=H(l,u,o,4,n),C=!1),b)return b}return o&&U(t,r,l,u,s),0}function U(t,r,n,i,o){var s=!!Af(t),c=!!Af(r);n=t.aliasSymbol||s?t:n,i=r.aliasSymbol||c?r:i;var l=D>0;if(l&&D--,524288&n.flags&&524288&i.flags){var u=d;B(n,i,!0),d!==u&&(l=!!d)}if(524288&n.flags&&131068&i.flags)!function(t,r){var n=Xa(t.symbol)?Wa(t,t.symbol.valueDeclaration):Wa(t),i=Xa(r.symbol)?Wa(r,r.symbol.valueDeclaration):Wa(r);(zt===t&&$e===r||Gt===t&&Ye===r||qt===t&&it===r||ju()===t&&at===r)&&L(e.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,i,n)}(n,i);else if(n.symbol&&524288&n.flags&&Bt===n)L(e.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(2048&e.getObjectFlags(n)&&2097152&i.flags){var _=i.types,p=Nh(w.IntrinsicAttributes,a),f=Nh(w.IntrinsicClassAttributes,a);if(!mo(p)&&!mo(f)&&(e.contains(_,p)||e.contains(_,f)))return}else d=sl(d,r);o||!l?R(o,n,i):g=[n,i]}function V(t,r){if(e.tracing&&3145728&t.flags&&3145728&r.flags){var n=t,i=r;if(n.objectFlags&i.objectFlags&32768)return;var o=n.types.length,s=i.types.length;o*s>1e6&&e.tracing.instant("checkTypes","traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:t.id,sourceSize:o,targetId:r.id,targetSize:s,pos:null==a?void 0:a.pos,end:null==a?void 0:a.end})}}function K(t,r,n,a){if(1048576&t.flags)return i===wn?W(t,r,n&&!(131068&t.flags),a):function(e,t,r,n){for(var i=-1,a=e.types,o=function(e,t){if(1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags)return Qg(t,-32769);return t}(e,t),s=0;s=o.types.length&&a.length%o.types.length==0){var l=j(c,o.types[s%o.types.length],3,!1,void 0,n);if(l){i&=l;continue}}var u=j(c,t,1,r,void 0,n);if(!u)return 0;i&=u}return i}(t,r,n&&!(131068&t.flags),a);if(1048576&r.flags)return q(um(t),r,n&&!(131068&t.flags)&&!(131068&r.flags));if(2097152&r.flags)return function(e,t,r,n){for(var i=-1,a=t.types,o=0,s=a;o25)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","typeRelatedToDiscriminatedType_DepthLimit",{sourceId:t.id,targetId:r.id,numCombinations:a}),0}for(var c=new Array(n.length),l=new e.Set,u=0;u5?L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,Wa(t),Wa(n),e.map(g.slice(0,4),(function(e){return Ga(e)})).join(", "),g.length-4):L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,Wa(t),Wa(n),e.map(g,(function(e){return Ga(e)})).join(", ")),s&&d&&D++)}function re(t,r,n,a,o){if(i===Fn)return function(e,t,r){if(!(524288&e.flags&&524288&t.flags))return 0;var n=Y(Oc(e),r),i=Y(Oc(t),r);if(n.length!==i.length)return 0;for(var a=-1,o=0,s=n;o=l-y)?t.target.elementFlags[b]:4,S=r.target.elementFlags[v];if(8&S&&!(8&x))return n&&L(e.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target,v),0;if(8&x&&!(12&S))return n&&L(e.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,b,v),0;if(1&S&&!(1&x))return n&&L(e.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target,v),0;if(!(h&&((12&x||12&S)&&(h=!1),h&&(null==a?void 0:a.has(""+v))))){var D=Vf(t)?v=l-y?am(f[b],!!(x&S&2)):qf(t,g,y)||st:f[0],C=m[v];if(!(B=j(D,8&x&&4&S?Qu(C):am(C,!!(2&S)),3,n,void 0,o)))return n&&(l>1||c>1)&&(v=l-y||c-g-y==1?O(e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,b,v):O(e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,g,c-y-1,v)),0;s&=B}}return s}if(12&r.target.combinedFlags)return 0}var T=!(i!==kn&&i!==An||$m(t)||wf(t)||Vf(t)),E=Jm(t,r,T,!1);if(E)return n&&function(e,t){var r=ll(e,0),n=ll(e,1),i=Oc(e);if((r.length||n.length)&&!i.length)return!!(ul(t,0).length&&r.length||ul(t,1).length&&n.length);return!0}(t,r)&&te(t,r,E,T),0;if($m(r))for(var k=0,A=Y(Rc(t),a);k0||ul(t,n=1).length>0)return e.find(r.types,(function(e){return ul(e,n).length>0}))}(t,r)||function(t,r){var n;if(!(406978556&t.flags))for(var i=0,a=0,o=r.types;a=i&&(n=s,i=l)}}}return n}(t,r)}function tf(t,r,n,i,a){for(var o=t.types.map((function(e){})),s=0,c=r;s0&&e.every(r.properties,(function(e){return!!(16777216&e.flags)}))}return!!(2097152&t.flags)&&e.every(t.types,rf)}function nf(e){return e===Vt||e===Kt||8&e.objectFlags?K:of(e.symbol,e.typeParameters)}function af(e){return of(e,ri(e).typeParameters)}function of(t,r){void 0===r&&(r=e.emptyArray);var n=ri(t);if(!n.variances){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","getVariancesWorker",{arity:r.length,id:ud(Is(t))}),n.variances=e.emptyArray;for(var i=[],a=function(e){var r=lf(e),n=65536&r?32768&r?0:1:32768&r?2:void 0;if(void 0===n){var a=!1,o=!1,s=wr;wr=function(e){return e?o=!0:a=!0};var c=sf(t,e,Pt),l=sf(t,e,It);3===(n=(Cp(l,c)?1:0)|(Cp(c,l)?2:0))&&Cp(sf(t,e,Fr),c)&&(n=4),wr=s,(a||o)&&(a&&(n|=8),o&&(n|=16))}i.push(n)},o=0,s=r;ot.id){var a=e;e=t,t=a}var o=r?":"+r:"";return df(e)&&df(t)?function(e,t,r,n){var i=[],a="",o=c(e,0),s=c(t,0);return"".concat(a).concat(o,",").concat(s).concat(r);function c(e,t){void 0===t&&(t=0);for(var r=""+e.target.id,o=0,s=du(e);o";continue}r+="-"+l.id}return r}}(e,t,o,i):"".concat(e.id,",").concat(t.id).concat(o)}function pf(t,r){if(!(6&e.getCheckFlags(t)))return r(t);for(var n=0,i=t.containingType.types;n=n)for(var i=hf(e),a=0,o=0,s=0;s=o&&++a>=n)return!0;o=c.id}}return!1}function hf(t){if(524288&t.flags&&!Ym(t)){if(e.getObjectFlags(t)&&t.node)return t.node;if(t.symbol&&!(16&e.getObjectFlags(t)&&32&t.symbol.flags))return t.symbol;if(Vf(t))return t.target}if(262144&t.flags)return t.symbol;if(8388608&t.flags){do{t=t.objectType}while(8388608&t.flags);return t}return 16777216&t.flags?t.root:t}function vf(t,r,n){if(t===r)return-1;var i=24&e.getDeclarationModifierFlagsFromSymbol(t);if(i!==(24&e.getDeclarationModifierFlagsFromSymbol(r)))return 0;if(i){if(fC(t)!==fC(r))return 0}else if((16777216&t.flags)!=(16777216&r.flags))return 0;return Sx(t)!==Sx(r)?0:n(as(t),as(r))}function bf(t,r,n,i,a,o){if(t===r)return-1;if(!function(e,t,r){var n=Yb(e),i=Yb(t),a=Zb(e),o=Zb(t),s=ex(e),c=ex(t);return n===i&&a===o&&s===c||!!(r&&a<=o)}(t,r,n))return 0;if(e.length(t.typeParameters)!==e.length(r.typeParameters))return 0;if(r.typeParameters){for(var s=G_(t.typeParameters,r.typeParameters),c=0;ce.length(r.typeParameters)&&(a=Zs(a,e.last(du(t)))),t.objectFlags|=67108864,t.cachedEquivalentBaseType=a}}}function Nf(e){return Q?e===ut:e===qe}function wf(e){var t=Ef(e);return!!t&&Nf(t)}function Ff(e){return Vf(e)||!!cl(e,"0")}function Pf(e){return kf(e)||Ff(e)}function If(e){return!(240512&e.flags)}function Of(e){return!!(109440&e.flags)}function Mf(t){return 2097152&t.flags?e.some(t.types,Of):!!(109440&t.flags)}function Lf(t){return!!(16&t.flags)||(1048576&t.flags?!!(1024&t.flags)||e.every(t.types,Of):Of(t))}function Rf(e){return 1024&e.flags?Ns(e):402653312&e.flags?$e:256&e.flags?Ye:2048&e.flags?Ze:512&e.flags?it:1048576&e.flags?Wg(e,Rf):e}function Bf(e){return 1024&e.flags&&w_(e)?Ns(e):128&e.flags&&w_(e)?$e:256&e.flags&&w_(e)?Ye:2048&e.flags&&w_(e)?Ze:512&e.flags&&w_(e)?it:1048576&e.flags?Wg(e,Bf):e}function Jf(e){return 8192&e.flags?at:1048576&e.flags?Wg(e,Jf):e}function jf(e,t){return Hx(e,t)||(e=Jf(Bf(e))),e}function Uf(e,t,r,n){e&&Of(e)&&(e=jf(e,t?$D(r,t,n):void 0));return e}function Vf(t){return!!(4&e.getObjectFlags(t)&&8&t.target.objectFlags)}function Kf(e){return Vf(e)&&!!(8&e.target.combinedFlags)}function zf(e){return Kf(e)&&1===e.target.elementFlags.length}function Gf(e){return qf(e,e.target.fixedLength)}function qf(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=!1);var i=_u(e)-r;if(t-1&&(li(o,o.name.escapedText,788968,void 0,o.name.escapedText,!0)||o.name.originalKeywordKind&&e.isTypeNodeKind(o.name.originalKeywordKind))){var s="arg"+o.parent.parameters.indexOf(o),c=e.declarationNameToString(o.name)+(o.dotDotDotToken?"[]":"");return void Vn(Z,t,e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,s,c)}a=t.dotDotDotToken?Z?e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type:e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:Z?e.Diagnostics.Parameter_0_implicitly_has_an_1_type:e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 203:if(a=e.Diagnostics.Binding_element_0_implicitly_has_an_1_type,!Z)return;break;case 317:return void jn(t,e.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);case 256:case 169:case 168:case 172:case 173:case 213:case 214:if(Z&&!t.name)return void jn(t,3===n?e.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:e.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);a=Z?3===n?e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 195:return void(Z&&jn(t,e.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type));default:a=Z?e.Diagnostics.Variable_0_implicitly_has_an_1_type:e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage}Vn(Z,t,a,e.declarationNameToString(e.getNameOfDeclaration(t)),i)}}function bm(t,r,n){g((function(){!(Z&&65536&e.getObjectFlags(r))||n&&dh(t)||hm(r)||vm(t,r,n)}))}function xm(e,t,r){var n=Yb(e),i=Yb(t),a=tx(e),o=tx(t),s=o?i-1:i,c=a?s:Math.min(n,s),l=Ml(e);if(l){var u=Ml(t);u&&r(l,u)}for(var d=0;d0){for(var y=p,h=f;!((h=v(y).indexOf(g,h))>=0);){if(++y===e.length)return;h=0}b(y,h),f+=g.length}else if(f0)for(var S=0,D=r;Se.target.minLength||!t.target.hasRestElement&&(e.target.hasRestElement||t.target.fixedLength1){var r=e.filter(t,Ym);if(r.length){var n=yd(r,2);return e.concatenate(e.filter(t,(function(e){return!Ym(e)})),[n])}}return t}(t.candidates),o=(n=t.typeParameter,!!(i=Jc(n))&&Nx(16777216&i.flags?Uc(i):i,406978556)),s=!o&&t.topLevel&&(t.isFixed||!Om(Bl(r),t.typeParameter)),c=o?e.sameMap(a,N_):s?e.sameMap(a,Bf):a;return gm(416&t.priority?yd(c,2):function(t){if(!Q)return xf(t);var r=e.filter(t,(function(e){return!(98304&e.flags)}));return r.length?Yf(xf(r),98304&Hf(t)):yd(t,2)}(c))}function tg(t,r){var n,i,a=t.inferences[r];if(!a.inferredType){var o=void 0,s=t.signature;if(s){var c=a.candidates?eg(a,s):void 0;if(a.contraCandidates)o=!c||131072&c.flags||!e.some(a.contraCandidates,(function(e){return Dp(c,e)}))?Zm(a):c;else if(c)o=c;else if(1&t.flags)o=ct;else{var l=Qc(a.typeParameter);l&&(o=up(l,(n=function(t,r){return H_((function(n){return e.findIndex(t.inferences,(function(e){return e.typeParameter===n}))>=r?Ke:n}))}(t,r),i=t.nonFixingMapper,n?Q_(4,n,i):i)))}}else o=jm(a);a.inferredType=o||rg(!!(2&t.flags));var u=Jc(a.typeParameter);if(u){var d=up(u,t.nonFixingMapper);o&&t.compareTypes(o,Zs(d,o))||(a.inferredType=o=d)}}return a.inferredType}function rg(e){return e?Le:Ke}function ng(e){for(var t=[],r=0;r=10&&2*i>=t.length?n:void 0}(r,n);t.keyPropertyName=i?n:"",t.constituentMap=i}return t.keyPropertyName.length?t.keyPropertyName:void 0}}function gg(e,t){var r,n=null===(r=e.constituentMap)||void 0===r?void 0:r.get(ud(N_(t)));return n!==Ke?n:void 0}function yg(e,t){var r=mg(e),n=r&&po(t,r);return n&&gg(e,n)}function hg(e,t){return cg(e,t)||dg(e,t)}function vg(e,t){if(e.arguments)for(var r=0,n=e.arguments;r=0&&r.parameterIndex=n&&c-1){var u=a.filter((function(e){return void 0!==e})),d=c=2||0==(34&r.flags)||!r.valueDeclaration||e.isSourceFile(r.valueDeclaration)||292===r.valueDeclaration.parent.kind)return;var n=e.getEnclosingBlockScopeContainer(r.valueDeclaration),i=function(t,r){return!!e.findAncestor(t,(function(t){return t===r?"quit":e.isFunctionLike(t)||t.parent&&e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&t.parent.initializer===t}))}(t,n),a=Ey(n);if(a){if(i){var o=!0;if(e.isForStatement(n))if((u=e.getAncestor(r.valueDeclaration,255))&&u.parent===n){var s=function(t,r){return e.findAncestor(t,(function(e){return e===r?"quit":e===r.initializer||e===r.condition||e===r.incrementor||e===r.statement}))}(t.parent,n);if(s){var c=ni(s);c.flags|=131072;var l=c.capturedBlockScopeBindings||(c.capturedBlockScopeBindings=[]);e.pushIfUnique(l,r),s===n.initializer&&(o=!1)}}o&&(ni(a).flags|=65536)}var u;if(e.isForStatement(n))(u=e.getAncestor(r.valueDeclaration,255))&&u.parent===n&&function(t,r){var n=t;for(;212===n.parent.kind;)n=n.parent;var i=!1;if(e.isAssignmentTarget(n))i=!0;else if(219===n.parent.kind||220===n.parent.kind){var a=n.parent;i=45===a.operator||46===a.operator}if(!i)return!1;return!!e.findAncestor(n,(function(e){return e===r?"quit":e===r.statement}))}(t,n)&&(ni(r.valueDeclaration).flags|=4194304);ni(r.valueDeclaration).flags|=524288}i&&(ni(r.valueDeclaration).flags|=262144)}(t,n);var c=function(t,r){var n=t.valueDeclaration;if(n){if(e.isBindingElement(n)&&!n.initializer&&!n.dotDotDotToken&&n.parent.elements.length>=2){var i=n.parent.parent;if(254===i.kind&&2&e.getCombinedNodeFlags(n)||164===i.kind){var a=ni(i);if(!(268435456&a.flags)){a.flags|=268435456;var o=go(i,0);if(a.flags&=-268435457,o&&1048576&o.flags&&(164!==i.kind||!yy(t)))return 131072&(l=my(n.parent,o,o,void 0,r.flowNode)).flags?st:Co(n,l)}}}if(e.isParameter(n)&&!n.type&&!n.initializer&&!n.dotDotDotToken){var s=n.parent;if(s.parameters.length>=2&&yp(s)){var c=_h(s);if(c&&1===c.parameters.length&&j(c)){var l,u=Zc(as(c.parameters[0]));if(1048576&u.flags&&Kg(u,Vf)&&!yy(t))return t_(l=my(s,u,u,void 0,r.flowNode),P_(s.parameters.indexOf(n)-(e.getThisParameter(s)?1:0)))}}}}return as(t)}(a,t),l=e.getAssignmentTargetKind(t);if(l){if(!(3&a.flags||e.isInJSFile(t)&&512&a.flags))return jn(t,384&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum:32&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_class:1536&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace:16&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_function:2097152&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_import:e.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable,Ga(n)),Je;if(Sx(a))return 3&a.flags?jn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant,Ga(n)):jn(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ga(n)),Je}var u=2097152&a.flags;if(3&a.flags){if(1===l)return c}else{if(!u)return c;s=xi(n)}if(!s)return c;c=Sy(c,t,r);for(var d=164===e.getRootDeclaration(s).kind,_=gy(s),p=gy(t),f=p!==_,m=t.parent&&t.parent.parent&&e.isSpreadAssignment(t.parent)&&wg(t.parent.parent),g=134217728&n.flags;p!==_&&(213===p.kind||214===p.kind||e.isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(vy(a)&&c!==Xt||d&&!yy(a));)p=gy(p);var y=d||u||f||m||g||e.isBindingElement(s)||c!==Re&&c!==Xt&&(!Q||0!=(16387&c.flags)||og(t)||275===t.parent.kind)||230===t.parent.kind||254===s.kind&&s.exclamationToken||16777216&s.flags,h=y?d?function(e,t){if(so(t.symbol,2)){var r=Q&&164===t.kind&&t.initializer&&32768&Qf(e)&&!(32768&Qf(cS(t.initializer)));return uo(),r?Cg(e,524288):e}return rs(t.symbol),e}(c,s):c:c===Re||c===Xt?Ge:Zf(c),v=my(t,c,h,p);if(ay(t)||c!==Re&&c!==Xt){if(!y&&!(32768&Qf(c))&&32768&Qf(v))return jn(t,e.Diagnostics.Variable_0_is_used_before_being_assigned,Ga(n)),c}else if(v===Re||v===Xt)return Z&&(jn(e.getNameOfDeclaration(s),e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,Ga(n),Wa(v)),jn(t,e.Diagnostics.Variable_0_implicitly_has_an_1_type,Ga(n),Wa(v))),mD(v);return l?Rf(v):v}function Ey(t){return e.findAncestor(t,(function(t){return!t||e.nodeStartsNewLexicalEnvironment(t)?"quit":e.isIterationStatement(t,!1)}))}function ky(e,t){(ni(e).flags|=2,167===t.kind||171===t.kind)?ni(t.parent).flags|=4:ni(t).flags|=4}function Ay(t){return e.isSuperCall(t)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,Ay)}function Ny(e){return vs(Is(da(e)))===Xe}function wy(t,r,n){var i=r.parent;e.getClassExtendsHeritageElement(i)&&!Ny(i)&&t.flowNode&&!py(t.flowNode,!1)&&jn(t,n)}function Fy(t){var r=og(t),n=e.getThisContainer(t,!0),i=!1;switch(171===n.kind&&wy(t,n,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class),214===n.kind&&(n=e.getThisContainer(n,!1),i=!0),function(t,r){e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)&&r.initializer&&e.textRangeContainsPositionInclusive(r.initializer,t.pos)&&e.length(r.parent.decorators)&&jn(t,e.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class)}(t,n),n.kind){case 261:jn(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 260:jn(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 171:Iy(t,n)&&jn(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 162:jn(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name)}!r&&i&&G<2&&ky(t,n);var a=Py(t,!0,n);if(ee){var o=as(ue);if(a===o&&i)jn(t,e.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);else if(!a){var s=jn(t,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!e.isSourceFile(n)){var c=Py(n);c&&c!==o&&e.addRelatedInfo(s,e.createDiagnosticForNode(n,e.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container))}}}return a||Le}function Py(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=e.getThisContainer(t,!1));var i=e.isInJSFile(t);if(e.isFunctionLike(n)&&(!jy(t)||e.getThisParameter(n))){var a=Ml(wl(n))||i&&function(t){var r=e.getJSDocType(t);if(r&&317===r.kind){var n=r;if(n.parameters.length>0&&n.parameters[0].name&&"this"===n.parameters[0].name.escapedText)return J_(n.parameters[0].type)}var i=e.getJSDocThisTag(t);if(i&&i.typeExpression)return J_(i.typeExpression)}(n);if(!a){var o=function(t){if(213===t.kind&&e.isBinaryExpression(t.parent)&&3===e.getAssignmentDeclarationKind(t.parent))return t.parent.left.expression.expression;if(169===t.kind&&205===t.parent.kind&&e.isBinaryExpression(t.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent))return t.parent.parent.left.expression;if(213===t.kind&&296===t.parent.kind&&205===t.parent.parent.kind&&e.isBinaryExpression(t.parent.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent.parent))return t.parent.parent.parent.left.expression;if(213===t.kind&&e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)&&("value"===t.parent.name.escapedText||"get"===t.parent.name.escapedText||"set"===t.parent.name.escapedText)&&e.isObjectLiteralExpression(t.parent.parent)&&e.isCallExpression(t.parent.parent.parent)&&t.parent.parent.parent.arguments[2]===t.parent.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent.parent))return t.parent.parent.parent.arguments[0].expression;if(e.isMethodDeclaration(t)&&e.isIdentifier(t.name)&&("value"===t.name.escapedText||"get"===t.name.escapedText||"set"===t.name.escapedText)&&e.isObjectLiteralExpression(t.parent)&&e.isCallExpression(t.parent.parent)&&t.parent.parent.arguments[2]===t.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent))return t.parent.parent.arguments[0].expression}(n);if(i&&o){var s=cS(o).symbol;s&&s.members&&16&s.flags&&(a=Is(s).thisType)}else Cb(n)&&(a=Is(ua(n.symbol)).thisType);a||(a=Ry(n))}if(a)return my(t,a)}if(e.isClassLike(n.parent)){var c=da(n.parent);return my(t,e.isStatic(n)?as(c):Is(c).thisType)}if(e.isSourceFile(n)){if(n.commonJsModuleIndicator){var l=da(n);return l&&as(l)}if(n.externalModuleIndicator)return Ge;if(r)return as(ue)}}function Iy(t,r){return!!e.findAncestor(t,(function(t){return e.isFunctionLikeDeclaration(t)?"quit":164===t.kind&&t.parent===r}))}function Oy(t){var r=208===t.parent.kind&&t.parent.expression===t,n=e.getSuperContainer(t,!0),i=n,a=!1;if(!r)for(;i&&214===i.kind;)i=e.getSuperContainer(i,!0),a=G<2;var o=function(t){if(!t)return!1;if(r)return 171===t.kind;if(e.isClassLike(t.parent)||205===t.parent.kind)return e.isStatic(t)?169===t.kind||168===t.kind||172===t.kind||173===t.kind||167===t.kind||170===t.kind:169===t.kind||168===t.kind||172===t.kind||173===t.kind||167===t.kind||166===t.kind||171===t.kind;return!1}(i),s=0;if(!o){var c=e.findAncestor(t,(function(e){return e===i?"quit":162===e.kind}));return c&&162===c.kind?jn(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):r?jn(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):i&&i.parent&&(e.isClassLike(i.parent)||205===i.parent.kind)?jn(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):jn(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),Je}if(r||171!==n.kind||wy(t,i,e.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),e.isStatic(i)||r?(s=512,!r&&G>=2&&G<=8&&(e.isPropertyDeclaration(i)||e.isClassStaticBlockDeclaration(i))&&e.forEachEnclosingBlockScopeContainer(t.parent,(function(t){e.isSourceFile(t)&&!e.isExternalOrCommonJsModule(t)||(ni(t).flags|=134217728)}))):s=256,ni(t).flags|=s,169===i.kind&&e.hasSyntacticModifier(i,256)&&(e.isSuperProperty(t.parent)&&e.isAssignmentTarget(t.parent)?ni(i).flags|=4096:ni(i).flags|=2048),a&&ky(t.parent,i),205===i.parent.kind)return G<2?(jn(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),Je):Le;var l=i.parent;if(!e.getClassExtendsHeritageElement(l))return jn(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),Je;var u=Is(da(l)),d=u&&xs(u)[0];return d?171===i.kind&&Iy(t,i)?(jn(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),Je):512===s?vs(u):Zs(d,u.thisType):Je}function My(t){return 4&e.getObjectFlags(t)&&t.target===Ht?du(t)[0]:void 0}function Ly(t){return Wg(t,(function(t){return 2097152&t.flags?e.forEach(t.types,My):My(t)}))}function Ry(t){if(214!==t.kind){if(yp(t)){var r=_h(t);if(r){var n=r.thisParameter;if(n)return as(n)}}var i=e.isInJSFile(t);if(ee||i){var a=function(e){return 169!==e.kind&&172!==e.kind&&173!==e.kind||205!==e.parent.kind?213===e.kind&&296===e.parent.kind?e.parent.parent:void 0:e.parent}(t);if(a){for(var o=rh(a),s=a,c=o;c;){var l=Ly(c);if(l)return up(l,Fm(oh(a)));if(296!==s.parent.kind)break;c=rh(s=s.parent.parent)}return gm(o?em(o):zx(a))}var u=e.walkUpParenthesizedExpressions(t.parent);if(221===u.kind&&63===u.operatorToken.kind){var d=u.left;if(e.isAccessExpression(d)){var _=d.expression;if(i&&e.isIdentifier(_)){var p=e.getSourceFileOfNode(u);if(p.commonJsModuleIndicator&&ag(_)===p.symbol)return}return gm(zx(_))}}}}}function By(t){var r=t.parent;if(yp(r)){var n=e.getImmediatelyInvokedFunctionExpression(r);if(n&&n.arguments){var i=rb(n),a=r.parameters.indexOf(t);if(t.dotDotDotToken)return Xv(i,a,i.length,Le,void 0,0);var o=ni(n),s=o.resolvedSignature;o.resolvedSignature=Ir;var c=a=i?t_(as(n.parameters[i]),P_(r-i),256):Qb(n,r)}function Gy(t,r){var n=t.parent,i=n.left,a=n.operatorToken,o=n.right;switch(a.kind){case 63:case 76:case 75:case 77:return t===o?function(t){var r,n,i=e.getAssignmentDeclarationKind(t);switch(i){case 0:case 4:var a=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t))return ag(t);if(e.isPropertyAccessExpression(t)){var r=aS(t.expression);return e.isPrivateIdentifier(t.name)?n(r,t.name):cl(r,t.name.escapedText)}return;function n(e,t){var r=sv(t.escapedText,t);return r&&uv(e,r)}}(t.left),o=a&&a.valueDeclaration;return o&&(e.isPropertyDeclaration(o)||e.isPropertySignature(o))?(c=e.getEffectiveTypeAnnotationNode(o))&&up(J_(c),ri(a).mapper)||o.initializer&&aS(t.left):0===i?aS(t.left):Wy(t);case 5:if(qy(t,i))return Wy(t);if(t.left.symbol){var s=t.left.symbol.valueDeclaration;if(!s)return;var c,l=e.cast(t.left,e.isAccessExpression);if(c=e.getEffectiveTypeAnnotationNode(s))return J_(c);if(e.isIdentifier(l.expression)){var u=l.expression,d=li(u,u.escapedText,111551,void 0,u.escapedText,!0);if(d){var _=d.valueDeclaration&&e.getEffectiveTypeAnnotationNode(d.valueDeclaration);if(_){var p=e.getElementOrPropertyAccessName(l);if(void 0!==p)return Hy(J_(_),p)}return}}return e.isInJSFile(s)?void 0:aS(t.left)}return aS(t.left);case 1:case 6:case 3:var f=null===(r=t.left.symbol)||void 0===r?void 0:r.valueDeclaration;case 2:f||(f=null===(n=t.symbol)||void 0===n?void 0:n.valueDeclaration);var m=f&&e.getEffectiveTypeAnnotationNode(f);return m?J_(m):void 0;case 7:case 8:case 9:return e.Debug.fail("Does not apply");default:return e.Debug.assertNever(i)}}(n):void 0;case 56:case 60:var s=ah(n,r);return t===o&&(s&&s.pattern||!s&&!e.isDefaultedExpandoInitializer(n))?aS(i):s;case 55:case 27:return t===o?ah(n,r):void 0;default:return}}function qy(t,r){if(void 0===r&&(r=e.getAssignmentDeclarationKind(t)),4===r)return!0;if(!e.isInJSFile(t)||5!==r||!e.isIdentifier(t.left.expression))return!1;var n=t.left.expression.escapedText,i=li(t.left,n,111551,void 0,void 0,!0,!0);return e.isThisInitializedDeclaration(null==i?void 0:i.valueDeclaration)}function Wy(t){if(!t.symbol)return aS(t.left);if(t.symbol.valueDeclaration){var r=e.getEffectiveTypeAnnotationNode(t.symbol.valueDeclaration);if(r){var n=J_(r);if(n)return n}}var i=e.cast(t.left,e.isAccessExpression);if(e.isObjectLiteralMethod(e.getThisContainer(i.expression,!1))){var a=Fy(i.expression),o=e.getElementOrPropertyAccessName(i);return void 0!==o&&Hy(a,o)||void 0}}function Hy(t,r,n){return Wg(t,(function(t){var i,a;if(Pc(t)&&!t.declaration.nameType){var o=Dc(t),s=zc(o)||o,c=n||F_(e.unescapeLeadingUnderscores(r));if(Cp(c,s))return e_(t,c)}else if(3670016&t.flags){var l=cl(t,r);if(l)return a=l,262144&e.getCheckFlags(a)&&!a.type&&co(a,0)>=0?void 0:as(l);if(Vf(t)){var u=Gf(t);if(u&&e.isNumericLiteralName(r)&&+r>=0)return u}return null===(i=_l(fl(t),n||F_(e.unescapeLeadingUnderscores(r))))||void 0===i?void 0:i.type}}),!0)}function Qy(t,r){if(e.Debug.assert(e.isObjectLiteralMethod(t)),!(33554432&t.flags))return Xy(t,r)}function Xy(t,r){var n=t.parent,i=e.isPropertyAssignment(t)&&Jy(t);if(i)return i;var a=rh(n,r);if(a){if(Ws(t)){var o=da(t);return Hy(a,o.escapedName,ri(o).nameType)}if(t.name){var s=wd(t.name);return Wg(a,(function(e){var t;return null===(t=_l(fl(e),s))||void 0===t?void 0:t.type}),!0)}}}function $y(e,t){return e&&(Hy(e,""+t)||Wg(e,(function(e){return ND(1,e,Ge,void 0,!1)}),!0))}function Yy(t){var r=t.parent;return e.isJsxAttributeLike(r)?ah(t):e.isJsxElement(r)?function(t,r){var n=rh(t.openingElement.tagName),i=Oh(Ph(t));if(n&&!fo(n)&&i&&""!==i){var a=e.getSemanticJsxChildren(t.children),o=a.indexOf(r),s=Hy(n,i);return s&&(1===a.length?s:Wg(s,(function(e){return kf(e)?t_(e,P_(o)):e}),!0))}}(r,t):void 0}function Zy(t){if(e.isJsxAttribute(t)){var r=rh(t.parent);if(!r||fo(r))return;return Hy(r,t.name.escapedText)}return ah(t.parent)}function eh(e){switch(e.kind){case 10:case 8:case 9:case 14:case 110:case 95:case 104:case 79:case 153:return!0;case 206:case 212:return eh(e.expression);case 288:return!e.expression||eh(e.expression)}return!1}function th(t,r){return function(t,r){var n=mg(t),i=n&&e.find(r.properties,(function(e){return e.symbol&&296===e.kind&&e.symbol.escapedName===n&&eh(e.initializer)})),a=i&&sS(i.initializer);return a&&gg(t,a)}(r,t)||tf(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return!!e.symbol&&296===e.kind&&eh(e.initializer)&&pg(r,e.symbol.escapedName)})),(function(e){return[function(){return sS(e.initializer)},e.symbol.escapedName]})),e.map(e.filter(Rc(r),(function(e){var n;return!!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&pg(r,e.escapedName)})),(function(e){return[function(){return Ge},e.escapedName]}))),Cp,r)}function rh(t,r){var n=nh(e.isObjectLiteralMethod(t)?Qy(t,r):ah(t,r),t,r);if(n&&!(r&&2&r&&8650752&n.flags)){var i=Wg(n,Yc,!0);return 1048576&i.flags&&e.isObjectLiteralExpression(t)?th(t,i):1048576&i.flags&&e.isJsxAttributes(t)?function(t,r){return tf(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return!!e.symbol&&285===e.kind&&pg(r,e.symbol.escapedName)&&(!e.initializer||eh(e.initializer))})),(function(e){return[e.initializer?function(){return sS(e.initializer)}:function(){return rt},e.symbol.escapedName]})),e.map(e.filter(Rc(r),(function(e){var n;return!!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&pg(r,e.escapedName)})),(function(e){return[function(){return Ge},e.escapedName]}))),Cp,r)}(t,i):i}}function nh(t,r,n){if(t&&Nx(t,465829888)){var i=oh(r);if(i&&e.some(i.inferences,tS)){if(n&&1&n)return ih(t,i.nonFixingMapper);if(i.returnMapper){var a=ih(t,i.returnMapper);return 1048576&a.flags&&dd(a.types,tt)&&dd(a.types,nt)?zg(a,(function(e){return e!==tt&&e!==nt})):a}}}return t}function ih(t,r){return 465829888&t.flags?up(t,r):1048576&t.flags?yd(e.map(t.types,(function(e){return ih(e,r)})),0):2097152&t.flags?Td(e.map(t.types,(function(e){return ih(e,r)}))):t}function ah(t,r){if(33554432&t.flags);else{if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 254:case 164:case 167:case 166:case 203:return function(t,r){var n=t.parent;if(e.hasInitializer(n)&&t===n.initializer){var i=Jy(n);if(i)return i;if(!(8&r)&&e.isBindingPattern(n.name))return Uo(n.name,!0,!1)}}(t,r);case 214:case 247:return function(t){var r=e.getContainingFunction(t);if(r){var n=Vy(r);if(n){var i=e.getFunctionFlags(r);if(1&i){var a=MD(n,2&i?2:1,void 0);if(!a)return;n=a.returnType}if(2&i){var o=Wg(n,BS);return o&&yd([o,lx(o)])}return n}}}(t);case 224:return function(t){var r=e.getContainingFunction(t);if(r){var n=e.getFunctionFlags(r),i=Vy(r);if(i)return t.asteriskToken?i:$D(0,i,0!=(2&n))}}(n);case 218:return function(e,t){var r=ah(e,t);if(r){var n=BS(r);return n&&yd([n,lx(n)])}}(n,r);case 208:case 209:return Ky(n,t);case 211:case 229:return e.isConstTypeReference(n.type)?o(n):J_(n.type);case 221:return Gy(t,r);case 296:case 297:return Xy(n,r);case 298:return ah(n.parent,r);case 204:var i=n;return $y(rh(i,r),e.indexOfNode(i.elements,t));case 222:return function(e,t){var r=e.parent;return e===r.whenTrue||e===r.whenFalse?ah(r,t):void 0}(t,r);case 233:return e.Debug.assert(223===n.parent.kind),function(e,t){if(210===e.parent.kind)return Ky(e.parent,t)}(n.parent,t);case 212:var a=e.isInJSFile(n)?e.getJSDocTypeTag(n):void 0;return a?e.isJSDocTypeTag(a)&&e.isConstTypeReference(a.typeExpression.type)?o(n):J_(a.typeExpression.type):ah(n,r);case 230:return ah(n,r);case 271:return qo(n);case 288:return Yy(n);case 285:case 287:return Zy(n);case 280:case 279:return function(t,r){if(e.isJsxOpeningElement(t)&&t.parent.contextualType&&4!==r)return t.parent.contextualType;return zy(t,0)}(n,r)}}function o(e){return ah(e)}}function oh(t){var r=e.findAncestor(t,(function(e){return!!e.inferenceContext}));return r&&r.inferenceContext}function sh(t,r){return 0!==Yv(r)?function(e,t){var r=ix(e,Ke);r=ch(t,Ph(t),r);var n=Nh(w.IntrinsicAttributes,t);mo(n)||(r=dc(n,r));return r}(t,r):function(t,r){var n=Ph(r),i=(o=n,Ih(w.ElementAttributesPropertyNameContainer,o)),a=void 0===i?ix(t,Ke):""===i?Bl(t):function(e,t){if(e.compositeSignatures){for(var r=[],n=0,i=e.compositeSignatures;n=2)return fu(a,Nl([s,n],c,2,e.isInJSFile(t)))}if(e.length(o.typeParameters)>=2)return cu(o,Nl([s,n],o.typeParameters,2,e.isInJSFile(t)))}return n}function lh(t){return e.getStrictOptionValue(z,"noImplicitAny")?e.reduceLeft(t,(function(t,r){return t!==r&&t?lc(t.typeParameters,r.typeParameters)?function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=G_(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Yb(e),i=Yb(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=ex(e)||ex(t),l=c&&!ex(a),u=new Array(s+(l?1:0)),d=0;d=Zb(a)&&d>=Zb(o),y=d>=n?void 0:Gb(e,d),h=d>=i?void 0:Gb(t,d),v=Wn(1|(g&&!m?16777216:0),(y===h?y:y?h?void 0:y:h)||"arg".concat(d));v.type=m?Qu(f):f,u[d]=v}if(l){var b=Wn(1,"args");b.type=Qu(Qb(o,s)),o===t&&(b.type=up(b.type,r)),u[s]=b}return u}(t,r,n),s=function(e,t,r){if(!e||!t)return e||t;var n=yd([as(e),up(as(t),r)]);return lm(e,n)}(t.thisParameter,r.thisParameter,n),c=Math.max(t.minArgumentCount,r.minArgumentCount),l=tc(a,i,s,o,void 0,void 0,c,39&(t.flags|r.flags));l.compositeKind=2097152,l.compositeSignatures=e.concatenate(2097152===t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(l.mapper=2097152===t.compositeKind&&t.mapper&&t.compositeSignatures?$_(t.mapper,n):n);return l}(t,r):void 0:t})):void 0}function uh(t,r){var n=ul(t,0),i=e.filter(n,(function(t){return!function(t,r){for(var n=0;n0&&(s=C_(s,B(),t.symbol,m,u),o=[],a=e.createSymbolTable(),y=!1,h=!1,v=!1),Sh(N=nl(cS(E.expression)))){var M=D_(N,u);if(i&&kh(M,i,E),D=o.length,mo(s))continue;s=C_(s,M,t.symbol,m,u)}else jn(E,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),s=Je;continue}e.Debug.assert(172===E.kind||173===E.kind),UC(E)}!A||8576&A.flags?a.set(k.escapedName,k):Cp(A,ft)&&(Cp(A,Ye)?h=!0:Cp(A,at)?v=!0:y=!0,n&&(g=!0)),o.push(k)}if(l&&298!==t.parent.kind)for(var L=0,R=Rc(c);L0&&(s=C_(s,B(),t.symbol,m,u),o=[],a=e.createSymbolTable(),y=!1,h=!1),Wg(s,(function(e){return e===Dt?B():e}))):B();function B(){var r=[];y&&r.push(vh(t,D,o,$e)),h&&r.push(vh(t,D,o,Ye)),v&&r.push(vh(t,D,o,at));var i=Na(t.symbol,a,e.emptyArray,e.emptyArray,r);return i.objectFlags|=131200|m,f&&(i.objectFlags|=4096),g&&(i.objectFlags|=512),n&&(i.pattern=t),i}}function Sh(t){var r=Xf(Wg(t,Gc));return!!(126615553&r.flags||3145728&r.flags&&e.every(r.types,Sh))}function Dh(t){return e.stringContains(t,"-")}function Ch(t){return 79===t.kind&&e.isIntrinsicJsxName(t.escapedText)}function Th(e,t){return e.initializer?Xx(e.initializer,t):rt}function Eh(e,t){for(var r=[],n=0,i=e.children;n0&&(s=C_(s,C(),i.symbol,u,!1),o=e.createSymbolTable()),fo(g=nl(zx(f.expression,r)))&&(c=!0),Sh(g)?(s=C_(s,g,i.symbol,u,!1),a&&kh(g,a,f)):(jn(f.expression,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),n=n?Td([n,g]):g)}c||o.size>0&&(s=C_(s,C(),i.symbol,u,!1));var h=278===t.parent.kind?t.parent:void 0;if(h&&h.openingElement===t&&h.children.length>0){var v=Eh(h,r);if(!c&&d&&""!==d){l&&jn(i,e.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,e.unescapeLeadingUnderscores(d));var b=rh(t.attributes),x=b&&Hy(b,d),S=Wn(4,d);S.type=1===v.length?v[0]:x&&Vg(x,Ff)?rd(v):Qu(yd(v)),S.valueDeclaration=e.factory.createPropertySignature(void 0,e.unescapeLeadingUnderscores(d),void 0,void 0),e.setParent(S.valueDeclaration,i),S.valueDeclaration.symbol=S;var D=e.createSymbolTable();D.set(d,S),s=C_(s,Na(i.symbol,D,e.emptyArray,e.emptyArray,e.emptyArray),i.symbol,u,!1)}}return c?Le:n&&s!==Ct?Td([n,s]):n||(s===Ct?C():s);function C(){u|=ne;var t=Na(i.symbol,o,e.emptyArray,e.emptyArray,e.emptyArray);return t.objectFlags|=131200|u,t}}(t.parent,r)}function Nh(e,t){var r=Ph(t),n=r&&oa(r),i=n&&ai(n,e,788968);return i?Is(i):Je}function wh(t){var r=ni(t);if(!r.resolvedSymbol){var n=Nh(w.IntrinsicElements,t);if(mo(n))return Z&&jn(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,e.unescapeLeadingUnderscores(w.IntrinsicElements)),r.resolvedSymbol=Pe;if(!e.isIdentifier(t.tagName))return e.Debug.fail();var i=cl(n,t.tagName.escapedText);return i?(r.jsxFlags|=1,r.resolvedSymbol=i):yl(n,$e)?(r.jsxFlags|=2,r.resolvedSymbol=n.symbol):(jn(t,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.idText(t.tagName),"JSX."+w.IntrinsicElements),r.resolvedSymbol=Pe)}return r.resolvedSymbol}function Fh(t){var r=t&&e.getSourceFileOfNode(t),n=r&&ni(r);if(!n||!1!==n.jsxImplicitImportContainer){if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;var i=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(z,r),z);if(i){var a=$i(t,i,e.getEmitModuleResolutionKind(z)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations,t),o=a&&a!==Pe?ua(Bi(a)):void 0;return n&&(n.jsxImplicitImportContainer=o||!1),o}}}function Ph(e){var t=e&&ni(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){var r=Fh(e);if(!r||r===Pe){var n=Mn(e);r=li(e,n,1920,void 0,n,!1)}if(r){var i=Bi(ai(oa(Bi(r)),w.JSX,1920));if(i&&i!==Pe)return t&&(t.jsxNamespace=i),i}t&&(t.jsxNamespace=!1)}var a=Bi(Ou(w.JSX,1920,void 0));return a!==Pe?a:void 0}function Ih(t,r){var n=r&&ai(r.exports,t,788968),i=n&&Is(n),a=i&&Rc(i);if(a){if(0===a.length)return"";if(1===a.length)return a[0].escapedName;a.length>1&&n.declarations&&jn(n.declarations[0],e.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property,e.unescapeLeadingUnderscores(t))}}function Oh(e){return Ih(w.ElementChildrenAttributeNameContainer,e)}function Mh(t,r){if(4&t.flags)return[Ir];if(128&t.flags){var n=Lh(t,r);return n?[bb(r,n)]:(jn(r,e.Diagnostics.Property_0_does_not_exist_on_type_1,t.value,"JSX."+w.IntrinsicElements),e.emptyArray)}var i=Yc(t),a=ul(i,1);return 0===a.length&&(a=ul(i,0)),0===a.length&&1048576&i.flags&&(a=cc(e.map(i.types,(function(e){return Mh(e,r)})))),a}function Lh(t,r){var n=Nh(w.IntrinsicElements,r);if(!mo(n)){var i=t.value,a=cl(n,e.escapeLeadingUnderscores(i));if(a)return as(a);var o=yl(n,$e);return o||void 0}return Le}function Rh(t){e.Debug.assert(Ch(t.tagName));var r=ni(t);if(!r.resolvedJsxElementAttributesType){var n=wh(t);return 1&r.jsxFlags?r.resolvedJsxElementAttributesType=as(n)||Je:2&r.jsxFlags?r.resolvedJsxElementAttributesType=yl(Nh(w.IntrinsicElements,t),$e)||Je:r.resolvedJsxElementAttributesType=Je}return r.resolvedJsxElementAttributesType}function Bh(e){var t=Nh(w.ElementClass,e);if(!mo(t))return t}function Jh(e){return Nh(w.Element,e)}function jh(e){var t=Jh(e);if(t)return yd([t,Qe])}function Uh(t){var r,n=e.isJsxOpeningLikeElement(t);if(n&&function(t){(function(t){if(e.isPropertyAccessExpression(t)){var r=t;do{var n=a(r.name);if(n)return n;r=r.expression}while(e.isPropertyAccessExpression(r));var i=a(r);if(i)return i}function a(t){if(e.isIdentifier(t)&&-1!==e.idText(t).indexOf(":"))return vE(t,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}})(t.tagName),ZT(t,t.typeArguments);for(var r=new e.Map,n=0,i=t.attributes.properties;n=0)return d>=Zb(n)&&(ex(n)||ds)return!1;if(o||a>=c)return!0;for(var _=a;_=i&&r.length<=n}function Kv(e){return Gv(e,0,!1)}function zv(e){return Gv(e,0,!1)||Gv(e,1,!1)}function Gv(e,t,r){if(524288&e.flags){var n=Ic(e);if(r||0===n.properties.length&&0===n.indexInfos.length){if(0===t&&1===n.callSignatures.length&&0===n.constructSignatures.length)return n.callSignatures[0];if(1===t&&1===n.constructSignatures.length&&0===n.callSignatures.length)return n.constructSignatures[0]}}}function qv(t,r,n,i){var a=Dm(t.typeParameters,t,0,i),o=tx(r),s=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return xm(s?tp(r,s):r,t,(function(e,t){Hm(a.inferences,e,t)})),n||Sm(r,t,(function(e,t){Hm(a.inferences,e,t,128)})),Vl(t,ng(a),e.isInJSFile(r.declaration))}function Wv(t){if(!t)return ot;var r=cS(t);return e.isOptionalChainRoot(t.parent)?em(r):e.isOptionalChain(t.parent)?rm(r):r}function Hv(t,r,n,i,a){if(e.isJsxOpeningLikeElement(t))return function(e,t,r,n){var i=sh(t,e),a=Kx(e.attributes,i,n,r);return Hm(n.inferences,a,i),ng(n)}(t,r,i,a);if(165!==t.kind){var o=ah(t,e.every(r.typeParameters,(function(e){return!!Qc(e)}))?8:0);if(o){var s=Bl(r);if(Pm(s)){var c=oh(t),l=Fm(function(t,r){return void 0===r&&(r=0),t&&Cm(e.map(t.inferences,wm),t.signature,t.flags|r,t.compareTypes)}(c,1)),u=up(o,l),d=Kv(u),_=d&&d.typeParameters?Hl(Kl(d,d.typeParameters)):u;Hm(a.inferences,_,s,128);var p=Dm(r.typeParameters,r,a.flags),f=up(o,c&&c.returnMapper);Hm(p.inferences,f,s),a.returnMapper=e.some(p.inferences,tS)?Fm(function(t){var r=e.filter(t.inferences,tS);return r.length?Cm(e.map(r,wm),t.signature,t.flags,t.compareTypes):void 0}(p)):void 0}}}var m=rx(r),g=m?Math.min(Yb(r)-1,n.length):n.length;if(m&&262144&m.flags){var y=e.find(a.inferences,(function(e){return e.typeParameter===m}));y&&(y.impliedArity=e.findIndex(n,Rv,g)<0?n.length-g:void 0)}var h=Ml(r);if(h&&Pm(h)){var v=eb(t);Hm(a.inferences,Wv(v),h)}for(var b=0;b=n-1&&Rv(d=t[n-1]))return Qv(232===d.kind?d.type:Kx(d.expression,i,a,o));for(var s=[],c=[],l=[],u=r;ud&&(d=h)}}if(!u)return!0;for(var v=1/0,b=0,x=i;b0||e.isJsxOpeningElement(t)&&t.parent.children.length>0?[t.attributes]:e.emptyArray;var i=t.arguments||e.emptyArray,a=Bv(i);if(a>=0){for(var o=i.slice(0,a),s=function(t){var r=i[t],n=225===r.kind&&(Qr?cS(r.expression):zx(r.expression));n&&Vf(n)?e.forEach(du(n),(function(e,t){var i,a=n.target.elementFlags[t],s=tb(r,4&a?Qu(e):e,!!(12&a),null===(i=n.target.labeledElementDeclarations)||void 0===i?void 0:i[t]);o.push(s)})):o.push(r)},c=a;c-1)return e.createDiagnosticForNode(n[a],e.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);for(var o,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,d=0,_=r;d<_.length;d++){var p=_[d],f=Zb(p),m=Yb(p);fl&&(l=f),n.length1&&(y=G(p,kn,v,x)),y||(y=G(p,Nn,v,x)),y)return y;if(_)if(f)if(1===f.length||f.length>3){var S,D=f[f.length-1];f.length>3&&(S=e.chainDiagnosticMessages(S,e.Diagnostics.The_last_overload_gave_the_following_error),S=e.chainDiagnosticMessages(S,e.Diagnostics.No_overload_matches_this_call));var C=Zv(t,h,D,Nn,0,!0,(function(){return S}));if(C)for(var T=0,E=C;T3&&e.addRelatedInfo(k,e.createDiagnosticForNode(D.declaration,e.Diagnostics.The_last_overload_is_declared_here)),z(D,k),Dn.add(k)}else e.Debug.fail("No error for last overload signature")}else{for(var A=[],N=0,w=Number.MAX_VALUE,F=0,P=0,I=function(r){var n=Zv(t,h,r,Nn,0,!0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Overload_0_of_1_2_gave_the_following_error,P+1,p.length,qa(r))}));n?(n.length<=w&&(w=n.length,F=P),N=Math.max(N,n.length),A.push(n)):e.Debug.fail("No error for 3 or fewer overload signatures"),P++},O=0,M=f;O1?A[F]:e.flatten(A);e.Debug.assert(L.length>0,"No errors reported for 3 or fewer overload signatures");var R=e.chainDiagnosticMessages(e.map(L,e.createDiagnosticMessageChainFromDiagnostic),e.Diagnostics.No_overload_matches_this_call),B=r([],e.flatMap(L,(function(e){return e.relatedInformation})),!0),J=void 0;if(e.every(L,(function(e){return e.start===L[0].start&&e.length===L[0].length&&e.file===L[0].file}))){var V=L[0];J={file:V.file,start:V.start,length:V.length,code:R.code,category:R.category,messageText:R,relatedInformation:B}}else J=e.createDiagnosticForNodeFromMessageChain(t,R,B);z(f[0],J),Dn.add(J)}else if(m)Dn.add(ob(t,[m],h));else if(g)$v(g,t.typeArguments,!0,s);else{var K=e.filter(n,(function(e){return Vv(e,c)}));0===K.length?Dn.add(function(t,r,n){var i=n.length;if(1===r.length){var a=Al((d=r[0]).typeParameters),o=e.length(d.typeParameters);return e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,ai?c=Math.min(c,_):o0),UC(t),i||1===r.length||r.some((function(e){return!!e.typeParameters}))?function(t,r,n,i){var a=function(e,t){for(var r=-1,n=-1,i=0;i=t)return i;o>n&&(n=o,r=i)}return r}(r,void 0===de?n.length:de),o=r[a],s=o.typeParameters;if(!s)return o;var c=Ov(t)?t.typeArguments:void 0,l=c?zl(o,function(e,t,r){var n=e.map(nT);for(;n.length>t.length;)n.pop();for(;n.length1?e.find(c,(function(t){return e.isFunctionLikeDeclaration(t)&&e.nodeIsPresent(t.body)})):void 0;if(l){var u=wl(l),d=!u.typeParameters;G([u],Nn,d)&&e.addRelatedInfo(r,e.createDiagnosticForNode(l,e.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible))}f=a,m=o,g=s}function G(r,n,i,o){if(void 0===o&&(o=!1),f=void 0,m=void 0,g=void 0,i){var s=r[0];if(e.some(c)||!Uv(t,h,s,o))return;return Zv(t,h,s,n,0,!1,void 0)?void(f=[s]):s}for(var l=0;l=0&&jn(t.arguments[i],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher)}var a=Xh(t.expression);if(a===ct)return Lr;if(mo(a=Yc(a)))return Lv(t);if(fo(a))return t.typeArguments&&jn(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),Mv(t);var o=ul(a,1);if(o.length){if(!function(t,r){if(!r||!r.declaration)return!0;var n=r.declaration,i=e.getSelectedEffectiveModifierFlags(n,24);if(!i||171!==n.kind)return!0;var a=e.getClassLikeDeclarationOfSymbol(n.parent.symbol),o=Is(n.parent.symbol);if(!YC(t,a)){var s=e.getContainingClass(t);if(s&&16&i){var c=nT(s);if(mb(n.parent.symbol,c))return!0}return 8&i&&jn(t,e.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,Wa(o)),16&i&&jn(t,e.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,Wa(o)),!1}return!0}(t,o[0]))return Lv(t);if(fb(o,(function(e){return!!(4&e.flags)})))return jn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Lv(t);var s=a.symbol&&e.getClassLikeDeclarationOfSymbol(a.symbol);return s&&e.hasSyntacticModifier(s,128)?(jn(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Lv(t)):sb(t,o,r,n,0)}var c=ul(a,0);if(c.length){var l=sb(t,c,r,n,0);return Z||(l.declaration&&!Cb(l.declaration)&&Bl(l)!==ot&&jn(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),Ml(l)===ot&&jn(t,e.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),l}return yb(t.expression,a,1),Lv(t)}function fb(t,r){return e.isArray(t)?e.some(t,(function(e){return fb(e,r)})):1048576===t.compositeKind?e.some(t.compositeSignatures,r):r(t)}function mb(t,r){var n=xs(r);if(!e.length(n))return!1;var i=n[0];if(2097152&i.flags){for(var a=_c(i.types),o=0,s=0,c=i.types;s0;if(1048576&r.flags){for(var c=!1,l=0,u=r.types;l1)return vE(r[1],e.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext)}if(0===r.length||r.length>2)return vE(t,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);var n=e.find(r,e.isSpreadElement);if(n)return vE(n,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element)}(t),0===t.arguments.length)return ux(t,Le);for(var r=t.arguments[0],n=zx(r),i=t.arguments.length>1?zx(t.arguments[1]):void 0,a=2;a=n-1)return r===n-1?a:Qu(t_(a,Ye));for(var o=[],s=[],c=[],l=r;l0&&(a=t.parameters.length-1+c)}}if(void 0===a){if(!n&&32&t.flags)return 0;a=t.minArgumentCount}if(i)return a;for(var l=a-1;l>=0;l--){if(131072&zg(Qb(t,l),Jv).flags)break;a=l}t.resolvedMinArgumentCount=a}return t.resolvedMinArgumentCount}function ex(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]);return!Vf(t)||t.target.hasRestElement}return!1}function tx(e){if(j(e)){var t=as(e.parameters[e.parameters.length-1]);if(!Vf(t))return t;if(t.target.hasRestElement)return od(t,t.target.fixedLength)}}function rx(e){var t=tx(e);return!t||Sf(t)||fo(t)||0!=(131072&nl(t).flags)?void 0:t}function nx(e){return ix(e,st)}function ix(e,t){return e.parameters.length>0?Qb(e,0):t}function ax(t,r){if(r.typeParameters){if(t.typeParameters)return;t.typeParameters=r.typeParameters}r.thisParameter&&((!(a=t.thisParameter)||a.valueDeclaration&&!a.valueDeclaration.type)&&(a||(t.thisParameter=lm(r.thisParameter,void 0)),ox(t.thisParameter,as(r.thisParameter))));for(var n=t.parameters.length-(j(t)?1:0),i=0;i0&&(n=yd(u,2)):l=st;var d=function(t,r){var n=[],i=[],a=0!=(2&e.getFunctionFlags(t));return e.forEachYieldExpression(t.body,(function(t){var o,s=t.expression?cS(t.expression,r):qe;if(e.pushIfUnique(n,px(t,s,Le,a)),t.asteriskToken){var c=MD(s,a?19:17,t.expression);o=c&&c.nextType}else o=ah(t);o&&e.pushIfUnique(i,o)})),{yieldTypes:n,nextTypes:i}}(t,r),_=d.yieldTypes,p=d.nextTypes;i=e.some(_)?yd(_,2):void 0,a=e.some(p)?Td(p):void 0}else{var f=yx(t,r);if(!f)return 2&o?ux(t,st):st;if(0===f.length)return 2&o?ux(t,ot):ot;n=yd(f,2)}if(n||i||a){if(i&&bm(t,i,3),n&&bm(t,n,1),a&&bm(t,a,2),n&&Of(n)||i&&Of(i)||a&&Of(a)){var m=dh(t),g=m?m===wl(t)?c?void 0:n:nh(Bl(m),t):void 0;c?(i=Uf(i,g,0,s),n=Uf(n,g,1,s),a=Uf(a,g,2,s)):n=function(e,t,r){return e&&Of(e)&&(e=jf(e,t?r?PS(t):t:void 0)),e}(n,g,s)}i&&(i=gm(i)),n&&(n=gm(n)),a&&(a=gm(a))}return c?_x(i||st,n||l,a||Uy(2,t)||Ke,s):s?cx(n||l):n||l}function _x(e,t,r,n){var i=n?Kr:zr,a=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||Ke,t=i.resolveIterationType(t,void 0)||Ke,r=i.resolveIterationType(r,void 0)||Ke,a===kt){var o=i.getGlobalIterableIteratorType(!1),s=o!==kt?JD(o,i):void 0,c=s?s.returnType:Le,l=s?s.nextType:Ge;return Cp(t,c)&&Cp(l,r)?o!==kt?Wu(o,[e]):(i.getGlobalIterableIteratorType(!0),Dt):(i.getGlobalGeneratorType(!0),Dt)}return Wu(a,[e,t,r])}function px(t,r,n,i){var a=t.expression||t,o=t.asteriskToken?AD(i?19:17,r,n,a):r;return i?RS(o,a,t.asteriskToken?e.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:e.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function fx(e,t,r,n){var i=0;if(n){for(var a=t;a=4)break;default:null!=i||(i=e.getSpanOfTokenAtPosition(n,t.pos)),Dn.add(e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher))}}}else if(!gE(n=e.getSourceFileOfNode(t))){if(i=e.getSpanOfTokenAtPosition(n,t.pos),a=e.createFileDiagnostic(n,i.start,i.length,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),r&&171!==r.kind&&0==(2&e.getFunctionFlags(r))){var o=e.createDiagnosticForNode(r,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(a,o)}Dn.add(a)}}jy(t)&&jn(t,e.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer)}(t)}));var r=cS(t.expression),n=IS(r,!0,t,e.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return n!==r||mo(n)||3&r.flags||Un(!1,e.createDiagnosticForNode(t,e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression)),n}function kx(e){return Nx(e,2112)?wx(e,3)||Nx(e,296)?gt:Ze:Ye}function Ax(e,t){if(Nx(e,t))return!0;var r=Gc(e);return!!r&&Nx(r,t)}function Nx(e,t){if(e.flags&t)return!0;if(3145728&e.flags)for(var r=0,n=e.types;r1&&t.charCodeAt(r-1)>=48&&t.charCodeAt(r-1)<=57;)r--;for(var n=t.slice(0,r),i=1;;i++){var a=n+i;if(!rS(e,a))return a}}function iS(e){var t=Kv(e);if(t&&!t.typeParameters)return Bl(t)}function aS(t){var r=oS(t);if(r)return r;if(134217728&t.flags&&kr){var n=kr[O(t)];if(n)return n}var i=Yr,a=cS(t);Yr!==i&&((kr||(kr=[]))[O(t)]=a,e.setNodeFlags(t,134217728|t.flags));return a}function oS(t){var r=e.skipParentheses(t,!0);if(e.isJSDocTypeAssertion(r)){var n=e.getJSDocTypeAssertionType(r);if(!e.isConstTypeReference(n))return J_(n)}if(r=e.skipParentheses(t),!e.isCallExpression(r)||106===r.expression.kind||e.isRequireCall(r,!0)||Nb(r)){if(e.isAssertionExpression(r)&&!e.isConstTypeReference(r.type))return J_(r.type);if(8===t.kind||10===t.kind||110===t.kind||95===t.kind)return cS(t)}else{if(n=e.isCallChain(r)?function(e){var t=cS(e.expression),r=im(t,e.expression),n=iS(t);return n&&nm(n,e,r!==t)}(r):iS(Xh(r.expression)))return n}}function sS(e){var t=ni(e);if(t.contextFreeType)return t.contextFreeType;var r=e.contextualType;e.contextualType=Le;try{return t.contextFreeType=cS(e,4)}finally{e.contextualType=r}}function cS(t,r,n){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkExpression",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var a=u;u=t,E=0;var o=function(t,r,n){var a=t.kind;if(i)switch(a){case 226:case 213:case 214:i.throwIfCancellationRequested()}switch(a){case 79:return Ty(t,r);case 80:return cv(t);case 108:return Fy(t);case 106:return Oy(t);case 104:return Xe;case 14:case 10:return A_(F_(t.text));case 8:return SE(t),A_(P_(+t.text));case 9:return function(t){if(!(e.isLiteralTypeNode(t.parent)||e.isPrefixUnaryExpression(t.parent)&&e.isLiteralTypeNode(t.parent.parent))&&G<7&&vE(t,e.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020))return!0}(t),A_(I_({negative:!1,base10Value:e.parsePseudoBigInt(t.text)}));case 110:return rt;case 95:return et;case 223:return Ux(t);case 13:return Wt;case 204:return fh(t,r,n);case 205:return xh(t,r);case 206:return iv(t,r);case 161:return av(t,r);case 207:return Pv(t,r);case 208:if(100===t.expression.kind)return wb(t);case 209:return function(t,r){var n;ZT(t,t.typeArguments);var i=Db(t,void 0,r);if(i===Mr)return lt;if(kb(i,t),106===t.expression.kind)return ot;if(209===t.kind){var a=i.declaration;if(a&&171!==a.kind&&175!==a.kind&&180!==a.kind&&!e.isJSDocConstructSignature(a)&&!Cb(a))return Z&&jn(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),Le}if(e.isInJSFile(t)&&Ob(t))return Ol(t.arguments[0]);var o=Bl(i);if(12288&o.flags&&Nb(t))return M_(e.walkUpParenthesizedExpressions(t.parent));if(208===t.kind&&!t.questionDotToken&&238===t.parent.kind&&16384&o.flags&&Ll(i))if(e.isDottedName(t.expression)){if(!cy(t)){var s=jn(t.expression,e.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);sy(t.expression,s)}}else jn(t.expression,e.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(e.isInJSFile(t)){var c=Eb(t,!1);if(null===(n=null==c?void 0:c.exports)||void 0===n?void 0:n.size){var l=Na(c,c.exports,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=4096,Td([o,l])}}return o}(t,r);case 210:return Mb(t);case 212:return function(t,r){if(e.hasJSDocNodes(t)&&e.isJSDocTypeAssertion(t)){var n=e.getJSDocTypeAssertionType(t);return Rb(n,n,t.expression,r)}return cS(t.expression,r)}(t,r);case 226:return function(e){return uC(e),UC(e),as(da(e))}(t);case 213:case 214:return vx(t,r);case 216:return function(e){return cS(e.expression),En}(t);case 211:case 229:return function(t){if(211===t.kind){var r=e.getSourceFileOfNode(t);r&&e.fileExtensionIsOneOf(r.fileName,[".cts",".mts"])&&vE(t,e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead)}return Rb(t,t.type,t.expression)}(t);case 230:return Bb(t);case 228:return Jb(t);case 231:return jb(t);case 215:return Tx(t);case 217:return function(e){return cS(e.expression),qe}(t);case 218:return Ex(t);case 219:return function(t){var r=cS(t.operand);if(r===ct)return ct;switch(t.operand.kind){case 8:switch(t.operator){case 40:return A_(P_(-t.operand.text));case 39:return A_(P_(+t.operand.text))}break;case 9:if(40===t.operator)return A_(I_({negative:!0,base10Value:e.parsePseudoBigInt(t.operand.text)}))}switch(t.operator){case 39:case 40:case 54:return rv(r,t.operand),Ax(r,12288)&&jn(t.operand,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(t.operator)),39===t.operator?(Nx(r,2112)&&jn(t.operand,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1,e.tokenToString(t.operator),Wa(Rf(r))),Ye):kx(r);case 53:CD(t.operand);var n=12582912&Dg(r);return 4194304===n?et:8388608===n?rt:it;case 45:case 46:return bx(t.operand,rv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Cx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),kx(r)}return Je}(t);case 220:return function(t){var r=cS(t.operand);return r===ct?ct:(bx(t.operand,rv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Cx(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),kx(r))}(t);case 221:return ae(t,r);case 222:return function(e,t){return CD(e.condition),SD(e.condition,e.whenTrue),yd([cS(e.whenTrue,t),cS(e.whenFalse,t)],2)}(t,r);case 225:return function(e,t){return G<2&&zT(e,z.downlevelIteration?1536:1024),AD(33,cS(e.expression,t),Ge,e.expression)}(t,r);case 227:return qe;case 224:return function(t){g((function(){8192&t.flags||yE(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),jy(t)&&jn(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer)}));var r=e.getContainingFunction(t);if(!r)return Le;var n=e.getFunctionFlags(r);if(!(1&n))return Le;var i=0!=(2&n);t.asteriskToken&&(i&&G<99&&zT(t,26624),!i&&G<2&&z.downlevelIteration&&zT(t,256));var a=Jl(r),o=a&&YD(a,i),s=o&&o.yieldType||Le,c=o&&o.nextType||Le,l=i?RS(c)||Le:c,u=t.expression?cS(t.expression):qe,d=px(t,u,l,i);if(a&&d&&Np(d,s,t.expression||t,t.expression),t.asteriskToken)return wD(i?19:17,1,u,t.expression)||Le;if(a)return $D(2,a,i)||Le;var _=Uy(2,r);return _||(_=Le,g((function(){if(Z&&!e.expressionResultIsUnused(t)){var r=ah(t);r&&!fo(r)||jn(t,e.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation)}}))),_}(t);case 232:return function(e){return e.isSpread?t_(e.type,Ye):e.type}(t);case 288:return zh(t,r);case 278:case 279:return function(e,t){return UC(e),Jh(e)||Le}(t);case 282:return function(t){Uh(t.openingFragment);var r=e.getSourceFileOfNode(t);return!e.getJSXTransformEnabled(z)||!z.jsxFactory&&!r.pragmas.has("jsx")||z.jsxFragmentFactory||r.pragmas.has("jsxfrag")||jn(t,z.jsxFactory?e.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:e.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),Eh(t),Jh(t)||Le}(t);case 286:return Ah(t,r);case 280:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement")}return Je}(t,r,n),s=Zx(t,o,r);return Px(s)&&function(t,r){206===t.parent.kind&&t.parent.expression===t||207===t.parent.kind&&t.parent.expression===t||(79===t.kind||161===t.kind)&&ZC(t)||181===t.parent.kind&&t.parent.exprName===t||275===t.parent.kind||jn(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);if(z.isolatedModules){e.Debug.assert(!!(128&r.symbol.flags)),16777216&r.symbol.valueDeclaration.flags&&jn(t,e.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided)}}(t,s),u=a,null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function lS(t){WT(t),t.expression&&yE(t.expression,e.Diagnostics.Type_expected),JC(t.constraint),JC(t.default);var r=Ps(da(t));zc(r),function(e){return Hc(e)!==wt}(r)||jn(t.default,e.Diagnostics.Type_parameter_0_has_a_circular_default,Wa(r));var n=Jc(r),i=Qc(r);n&&i&&Ap(i,Zs(up(n,W_(r,i)),i),t.default,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1),UC(t),g((function(){return oC(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0)}))}function uS(t){qT(t),gD(t);var r=e.getContainingFunction(t);e.hasSyntacticModifier(t,16476)&&(171===r.kind&&e.nodeIsPresent(r.body)||jn(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation),171===r.kind&&e.isIdentifier(t.name)&&"constructor"===t.name.escapedText&&jn(t.name,e.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name)),t.questionToken&&e.isBindingPattern(t.name)&&r.body&&jn(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),t.name&&e.isIdentifier(t.name)&&("this"===t.name.escapedText||"new"===t.name.escapedText)&&(0!==r.parameters.indexOf(t)&&jn(t,e.Diagnostics.A_0_parameter_must_be_the_first_parameter,t.name.escapedText),171!==r.kind&&175!==r.kind&&180!==r.kind||jn(t,e.Diagnostics.A_constructor_cannot_have_a_this_parameter),214===r.kind&&jn(t,e.Diagnostics.An_arrow_function_cannot_have_a_this_parameter),172!==r.kind&&173!==r.kind||jn(t,e.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters)),!t.dotDotDotToken||e.isBindingPattern(t.name)||Cp(nl(as(t.symbol)),$t)||jn(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type)}function dS(t,r,n){for(var i=0,a=t.elements;i=2||!e.hasRestParameter(t)||16777216&t.flags||e.nodeIsMissing(t.body))return;e.forEach(t.parameters,(function(t){t.name&&!e.isBindingPattern(t.name)&&t.name.escapedText===_e.escapedName&&Bn("noEmit",t,e.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)}))}(t);var r=e.getEffectiveReturnTypeNode(t);if(Z&&!r)switch(t.kind){case 175:jn(t,e.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 174:jn(t,e.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)}if(r){var n=e.getFunctionFlags(t);if(1==(5&n)){var i=J_(r);if(i===ot)jn(r,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else{var a=$D(0,i,0!=(2&n))||Le,o=$D(1,i,0!=(2&n))||a,s=$D(2,i,0!=(2&n))||Ke;Ap(_x(a,o,s,!!(2&n)),i,r)}}else 2==(3&n)&&function(t,r){var n=J_(r);if(G>=2){if(mo(n))return;var i=Uu(!0);if(i!==kt&&!ss(n,i))return void jn(r,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,Wa(BS(n)||ot))}else{if(function(t){jS(t&&e.getEntityNameFromTypeNode(t),!1)}(r),mo(n))return;var a=e.getEntityNameFromTypeNode(r);if(void 0===a)return void jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,Wa(n));var o=Wi(a,111551,!0),s=o?as(o):Je;if(mo(s))return void(79===a.kind&&"Promise"===a.escapedText&&cs(n)===Uu(!1)?jn(r,e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a)));var c=(d=!0,or||(or=Mu("PromiseConstructorLike",0,d))||Dt);if(c===Dt)return void jn(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a));if(!Ap(s,c,r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value))return;var l=a&&e.getFirstIdentifier(a),u=ai(t.locals,l.escapedText,111551);if(u)return void jn(u.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,e.idText(l),e.entityNameToString(a))}var d;IS(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)}(t,r)}176!==t.kind&&317!==t.kind&&HS(t)}))}function pS(t){for(var r=new e.Map,n=0,i=t.members;n0&&r.declarations[0]!==t)return}var n=Ql(da(t));if(null==n?void 0:n.declarations){for(var i=new e.Map,a=function(e){1===e.parameters.length&&e.parameters[0].type&&Ug(J_(e.parameters[0].type),(function(t){var r=i.get(ud(t));r?r.declarations.push(e):i.set(ud(t),{type:t,declarations:[e]})}))},o=0,s=n.declarations;o1)for(var r=0,n=t.declarations;r0}function MS(e){var t;if(16777216&e.flags){var r=qu(!1);return!!r&&e.aliasSymbol===r&&1===(null===(t=e.aliasTypeArguments)||void 0===t?void 0:t.length)}return!1}function LS(e){return 1048576&e.flags?Wg(e,LS):MS(e)?e.aliasTypeArguments[0]:e}function RS(t,r,n,i){var a=BS(t,r,n,i);return a&&function(t){if(fo(t))return t;if(MS(t))return t;if(Hd(t)){var r=zc(t);if(!r||3&r.flags||Vp(r)||OS(r)){var n=qu(!0);if(n)return fu(n,[LS(t)])}}return e.Debug.assert(void 0===PS(t),"type provided should not be a non-generic 'promise'-like."),t}(a)}function BS(t,r,n,i){if(fo(t))return t;if(MS(t))return t;var a=t;if(a.awaitedTypeOfType)return a.awaitedTypeOfType;if(1048576&t.flags){var o=r?function(e){return BS(e,r,n,i)}:BS;return a.awaitedTypeOfType=Wg(t,o)}var s=PS(t);if(s){if(t.id===s.id||Sn.lastIndexOf(s.id)>=0)return void(r&&jn(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));Sn.push(t.id);var c=BS(s,r,n,i);if(Sn.pop(),!c)return;return a.awaitedTypeOfType=c}if(!OS(t))return a.awaitedTypeOfType=t;r&&(e.Debug.assertIsDefined(n),jn(r,n,i))}function JS(t){var r=Db(t);kb(r,t);var n=Bl(r);if(!(1&n.flags)){var i,a;switch(t.parent.kind){case 257:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=yd([as(da(t.parent)),ot]);break;case 167:case 164:i=e.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any,a=ot;break;case 169:case 172:case 173:i=e.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1,a=yd([Hu(nT(t.parent)),ot]);break;default:return e.Debug.fail()}Ap(n,a,t,i)}}function jS(t,r){if(t){var n=e.getFirstIdentifier(t),i=2097152|(79===t.kind?788968:1920),a=li(n,n.escapedText,i,void 0,void 0,!0);if(a&&2097152&a.flags)if(!ha(a)||bT(Ji(a))||Vi(a)){if(r&&z.isolatedModules&&e.getEmitModuleKind(z)>=e.ModuleKind.ES2015&&!ha(a)&&!e.some(a.declarations,e.isTypeOnlyImportOrExportDeclaration)){var o=jn(t,e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled),s=e.find(a.declarations||e.emptyArray,Si);s&&e.addRelatedInfo(o,e.createDiagnosticForNode(s,e.Diagnostics._0_was_imported_here,e.idText(n)))}}else zi(a)}}function US(t){var r=VS(t);r&&e.isEntityName(r)&&jS(r,!0)}function VS(e){if(e)switch(e.kind){case 188:case 187:return KS(e.types);case 189:return KS([e.trueType,e.falseType]);case 191:case 197:return VS(e.type);case 178:return e.typeName}}function KS(t){for(var r,n=0,i=t;n=e.ModuleKind.ES2015)||q>=e.ModuleKind.Node16&&e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&r&&(lD(t,r,"require")||lD(t,r,"exports"))&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=_o(t);305===n.kind&&e.isExternalOrCommonJsModule(n)&&Bn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,e.declarationNameToString(r),e.declarationNameToString(r))}}(t,r),function(t,r){if(r&&!(G>=4)&&lD(t,r,"Promise")&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=_o(t);305===n.kind&&e.isExternalOrCommonJsModule(n)&&2048&n.flags&&Bn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,e.declarationNameToString(r),e.declarationNameToString(r))}}(t,r),function(e,t){G<=8&&(lD(e,t,"WeakMap")||lD(e,t,"WeakSet"))&&bn.push(e)}(t,r),function(e,t){t&&G>=2&&G<=8&&lD(e,t,"Reflect")&&xn.push(e)}(t,r),e.isClassLike(t)?(oC(r,e.Diagnostics.Class_name_cannot_be_0),16777216&t.flags||function(t){G>=1&&"Object"===t.escapedText&&(q1&&e.some(_.declarations,(function(r){return r!==t&&e.isVariableLike(r)&&!hD(r,t)}))&&jn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name))}else{var m=mD(Vo(t));mo(p)||mo(m)||vp(p,m)||67108864&_.flags||yD(_.valueDeclaration,p,t,m),t.initializer&&Np(zx(t.initializer),m,t,t.initializer,void 0),_.valueDeclaration&&!hD(t,_.valueDeclaration)&&jn(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name))}167!==t.kind&&166!==t.kind&&(wS(t),254!==t.kind&&203!==t.kind||function(t){if(0==(3&e.getCombinedNodeFlags(t))&&!e.isParameterDeclaration(t)&&(254!==t.kind||t.initializer)){var r=da(t);if(1&r.flags){if(!e.isIdentifier(t.name))return e.Debug.fail();var n=li(t,t.name.escapedText,3,void 0,void 0,!1);if(n&&n!==r&&2&n.flags&&3&Gh(n)){var i=e.getAncestor(n.valueDeclaration,255),a=237===i.parent.kind&&i.parent.parent?i.parent.parent:void 0;if(!a||!(235===a.kind&&e.isFunctionLike(a.parent)||262===a.kind||261===a.kind||305===a.kind)){var o=Ga(n);jn(t,e.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,o,o)}}}}}(t),fD(t,t.name))}}}}function yD(t,r,n,i){var a=e.getNameOfDeclaration(n),o=167===n.kind||166===n.kind?e.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:e.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,s=e.declarationNameToString(a),c=jn(a,o,s,Wa(r),Wa(i));t&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,e.Diagnostics._0_was_also_declared_here,s))}function hD(t,r){if(164===t.kind&&254===r.kind||254===t.kind&&164===r.kind)return!0;if(e.hasQuestionToken(t)!==e.hasQuestionToken(r))return!1;return e.getSelectedEffectiveModifierFlags(t,504)===e.getSelectedEffectiveModifierFlags(r,504)}function vD(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath}),function(t){if(243!==t.parent.parent.kind&&244!==t.parent.parent.kind)if(16777216&t.flags)dE(t);else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return vE(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isVarConst(t))return vE(t,e.Diagnostics.const_declarations_must_be_initialized)}if(t.exclamationToken&&(237!==t.parent.parent.kind||!t.type||t.initializer||16777216&t.flags)){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return vE(t.exclamationToken,r)}!(q=1&&vD(t.declarations[0])}function kD(e){return AD(e.awaitModifier?15:13,Xh(e.expression),Ge,e.expression)}function AD(e,t,r,n){return fo(t)?t:ND(e,t,r,n,!0)||Le}function ND(t,r,n,i,a){var o=0!=(2&t);if(r!==st){var s=G>=2,c=!s&&z.downlevelIteration,l=z.noUncheckedIndexedAccess&&!!(128&t);if(s||c||o){var u=MD(r,t,s?i:void 0);if(a&&u){var d=8&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&t?e.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;d&&Ap(n,u.nextType,i,d)}if(u||s)return l?Ag(u&&u.yieldType):u&&u.yieldType}var _=r,p=!1,f=!1;if(4&t){if(1048576&_.flags){var m=r.types,g=e.filter(m,(function(e){return!(402653316&e.flags)}));g!==m&&(_=yd(g,2))}else 402653316&_.flags&&(_=st);if((f=_!==r)&&(G<1&&i&&(jn(i,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),p=!0),131072&_.flags))return l?Ag($e):$e}if(!kf(_)){if(i&&!p){var y=function(n,i){var a;if(i)return n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0];if(wD(t,0,r,void 0))return[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!1];if(function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return!0}return!1}(null===(a=r.symbol)||void 0===a?void 0:a.escapedName))return[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0];return n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,!0]:[e.Diagnostics.Type_0_is_not_an_array_type,!0]}(!!(4&t)&&!f,c),h=y[0];Kn(i,y[1]&&!!FS(_),h,Wa(_))}return f?l?Ag($e):$e:void 0}var v=yl(_,Ye);return f&&v?402653316&v.flags&&!z.noUncheckedIndexedAccess?$e:yd(l?[v,$e,Ge]:[v,$e],2):128&t?Ag(v):v}VD(i,r,o)}function wD(e,t,r,n){if(!fo(r)){var i=MD(r,e,n);return i&&i[J(t)]}}function FD(e,t,r){if(void 0===e&&(e=st),void 0===t&&(t=st),void 0===r&&(r=Ke),67359327&e.flags&&180227&t.flags&&180227&r.flags){var n=au([e,t,r]),i=Br.get(n);return i||(i={yieldType:e,returnType:t,nextType:r},Br.set(n,i)),i}return{yieldType:e,returnType:t,nextType:r}}function PD(t){for(var r,n,i,a=0,o=t;a1)for(var p=0,f=i;pi)return!1;for(var u=0;u1)return yE(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);r=!0}else{if(e.Debug.assert(117===o.token),n)return yE(o,e.Diagnostics.implements_clause_already_seen);n=!0}eE(o)}})(t)||XT(t.typeParameters,r)}(t),GS(t),fD(t,t.name),sC(e.getEffectiveTypeParameterDeclarations(t)),wS(t);var r=da(t),n=Is(r),i=Zs(n),a=as(r);cC(r),NS(r),function(t){for(var r=new e.Map,n=new e.Map,i=new e.Map,a=0,o=t.members;a>a;case 49:return i>>>a;case 47:return i<1){var i=e.isEnumConst(t);e.forEach(r.declarations,(function(t){e.isEnumDeclaration(t)&&e.isEnumConst(t)!==i&&jn(e.getNameOfDeclaration(t),e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const)}))}var a=!1;e.forEach(r.declarations,(function(t){if(260!==t.kind)return!1;var r=t;if(!r.members.length)return!1;var n=r.members[0];n.initializer||(a?jn(n.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):a=!0)}))}}(t)}))}function SC(t){e.isPrivateIdentifier(t.name)&&jn(t,e.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier)}function DC(t){t.body&&(JC(t.body),e.isGlobalScopeAugmentation(t)||HS(t)),g((function(){var r=e.isGlobalScopeAugmentation(t),n=16777216&t.flags;r&&!n&&jn(t.name,e.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);var i=e.isAmbientModule(t),a=i?e.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:e.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;if(IC(t,a))return;qT(t)||n||10!==t.name.kind||vE(t.name,e.Diagnostics.Only_ambient_modules_can_use_quoted_names);e.isIdentifier(t.name)&&fD(t,t.name);wS(t);var o=da(t);if(512&o.flags&&!n&&o.declarations&&o.declarations.length>1&&L(t,e.shouldPreserveConstEnums(z))){var s=function(t){var r=t.declarations;if(r)for(var n=0,i=r;n1&&!BC(n))for(var o=0,s=n;o1&&t.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&(e.isExportsIdentifier(t.expression)||e.isModuleExportsAccessExpression(t.expression))}))}function JC(t){if(t){var r=u;u=t,E=0,function(t){e.isInJSFile(t)&&e.forEach(t.jsDoc,(function(t){var r=t.tags;return e.forEach(r,JC)}));var r=t.kind;if(i)switch(r){case 261:case 257:case 258:case 256:i.throwIfCancellationRequested()}r>=237&&r<=253&&t.flowNode&&!uy(t.flowNode)&&Vn(!1===z.allowUnreachableCode,t,e.Diagnostics.Unreachable_code_detected);switch(r){case 163:return lS(t);case 164:return uS(t);case 167:return mS(t);case 166:return function(t){return e.isPrivateIdentifier(t.name)&&jn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),mS(t)}(t);case 180:case 179:case 174:case 175:case 176:return _S(t);case 169:case 168:return function(t){lE(t)||rE(t.name),WS(t),e.hasSyntacticModifier(t,128)&&169===t.kind&&t.body&&jn(t,e.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,e.declarationNameToString(t.name)),e.isPrivateIdentifier(t.name)&&!e.getContainingClass(t)&&jn(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),gS(t)}(t);case 170:return function(t){qT(t),e.forEachChild(t,JC)}(t);case 171:return yS(t);case 172:case 173:return vS(t);case 178:return DS(t);case 177:return function(t){var r=function(e){switch(e.parent.kind){case 214:case 174:case 256:case 213:case 179:case 169:case 168:var t=e.parent;if(e===t.type)return t}}(t);if(r){var n=wl(r),i=Ll(n);if(i){JC(t.type);var a=t.parameterName;if(0===i.kind||2===i.kind)L_(a);else if(i.parameterIndex>=0)j(n)&&i.parameterIndex===n.parameters.length-1?jn(a,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):i.type&&Ap(i.type,as(n.parameters[i.parameterIndex]),t.type,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type)}));else if(a){for(var o=!1,s=0,c=r.parameters;s1){var n=ri(r);if(!n.typeParametersChecked){n.typeParametersChecked=!0;var i=Ps(r),a=e.getDeclarationsOfKind(r,163);if(!lC(a,[i],(function(e){return[e]})))for(var o=Ga(r),s=0,c=a;s0),n.length>1&&jn(n[1],e.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);var i=qS(t.class.expression),a=e.getClassExtendsHeritageElement(r);if(a){var o=qS(a.expression);o&&i.escapedText!==o.escapedText&&jn(i,e.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause,e.idText(t.tagName),e.idText(i),e.idText(o))}}else jn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName))}(t);case 329:return function(t){var r=e.getEffectiveJSDocHost(t);r&&(e.isClassDeclaration(r)||e.isClassExpression(r))||jn(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName))}(t);case 345:case 338:case 339:return function(t){t.typeExpression||jn(t.name,e.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),t.name&&oC(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),JC(t.typeExpression),sC(e.getEffectiveTypeParameterDeclarations(t))}(t);case 344:return function(e){JC(e.constraint);for(var t=0,r=e.typeParameters;t=e.ModuleKind.ES2015&&void 0===e.getSourceFileOfNode(t).impliedNodeFormat)||t.isTypeOnly||16777216&t.flags||vE(t,e.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead)}(t);case 272:return PC(t);case 271:return function(t){if(!IC(t,t.isExportEquals?e.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration)){var r=305===t.parent.kind?t.parent:t.parent.parent;if(261!==r.kind||e.isAmbientModule(r)){!qT(t)&&e.hasEffectiveModifiers(t)&&yE(t,e.Diagnostics.An_export_assignment_cannot_have_modifiers);var n=e.getEffectiveTypeAnnotationNode(t);if(n&&Ap(zx(t.expression),J_(n),t.expression),79===t.expression.kind){var i=t.expression,a=Wi(i,67108863,!0,!0,t);if(a){Cy(a,i);var o=2097152&a.flags?Ji(a):a;(o===Pe||111551&o.flags)&&zx(t.expression)}else zx(t.expression);e.getEmitDeclarations(z)&&oo(t.expression,!0)}else zx(t.expression);RC(r),16777216&t.flags&&!e.isEntityNameExpression(t.expression)&&vE(t.expression,e.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),!t.isExportEquals||16777216&t.flags||(q>=e.ModuleKind.ES2015&&e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.CommonJS?vE(t,e.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):q===e.ModuleKind.System&&vE(t,e.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system))}else t.isExportEquals?jn(t,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace):jn(t,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module)}}(t);case 236:case 253:return void xE(t);case 276:(function(e){GS(e)})(t)}}(t),u=r}}function jC(t){e.isInJSFile(t)||vE(t,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments)}function UC(t){var r=ni(e.getSourceFileOfNode(t));1&r.flags||(r.deferredNodes||(r.deferredNodes=new e.Set),r.deferredNodes.add(t))}function VC(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkDeferredNode",{kind:t.kind,pos:t.pos,end:t.end,path:t.tracingPath});var r=u;switch(u=t,E=0,t.kind){case 208:case 209:case 210:case 165:case 280:Mv(t);break;case 213:case 214:case 169:case 168:!function(t){e.Debug.assert(169!==t.kind||e.isObjectLiteralMethod(t));var r=e.getFunctionFlags(t),n=Jl(t);if(hx(t,n),t.body)if(e.getEffectiveReturnTypeNode(t)||Bl(wl(t)),235===t.body.kind)JC(t.body);else{var i=cS(t.body),a=n&&eC(n,r);a&&Np(2==(3&r)?IS(i,!1,t.body,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,a,t.body,t.body)}}(t);break;case 172:case 173:vS(t);break;case 226:!function(t){e.forEach(t.members,JC),HS(t)}(t);break;case 163:!function(t){if(e.isInterfaceDeclaration(t.parent)||e.isClassLike(t.parent)||e.isTypeAliasDeclaration(t.parent)){var r=Ps(da(t)),n=lf(r);if(n){var i=da(t.parent);if(!e.isTypeAliasDeclaration(t.parent)||48&e.getObjectFlags(Is(i))){if(32768===n||65536===n){var a=sf(i,r,65536===n?It:Pt),o=sf(i,r,65536===n?Pt:It),s=r;d=r,Ap(a,o,t,e.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation),d=s}}else jn(t,e.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types)}}}(t);break;case 279:!function(e){Uh(e)}(t);break;case 278:!function(e){Uh(e.openingElement),Ch(e.closingElement.tagName)?wh(e.closingElement):cS(e.closingElement.tagName),Eh(e)}(t)}u=r,null===e.tracing||void 0===e.tracing||e.tracing.pop()}function KC(r){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkSourceFile",{path:r.path},!0),e.performance.mark("beforeCheck"),function(r){var n=ni(r);if(!(1&n.flags)){if(e.skipTypeChecking(r,z,t))return;!function(t){!!(16777216&t.flags)&&function(t){for(var r=0,n=t.statements;r0?e.concatenate(o,a):a}return e.forEach(t.getSourceFiles(),HC),Dn.getDiagnostics()}(r)}finally{i=void 0}}function WC(){for(var e=0,t=m;e1||1===r.length&&r[0].declaration!==t}return!1}function DT(t){return!(!Q||Tl(t)||e.isJSDocParameterTag(t)||!t.initializer||e.hasSyntacticModifier(t,16476))}function CT(t){return Q&&Tl(t)&&!t.initializer&&e.hasSyntacticModifier(t,16476)}function TT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return!1;var n=da(r);return!!(n&&16&n.flags)&&!!e.forEachEntry(oa(n),(function(t){return 111551&t.flags&&t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)}))}function ET(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return e.emptyArray;var n=da(r);return n&&Rc(as(n))||e.emptyArray}function kT(e){var t,r=e.id||0;return r<0||r>=ln.length?0:(null===(t=ln[r])||void 0===t?void 0:t.flags)||0}function AT(e){return hC(e.parent),ni(e).enumMemberValue}function NT(e){switch(e.kind){case 299:case 206:case 207:return!0}return!1}function wT(t){if(299===t.kind)return AT(t);var r=ni(t).resolvedSymbol;if(r&&8&r.flags){var n=r.valueDeclaration;if(e.isEnumConst(n.parent))return AT(n)}}function FT(e){return!!(524288&e.flags)&&ul(e,0).length>0}function PT(t,r){var n,i,a=e.getParseTreeNode(t,e.isEntityName);if(!a)return e.TypeReferenceSerializationKind.Unknown;if(r&&!(r=e.getParseTreeNode(r)))return e.TypeReferenceSerializationKind.Unknown;var o=!1;if(e.isQualifiedName(a)){var s=Wi(e.getFirstIdentifier(a),111551,!0,!0,r);o=!!(null===(n=null==s?void 0:s.declarations)||void 0===n?void 0:n.every(e.isTypeOnlyImportOrExportDeclaration))}var c=Wi(a,111551,!0,!0,r),l=c&&2097152&c.flags?Ji(c):c;o||(o=!!(null===(i=null==c?void 0:c.declarations)||void 0===i?void 0:i.every(e.isTypeOnlyImportOrExportDeclaration)));var u=Wi(a,788968,!0,!1,r);if(l&&l===u){var d=Ku(!1);if(d&&l===d)return e.TypeReferenceSerializationKind.Promise;var _=as(l);if(_&&ms(_))return o?e.TypeReferenceSerializationKind.TypeWithCallSignature:e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue}if(!u)return o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown;var p=Is(u);return mo(p)?o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown:3&p.flags?e.TypeReferenceSerializationKind.ObjectType:wx(p,245760)?e.TypeReferenceSerializationKind.VoidNullableOrNeverType:wx(p,528)?e.TypeReferenceSerializationKind.BooleanType:wx(p,296)?e.TypeReferenceSerializationKind.NumberLikeType:wx(p,2112)?e.TypeReferenceSerializationKind.BigIntLikeType:wx(p,402653316)?e.TypeReferenceSerializationKind.StringLikeType:Vf(p)?e.TypeReferenceSerializationKind.ArrayLikeType:wx(p,12288)?e.TypeReferenceSerializationKind.ESSymbolType:FT(p)?e.TypeReferenceSerializationKind.TypeWithCallSignature:Sf(p)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function IT(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isVariableLikeOrAccessor);if(!o)return e.factory.createToken(130);var s=da(o),c=!s||133120&s.flags?Je:Bf(as(s));return 8192&c.flags&&c.symbol===s&&(n|=1048576),a&&(c=Zf(c)),se.typeToTypeNode(c,r,1024|n,i)}function OT(t,r,n,i){var a=e.getParseTreeNode(t,e.isFunctionLike);if(!a)return e.factory.createToken(130);var o=wl(a);return se.typeToTypeNode(Bl(o),r,1024|n,i)}function MT(t,r,n,i){var a=e.getParseTreeNode(t,e.isExpression);if(!a)return e.factory.createToken(130);var o=gm(aT(a));return se.typeToTypeNode(o,r,1024|n,i)}function LT(t){return ce.has(e.escapeLeadingUnderscores(t))}function RT(t,r){var n=ni(t).resolvedSymbol;if(n)return n;var i=t;if(r){var a=t.parent;e.isDeclaration(a)&&t===a.name&&(i=_o(a))}return li(i,t.escapedText,3257279,void 0,void 0,!0)}function BT(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=RT(r);if(n)return ya(n).valueDeclaration}}}function JT(t){return!!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&w_(as(da(t)))}function jT(t,r){return function(t,r,n){var i=1024&t.flags?se.symbolToExpression(t.symbol,111551,r,void 0,n):t===rt?e.factory.createTrue():t===et&&e.factory.createFalse();if(i)return i;var a=t.value;return"object"==typeof a?e.factory.createBigIntLiteral(a):"number"==typeof a?e.factory.createNumericLiteral(a):e.factory.createStringLiteral(a)}(as(da(t)),t,r)}function UT(t){return t?(Mn(t),e.getSourceFileOfNode(t).localJsxFactory||Nr):Nr}function VT(t){if(t){var r=e.getSourceFileOfNode(t);if(r){if(r.localJsxFragmentFactory)return r.localJsxFragmentFactory;var n=r.pragmas.get("jsxfrag"),i=e.isArray(n)?n[0]:n;if(i)return r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,G),r.localJsxFragmentFactory}}if(z.jsxFragmentFactory)return e.parseIsolatedEntityName(z.jsxFragmentFactory,G)}function KT(t){var r=261===t.kind?e.tryCast(t.name,e.isStringLiteral):e.getExternalModuleName(t),n=Xi(r,r,void 0);if(n)return e.getDeclarationOfKind(n,305)}function zT(t,r){if((o&r)!==r&&z.importHelpers){var n=e.getSourceFileOfNode(t);if(e.isEffectiveExternalModule(n,z)&&!(16777216&t.flags)){var i=function(t,r){s||(s=$i(t,e.externalHelpersModuleNameText,e.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,r)||Pe);return s}(n,t);if(i!==Pe)for(var a=r&~o,c=1;c<=4194304;c<<=1)if(a&c){var l=GT(c),u=ai(i.exports,e.escapeLeadingUnderscores(l),111551);u?524288&c?e.some(Il(u),(function(e){return Yb(e)>3}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,4):1048576&c?e.some(Il(u),(function(e){return Yb(e)>4}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,5):1024&c&&(e.some(Il(u),(function(e){return Yb(e)>2}))||jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l,3)):jn(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,l)}o|=r}}}function GT(t){switch(t){case 1:return"__extends";case 2:return"__assign";case 4:return"__rest";case 8:return"__decorate";case 16:return"__metadata";case 32:return"__param";case 64:return"__awaiter";case 128:return"__generator";case 256:return"__values";case 512:return"__read";case 1024:return"__spreadArray";case 2048:return"__await";case 4096:return"__asyncGenerator";case 8192:return"__asyncDelegator";case 16384:return"__asyncValues";case 32768:return"__exportStar";case 65536:return"__importStar";case 131072:return"__importDefault";case 262144:return"__makeTemplateObject";case 524288:return"__classPrivateFieldGet";case 1048576:return"__classPrivateFieldSet";case 2097152:return"__classPrivateFieldIn";case 4194304:return"__createBinding";default:return e.Debug.fail("Unrecognized helper")}}function qT(t){return function(t){if(!t.decorators)return!1;if(!e.nodeCanBeDecorated(t,t.parent,t.parent.parent))return 169!==t.kind||e.nodeIsPresent(t.body)?yE(t,e.Diagnostics.Decorators_are_not_valid_here):yE(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(172===t.kind||173===t.kind){var r=e.getAllAccessorDeclarations(t.parent.members,t);if(r.firstAccessor.decorators&&t===r.secondAccessor)return yE(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return!1}(t)||WT(t)}function WT(t){var r,n,i,a,o=function(t){return!!t.modifiers&&(function(t){switch(t.kind){case 172:case 173:case 171:case 167:case 166:case 169:case 168:case 176:case 261:case 266:case 265:case 272:case 271:case 213:case 214:case 164:case 163:return!1;default:if(262===t.parent.kind||305===t.parent.kind)return!1;switch(t.kind){case 256:return HT(t,131);case 257:case 180:return HT(t,126);case 258:case 237:case 259:case 170:return!0;case 260:return HT(t,85);default:e.Debug.fail()}}}(t)?yE(t,e.Diagnostics.Modifiers_cannot_appear_here):void 0)}(t);if(void 0!==o)return o;for(var s=0,c=0,l=t.modifiers;c1||e.modifiers[0].kind!==t}function QT(t,r){return void 0===r&&(r=e.Diagnostics.Trailing_comma_not_allowed),!(!t||!t.hasTrailingComma)&&hE(t[0],t.end-",".length,",".length,r)}function XT(t,r){if(t&&0===t.length){var n=t.pos-"<".length;return hE(r,n,e.skipTrivia(r.text,t.end)+">".length-n,e.Diagnostics.Type_parameter_list_cannot_be_empty)}return!1}function $T(t){if(G>=3){var n=t.body&&e.isBlock(t.body)&&e.findUseStrictPrologue(t.body.statements);if(n){var i=(o=t.parameters,e.filter(o,(function(t){return!!t.initializer||e.isBindingPattern(t.name)||e.isRestParameter(t)})));if(e.length(i)){e.forEach(i,(function(t){e.addRelatedInfo(jn(t,e.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive),e.createDiagnosticForNode(n,e.Diagnostics.use_strict_directive_used_here))}));var a=i.map((function(t,r){return 0===r?e.createDiagnosticForNode(t,e.Diagnostics.Non_simple_parameter_declared_here):e.createDiagnosticForNode(t,e.Diagnostics.and_here)}));return e.addRelatedInfo.apply(void 0,r([jn(n,e.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)],a,!1)),!0}}}var o;return!1}function YT(t){var r=e.getSourceFileOfNode(t);return qT(t)||XT(t.typeParameters,r)||function(t){for(var r=!1,n=t.length,i=0;i1||t.typeParameters.hasTrailingComma||t.typeParameters[0].constraint)&&r&&e.fileExtensionIsOneOf(r.fileName,[".mts",".cts"])&&vE(t.typeParameters[0],e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);var n=t.equalsGreaterThanToken,i=e.getLineAndCharacterOfPosition(r,n.pos).line,a=e.getLineAndCharacterOfPosition(r,n.end).line;return i!==a&&vE(n,e.Diagnostics.Line_terminator_not_permitted_before_arrow)}(t,r)||e.isFunctionLikeDeclaration(t)&&$T(t)}function ZT(t,r){return QT(r)||function(t,r){if(r&&0===r.length){var n=e.getSourceFileOfNode(t),i=r.pos-"<".length;return hE(n,i,e.skipTrivia(n.text,r.end)+">".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}return!1}(t,r)}function eE(t){var r=t.types;if(QT(r))return!0;if(r&&0===r.length){var n=e.tokenToString(t.token);return hE(t,r.pos,0,e.Diagnostics._0_list_cannot_be_empty,n)}return e.some(r,tE)}function tE(t){return e.isExpressionWithTypeArguments(t)&&e.isImportKeyword(t.expression)&&t.typeArguments?vE(t,e.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments):ZT(t,t.typeArguments)}function rE(t){if(162!==t.kind)return!1;var r=t;return 221===r.expression.kind&&27===r.expression.operatorToken.kind&&vE(r.expression,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function nE(t){if(t.asteriskToken){if(e.Debug.assert(256===t.kind||213===t.kind||169===t.kind),16777216&t.flags)return vE(t.asteriskToken,e.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);if(!t.body)return vE(t.asteriskToken,e.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator)}}function iE(e,t){return!!e&&vE(e,t)}function aE(e,t){return!!e&&vE(e,t)}function oE(t){if(xE(t))return!0;if(244===t.kind&&t.awaitModifier&&!(32768&t.flags)){var r=e.getSourceFileOfNode(t);if(e.isInTopLevelContext(t)){if(!gE(r))switch(e.isEffectiveExternalModule(r,z)||Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),q){case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:if(r.impliedNodeFormat===e.ModuleKind.CommonJS){Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));break}case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.System:if(G>=4)break;default:Dn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher))}}else if(!gE(r)){var n=e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),i=e.getContainingFunction(t);if(i&&171!==i.kind){e.Debug.assert(0==(2&e.getFunctionFlags(i)),"Enclosing function should never be an async function.");var a=e.createDiagnosticForNode(i,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(n,a)}return Dn.add(n),!0}return!1}if(e.isForOfStatement(t)&&!(32768&t.flags)&&e.isIdentifier(t.initializer)&&"async"===t.initializer.escapedText)return vE(t.initializer,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(255===t.initializer.kind){var o=t.initializer;if(!fE(o)){var s=o.declarations;if(!s.length)return!1;if(s.length>1){n=243===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement;return yE(o.declarations[1],n)}var c=s[0];if(c.initializer){var n=243===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return vE(c.name,n)}if(c.type)return vE(c,n=243===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}return!1}function sE(t){if(t.parameters.length===(172===t.kind?1:2))return e.getThisParameter(t)}function cE(t,r){if(function(t){return e.isDynamicName(t)&&!zs(t)}(t))return vE(t,r)}function lE(t){if(YT(t))return!0;if(169===t.kind){if(205===t.parent.kind){if(t.modifiers&&(1!==t.modifiers.length||131!==e.first(t.modifiers).kind))return yE(t,e.Diagnostics.Modifiers_cannot_appear_here);if(iE(t.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional))return!0;if(aE(t.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context))return!0;if(void 0===t.body)return hE(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(nE(t))return!0}if(e.isClassLike(t.parent)){if(G<2&&e.isPrivateIdentifier(t.name))return vE(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(16777216&t.flags)return cE(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(169===t.kind&&!t.body)return cE(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else{if(258===t.parent.kind)return cE(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(182===t.parent.kind)return cE(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function uE(t){return e.isStringOrNumericLiteralLike(t)||219===t.kind&&40===t.operator&&8===t.operand.kind}function dE(t){var r,n=t.initializer;if(n){var i=!(uE(n)||function(t){if((e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)&&uE(t.argumentExpression))&&e.isEntityNameExpression(t.expression))return!!(1024&zx(t).flags)}(n)||110===n.kind||95===n.kind||(r=n,9===r.kind||219===r.kind&&40===r.operator&&9===r.operand.kind)),a=e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t);if(!a||t.type)return vE(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);if(i)return vE(n,e.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);if(!a||i)return vE(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}}function _E(t){if(79===t.kind){if("__esModule"===e.idText(t))return function(t,r,n,i,a,o){if(!gE(e.getSourceFileOfNode(r)))return Bn(t,r,n,i,a,o),!0;return!1}("noEmit",t,e.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules)}else for(var r=0,n=t.elements;r0}function yE(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!gE(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return Dn.add(e.createFileDiagnostic(o,s.start,s.length,r,n,i,a)),!0}return!1}function hE(t,r,n,i,a,o,s){var c=e.getSourceFileOfNode(t);return!gE(c)&&(Dn.add(e.createFileDiagnostic(c,r,n,i,a,o,s)),!0)}function vE(t,r,n,i,a){return!gE(e.getSourceFileOfNode(t))&&(Dn.add(e.createDiagnosticForNode(t,r,n,i,a)),!0)}function bE(t){return 258!==t.kind&&259!==t.kind&&266!==t.kind&&265!==t.kind&&272!==t.kind&&271!==t.kind&&264!==t.kind&&!e.hasSyntacticModifier(t,515)&&yE(t,e.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function xE(t){if(16777216&t.flags){if(!ni(t).hasReportedStatementInAmbientContext&&(e.isFunctionLike(t.parent)||e.isAccessor(t.parent)))return ni(t).hasReportedStatementInAmbientContext=yE(t,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);if(235===t.parent.kind||262===t.parent.kind||305===t.parent.kind){var r=ni(t.parent);if(!r.hasReportedStatementInAmbientContext)return r.hasReportedStatementInAmbientContext=yE(t,e.Diagnostics.Statements_are_not_allowed_in_ambient_contexts)}}return!1}function SE(t){if(32&t.numericLiteralFlags){var r=void 0;if(G>=1?r=e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:e.isChildOfNodeWithKind(t,196)?r=e.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:e.isChildOfNodeWithKind(t,299)&&(r=e.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0),r){var n=e.isPrefixUnaryExpression(t.parent)&&40===t.parent.operator,i=(n?"-":"")+"0o"+t.text;return vE(n?t.parent:t,r,i)}}return function(t){var r=-1!==e.getTextOfNode(t).indexOf("."),n=16&t.numericLiteralFlags;if(r||n)return;if(+t.text<=Math.pow(2,53)-1)return;Un(!1,e.createDiagnosticForNode(t,e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers))}(t),!1}function DE(t){return!!e.forEach(t.elements,(function(t){if(t.isTypeOnly)return yE(t,270===t.kind?e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}))}function CE(t,r,n,i){if(1048576&r.flags&&2621440&t.flags){var a=yg(r,t);if(a)return a;var o=Rc(t);if(o){var s=fg(o,r);if(s)return tf(r,e.map(s,(function(e){return[function(){return as(e)},e.escapedName]})),n,void 0,i)}}}},function(e){e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes"}(w||(w={})),e.signatureHasRestParameter=j,e.signatureHasLiteralTypes=U}(c||(c={})),function(e){function t(t,r,n,i){if(void 0===t||void 0===r)return t;var a,o=r(t);return o===t?t:void 0!==o?(a=e.isArray(o)?(i||c)(o):o,e.Debug.assertNode(a,n),a):void 0}function r(t,r,n,i,a){if(void 0===t||void 0===r)return t;var o,s,c=t.length;(void 0===i||i<0)&&(i=0),(void 0===a||a>c-i)&&(a=c-i);var l=-1,u=-1;(i>0||a=2&&(s=function(t,r){for(var n,i=0;i0&&p<=160||192===p)return a;var f=l.factory;switch(p){case 79:return e.Debug.type(a),f.updateIdentifier(a,u(a.typeArguments,c,e.isTypeNodeOrTypeParameterDeclaration));case 161:return e.Debug.type(a),f.updateQualifiedName(a,_(a.left,c,e.isEntityName),_(a.right,c,e.isIdentifier));case 162:return e.Debug.type(a),f.updateComputedPropertyName(a,_(a.expression,c,e.isExpression));case 163:return e.Debug.type(a),f.updateTypeParameterDeclaration(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),_(a.constraint,c,e.isTypeNode),_(a.default,c,e.isTypeNode));case 164:return e.Debug.type(a),f.updateParameterDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.dotDotDotToken,d,e.isDotDotDotToken),_(a.name,c,e.isBindingName),_(a.questionToken,d,e.isQuestionToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 165:return e.Debug.type(a),f.updateDecorator(a,_(a.expression,c,e.isExpression));case 166:return e.Debug.type(a),f.updatePropertySignature(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isToken),_(a.type,c,e.isTypeNode));case 167:return e.Debug.type(a),f.updatePropertyDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken||a.exclamationToken,d,e.isQuestionOrExclamationToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 168:return e.Debug.type(a),f.updateMethodSignature(a,u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 169:return e.Debug.type(a),f.updateMethodDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isPropertyName),_(a.questionToken,d,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 171:return e.Debug.type(a),f.updateConstructorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),i(a.parameters,c,l,u),o(a.body,c,l,_));case 172:return e.Debug.type(a),f.updateGetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 173:return e.Debug.type(a),f.updateSetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),o(a.body,c,l,_));case 170:return e.Debug.type(a),l.startLexicalEnvironment(),l.suspendLexicalEnvironment(),f.updateClassStaticBlockDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),o(a.body,c,l,_));case 174:return e.Debug.type(a),f.updateCallSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 175:return e.Debug.type(a),f.updateConstructSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 176:return e.Debug.type(a),f.updateIndexSignature(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 177:return e.Debug.type(a),f.updateTypePredicateNode(a,_(a.assertsModifier,c,e.isAssertsKeyword),_(a.parameterName,c,e.isIdentifierOrThisTypeNode),_(a.type,c,e.isTypeNode));case 178:return e.Debug.type(a),f.updateTypeReferenceNode(a,_(a.typeName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 179:return e.Debug.type(a),f.updateFunctionTypeNode(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 180:return e.Debug.type(a),f.updateConstructorTypeNode(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),_(a.type,c,e.isTypeNode));case 181:return e.Debug.type(a),f.updateTypeQueryNode(a,_(a.exprName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 182:return e.Debug.type(a),f.updateTypeLiteralNode(a,u(a.members,c,e.isTypeElement));case 183:return e.Debug.type(a),f.updateArrayTypeNode(a,_(a.elementType,c,e.isTypeNode));case 184:return e.Debug.type(a),f.updateTupleTypeNode(a,u(a.elements,c,e.isTypeNode));case 185:return e.Debug.type(a),f.updateOptionalTypeNode(a,_(a.type,c,e.isTypeNode));case 186:return e.Debug.type(a),f.updateRestTypeNode(a,_(a.type,c,e.isTypeNode));case 187:return e.Debug.type(a),f.updateUnionTypeNode(a,u(a.types,c,e.isTypeNode));case 188:return e.Debug.type(a),f.updateIntersectionTypeNode(a,u(a.types,c,e.isTypeNode));case 189:return e.Debug.type(a),f.updateConditionalTypeNode(a,_(a.checkType,c,e.isTypeNode),_(a.extendsType,c,e.isTypeNode),_(a.trueType,c,e.isTypeNode),_(a.falseType,c,e.isTypeNode));case 190:return e.Debug.type(a),f.updateInferTypeNode(a,_(a.typeParameter,c,e.isTypeParameterDeclaration));case 200:return e.Debug.type(a),f.updateImportTypeNode(a,_(a.argument,c,e.isTypeNode),_(a.assertions,c,e.isNode),_(a.qualifier,c,e.isEntityName),r(a.typeArguments,c,e.isTypeNode),a.isTypeOf);case 295:return e.Debug.type(a),f.updateImportTypeAssertionContainer(a,_(a.assertClause,c,e.isNode),a.multiLine);case 197:return e.Debug.type(a),f.updateNamedTupleMember(a,t(a.dotDotDotToken,c,e.isDotDotDotToken),t(a.name,c,e.isIdentifier),t(a.questionToken,c,e.isQuestionToken),t(a.type,c,e.isTypeNode));case 191:return e.Debug.type(a),f.updateParenthesizedType(a,_(a.type,c,e.isTypeNode));case 193:return e.Debug.type(a),f.updateTypeOperatorNode(a,_(a.type,c,e.isTypeNode));case 194:return e.Debug.type(a),f.updateIndexedAccessTypeNode(a,_(a.objectType,c,e.isTypeNode),_(a.indexType,c,e.isTypeNode));case 195:return e.Debug.type(a),f.updateMappedTypeNode(a,_(a.readonlyToken,d,e.isReadonlyKeywordOrPlusOrMinusToken),_(a.typeParameter,c,e.isTypeParameterDeclaration),_(a.nameType,c,e.isTypeNode),_(a.questionToken,d,e.isQuestionOrPlusOrMinusToken),_(a.type,c,e.isTypeNode),u(a.members,c,e.isTypeElement));case 196:return e.Debug.type(a),f.updateLiteralTypeNode(a,_(a.literal,c,e.isExpression));case 198:return e.Debug.type(a),f.updateTemplateLiteralType(a,_(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateLiteralTypeSpan));case 199:return e.Debug.type(a),f.updateTemplateLiteralTypeSpan(a,_(a.type,c,e.isTypeNode),_(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 201:return e.Debug.type(a),f.updateObjectBindingPattern(a,u(a.elements,c,e.isBindingElement));case 202:return e.Debug.type(a),f.updateArrayBindingPattern(a,u(a.elements,c,e.isArrayBindingElement));case 203:return e.Debug.type(a),f.updateBindingElement(a,_(a.dotDotDotToken,d,e.isDotDotDotToken),_(a.propertyName,c,e.isPropertyName),_(a.name,c,e.isBindingName),_(a.initializer,c,e.isExpression));case 204:return e.Debug.type(a),f.updateArrayLiteralExpression(a,u(a.elements,c,e.isExpression));case 205:return e.Debug.type(a),f.updateObjectLiteralExpression(a,u(a.properties,c,e.isObjectLiteralElementLike));case 206:return 32&a.flags?(e.Debug.type(a),f.updatePropertyAccessChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),_(a.name,c,e.isMemberName))):(e.Debug.type(a),f.updatePropertyAccessExpression(a,_(a.expression,c,e.isExpression),_(a.name,c,e.isMemberName)));case 207:return 32&a.flags?(e.Debug.type(a),f.updateElementAccessChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),_(a.argumentExpression,c,e.isExpression))):(e.Debug.type(a),f.updateElementAccessExpression(a,_(a.expression,c,e.isExpression),_(a.argumentExpression,c,e.isExpression)));case 208:return 32&a.flags?(e.Debug.type(a),f.updateCallChain(a,_(a.expression,c,e.isExpression),_(a.questionDotToken,d,e.isQuestionDotToken),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression))):(e.Debug.type(a),f.updateCallExpression(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression)));case 209:return e.Debug.type(a),f.updateNewExpression(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression));case 210:return e.Debug.type(a),f.updateTaggedTemplateExpression(a,_(a.tag,c,e.isExpression),r(a.typeArguments,c,e.isTypeNode),_(a.template,c,e.isTemplateLiteral));case 211:return e.Debug.type(a),f.updateTypeAssertion(a,_(a.type,c,e.isTypeNode),_(a.expression,c,e.isExpression));case 212:return e.Debug.type(a),f.updateParenthesizedExpression(a,_(a.expression,c,e.isExpression));case 213:return e.Debug.type(a),f.updateFunctionExpression(a,u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 214:return e.Debug.type(a),f.updateArrowFunction(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),_(a.equalsGreaterThanToken,d,e.isEqualsGreaterThanToken),o(a.body,c,l,_));case 215:return e.Debug.type(a),f.updateDeleteExpression(a,_(a.expression,c,e.isExpression));case 216:return e.Debug.type(a),f.updateTypeOfExpression(a,_(a.expression,c,e.isExpression));case 217:return e.Debug.type(a),f.updateVoidExpression(a,_(a.expression,c,e.isExpression));case 218:return e.Debug.type(a),f.updateAwaitExpression(a,_(a.expression,c,e.isExpression));case 219:return e.Debug.type(a),f.updatePrefixUnaryExpression(a,_(a.operand,c,e.isExpression));case 220:return e.Debug.type(a),f.updatePostfixUnaryExpression(a,_(a.operand,c,e.isExpression));case 221:return e.Debug.type(a),f.updateBinaryExpression(a,_(a.left,c,e.isExpression),_(a.operatorToken,d,e.isBinaryOperatorToken),_(a.right,c,e.isExpression));case 222:return e.Debug.type(a),f.updateConditionalExpression(a,_(a.condition,c,e.isExpression),_(a.questionToken,d,e.isQuestionToken),_(a.whenTrue,c,e.isExpression),_(a.colonToken,d,e.isColonToken),_(a.whenFalse,c,e.isExpression));case 223:return e.Debug.type(a),f.updateTemplateExpression(a,_(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateSpan));case 224:return e.Debug.type(a),f.updateYieldExpression(a,_(a.asteriskToken,d,e.isAsteriskToken),_(a.expression,c,e.isExpression));case 225:return e.Debug.type(a),f.updateSpreadElement(a,_(a.expression,c,e.isExpression));case 226:return e.Debug.type(a),f.updateClassExpression(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 228:return e.Debug.type(a),f.updateExpressionWithTypeArguments(a,_(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode));case 229:return e.Debug.type(a),f.updateAsExpression(a,_(a.expression,c,e.isExpression),_(a.type,c,e.isTypeNode));case 230:return 32&a.flags?(e.Debug.type(a),f.updateNonNullChain(a,_(a.expression,c,e.isExpression))):(e.Debug.type(a),f.updateNonNullExpression(a,_(a.expression,c,e.isExpression)));case 231:return e.Debug.type(a),f.updateMetaProperty(a,_(a.name,c,e.isIdentifier));case 233:return e.Debug.type(a),f.updateTemplateSpan(a,_(a.expression,c,e.isExpression),_(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 235:return e.Debug.type(a),f.updateBlock(a,u(a.statements,c,e.isStatement));case 237:return e.Debug.type(a),f.updateVariableStatement(a,u(a.modifiers,c,e.isModifier),_(a.declarationList,c,e.isVariableDeclarationList));case 238:return e.Debug.type(a),f.updateExpressionStatement(a,_(a.expression,c,e.isExpression));case 239:return e.Debug.type(a),f.updateIfStatement(a,_(a.expression,c,e.isExpression),_(a.thenStatement,c,e.isStatement,f.liftToBlock),_(a.elseStatement,c,e.isStatement,f.liftToBlock));case 240:return e.Debug.type(a),f.updateDoStatement(a,s(a.statement,c,l),_(a.expression,c,e.isExpression));case 241:return e.Debug.type(a),f.updateWhileStatement(a,_(a.expression,c,e.isExpression),s(a.statement,c,l));case 242:return e.Debug.type(a),f.updateForStatement(a,_(a.initializer,c,e.isForInitializer),_(a.condition,c,e.isExpression),_(a.incrementor,c,e.isExpression),s(a.statement,c,l));case 243:return e.Debug.type(a),f.updateForInStatement(a,_(a.initializer,c,e.isForInitializer),_(a.expression,c,e.isExpression),s(a.statement,c,l));case 244:return e.Debug.type(a),f.updateForOfStatement(a,_(a.awaitModifier,d,e.isAwaitKeyword),_(a.initializer,c,e.isForInitializer),_(a.expression,c,e.isExpression),s(a.statement,c,l));case 245:return e.Debug.type(a),f.updateContinueStatement(a,_(a.label,c,e.isIdentifier));case 246:return e.Debug.type(a),f.updateBreakStatement(a,_(a.label,c,e.isIdentifier));case 247:return e.Debug.type(a),f.updateReturnStatement(a,_(a.expression,c,e.isExpression));case 248:return e.Debug.type(a),f.updateWithStatement(a,_(a.expression,c,e.isExpression),_(a.statement,c,e.isStatement,f.liftToBlock));case 249:return e.Debug.type(a),f.updateSwitchStatement(a,_(a.expression,c,e.isExpression),_(a.caseBlock,c,e.isCaseBlock));case 250:return e.Debug.type(a),f.updateLabeledStatement(a,_(a.label,c,e.isIdentifier),_(a.statement,c,e.isStatement,f.liftToBlock));case 251:return e.Debug.type(a),f.updateThrowStatement(a,_(a.expression,c,e.isExpression));case 252:return e.Debug.type(a),f.updateTryStatement(a,_(a.tryBlock,c,e.isBlock),_(a.catchClause,c,e.isCatchClause),_(a.finallyBlock,c,e.isBlock));case 254:return e.Debug.type(a),f.updateVariableDeclaration(a,_(a.name,c,e.isBindingName),_(a.exclamationToken,d,e.isExclamationToken),_(a.type,c,e.isTypeNode),_(a.initializer,c,e.isExpression));case 255:return e.Debug.type(a),f.updateVariableDeclarationList(a,u(a.declarations,c,e.isVariableDeclaration));case 256:return e.Debug.type(a),f.updateFunctionDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.asteriskToken,d,e.isAsteriskToken),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),_(a.type,c,e.isTypeNode),o(a.body,c,l,_));case 257:return e.Debug.type(a),f.updateClassDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 258:return e.Debug.type(a),f.updateInterfaceDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isTypeElement));case 259:return e.Debug.type(a),f.updateTypeAliasDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),_(a.type,c,e.isTypeNode));case 260:return e.Debug.type(a),f.updateEnumDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isIdentifier),u(a.members,c,e.isEnumMember));case 261:return e.Debug.type(a),f.updateModuleDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.name,c,e.isModuleName),_(a.body,c,e.isModuleBody));case 262:return e.Debug.type(a),f.updateModuleBlock(a,u(a.statements,c,e.isStatement));case 263:return e.Debug.type(a),f.updateCaseBlock(a,u(a.clauses,c,e.isCaseOrDefaultClause));case 264:return e.Debug.type(a),f.updateNamespaceExportDeclaration(a,_(a.name,c,e.isIdentifier));case 265:return e.Debug.type(a),f.updateImportEqualsDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,_(a.name,c,e.isIdentifier),_(a.moduleReference,c,e.isModuleReference));case 266:return e.Debug.type(a),f.updateImportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.importClause,c,e.isImportClause),_(a.moduleSpecifier,c,e.isExpression),_(a.assertClause,c,e.isAssertClause));case 293:return e.Debug.type(a),f.updateAssertClause(a,u(a.elements,c,e.isAssertEntry),a.multiLine);case 294:return e.Debug.type(a),f.updateAssertEntry(a,_(a.name,c,e.isAssertionKey),_(a.value,c,e.isExpressionNode));case 267:return e.Debug.type(a),f.updateImportClause(a,a.isTypeOnly,_(a.name,c,e.isIdentifier),_(a.namedBindings,c,e.isNamedImportBindings));case 268:return e.Debug.type(a),f.updateNamespaceImport(a,_(a.name,c,e.isIdentifier));case 274:return e.Debug.type(a),f.updateNamespaceExport(a,_(a.name,c,e.isIdentifier));case 269:return e.Debug.type(a),f.updateNamedImports(a,u(a.elements,c,e.isImportSpecifier));case 270:return e.Debug.type(a),f.updateImportSpecifier(a,a.isTypeOnly,_(a.propertyName,c,e.isIdentifier),_(a.name,c,e.isIdentifier));case 271:return e.Debug.type(a),f.updateExportAssignment(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),_(a.expression,c,e.isExpression));case 272:return e.Debug.type(a),f.updateExportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,_(a.exportClause,c,e.isNamedExportBindings),_(a.moduleSpecifier,c,e.isExpression),_(a.assertClause,c,e.isAssertClause));case 273:return e.Debug.type(a),f.updateNamedExports(a,u(a.elements,c,e.isExportSpecifier));case 275:return e.Debug.type(a),f.updateExportSpecifier(a,a.isTypeOnly,_(a.propertyName,c,e.isIdentifier),_(a.name,c,e.isIdentifier));case 277:return e.Debug.type(a),f.updateExternalModuleReference(a,_(a.expression,c,e.isExpression));case 278:return e.Debug.type(a),f.updateJsxElement(a,_(a.openingElement,c,e.isJsxOpeningElement),u(a.children,c,e.isJsxChild),_(a.closingElement,c,e.isJsxClosingElement));case 279:return e.Debug.type(a),f.updateJsxSelfClosingElement(a,_(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),_(a.attributes,c,e.isJsxAttributes));case 280:return e.Debug.type(a),f.updateJsxOpeningElement(a,_(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),_(a.attributes,c,e.isJsxAttributes));case 281:return e.Debug.type(a),f.updateJsxClosingElement(a,_(a.tagName,c,e.isJsxTagNameExpression));case 282:return e.Debug.type(a),f.updateJsxFragment(a,_(a.openingFragment,c,e.isJsxOpeningFragment),u(a.children,c,e.isJsxChild),_(a.closingFragment,c,e.isJsxClosingFragment));case 285:return e.Debug.type(a),f.updateJsxAttribute(a,_(a.name,c,e.isIdentifier),_(a.initializer,c,e.isStringLiteralOrJsxExpression));case 286:return e.Debug.type(a),f.updateJsxAttributes(a,u(a.properties,c,e.isJsxAttributeLike));case 287:return e.Debug.type(a),f.updateJsxSpreadAttribute(a,_(a.expression,c,e.isExpression));case 288:return e.Debug.type(a),f.updateJsxExpression(a,_(a.expression,c,e.isExpression));case 289:return e.Debug.type(a),f.updateCaseClause(a,_(a.expression,c,e.isExpression),u(a.statements,c,e.isStatement));case 290:return e.Debug.type(a),f.updateDefaultClause(a,u(a.statements,c,e.isStatement));case 291:return e.Debug.type(a),f.updateHeritageClause(a,u(a.types,c,e.isExpressionWithTypeArguments));case 292:return e.Debug.type(a),f.updateCatchClause(a,_(a.variableDeclaration,c,e.isVariableDeclaration),_(a.block,c,e.isBlock));case 296:return e.Debug.type(a),f.updatePropertyAssignment(a,_(a.name,c,e.isPropertyName),_(a.initializer,c,e.isExpression));case 297:return e.Debug.type(a),f.updateShorthandPropertyAssignment(a,_(a.name,c,e.isIdentifier),_(a.objectAssignmentInitializer,c,e.isExpression));case 298:return e.Debug.type(a),f.updateSpreadAssignment(a,_(a.expression,c,e.isExpression));case 299:return e.Debug.type(a),f.updateEnumMember(a,_(a.name,c,e.isPropertyName),_(a.initializer,c,e.isExpression));case 305:return e.Debug.type(a),f.updateSourceFile(a,n(a.statements,c,l));case 350:return e.Debug.type(a),f.updatePartiallyEmittedExpression(a,_(a.expression,c,e.isExpression));case 351:return e.Debug.type(a),f.updateCommaListExpression(a,u(a.elements,c,e.isExpression));default:return a}}}}(c||(c={})),function(e){e.createSourceMapGenerator=function(t,r,n,i,o){var s,c,l=o.extendedDiagnostics?e.performance.createTimer("Source Map","beforeSourcemap","afterSourcemap"):e.performance.nullTimer,u=l.enter,d=l.exit,_=[],p=[],f=new e.Map,m=[],g=[],y="",h=0,v=0,b=0,x=0,S=0,D=0,C=!1,T=0,E=0,k=0,A=0,N=0,w=0,F=!1,P=!1,I=!1;return{getSources:function(){return _},addSource:O,setSourceContent:M,addName:L,addMapping:R,appendSourceMap:function(t,r,n,i,o,s){e.Debug.assert(t>=T,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),u();for(var c,l=[],_=a(n.mappings),p=_.next();!p.done;p=_.next()){var f=p.value;if(s&&(f.generatedLine>s.line||f.generatedLine===s.line&&f.generatedCharacter>s.character))break;if(!o||!(f.generatedLine=T,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),e.Debug.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),e.Debug.assert(void 0===i||i>=0,"sourceLine cannot be negative"),e.Debug.assert(void 0===a||a>=0,"sourceCharacter cannot be negative"),u(),(function(e,t){return!F||T!==e||E!==t}(t,r)||function(e,t,r){return void 0!==e&&void 0!==t&&void 0!==r&&k===e&&(A>t||A===t&&N>r)}(n,i,a))&&(J(),T=t,E=r,P=!1,I=!1,F=!0),void 0!==n&&void 0!==i&&void 0!==a&&(k=n,A=i,N=a,P=!0,void 0!==o&&(w=o,I=!0)),d()}function B(e){g.push(e),g.length>=1024&&j()}function J(){if(F&&(!C||h!==T||v!==E||b!==k||x!==A||S!==N||D!==w)){if(u(),h0&&(y+=String.fromCharCode.apply(void 0,g),g.length=0)}function U(){return J(),j(),{version:3,file:r,sourceRoot:n,sources:p,names:m,mappings:y,sourcesContent:s}}function V(t){t<0?t=1+(-t<<1):t<<=1;do{var r=31&t;(t>>=5)>0&&(r|=32),B((n=r)>=0&&n<26?65+n:n>=26&&n<52?97+n-26:n>=52&&n<62?48+n-52:62===n?43:63===n?47:e.Debug.fail("".concat(n,": not a base64 value")))}while(t>0);var n}};var t=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,r=/^\s*(\/\/[@#] .*)?$/;function n(e){return"string"==typeof e||null===e}function i(t){return null!==t&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&e.isArray(t.sources)&&e.every(t.sources,e.isString)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||e.isArray(t.sourcesContent)&&e.every(t.sourcesContent,n))&&(void 0===t.names||null===t.names||e.isArray(t.names)&&e.every(t.names,e.isString))}function a(e){var t,r=!1,n=0,i=0,a=0,o=0,s=0,c=0,l=0;return{get pos(){return n},get error(){return t},get state(){return u(!0,!0)},next:function(){for(;!r&&n=e.length)return _("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;var o=(t=e.charCodeAt(n))>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:43===t?62:47===t?63:-1;if(-1===o)return _("Invalid character in VLQ"),-1;r=0!=(32&o),a|=(31&o)<>=1:a=-(a>>=1),a}}function o(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function s(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function c(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function l(t,r){return e.Debug.assert(t.sourceIndex===r.sourceIndex),e.compareValues(t.sourcePosition,r.sourcePosition)}function u(t,r){return e.compareValues(t.generatedPosition,r.generatedPosition)}function d(e){return e.sourcePosition}function _(e){return e.generatedPosition}e.getLineInfo=function(e,t){return{getLineCount:function(){return t.length},getLineText:function(r){return e.substring(t[r],t[r+1])}}},e.tryGetSourceMappingURL=function(n){for(var i=n.getLineCount()-1;i>=0;i--){var a=n.getLineText(i),o=t.exec(a);if(o)return e.trimStringEnd(o[1]);if(!a.match(r))break}},e.isRawSourceMap=i,e.tryParseRawSourceMap=function(e){try{var t=JSON.parse(e);if(i(t))return t}catch(e){}},e.decodeMappings=a,e.sameMapping=function(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex},e.isSourceMapping=o,e.createDocumentPositionMapper=function(t,r,n){var i,p,f,m=e.getDirectoryPath(n),g=r.sourceRoot?e.getNormalizedAbsolutePath(r.sourceRoot,m):m,y=e.getNormalizedAbsolutePath(r.file,m),h=t.getSourceFileLike(y),v=r.sources.map((function(t){return e.getNormalizedAbsolutePath(t,g)})),b=new e.Map(v.map((function(e,r){return[t.getCanonicalFileName(e),r]})));return{getSourcePosition:function(t){var r=C();if(!e.some(r))return t;var n=e.binarySearchKey(r,t.pos,_,e.compareValues);n<0&&(n=~n);var i=r[n];if(void 0===i||!s(i))return t;return{fileName:v[i.sourceIndex],pos:i.sourcePosition}},getGeneratedPosition:function(r){var n=b.get(t.getCanonicalFileName(r.fileName));if(void 0===n)return r;var i=D(n);if(!e.some(i))return r;var a=e.binarySearchKey(i,r.pos,d,e.compareValues);a<0&&(a=~a);var o=i[a];if(void 0===o||o.sourceIndex!==n)return r;return{fileName:y,pos:o.generatedPosition}}};function x(n){var i,a,s=void 0!==h?e.getPositionOfLineAndCharacter(h,n.generatedLine,n.generatedCharacter,!0):-1;if(o(n)){var c=t.getSourceFileLike(v[n.sourceIndex]);i=r.sources[n.sourceIndex],a=void 0!==c?e.getPositionOfLineAndCharacter(c,n.sourceLine,n.sourceCharacter,!0):-1}return{generatedPosition:s,source:i,sourceIndex:n.sourceIndex,sourcePosition:a,nameIndex:n.nameIndex}}function S(){if(void 0===i){var n=a(r.mappings),o=e.arrayFrom(n,x);void 0!==n.error?(t.log&&t.log("Encountered error while decoding sourcemap: ".concat(n.error)),i=e.emptyArray):i=o}return i}function D(t){if(void 0===f){for(var r=[],n=0,i=S();n0&&i!==n.elements.length||!!(n.elements.length-i)&&e.isDefaultImport(t)}function i(t){return!n(t)&&(e.isDefaultImport(t)||!!t.importClause&&e.isNamedImports(t.importClause.namedBindings)&&function(t){return!!t&&!!e.isNamedImports(t)&&e.some(t.elements,r)}(t.importClause.namedBindings))}function a(t,r,n){if(e.isBindingPattern(t.name))for(var i=0,o=t.name.elements;i=64&&e<=78},e.getNonAssignmentOperatorForCompoundAssignment=function(e){switch(e){case 64:return 39;case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 47;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 78:return 52;case 75:return 56;case 76:return 55;case 77:return 60}},e.getSuperCallFromStatement=c,e.findSuperStatementIndex=function(e,t){for(var r=t;r=1)||49152&f.transformFlags||49152&e.getTargetOfBindingOrAssignmentElement(f).transformFlags||e.isComputedPropertyName(m)){l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),a,c,n),l=void 0);var g=o(t,a,m);e.isComputedPropertyName(m)&&(u=e.append(u,g.argumentExpression)),i(t,f,g,f)}else l=e.append(l,e.visitNode(f,t.visitor))}}l&&t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),a,c,n)}(t,r,u,n,c):e.isArrayBindingOrAssignmentPattern(u)?function(t,r,n,o,c){var l,u,d=e.getElementsOfBindingOrAssignmentPattern(n),_=d.length;if(t.level<1&&t.downlevelIteration)o=s(t,e.setTextRange(t.context.getEmitHelperFactory().createReadHelper(o,_>0&&e.getRestIndicatorOfBindingOrAssignmentElement(d[_-1])?void 0:_),c),!1,c);else if(1!==_&&(t.level<1||0===_)||e.every(d,e.isOmittedExpression)){o=s(t,o,!e.isDeclarationBindingElement(r)||0!==_,c)}for(var p=0;p<_;p++){var f=d[p];if(t.level>=1)if(32768&f.transformFlags||t.hasTransformedPriorElement&&!a(f)){t.hasTransformedPriorElement=!0;var m=t.context.factory.createTempVariable(void 0);t.hoistTempVariables&&t.context.hoistVariableDeclaration(m),u=e.append(u,[m,f]),l=e.append(l,t.createArrayBindingOrAssignmentElement(m))}else l=e.append(l,f);else{if(e.isOmittedExpression(f))continue;if(e.getRestIndicatorOfBindingOrAssignmentElement(f)){if(p===_-1){g=t.context.factory.createArraySliceCall(o,p);i(t,f,g,f)}}else{var g=t.context.factory.createElementAccessExpression(o,p);i(t,f,g,f)}}}l&&t.emitBindingOrAssignment(t.createArrayBindingOrAssignmentPattern(l),o,c,n);if(u)for(var y=0,h=u;y1&&(l.push(p.createEndOfDeclarationMarker(r)),e.setEmitFlags(c,4194304|e.getEmitFlags(c)));return e.singleOrMany(l)}(r);case 226:return function(r){if(!j(r))return e.visitEachChild(r,A,t);var n=p.createClassExpression(void 0,void 0,r.name,void 0,e.visitNodes(r.heritageClauses,A,e.isHeritageClause),U(r));return e.setOriginalNode(n,r),e.setTextRange(n,r),n}(r);case 291:return function(r){if(117===r.token)return;return e.visitEachChild(r,A,t)}(r);case 228:return function(t){return p.updateExpressionWithTypeArguments(t,e.visitNode(t.expression,A,e.isLeftHandSideExpression),void 0)}(r);case 169:return function(r){if(!se(r))return;var n=p.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,oe(r),void 0,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 172:return function(r){if(!de(r))return;var n=p.updateGetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),oe(r),e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 173:return function(r){if(!de(r))return;var n=p.updateSetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),oe(r),e.visitParameterList(r.parameters,A,t),e.visitFunctionBody(r.body,A,t)||p.createBlock([]));n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r)));return n}(r);case 256:return function(r){if(!se(r))return p.createNotEmittedStatement(r);var n=p.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]));if(Te(r)){var i=[n];return Ne(i,r),i}return n}(r);case 213:return function(r){if(!se(r))return p.createOmittedExpression();return p.updateFunctionExpression(r,e.visitNodes(r.modifiers,L,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,A,t),void 0,e.visitFunctionBody(r.body,A,t)||p.createBlock([]))}(r);case 214:return function(r){return p.updateArrowFunction(r,e.visitNodes(r.modifiers,L,e.isModifier),void 0,e.visitParameterList(r.parameters,A,t),void 0,r.equalsGreaterThanToken,e.visitFunctionBody(r.body,A,t))}(r);case 164:return function(t){if(e.parameterIsThisKeyword(t))return;var r=p.updateParameterDeclaration(t,void 0,void 0,t.dotDotDotToken,e.visitNode(t.name,A,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,A,e.isExpression));r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32));return r}(r);case 212:return function(r){var n=e.skipOuterExpressions(r.expression,-7);if(e.isAssertionExpression(n)){var i=e.visitNode(r.expression,A,e.isExpression);return p.createPartiallyEmittedExpression(i,r)}return e.visitEachChild(r,A,t)}(r);case 211:case 229:return function(t){var r=e.visitNode(t.expression,A,e.isExpression);return p.createPartiallyEmittedExpression(r,t)}(r);case 208:return function(t){return p.updateCallExpression(t,e.visitNode(t.expression,A,e.isExpression),void 0,e.visitNodes(t.arguments,A,e.isExpression))}(r);case 209:return function(t){return p.updateNewExpression(t,e.visitNode(t.expression,A,e.isExpression),void 0,e.visitNodes(t.arguments,A,e.isExpression))}(r);case 210:return function(t){return p.updateTaggedTemplateExpression(t,e.visitNode(t.tag,A,e.isExpression),void 0,e.visitNode(t.template,A,e.isExpression))}(r);case 230:return function(t){var r=e.visitNode(t.expression,A,e.isLeftHandSideExpression);return p.createPartiallyEmittedExpression(r,t)}(r);case 260:return function(t){if(!function(t){return!e.isEnumConst(t)||e.shouldPreserveConstEnums(b)}(t))return p.createNotEmittedStatement(t);var r=[],i=2,s=ye(r,t);s&&(D===e.ModuleKind.System&&o===n||(i|=512));var c=Pe(t),l=Ie(t),u=e.hasSyntacticModifier(t,1)?p.getExternalModuleOrNamespaceExportName(a,t,!1,!0):p.getLocalName(t,!1,!0),d=p.createLogicalOr(u,p.createAssignment(u,p.createObjectLiteralExpression()));if(fe(t)){var _=p.getLocalName(t,!1,!0);d=p.createAssignment(_,d)}var f=p.createExpressionStatement(p.createCallExpression(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,c)],void 0,function(t,r){var n=a;a=r;var i=[];m();var o=e.map(t.members,pe);return e.insertStatementsAfterStandardPrologue(i,y()),e.addRange(i,o),a=n,p.createBlock(e.setTextRange(p.createNodeArray(i),t.members),!0)}(t,l)),void 0,[d]));e.setOriginalNode(f,t),s&&(e.setSyntheticLeadingComments(f,void 0),e.setSyntheticTrailingComments(f,void 0));return e.setTextRange(f,t),e.addEmitFlags(f,i),r.push(f),r.push(p.createEndOfDeclarationMarker(t)),r}(r);case 237:return function(r){if(Te(r)){var n=e.getInitializedVariables(r.declarationList);if(0===n.length)return;return e.setTextRange(p.createExpressionStatement(p.inlineExpressions(e.map(n,_e))),r)}return e.visitEachChild(r,A,t)}(r);case 254:return function(t){var r=p.updateVariableDeclaration(t,e.visitNode(t.name,A,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,A,e.isExpression));t.type&&e.setTypeNode(r.name,t.type);return r}(r);case 261:return he(r);case 265:return Ce(r);case 279:return function(t){return p.updateJsxSelfClosingElement(t,e.visitNode(t.tagName,A,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,A,e.isJsxAttributes))}(r);case 280:return function(t){return p.updateJsxOpeningElement(t,e.visitNode(t.tagName,A,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,A,e.isJsxAttributes))}(r);default:return e.visitEachChild(r,A,t)}}function B(r){var n=e.getStrictOptionValue(b,"alwaysStrict")&&!(e.isExternalModule(r)&&D>=e.ModuleKind.ES2015)&&!e.isJsonSourceFile(r);return p.updateSourceFile(r,e.visitLexicalEnvironment(r.statements,w,t,0,n))}function J(e){return!!(4096&e.transformFlags)}function j(t){return e.some(t.decorators)||e.some(t.typeParameters)||e.some(t.heritageClauses,J)||e.some(t.members,J)}function U(t){var r=[],n=e.getFirstConstructorWithBody(t),i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(i)for(var a=0,o=i;a0&&e.parameterIsThisKeyword(n[0]),a=i?1:0,o=i?n.length-1:n.length,s=0;s0?167===r.kind?p.createVoidZero():p.createNull():void 0,s=f().createDecorateHelper(n,i,a,o);return e.setTextRange(s,e.moveRangePastDecorators(r)),e.setEmitFlags(s,1536),s}}function Q(t){return e.visitNode(t.expression,A,e.isExpression)}function X(t,r){var n;if(t){n=[];for(var i=0,a=t;i=0&&e.addRange(o,e.visitNodes(n.statements,A,e.isStatement,s,c+1-s));var l=e.mapDefined(a,ue);c>=0?e.addRange(o,l):o=r(r(r([],o.slice(0,s),!0),l,!0),o.slice(s),!0);e.addRange(o,e.visitNodes(n.statements,A,e.isStatement,c+1+s)),o=p.mergeLexicalEnvironment(o,y());var u=p.createBlock(e.setTextRange(p.createNodeArray(o),n.statements),!0);return e.setTextRange(u,n),e.setOriginalNode(u,n),u}(n.body,n))}function ue(t){var r=t.name;if(e.isIdentifier(r)){var n=e.setParent(e.setTextRange(p.cloneNode(r),r),r.parent);e.setEmitFlags(n,1584);var i=e.setParent(e.setTextRange(p.cloneNode(r),r),r.parent);return e.setEmitFlags(i,1536),e.startOnNewLine(e.removeAllComments(e.setTextRange(e.setOriginalNode(p.createExpressionStatement(p.createAssignment(e.setTextRange(p.createPropertyAccessExpression(p.createThis(),n),t.name),i)),t),e.moveRangePos(t,-1))))}}function de(t){return!(e.nodeIsMissing(t.body)&&e.hasSyntacticModifier(t,128))}function _e(r){var n=r.name;return e.isBindingPattern(n)?e.flattenDestructuringAssignment(r,A,t,0,!1,we):e.setTextRange(p.createAssignment(Fe(n),e.visitNode(r.initializer,A,e.isExpression)),r)}function pe(r){var n=ae(r,!1),i=function(r){var n=v.getConstantValue(r);return void 0!==n?"string"==typeof n?p.createStringLiteral(n):p.createNumericLiteral(n):(0==(8&u)&&(u|=8,t.enableSubstitution(79)),r.initializer?e.visitNode(r.initializer,A,e.isExpression):p.createVoidZero())}(r),o=p.createAssignment(p.createElementAccessExpression(a,n),i),s=10===i.kind?o:p.createAssignment(p.createElementAccessExpression(a,o),n);return e.setTextRange(p.createExpressionStatement(e.setTextRange(s,r)),r)}function fe(t){return Te(t)||Ee(t)&&D!==e.ModuleKind.ES2015&&D!==e.ModuleKind.ES2020&&D!==e.ModuleKind.ES2022&&D!==e.ModuleKind.ESNext&&D!==e.ModuleKind.System}function me(t){c||(c=new e.Map);var r=ge(t);c.has(r)||c.set(r,t)}function ge(t){return e.Debug.assertNode(t.name,e.isIdentifier),t.name.escapedText}function ye(t,r){var n=p.createVariableStatement(e.visitNodes(r.modifiers,L,e.isModifier),p.createVariableDeclarationList([p.createVariableDeclaration(p.getLocalName(r,!1,!0))],305===o.kind?0:1));if(e.setOriginalNode(n,r),me(r),function(e){if(c){var t=ge(e);return c.get(t)===e}return!0}(r))return 260===r.kind?e.setSourceMapRange(n.declarationList,r):e.setSourceMapRange(n,r),e.setCommentRange(n,r),e.addEmitFlags(n,4195328),t.push(n),!0;var i=p.createMergeDeclarationMarker(n);return e.setEmitFlags(i,4195840),t.push(i),!1}function he(r){if(!function(t){var r=e.getParseTreeNode(t,e.isModuleDeclaration);return!r||e.isInstantiatedModule(r,e.shouldPreserveConstEnums(b))}(r))return p.createNotEmittedStatement(r);e.Debug.assertNode(r.name,e.isIdentifier,"A TypeScript namespace should have an Identifier name."),0==(2&u)&&(u|=2,t.enableSubstitution(79),t.enableSubstitution(297),t.enableEmitNotification(261));var s=[],l=2,d=ye(s,r);d&&(D===e.ModuleKind.System&&o===n||(l|=512));var _=Pe(r),f=Ie(r),g=e.hasSyntacticModifier(r,1)?p.getExternalModuleOrNamespaceExportName(a,r,!1,!0):p.getLocalName(r,!1,!0),h=p.createLogicalOr(g,p.createAssignment(g,p.createObjectLiteralExpression()));if(fe(r)){var v=p.getLocalName(r,!1,!0);h=p.createAssignment(v,h)}var x=p.createExpressionStatement(p.createCallExpression(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,_)],void 0,function(t,r){var n=a,o=i,s=c;a=r,i=t,c=void 0;var l,u,d=[];if(m(),t.body)if(262===t.body.kind)k(t.body,(function(t){return e.addRange(d,e.visitNodes(t.statements,P,e.isStatement))})),l=t.body.statements,u=t.body;else{var _=he(t.body);_&&(e.isArray(_)?e.addRange(d,_):d.push(_));var f=ve(t).body;l=e.moveRangePos(f.statements,-1)}e.insertStatementsAfterStandardPrologue(d,y()),a=n,i=o,c=s;var g=p.createBlock(e.setTextRange(p.createNodeArray(d),l),!0);e.setTextRange(g,u),t.body&&262===t.body.kind||e.setEmitFlags(g,1536|e.getEmitFlags(g));return g}(r,f)),void 0,[h]));return e.setOriginalNode(x,r),d&&(e.setSyntheticLeadingComments(x,void 0),e.setSyntheticTrailingComments(x,void 0)),e.setTextRange(x,r),e.addEmitFlags(x,l),s.push(x),s.push(p.createEndOfDeclarationMarker(r)),s}function ve(e){if(261===e.body.kind)return ve(e.body)||e.body}function be(t){e.Debug.assert(!t.isTypeOnly);var r=Le(t)?t.name:void 0,n=e.visitNode(t.namedBindings,xe,e.isNamedImportBindings);return r||n?p.updateImportClause(t,!1,r,n):void 0}function xe(t){if(268===t.kind)return Le(t)?t:void 0;var r=b.preserveValueImports&&(1===b.importsNotUsedAsValues||2===b.importsNotUsedAsValues),n=e.visitNodes(t.elements,Se,e.isImportSpecifier);return r||e.some(n)?p.updateNamedImports(t,n):void 0}function Se(e){return!e.isTypeOnly&&Le(e)?e:void 0}function De(e){return!e.isTypeOnly&&v.isValueAliasDeclaration(e)?e:void 0}function Ce(r){if(!r.isTypeOnly){if(e.isExternalModuleImportEqualsDeclaration(r)){var i=Le(r);return i||1!==b.importsNotUsedAsValues?i?e.visitEachChild(r,A,t):void 0:e.setOriginalNode(e.setTextRange(p.createImportDeclaration(void 0,void 0,void 0,r.moduleReference.expression,void 0),r),r)}if(function(t){return Le(t)||!e.isExternalModule(n)&&v.isTopLevelValueImportEqualsWithEntityName(t)}(r)){var o,s,c,l=e.createExpressionFromEntityName(p,r.moduleReference);return e.setEmitFlags(l,3584),ke(r)||!Te(r)?e.setOriginalNode(e.setTextRange(p.createVariableStatement(e.visitNodes(r.modifiers,L,e.isModifier),p.createVariableDeclarationList([e.setOriginalNode(p.createVariableDeclaration(r.name,void 0,void 0,l),r)])),r),r):e.setOriginalNode((o=r.name,s=l,c=r,e.setTextRange(p.createExpressionStatement(p.createAssignment(p.getNamespaceMemberName(a,o,!1,!0),s)),c)),r)}}}function Te(t){return void 0!==i&&e.hasSyntacticModifier(t,1)}function Ee(t){return void 0===i&&e.hasSyntacticModifier(t,1)}function ke(t){return Ee(t)&&!e.hasSyntacticModifier(t,512)}function Ae(e){return p.createExpressionStatement(e)}function Ne(t,r){var n=p.createAssignment(p.getExternalModuleOrNamespaceExportName(a,r,!1,!0),p.getLocalName(r));e.setSourceMapRange(n,e.createRange(r.name?r.name.pos:r.pos,r.end));var i=p.createExpressionStatement(n);e.setSourceMapRange(i,e.createRange(-1,r.end)),t.push(i)}function we(t,r,n){return e.setTextRange(p.createAssignment(Fe(t),r),n)}function Fe(e){return p.getNamespaceMemberName(a,e,!1,!0)}function Pe(t){var r=p.getGeneratedNameForNode(t);return e.setSourceMapRange(r,t.name),r}function Ie(e){return p.getGeneratedNameForNode(e)}function Oe(t){if(u&_&&!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var r=v.getReferencedExportContainer(t,!1);if(r&&305!==r.kind)if(2&_&&261===r.kind||8&_&&260===r.kind)return e.setTextRange(p.createPropertyAccessExpression(p.getGeneratedNameForNode(r),t),t)}}function Me(t){var r=function(t){if(b.isolatedModules)return;return e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)?v.getConstantValue(t):void 0}(t);if(void 0!==r){e.setConstantValue(t,r);var n="string"==typeof r?p.createStringLiteral(r):p.createNumericLiteral(r);if(!b.removeComments){var i=e.getOriginalNode(t,e.isAccessExpression);e.addSyntheticTrailingComment(n,3," ".concat(e.getTextOfNode(i).replace(/\*\//g,"*_/")," "))}return n}return t}function Le(e){return b.preserveValueImports?v.isValueAliasDeclaration(e):v.isReferencedAliasDeclaration(e)}}}(c||(c={})),function(e){var t,n,i;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.ClassStaticThisOrSuperReference=2]="ClassStaticThisOrSuperReference"}(t||(t={})),(n=e.PrivateIdentifierKind||(e.PrivateIdentifierKind={})).Field="f",n.Method="m",n.Accessor="a",function(e){e[e.None=0]="None",e[e.ClassWasDecorated=1]="ClassWasDecorated",e[e.NeedsClassConstructorReference=2]="NeedsClassConstructorReference",e[e.NeedsClassSuperReference=4]="NeedsClassSuperReference",e[e.NeedsSubstitutionForThisInClassStaticField=8]="NeedsSubstitutionForThisInClassStaticField"}(i||(i={})),e.transformClassFields=function(t){var n=t.factory,i=t.hoistVariableDeclaration,a=t.endLexicalEnvironment,o=t.startLexicalEnvironment,s=t.resumeLexicalEnvironment,c=t.addBlockScopedVariable,l=t.getEmitResolver(),u=t.getCompilerOptions(),d=e.getEmitScriptTarget(u),_=e.getUseDefineForClassFields(u),p=d<9,f=d<9,m=f&&d>=2,g=t.onSubstituteNode;t.onSubstituteNode=function(t,r){if(r=g(t,r),1===t)return function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&y&&33554432&l.getNodeCheckFlags(t)){var r=l.getReferencedValueDeclaration(t);if(r){var i=h[r.id];if(i){var a=n.cloneNode(i);return e.setSourceMapRange(a,t),e.setCommentRange(a,t),a}}}return}(t)||t}(t);case 108:return function(t){if(2&y&&S){var r=S.facts,i=S.classConstructor;if(1&r)return n.createParenthesizedExpression(n.createVoidZero());if(i)return e.setTextRange(e.setOriginalNode(n.cloneNode(i),t),t)}return t}(t)}return t}(r);return r};var y,h,v,b,x=t.onEmitNode;t.onEmitNode=function(t,r,n){var i=e.getOriginalNode(r);if(i.id){var a=E.get(i.id);if(a){var o=S,s=D;return S=a,D=a,x(t,r,n),S=o,void(D=s)}}switch(r.kind){case 213:if(e.isArrowFunction(i)||262144&e.getEmitFlags(r))break;case 256:case 171:o=S,s=D;return S=void 0,D=void 0,x(t,r,n),S=o,void(D=s);case 172:case 173:case 169:case 167:o=S,s=D;return D=S,S=void 0,x(t,r,n),S=o,void(D=s);case 162:o=S,s=D;return S=D,D=void 0,x(t,r,n),S=o,void(D=s)}x(t,r,n)};var S,D,C,T=[],E=new e.Map;return e.chainBundle(t,(function(r){var n=t.getCompilerOptions();if(r.isDeclarationFile||_&&e.getEmitScriptTarget(n)>=9)return r;var i=e.visitEachChild(r,N,t);return e.addEmitHelpers(i,t.readEmitHelpers()),i}));function k(a,o){if(8388608&a.transformFlags)switch(a.kind){case 226:case 257:return function(r){if(!e.forEach(r.members,J))return e.visitEachChild(r,N,t);var a=v;if(v=void 0,function(){T.push(S),S=void 0}(),p){var o=e.getNameOfDeclaration(r);o&&e.isIdentifier(o)&&(X().className=e.idText(o));var s=j(r);e.some(s)&&(X().weakSetName=Z("instances",s[0].name))}var u=e.isClassDeclaration(r)?function(t){var r,a=U(t);a&&(Q().facts=a);8&a&&W();if(2&a){var o=n.createTempVariable(i,!0);Q().classConstructor=n.cloneNode(o),r=n.createAssignment(o,n.getInternalName(t))}var s=e.getEffectiveBaseTypeNode(t),c=!(!s||104===e.skipOuterExpressions(s.expression).kind),l=[n.updateClassDeclaration(t,void 0,t.modifiers,t.name,void 0,e.visitNodes(t.heritageClauses,w,e.isHeritageClause),V(t,c))];r&&$().unshift(r);e.some(v)&&l.push(n.createExpressionStatement(n.inlineExpressions(v)));var u=e.getStaticPropertiesAndClassStaticBlock(t);e.some(u)&&z(l,u,n.getInternalName(t));return l}(r):function(r){var a=U(r);a&&(Q().facts=a);8&a&&W();var o,s=!!(1&a),u=e.getStaticPropertiesAndClassStaticBlock(r),d=e.getEffectiveBaseTypeNode(r),_=!(!d||104===e.skipOuterExpressions(d.expression).kind),f=16777216&l.getNodeCheckFlags(r);function m(){var e=l.getNodeCheckFlags(r),t=16777216&e,a=524288&e;return n.createTempVariable(a?c:i,!!t)}2&a&&(o=m(),Q().classConstructor=n.cloneNode(o));var g=n.updateClassExpression(r,e.visitNodes(r.decorators,N,e.isDecorator),r.modifiers,r.name,void 0,e.visitNodes(r.heritageClauses,w,e.isHeritageClause),V(r,_));if(p&&e.some(u,(function(t){return e.isClassStaticBlockDeclaration(t)||!!t.initializer||e.isPrivateIdentifier(t.name)}))||e.some(v)){if(s)return e.Debug.assertIsDefined(b,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),b&&v&&e.some(v)&&b.push(n.createExpressionStatement(n.inlineExpressions(v))),b&&e.some(u)&&z(b,u,n.getInternalName(r)),o?n.inlineExpressions([n.createAssignment(o,g),o]):g;var x=[];if(o||(o=m()),f){0==(1&y)&&(y|=1,t.enableSubstitution(79),h=[]);var S=n.cloneNode(o);S.autoGenerateFlags&=-9,h[e.getOriginalNodeId(r)]=S}return e.setEmitFlags(g,65536|e.getEmitFlags(g)),x.push(e.startOnNewLine(n.createAssignment(o,g))),e.addRange(x,e.map(v,e.startOnNewLine)),e.addRange(x,function(t,r){for(var n=[],i=0,a=t;i=0?(g=h+1,v=r(r(r([],v.slice(0,y),!0),e.visitNodes(o.body.statements,N,e.isStatement,y,g-y),!0),v.slice(y),!0)):y>=0&&(g=y));m&&v.push(n.createExpressionStatement(n.createCallExpression(n.createSuper(),void 0,[n.createSpreadElement(n.createIdentifier("arguments"))])));var b=0;if(null==o?void 0:o.body)if(_)v=v.filter((function(t){return!e.isParameterPropertyDeclaration(e.getOriginalNode(t),o)}));else{for(var x=0,S=o.body.statements;x0){var C=e.visitNodes(o.body.statements,N,e.isStatement,g,b);if(h>=0)e.addRange(v,C);else{var T=y;m&&T++,v=r(r(r([],v.slice(0,T),!0),C,!0),v.slice(T),!0)}g+=b}}var E=n.createThis();(function(t,r,i){if(!p||!e.some(r))return;var a=X().weakSetName;e.Debug.assert(a,"weakSetName should be set in private identifier environment"),t.push(n.createExpressionStatement(function(t,r){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(r,"add"),void 0,[t])}(i,a)))})(v,d,E),z(v,u,E),o&&e.addRange(v,e.visitNodes(o.body.statements,k,e.isStatement,g));return v=n.mergeLexicalEnvironment(v,a()),e.setTextRange(n.createBlock(e.setTextRange(n.createNodeArray(v),o?o.body.statements:i.members),!0),o?o.body:void 0);function k(t){if(!_||!e.isParameterPropertyDeclaration(e.getOriginalNode(t),o))return N(t)}}(i,c,o);if(!d)return;return e.startOnNewLine(e.setOriginalNode(e.setTextRange(n.createConstructorDeclaration(void 0,void 0,null!=u?u:[],d),c||i),c))}(i,o),g=e.visitNodes(i.members,P,e.isClassElement);return m&&l.push(m),!p&&e.some(v)&&(l.push(n.createClassStaticBlockDeclaration(void 0,void 0,n.createBlock([n.createExpressionStatement(n.inlineExpressions(v))]))),v=void 0),e.addRange(l,g),e.setTextRange(n.createNodeArray(l),i.members)}function K(t){return!e.isStatic(t)&&!e.hasSyntacticModifier(e.getOriginalNode(t),128)&&(_?d<9:e.isInitializedProperty(t)||p&&e.isPrivateIdentifierClassElementDeclaration(t))}function z(t,r,n){for(var i=0,a=r;i=0;--r){var n,i=T[r];if(i)if(n=null===(t=i.privateIdentifierEnvironment)||void 0===t?void 0:t.identifiers.get(e.escapedText))return n}}function re(r){var a=n.getGeneratedNameForNode(r),o=te(r.name);if(!o)return e.visitEachChild(r,N,t);var s=r.expression;return(e.isThisProperty(r)||e.isSuperProperty(r)||!e.isSimpleCopiableExpression(r.expression))&&(s=n.createTempVariable(i,!0),$().push(n.createBinaryExpression(s,63,e.visitNode(r.expression,N,e.isExpression)))),n.createAssignmentTargetWrapper(a,B(o,s,a,63))}function ne(t){var r=e.getTargetOfBindingOrAssignmentElement(t);if(r){var i=void 0;if(e.isPrivateIdentifierPropertyAccessExpression(r))i=re(r);else if(m&&e.isSuperProperty(r)&&C&&S){var a=S.classConstructor,o=S.superClassReference;if(1&S.facts)i=H(r);else if(a&&o){var s=e.isElementAccessExpression(r)?e.visitNode(r.argumentExpression,N,e.isExpression):e.isIdentifier(r.name)?n.createStringLiteralFromNode(r.name):void 0;if(s){var c=n.createTempVariable(void 0);i=n.createAssignmentTargetWrapper(c,n.createReflectSetCall(o,s,c,a))}}}if(i)return e.isAssignmentExpression(t)?n.updateBinaryExpression(t,i,t.operatorToken,e.visitNode(t.right,N,e.isExpression)):e.isSpreadElement(t)?n.updateSpreadElement(t,i):i}return e.visitNode(t,F)}function ie(t){if(e.isObjectBindingOrAssignmentElement(t)&&!e.isShorthandPropertyAssignment(t)){var r=e.getTargetOfBindingOrAssignmentElement(t),i=void 0;if(r)if(e.isPrivateIdentifierPropertyAccessExpression(r))i=re(r);else if(m&&e.isSuperProperty(r)&&C&&S){var a=S.classConstructor,o=S.superClassReference;if(1&S.facts)i=H(r);else if(a&&o){var s=e.isElementAccessExpression(r)?e.visitNode(r.argumentExpression,N,e.isExpression):e.isIdentifier(r.name)?n.createStringLiteralFromNode(r.name):void 0;if(s){var c=n.createTempVariable(void 0);i=n.createAssignmentTargetWrapper(c,n.createReflectSetCall(o,s,c,a))}}}if(e.isPropertyAssignment(t)){var l=e.getInitializerOfBindingOrAssignmentElement(t);return n.updatePropertyAssignment(t,e.visitNode(t.name,N,e.isPropertyName),i?l?n.createAssignment(i,e.visitNode(l,N)):i:e.visitNode(t.initializer,F,e.isExpression))}if(e.isSpreadAssignment(t))return n.updateSpreadAssignment(t,i||e.visitNode(t.expression,F,e.isExpression));e.Debug.assert(void 0===i,"Should not have generated a wrapped target")}return e.visitNode(t,N)}}}(c||(c={})),function(e){var t,n;function i(t,r,n,i){var a=0!=(4096&r.getNodeCheckFlags(n)),o=[];return i.forEach((function(r,n){var i=e.unescapeLeadingUnderscores(n),s=[];s.push(t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[],void 0,void 0,e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4)))),a&&s.push(t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,t.createAssignment(e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4),t.createIdentifier("v"))))),o.push(t.createPropertyAssignment(i,t.createObjectLiteralExpression(s)))})),t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_super",48),void 0,void 0,t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[t.createNull(),t.createObjectLiteralExpression(o,!0)]))],2))}!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper"}(t||(t={})),function(e){e[e.NonTopLevel=1]="NonTopLevel",e[e.HasLexicalThis=2]="HasLexicalThis"}(n||(n={})),e.transformES2017=function(t){var n,a,o,s,c=t.factory,l=t.getEmitHelperFactory,u=t.resumeLexicalEnvironment,d=t.endLexicalEnvironment,_=t.hoistVariableDeclaration,p=t.getEmitResolver(),f=t.getCompilerOptions(),m=e.getEmitScriptTarget(f),g=0,y=[],h=0,v=t.onEmitNode,b=t.onSubstituteNode;return t.onEmitNode=function(t,r,i){if(1&n&&function(e){var t=e.kind;return 257===t||171===t||169===t||172===t||173===t}(r)){var a=6144&p.getNodeCheckFlags(r);if(a!==g){var o=g;return g=a,v(t,r,i),void(g=o)}}else if(n&&y[e.getNodeId(r)]){o=g;return g=0,v(t,r,i),void(g=o)}v(t,r,i)},t.onSubstituteNode=function(t,n){if(n=b(t,n),1===t&&g)return function(t){switch(t.kind){case 206:return j(t);case 207:return U(t);case 208:return function(t){var n=t.expression;if(e.isSuperProperty(n)){var i=e.isPropertyAccessExpression(n)?j(n):U(n);return c.createCallExpression(c.createPropertyAccessExpression(i,"call"),void 0,r([c.createThis()],t.arguments,!0))}return t}(t)}return t}(n);return n},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;x(1,!1),x(2,!e.isEffectiveStrictModeSourceFile(r,f));var n=e.visitEachChild(r,E,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function x(e,t){h=t?h|e:h&~e}function S(e){return 0!=(h&e)}function D(){return S(2)}function C(e,t,r){var n=e&~h;if(n){x(n,!0);var i=t(r);return x(n,!1),i}return t(r)}function T(r){return e.visitEachChild(r,E,t)}function E(r){if(0==(256&r.transformFlags))return r;switch(r.kind){case 131:return;case 218:return function(r){if(!S(1))return e.visitEachChild(r,E,t);return e.setOriginalNode(e.setTextRange(c.createYieldExpression(void 0,e.visitNode(r.expression,E,e.isExpression)),r),r)}(r);case 169:return C(3,A,r);case 256:return C(3,N,r);case 213:return C(3,w,r);case 214:return C(1,F,r);case 206:return o&&e.isPropertyAccessExpression(r)&&106===r.expression.kind&&o.add(r.name.escapedText),e.visitEachChild(r,E,t);case 207:return o&&106===r.expression.kind&&(s=!0),e.visitEachChild(r,E,t);case 172:case 173:case 171:case 257:case 226:return C(3,T,r);default:return e.visitEachChild(r,E,t)}}function k(r){if(e.isNodeWithPossibleHoistedDeclaration(r))switch(r.kind){case 237:return function(r){if(I(r.declarationList)){var n=O(r.declarationList,!1);return n?c.createExpressionStatement(n):void 0}return e.visitEachChild(r,E,t)}(r);case 242:return function(r){var n=r.initializer;return c.updateForStatement(r,I(n)?O(n,!1):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.condition,E,e.isExpression),e.visitNode(r.incrementor,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 243:return function(r){return c.updateForInStatement(r,I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 244:return function(r){return c.updateForOfStatement(r,e.visitNode(r.awaitModifier,E,e.isToken),I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 292:return function(r){var n,i=new e.Set;if(P(r.variableDeclaration,i),i.forEach((function(t,r){a.has(r)&&(n||(n=new e.Set(a)),n.delete(r))})),n){var o=a;a=n;var s=e.visitEachChild(r,k,t);return a=o,s}return e.visitEachChild(r,k,t)}(r);case 235:case 249:case 263:case 289:case 290:case 252:case 240:case 241:case 239:case 248:case 250:return e.visitEachChild(r,k,t);default:return e.Debug.assertNever(r,"Unhandled node.")}return E(r)}function A(r){return c.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function N(r){return c.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function w(r){return c.updateFunctionExpression(r,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function F(r){return c.updateArrowFunction(r,e.visitNodes(r.modifiers,E,e.isModifier),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function P(t,r){var n=t.name;if(e.isIdentifier(n))r.add(n.escapedText);else for(var i=0,a=n.elements;i=2&&6144&p.getNodeCheckFlags(r);if(F&&(0==(1&n)&&(n|=1,t.enableSubstitution(208),t.enableSubstitution(206),t.enableSubstitution(207),t.enableEmitNotification(257),t.enableEmitNotification(169),t.enableEmitNotification(172),t.enableEmitNotification(173),t.enableEmitNotification(171),t.enableEmitNotification(237)),o.size)){var I=i(c,p,r,o);y[e.getNodeId(I)]=!0,e.insertStatementsAfterStandardPrologue(N,[I])}var O=c.createBlock(N,!0);e.setTextRange(O,r.body),F&&s&&(4096&p.getNodeCheckFlags(r)?e.addEmitHelper(O,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(r)&&e.addEmitHelper(O,e.asyncSuperHelper)),S=O}return a=v,g||(o=C,s=T),S}function J(t,r){return e.isBlock(t)?c.updateBlock(t,e.visitNodes(t.statements,k,e.isStatement,r)):c.converters.convertToFunctionBlock(e.visitNode(t,k,e.isConciseBody))}function j(t){return 106===t.expression.kind?e.setTextRange(c.createPropertyAccessExpression(c.createUniqueName("_super",48),t.name),t):t}function U(t){return 106===t.expression.kind?(r=t.argumentExpression,n=t,4096&g?e.setTextRange(c.createPropertyAccessExpression(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),"value"),n):e.setTextRange(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),n)):t;var r,n}},e.createSuperAccessVariableStatement=i}(c||(c={})),function(e){var t,n;!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper"}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasLexicalThis=1]="HasLexicalThis",e[e.IterationContainer=2]="IterationContainer",e[e.AncestorFactsMask=3]="AncestorFactsMask",e[e.SourceFileIncludes=1]="SourceFileIncludes",e[e.SourceFileExcludes=2]="SourceFileExcludes",e[e.StrictModeSourceFileIncludes=0]="StrictModeSourceFileIncludes",e[e.ClassOrFunctionIncludes=1]="ClassOrFunctionIncludes",e[e.ClassOrFunctionExcludes=2]="ClassOrFunctionExcludes",e[e.ArrowFunctionIncludes=0]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=2]="ArrowFunctionExcludes",e[e.IterationStatementIncludes=2]="IterationStatementIncludes",e[e.IterationStatementExcludes=0]="IterationStatementExcludes"}(n||(n={})),e.transformES2018=function(t){var n=t.factory,i=t.getEmitHelperFactory,a=t.resumeLexicalEnvironment,o=t.endLexicalEnvironment,s=t.hoistVariableDeclaration,c=t.getEmitResolver(),l=t.getCompilerOptions(),u=e.getEmitScriptTarget(l),d=t.onEmitNode;t.onEmitNode=function(t,r,n){if(1&p&&function(e){var t=e.kind;return 257===t||171===t||169===t||172===t||173===t}(r)){var i=6144&c.getNodeCheckFlags(r);if(i!==x){var a=x;return x=i,d(t,r,n),void(x=a)}}else if(p&&D[e.getNodeId(r)]){a=x;return x=0,d(t,r,n),void(x=a)}d(t,r,n)};var _=t.onSubstituteNode;t.onSubstituteNode=function(t,i){if(i=_(t,i),1===t&&x)return function(t){switch(t.kind){case 206:return X(t);case 207:return $(t);case 208:return function(t){var i=t.expression;if(e.isSuperProperty(i)){var a=e.isPropertyAccessExpression(i)?X(i):$(i);return n.createCallExpression(n.createPropertyAccessExpression(a,"call"),void 0,r([n.createThis()],t.arguments,!0))}return t}(t)}return t}(i);return i};var p,f,m,g,y,h,v,b=!1,x=0,S=0,D=[];return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;g=r;var i=function(r){var i=C(2,e.isEffectiveStrictModeSourceFile(r,l)?0:1);b=!1;var a=e.visitEachChild(r,k,t),o=e.concatenate(a.statements,y&&[n.createVariableStatement(void 0,n.createVariableDeclarationList(y))]),s=n.updateSourceFile(a,e.setTextRange(n.createNodeArray(o),r.statements));return T(i),s}(r);return e.addEmitHelpers(i,t.readEmitHelpers()),g=void 0,y=void 0,i}));function C(e,t){var r=S;return S=3&(S&~e|t),r}function T(e){S=e}function E(t){y=e.append(y,n.createVariableDeclaration(t))}function k(e){return P(e,!1)}function A(e){return P(e,!0)}function N(e){if(131!==e.kind)return e}function w(e,t,r,n){if(function(e,t){return S!==(S&~e|t)}(r,n)){var i=C(r,n),a=e(t);return T(i),a}return e(t)}function F(r){return e.visitEachChild(r,k,t)}function P(a,o){if(0==(128&a.transformFlags))return a;switch(a.kind){case 218:return function(r){if(2&f&&1&f)return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,i().createAwaitHelper(e.visitNode(r.expression,k,e.isExpression))),r),r);return e.visitEachChild(r,k,t)}(a);case 224:return function(r){if(2&f&&1&f){if(r.asteriskToken){var a=e.visitNode(e.Debug.checkDefined(r.expression),k,e.isExpression);return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,i().createAwaitHelper(n.updateYieldExpression(r,r.asteriskToken,e.setTextRange(i().createAsyncDelegatorHelper(e.setTextRange(i().createAsyncValuesHelper(a),a)),a)))),r),r)}return e.setOriginalNode(e.setTextRange(n.createYieldExpression(void 0,L(r.expression?e.visitNode(r.expression,k,e.isExpression):n.createVoidZero())),r),r)}return e.visitEachChild(r,k,t)}(a);case 247:return function(r){if(2&f&&1&f)return n.updateReturnStatement(r,L(r.expression?e.visitNode(r.expression,k,e.isExpression):n.createVoidZero()));return e.visitEachChild(r,k,t)}(a);case 250:return function(r){if(2&f){var i=e.unwrapInnermostStatementOfLabel(r);return 244===i.kind&&i.awaitModifier?M(i,r):n.restoreEnclosingLabel(e.visitNode(i,k,e.isStatement,n.liftToBlock),r)}return e.visitEachChild(r,k,t)}(a);case 205:return function(r){if(32768&r.transformFlags){var a=function(t){for(var r,i=[],a=0,o=t;a1){for(var s=1;s=2&&6144&c.getNodeCheckFlags(r);if(m){0==(1&p)&&(p|=1,t.enableSubstitution(208),t.enableSubstitution(206),t.enableSubstitution(207),t.enableEmitNotification(257),t.enableEmitNotification(169),t.enableEmitNotification(172),t.enableEmitNotification(173),t.enableEmitNotification(171),t.enableEmitNotification(237));var g=e.createSuperAccessVariableStatement(n,c,r,h);D[e.getNodeId(g)]=!0,e.insertStatementsAfterStandardPrologue(s,[g])}s.push(f),e.insertStatementsAfterStandardPrologue(s,o());var y=n.updateBlock(r.body,s);return m&&v&&(4096&c.getNodeCheckFlags(r)?e.addEmitHelper(y,e.advancedAsyncSuperHelper):2048&c.getNodeCheckFlags(r)&&e.addEmitHelper(y,e.asyncSuperHelper)),h=d,v=_,y}function H(t){var r;a();var i=0,s=[],c=null!==(r=e.visitNode(t.body,k,e.isConciseBody))&&void 0!==r?r:n.createBlock([]);e.isBlock(c)&&(i=n.copyPrologue(c.statements,s,!1,k)),e.addRange(s,Q(void 0,t));var l=o();if(i>0||e.some(s)||e.some(l)){var u=n.converters.convertToFunctionBlock(c,!0);return e.insertStatementsAfterStandardPrologue(s,l),e.addRange(s,u.statements.slice(i)),n.updateBlock(u,e.setTextRange(n.createNodeArray(s),u.statements))}return c}function Q(r,i){for(var a=!1,o=0,s=i.parameters;o0){var l=e.flattenDestructuringBinding(c,k,t,0,n.getGeneratedNameForNode(c));if(e.some(l)){var u=n.createVariableDeclarationList(l),d=n.createVariableStatement(void 0,u);e.setEmitFlags(d,1048576),r=e.append(r,d)}}else if(c.initializer){var _=n.getGeneratedNameForNode(c),p=e.visitNode(c.initializer,k,e.isExpression),f=n.createAssignment(_,p);d=n.createExpressionStatement(f);e.setEmitFlags(d,1048576),r=e.append(r,d)}}else if(c.initializer){_=n.cloneNode(c.name);e.setTextRange(_,c.name),e.setEmitFlags(_,48);p=e.visitNode(c.initializer,k,e.isExpression);e.addEmitFlags(p,1584);f=n.createAssignment(_,p);e.setTextRange(f,c),e.setEmitFlags(f,1536);var m=n.createBlock([n.createExpressionStatement(f)]);e.setTextRange(m,c),e.setEmitFlags(m,1953);var g=n.createTypeCheck(n.cloneNode(c.name),"undefined");d=n.createIfStatement(g,m);e.startOnNewLine(d),e.setTextRange(d,c),e.setEmitFlags(d,1050528),r=e.append(r,d)}}else if(32768&c.transformFlags){a=!0;l=e.flattenDestructuringBinding(c,k,t,1,n.getGeneratedNameForNode(c),!1,!0);if(e.some(l)){u=n.createVariableDeclarationList(l),d=n.createVariableStatement(void 0,u);e.setEmitFlags(d,1048576),r=e.append(r,d)}}}return r}function X(t){return 106===t.expression.kind?e.setTextRange(n.createPropertyAccessExpression(n.createUniqueName("_super",48),t.name),t):t}function $(t){return 106===t.expression.kind?(r=t.argumentExpression,i=t,4096&x?e.setTextRange(n.createPropertyAccessExpression(n.createCallExpression(n.createIdentifier("_superIndex"),void 0,[r]),"value"),i):e.setTextRange(n.createCallExpression(n.createIdentifier("_superIndex"),void 0,[r]),i)):t;var r,i}}}(c||(c={})),function(e){e.transformES2019=function(t){var r=t.factory;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,n,t)}));function n(i){return 0==(64&i.transformFlags)?i:292===i.kind?function(i){if(!i.variableDeclaration)return r.updateCatchClause(i,r.createVariableDeclaration(r.createTempVariable(void 0)),e.visitNode(i.block,n,e.isBlock));return e.visitEachChild(i,n,t)}(i):e.visitEachChild(i,n,t)}}}(c||(c={})),function(e){e.transformES2020=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,i,t)}));function i(a){if(0==(32&a.transformFlags))return a;switch(a.kind){case 208:var u=o(a,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u;case 206:case 207:if(e.isOptionalChain(a)){u=c(a,!1,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u}return e.visitEachChild(a,i,t);case 221:return 60===a.operatorToken.kind?function(t){var a=e.visitNode(t.left,i,e.isExpression),o=a;e.isSimpleCopiableExpression(a)||(o=r.createTempVariable(n),a=r.createAssignment(o,a));return e.setTextRange(r.createConditionalExpression(l(a,o),void 0,o,void 0,e.visitNode(t.right,i,e.isExpression)),t)}(a):e.visitEachChild(a,i,t);case 215:return function(t){return e.isOptionalChain(e.skipParentheses(t.expression))?e.setOriginalNode(s(t.expression,!1,!0),t):r.updateDeleteExpression(t,e.visitNode(t.expression,i,e.isExpression))}(a);default:return e.visitEachChild(a,i,t)}}function a(t,n,i){var a=s(t.expression,n,i);return e.isSyntheticReference(a)?r.createSyntheticReferenceExpression(r.updateParenthesizedExpression(t,a.expression),a.thisArg):r.updateParenthesizedExpression(t,a)}function o(n,o){if(e.isOptionalChain(n))return c(n,o,!1);if(e.isParenthesizedExpression(n.expression)&&e.isOptionalChain(e.skipParentheses(n.expression))){var s=a(n.expression,!0,!1),l=e.visitNodes(n.arguments,i,e.isExpression);return e.isSyntheticReference(s)?e.setTextRange(r.createFunctionCallCall(s.expression,s.thisArg,l),n):r.updateCallExpression(n,s,void 0,l)}return e.visitEachChild(n,i,t)}function s(t,s,l){switch(t.kind){case 212:return a(t,s,l);case 206:case 207:return function(t,a,o){if(e.isOptionalChain(t))return c(t,a,o);var s,l=e.visitNode(t.expression,i,e.isExpression);return e.Debug.assertNotNode(l,e.isSyntheticReference),a&&(e.isSimpleCopiableExpression(l)?s=l:(s=r.createTempVariable(n),l=r.createAssignment(s,l))),l=206===t.kind?r.updatePropertyAccessExpression(t,l,e.visitNode(t.name,i,e.isIdentifier)):r.updateElementAccessExpression(t,l,e.visitNode(t.argumentExpression,i,e.isExpression)),s?r.createSyntheticReferenceExpression(l,s):l}(t,s,l);case 208:return o(t,s);default:return e.visitNode(t,i,e.isExpression)}}function c(t,a,o){var c=function(t){e.Debug.assertNotNode(t,e.isNonNullChain);for(var r=[t];!t.questionDotToken&&!e.isTaggedTemplateExpression(t);)t=e.cast(e.skipPartiallyEmittedExpressions(t.expression),e.isOptionalChain),e.Debug.assertNotNode(t,e.isNonNullChain),r.unshift(t);return{expression:t.expression,chain:r}}(t),u=c.expression,d=c.chain,_=s(e.skipPartiallyEmittedExpressions(u),e.isCallChain(d[0]),!1),p=e.isSyntheticReference(_)?_.thisArg:void 0,f=e.isSyntheticReference(_)?_.expression:_,m=r.restoreOuterExpressions(u,f,8);e.isSimpleCopiableExpression(f)||(f=r.createTempVariable(n),m=r.createAssignment(f,m));for(var g,y=f,h=0;h1||!!(null===(_=p[0])||void 0===_?void 0:_.dotDotDotToken),m=[t,r];if(i&&m.push(E(i.initializer)),5===s.jsx){var g=e.getOriginalNode(n);if(g&&e.isSourceFile(g)){void 0===i&&m.push(a.createVoidZero()),m.push(f?a.createTrue():a.createFalse());var y=e.getLineAndCharacterOfPosition(g,d.pos);m.push(a.createObjectLiteralExpression([a.createPropertyAssignment("fileName",c()),a.createPropertyAssignment("lineNumber",a.createNumericLiteral(y.line+1)),a.createPropertyAssignment("columnNumber",a.createNumericLiteral(y.character+1))])),m.push(a.createThis())}}var h=e.setTextRange(a.createCallExpression(l(f),void 0,m),d);return u&&e.startOnNewLine(h),h}function b(t,o,c,l){var d=N(t),p=t.attributes.properties,f=e.length(p)?D(p):a.createNull(),m=void 0===i.importSpecifier?e.createJsxFactoryExpression(a,r.getEmitResolver().getJsxFactoryEntity(n),s.reactNamespace,t):u("createElement"),g=e.createExpressionForJsxElement(a,m,d,f,e.mapDefined(o,_),l);return c&&e.startOnNewLine(g),g}function x(e,t,r,n){var i;if(t&&t.length){var o=function(e){var t=y(e);return t&&a.createObjectLiteralExpression([t])}(t);o&&(i=o)}return v(u("Fragment"),i||a.createObjectLiteralExpression([]),void 0,t,r,n)}function S(t,i,o,c){var l=e.createExpressionForJsxFragment(a,r.getEmitResolver().getJsxFactoryEntity(n),r.getEmitResolver().getJsxFragmentFactoryEntity(n),s.reactNamespace,e.mapDefined(i,_),t,c);return o&&e.startOnNewLine(l),l}function D(t,r){var n=e.getEmitScriptTarget(s);return n&&n>=5?a.createObjectLiteralExpression(function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return e.map(t,(function(t){return r?function(t){return a.createSpreadAssignment(e.visitNode(t.expression,d,e.isExpression))}(t):T(t)}))})));r&&n.push(r);return n}(t,r)):function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return r?e.map(t,C):a.createObjectLiteralExpression(e.map(t,T))})));e.isJsxSpreadAttribute(t[0])&&n.unshift(a.createObjectLiteralExpression());r&&n.push(a.createObjectLiteralExpression([r]));return e.singleOrUndefined(n)||o().createAssignHelper(n)}(t,r)}function C(t){return e.visitNode(t.expression,d,e.isExpression)}function T(t){var r=function(t){var r=t.name,n=e.idText(r);return/^[A-Za-z_]\w*$/.test(n)?r:a.createStringLiteral(n)}(t),n=E(t.initializer);return a.createPropertyAssignment(r,n)}function E(t){if(void 0===t)return a.createTrue();if(10===t.kind){var r=void 0!==t.singleQuote?t.singleQuote:!e.isStringDoubleQuoted(t,n),i=a.createStringLiteral((o=t.text,((s=A(o))===o?void 0:s)||t.text),r);return e.setTextRange(i,t)}return 288===t.kind?void 0===t.expression?a.createTrue():e.visitNode(t.expression,d,e.isExpression):e.Debug.failBadSyntaxKind(t);var o,s}function k(e,t){var r=A(t);return void 0===e?r:e+" "+r}function A(r){return r.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(function(r,n,i,a,o,s,c){if(o)return e.utf16EncodeAsString(parseInt(o,10));if(s)return e.utf16EncodeAsString(parseInt(s,16));var l=t.get(c);return l?e.utf16EncodeAsString(l):r}))}function N(t){if(278===t.kind)return N(t.openingElement);var r=t.tagName;return e.isIdentifier(r)&&e.isIntrinsicJsxName(r.escapedText)?a.createStringLiteral(e.idText(r)):e.createExpressionFromEntityName(a,r)}function w(t){var r=e.visitNode(t.expression,d,e.isExpression);return t.dotDotDotToken?a.createSpreadElement(r):r}};var t=new e.Map(e.getEntries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}))}(c||(c={})),function(e){e.transformES2016=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;return e.visitEachChild(r,i,t)}));function i(a){return 0==(512&a.transformFlags)?a:221===a.kind?function(a){switch(a.operatorToken.kind){case 67:return function(t){var a,o,s=e.visitNode(t.left,i,e.isExpression),c=e.visitNode(t.right,i,e.isExpression);if(e.isElementAccessExpression(s)){var l=r.createTempVariable(n),u=r.createTempVariable(n);a=e.setTextRange(r.createElementAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),e.setTextRange(r.createAssignment(u,s.argumentExpression),s.argumentExpression)),s),o=e.setTextRange(r.createElementAccessExpression(l,u),s)}else if(e.isPropertyAccessExpression(s)){l=r.createTempVariable(n);a=e.setTextRange(r.createPropertyAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),s.name),s),o=e.setTextRange(r.createPropertyAccessExpression(l,s.name),s)}else a=s,o=s;return e.setTextRange(r.createAssignment(a,e.setTextRange(r.createGlobalMethodCall("Math","pow",[o,c]),t)),t)}(a);case 42:return function(t){var n=e.visitNode(t.left,i,e.isExpression),a=e.visitNode(t.right,i,e.isExpression);return e.setTextRange(r.createGlobalMethodCall("Math","pow",[n,a]),t)}(a);default:return e.visitEachChild(a,i,t)}}(a):e.visitEachChild(a,i,t)}}}(c||(c={})),function(e){var t,n,i,a,o,s;function c(e,t){return{kind:e,expression:t}}!function(e){e[e.CapturedThis=1]="CapturedThis",e[e.BlockScopedBindings=2]="BlockScopedBindings"}(t||(t={})),function(e){e[e.Body=1]="Body",e[e.Initializer=2]="Initializer"}(n||(n={})),function(e){e[e.ToOriginal=0]="ToOriginal",e[e.ToOutParameter=1]="ToOutParameter"}(i||(i={})),function(e){e[e.Break=2]="Break",e[e.Continue=4]="Continue",e[e.Return=8]="Return"}(a||(a={})),function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.ArrowFunction=2]="ArrowFunction",e[e.AsyncFunctionBody=4]="AsyncFunctionBody",e[e.NonStaticClassElement=8]="NonStaticClassElement",e[e.CapturesThis=16]="CapturesThis",e[e.ExportedVariableStatement=32]="ExportedVariableStatement",e[e.TopLevel=64]="TopLevel",e[e.Block=128]="Block",e[e.IterationStatement=256]="IterationStatement",e[e.IterationStatementBlock=512]="IterationStatementBlock",e[e.IterationContainer=1024]="IterationContainer",e[e.ForStatement=2048]="ForStatement",e[e.ForInOrForOfStatement=4096]="ForInOrForOfStatement",e[e.ConstructorWithCapturedSuper=8192]="ConstructorWithCapturedSuper",e[e.StaticInitializer=16384]="StaticInitializer",e[e.AncestorFactsMask=32767]="AncestorFactsMask",e[e.BlockScopeIncludes=0]="BlockScopeIncludes",e[e.BlockScopeExcludes=7104]="BlockScopeExcludes",e[e.SourceFileIncludes=64]="SourceFileIncludes",e[e.SourceFileExcludes=8064]="SourceFileExcludes",e[e.FunctionIncludes=65]="FunctionIncludes",e[e.FunctionExcludes=32670]="FunctionExcludes",e[e.AsyncFunctionBodyIncludes=69]="AsyncFunctionBodyIncludes",e[e.AsyncFunctionBodyExcludes=32662]="AsyncFunctionBodyExcludes",e[e.ArrowFunctionIncludes=66]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=15232]="ArrowFunctionExcludes",e[e.ConstructorIncludes=73]="ConstructorIncludes",e[e.ConstructorExcludes=32662]="ConstructorExcludes",e[e.DoOrWhileStatementIncludes=1280]="DoOrWhileStatementIncludes",e[e.DoOrWhileStatementExcludes=0]="DoOrWhileStatementExcludes",e[e.ForStatementIncludes=3328]="ForStatementIncludes",e[e.ForStatementExcludes=5056]="ForStatementExcludes",e[e.ForInOrForOfStatementIncludes=5376]="ForInOrForOfStatementIncludes",e[e.ForInOrForOfStatementExcludes=3008]="ForInOrForOfStatementExcludes",e[e.BlockIncludes=128]="BlockIncludes",e[e.BlockExcludes=6976]="BlockExcludes",e[e.IterationStatementBlockIncludes=512]="IterationStatementBlockIncludes",e[e.IterationStatementBlockExcludes=7104]="IterationStatementBlockExcludes",e[e.StaticInitializerIncludes=16449]="StaticInitializerIncludes",e[e.StaticInitializerExcludes=32670]="StaticInitializerExcludes",e[e.NewTarget=32768]="NewTarget",e[e.CapturedLexicalThis=65536]="CapturedLexicalThis",e[e.SubtreeFactsMask=-32768]="SubtreeFactsMask",e[e.ArrowFunctionSubtreeExcludes=0]="ArrowFunctionSubtreeExcludes",e[e.FunctionSubtreeExcludes=98304]="FunctionSubtreeExcludes"}(o||(o={})),function(e){e[e.None=0]="None",e[e.UnpackedSpread=1]="UnpackedSpread",e[e.PackedSpread=2]="PackedSpread"}(s||(s={})),e.transformES2015=function(t){var n,i,a,o,s,l,u=t.factory,d=t.getEmitHelperFactory,_=t.startLexicalEnvironment,p=t.resumeLexicalEnvironment,f=t.endLexicalEnvironment,m=t.hoistVariableDeclaration,g=t.getCompilerOptions(),y=t.getEmitResolver(),h=t.onSubstituteNode,v=t.onEmitNode;function b(t){o=e.append(o,u.createVariableDeclaration(t))}return t.onEmitNode=function(t,r,n){if(1&l&&e.isFunctionLike(r)){var i=x(32670,8&e.getEmitFlags(r)?81:65);return v(t,r,n),void S(i,0,0)}v(t,r,n)},t.onSubstituteNode=function(t,r){if(r=h(t,r),1===t)return function(t){switch(t.kind){case 79:return function(t){if(2&l&&!e.isInternalName(t)){var r=y.getReferencedDeclarationWithCollidingName(t);if(r&&(!e.isClassLike(r)||!function(t,r){var n=e.getParseTreeNode(r);if(!n||n===t||n.end<=t.pos||n.pos>=t.end)return!1;var i=e.getEnclosingBlockScopeContainer(t);for(;n;){if(n===i||n===t)return!1;if(e.isClassElement(n)&&n.parent===t)return!0;n=n.parent}return!1}(r,t)))return e.setTextRange(u.getGeneratedNameForNode(e.getNameOfDeclaration(r)),t)}return t}(t);case 108:return function(t){if(1&l&&16&a)return e.setTextRange(u.createUniqueName("_this",48),t);return t}(t)}return t}(r);if(e.isIdentifier(r))return function(t){if(2&l&&!e.isInternalName(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r&&function(e){switch(e.parent.kind){case 203:case 257:case 260:case 254:return e.parent.name===e&&y.isDeclarationWithCollidingName(e.parent)}return!1}(r))return e.setTextRange(u.getGeneratedNameForNode(r),t)}return t}(r);return r},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;n=r,i=r.text;var s=function(t){var r=x(8064,64),n=[],i=[];_();var a=u.copyPrologue(t.statements,n,!1,T);e.addRange(i,e.visitNodes(t.statements,T,e.isStatement,a)),o&&i.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(o)));return u.mergeLexicalEnvironment(n,f()),U(n,t),S(r,0,0),u.updateSourceFile(t,e.setTextRange(u.createNodeArray(e.concatenate(n,i)),t.statements))}(r);return e.addEmitHelpers(s,t.readEmitHelpers()),n=void 0,i=void 0,o=void 0,a=0,s}));function x(e,t){var r=a;return a=32767&(a&~e|t),r}function S(e,t,r){a=-32768&(a&~t|r)|e}function D(e){return 0!=(8192&a)&&247===e.kind&&!e.expression}function C(t){return 0!=(1024&t.transformFlags)||void 0!==s||8192&a&&function(t){return 2097152&t.transformFlags&&(e.isReturnStatement(t)||e.isIfStatement(t)||e.isWithStatement(t)||e.isSwitchStatement(t)||e.isCaseBlock(t)||e.isCaseClause(t)||e.isDefaultClause(t)||e.isTryStatement(t)||e.isCatchClause(t)||e.isLabeledStatement(t)||e.isIterationStatement(t,!1)||e.isBlock(t))}(t)||e.isIterationStatement(t,!1)&&fe(t)||0!=(33554432&e.getEmitFlags(t))}function T(e){return C(e)?N(e,!1):e}function E(e){return C(e)?N(e,!0):e}function k(t){if(C(t)){var r=e.getOriginalNode(t);if(e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)){var n=x(32670,16449),i=N(t,!1);return S(n,98304,0),i}return N(t,!1)}return t}function A(e){return 106===e.kind?Ie(!0):T(e)}function N(i,o){switch(i.kind){case 124:return;case 257:return function(t){var r=u.createVariableDeclaration(u.getLocalName(t,!0),void 0,void 0,P(t));e.setOriginalNode(r,t);var n=[],i=u.createVariableStatement(void 0,u.createVariableDeclarationList([r]));if(e.setOriginalNode(i,t),e.setTextRange(i,t),e.startOnNewLine(i),n.push(i),e.hasSyntacticModifier(t,1)){var a=e.hasSyntacticModifier(t,512)?u.createExportDefault(u.getLocalName(t)):u.createExternalModuleExport(u.getLocalName(t));e.setOriginalNode(a,i),n.push(a)}var o=e.getEmitFlags(t);0==(4194304&o)&&(n.push(u.createEndOfDeclarationMarker(t)),e.setEmitFlags(i,4194304|o));return e.singleOrMany(n)}(i);case 226:return function(e){return P(e)}(i);case 164:return function(t){return t.dotDotDotToken?void 0:e.isBindingPattern(t.name)?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,u.getGeneratedNameForNode(t),void 0,void 0,void 0),t),t):t.initializer?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,t.name,void 0,void 0,void 0),t),t):t}(i);case 256:return function(r){var n=s;s=void 0;var i=x(32670,65),o=e.visitParameterList(r.parameters,T,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return S(i,98304,0),s=n,u.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,T,e.isModifier),r.asteriskToken,l,void 0,o,void 0,c)}(i);case 214:return function(r){8192&r.transformFlags&&!(16384&a)&&(a|=65536);var n=s;s=void 0;var i=x(15232,66),o=u.createFunctionExpression(void 0,void 0,void 0,void 0,e.visitParameterList(r.parameters,T,t),void 0,Q(r));return e.setTextRange(o,r),e.setOriginalNode(o,r),e.setEmitFlags(o,8),S(i,0,0),s=n,o}(i);case 213:return function(r){var n=262144&e.getEmitFlags(r)?x(32662,69):x(32670,65),i=s;s=void 0;var o=e.visitParameterList(r.parameters,T,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return S(n,98304,0),s=i,u.updateFunctionExpression(r,void 0,r.asteriskToken,l,void 0,o,void 0,c)}(i);case 254:return Y(i);case 79:return F(i);case 255:return function(r){if(3&r.flags||262144&r.transformFlags){3&r.flags&&Oe();var n=e.flatMap(r.declarations,1&r.flags?$:Y),i=u.createVariableDeclarationList(n);return e.setOriginalNode(i,r),e.setTextRange(i,r),e.setCommentRange(i,r),262144&r.transformFlags&&(e.isBindingPattern(r.declarations[0].name)||e.isBindingPattern(e.last(r.declarations).name))&&e.setSourceMapRange(i,function(t){for(var r=-1,n=-1,i=0,a=t;i0&&o.push(u.createStringLiteral(a.literal.text)),r=u.createCallExpression(u.createPropertyAccessExpression(r,"concat"),void 0,o)}return e.setTextRange(r,t)}(i);case 225:return function(t){return e.visitNode(t.expression,T,e.isExpression)}(i);case 106:return Ie(!1);case 108:return function(e){2&a&&!(16384&a)&&(a|=65536);if(s)return 2&a?(s.containsLexicalThis=!0,e):s.thisName||(s.thisName=u.createUniqueName("this"));return e}(i);case 231:return function(e){if(103===e.keywordToken&&"target"===e.name.escapedText)return a|=32768,u.createUniqueName("_newTarget",48);return e}(i);case 169:return function(t){e.Debug.assert(!e.isComputedPropertyName(t.name));var r=H(t,e.moveRangePos(t,-1),void 0,void 0);return e.setEmitFlags(r,512|e.getEmitFlags(r)),e.setTextRange(u.createPropertyAssignment(t.name,r),t)}(i);case 172:case 173:return function(r){e.Debug.assert(!e.isComputedPropertyName(r.name));var n=s;s=void 0;var i,a=x(32670,65),o=e.visitParameterList(r.parameters,T,t),c=Q(r);i=172===r.kind?u.updateGetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,r.type,c):u.updateSetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,c);return S(a,98304,0),s=n,i}(i);case 237:return function(r){var n,i=x(0,e.hasSyntacticModifier(r,1)?32:0);if(s&&0==(3&r.declarationList.flags)&&!function(t){return 1===t.declarationList.declarations.length&&!!t.declarationList.declarations[0].initializer&&!!(33554432&e.getEmitFlags(t.declarationList.declarations[0].initializer))}(r)){for(var a=void 0,o=0,c=r.declarationList.declarations;o0?(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(n,T,t,0,u.getGeneratedNameForNode(n)))),1048576)),!0):!!a&&(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createExpressionStatement(u.createAssignment(u.getGeneratedNameForNode(n),e.visitNode(a,T,e.isExpression))),1048576)),!0)}function J(t,r,n,i){i=e.visitNode(i,T,e.isExpression);var a=u.createIfStatement(u.createTypeCheck(u.cloneNode(n),"undefined"),e.setEmitFlags(e.setTextRange(u.createBlock([u.createExpressionStatement(e.setEmitFlags(e.setTextRange(u.createAssignment(e.setEmitFlags(e.setParent(e.setTextRange(u.cloneNode(n),n),n.parent),48),e.setEmitFlags(i,1584|e.getEmitFlags(i))),r),1536))]),r),1953));e.startOnNewLine(a),e.setTextRange(a,r),e.setEmitFlags(a,1050528),e.insertStatementAfterCustomPrologue(t,a)}function j(r,n,i){var a=[],o=e.lastOrUndefined(n.parameters);if(!function(e,t){return!(!e||!e.dotDotDotToken||t)}(o,i))return!1;var s=79===o.name.kind?e.setParent(e.setTextRange(u.cloneNode(o.name),o.name),o.name.parent):u.createTempVariable(void 0);e.setEmitFlags(s,48);var c=79===o.name.kind?u.cloneNode(o.name):s,l=n.parameters.length-1,d=u.createLoopVariable();a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(s,void 0,void 0,u.createArrayLiteralExpression([]))])),o),1048576));var _=u.createForStatement(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(d,void 0,void 0,u.createNumericLiteral(l))]),o),e.setTextRange(u.createLessThan(d,u.createPropertyAccessExpression(u.createIdentifier("arguments"),"length")),o),e.setTextRange(u.createPostfixIncrement(d),o),u.createBlock([e.startOnNewLine(e.setTextRange(u.createExpressionStatement(u.createAssignment(u.createElementAccessExpression(c,0===l?d:u.createSubtract(d,u.createNumericLiteral(l))),u.createElementAccessExpression(u.createIdentifier("arguments"),d))),o))]));return e.setEmitFlags(_,1048576),e.startOnNewLine(_),a.push(_),79!==o.name.kind&&a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(o,T,t,0,c))),o),1048576)),e.insertStatementsAfterCustomPrologue(r,a),!0}function U(e,t){return!!(65536&a&&214!==t.kind)&&(V(e,t,u.createThis()),!0)}function V(t,r,n){Me();var i=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_this",48),void 0,void 0,n)]));e.setEmitFlags(i,1050112),e.setSourceMapRange(i,r),e.insertStatementAfterCustomPrologue(t,i)}function K(t,r,n){if(32768&a){var i=void 0;switch(r.kind){case 214:return t;case 169:case 172:case 173:i=u.createVoidZero();break;case 171:i=u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor");break;case 256:case 213:i=u.createConditionalExpression(u.createLogicalAnd(e.setEmitFlags(u.createThis(),4),u.createBinaryExpression(e.setEmitFlags(u.createThis(),4),102,u.getLocalName(r))),void 0,u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor"),void 0,u.createVoidZero());break;default:return e.Debug.failBadSyntaxKind(r)}var o=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_newTarget",48),void 0,void 0,i)]));e.setEmitFlags(o,1050112),n&&(t=t.slice()),e.insertStatementAfterCustomPrologue(t,o)}return t}function z(t){return e.setTextRange(u.createEmptyStatement(),t)}function G(r,n,i){var a,o=e.getCommentRange(n),s=e.getSourceMapRange(n),c=H(n,n,void 0,i),l=e.visitNode(n.name,T,e.isPropertyName);if(!e.isPrivateIdentifier(l)&&e.getUseDefineForClassFields(t.getCompilerOptions())){var d=e.isComputedPropertyName(l)?l.expression:e.isIdentifier(l)?u.createStringLiteral(e.unescapeLeadingUnderscores(l.escapedText)):l;a=u.createObjectDefinePropertyCall(r,d,u.createPropertyDescriptor({value:c,enumerable:!1,writable:!0,configurable:!0}))}else{var _=e.createMemberAccessForPropertyName(u,r,l,n.name);a=u.createAssignment(_,c)}e.setEmitFlags(c,1536),e.setSourceMapRange(c,s);var p=e.setTextRange(u.createExpressionStatement(a),n);return e.setOriginalNode(p,n),e.setCommentRange(p,o),e.setEmitFlags(p,48),p}function q(t,r,n){var i=u.createExpressionStatement(W(t,r,n,!1));return e.setEmitFlags(i,1536),e.setSourceMapRange(i,e.getSourceMapRange(r.firstAccessor)),i}function W(t,r,n,i){var a=r.firstAccessor,o=r.getAccessor,s=r.setAccessor,c=e.setParent(e.setTextRange(u.cloneNode(t),t),t.parent);e.setEmitFlags(c,1568),e.setSourceMapRange(c,a.name);var l=e.visitNode(a.name,T,e.isPropertyName);if(e.isPrivateIdentifier(l))return e.Debug.failBadSyntaxKind(l,"Encountered unhandled private identifier while transforming ES2015.");var d=e.createExpressionForPropertyName(u,l);e.setEmitFlags(d,1552),e.setSourceMapRange(d,a.name);var _=[];if(o){var p=H(o,void 0,void 0,n);e.setSourceMapRange(p,e.getSourceMapRange(o)),e.setEmitFlags(p,512);var f=u.createPropertyAssignment("get",p);e.setCommentRange(f,e.getCommentRange(o)),_.push(f)}if(s){var m=H(s,void 0,void 0,n);e.setSourceMapRange(m,e.getSourceMapRange(s)),e.setEmitFlags(m,512);var g=u.createPropertyAssignment("set",m);e.setCommentRange(g,e.getCommentRange(s)),_.push(g)}_.push(u.createPropertyAssignment("enumerable",o||s?u.createFalse():u.createTrue()),u.createPropertyAssignment("configurable",u.createTrue()));var y=u.createCallExpression(u.createPropertyAccessExpression(u.createIdentifier("Object"),"defineProperty"),void 0,[c,d,u.createObjectLiteralExpression(_,!0)]);return i&&e.startOnNewLine(y),y}function H(r,n,i,o){var c=s;s=void 0;var l=o&&e.isClassLike(o)&&!e.isStatic(r)?x(32670,73):x(32670,65),d=e.visitParameterList(r.parameters,T,t),_=Q(r);return 32768&a&&!i&&(256===r.kind||213===r.kind)&&(i=u.getGeneratedNameForNode(r)),S(l,98304,0),s=c,e.setOriginalNode(e.setTextRange(u.createFunctionExpression(void 0,r.asteriskToken,i,void 0,d,void 0,_),n),r)}function Q(t){var r,i,a,o=!1,s=!1,c=[],l=[],d=t.body;if(p(),e.isBlock(d)&&(a=u.copyStandardPrologue(d.statements,c,0,!1),a=u.copyCustomPrologue(d.statements,l,a,T,e.isHoistedFunction),a=u.copyCustomPrologue(d.statements,l,a,T,e.isHoistedVariableStatement)),o=R(l,t)||o,o=j(l,t,!1)||o,e.isBlock(d))a=u.copyCustomPrologue(d.statements,l,a,T),r=d.statements,e.addRange(l,e.visitNodes(d.statements,T,e.isStatement,a)),!o&&d.multiLine&&(o=!0);else{e.Debug.assert(214===t.kind),r=e.moveRangeEnd(d,-1);var _=t.equalsGreaterThanToken;e.nodeIsSynthesized(_)||e.nodeIsSynthesized(d)||(e.rangeEndIsOnSameLineAsRangeStart(_,d,n)?s=!0:o=!0);var m=e.visitNode(d,T,e.isExpression),g=u.createReturnStatement(m);e.setTextRange(g,d),e.moveSyntheticComments(g,d),e.setEmitFlags(g,1440),l.push(g),i=d}if(u.mergeLexicalEnvironment(c,f()),K(c,t,!1),U(c,t),e.some(c)&&(o=!0),l.unshift.apply(l,c),e.isBlock(d)&&e.arrayIsEqualTo(l,d.statements))return d;var y=u.createBlock(e.setTextRange(u.createNodeArray(l),r),o);return e.setTextRange(y,t.body),!o&&s&&e.setEmitFlags(y,1),i&&e.setTokenSourceMapRange(y,19,i),e.setOriginalNode(y,t.body),y}function X(r,n){return e.isDestructuringAssignment(r)?e.flattenDestructuringAssignment(r,T,t,0,!n):27===r.operatorToken.kind?u.updateBinaryExpression(r,e.visitNode(r.left,E,e.isExpression),r.operatorToken,e.visitNode(r.right,n?E:T,e.isExpression)):e.visitEachChild(r,T,t)}function $(r){var n=r.name;return e.isBindingPattern(n)?Y(r):!r.initializer&&function(e){var t=y.getNodeCheckFlags(e),r=262144&t,n=524288&t;return!(0!=(64&a)||r&&n&&0!=(512&a))&&0==(4096&a)&&(!y.isDeclarationWithCollidingName(e)||n&&!r&&0==(6144&a))}(r)?u.updateVariableDeclaration(r,r.name,void 0,void 0,u.createVoidZero()):e.visitEachChild(r,T,t)}function Y(r){var n,i=x(32,0);return n=e.isBindingPattern(r.name)?e.flattenDestructuringBinding(r,T,t,0,void 0,0!=(32&i)):e.visitEachChild(r,T,t),S(i,0,0),n}function Z(t){s.labels.set(e.idText(t.label),!0)}function ee(t){s.labels.set(e.idText(t.label),!1)}function te(r,n,i,o,c){var l=x(r,n),d=function(r,n,i,o){if(!fe(r)){var c=void 0;s&&(c=s.allowedNonLabeledJumps,s.allowedNonLabeledJumps=6);var l=o?o(r,n,void 0,i):u.restoreEnclosingLabel(e.isForStatement(r)?function(t){return u.updateForStatement(t,e.visitNode(t.initializer,E,e.isForInitializer),e.visitNode(t.condition,T,e.isExpression),e.visitNode(t.incrementor,E,e.isExpression),e.visitNode(t.statement,T,e.isStatement,u.liftToBlock))}(r):e.visitEachChild(r,T,t),n,s&&ee);return s&&(s.allowedNonLabeledJumps=c),l}var d=function(t){var r;switch(t.kind){case 242:case 243:case 244:var n=t.initializer;n&&255===n.kind&&(r=n)}var i=[],a=[];if(r&&3&e.getCombinedNodeFlags(r))for(var o=de(t)||_e(t)||pe(t),c=0,l=r.declarations;c=81&&r<=116)return e.setTextRange(i.createStringLiteralFromNode(t),t)}}}(c||(c={})),function(e){var t,n,i,a,o;!function(e){e[e.Nop=0]="Nop",e[e.Statement=1]="Statement",e[e.Assign=2]="Assign",e[e.Break=3]="Break",e[e.BreakWhenTrue=4]="BreakWhenTrue",e[e.BreakWhenFalse=5]="BreakWhenFalse",e[e.Yield=6]="Yield",e[e.YieldStar=7]="YieldStar",e[e.Return=8]="Return",e[e.Throw=9]="Throw",e[e.Endfinally=10]="Endfinally"}(t||(t={})),function(e){e[e.Open=0]="Open",e[e.Close=1]="Close"}(n||(n={})),function(e){e[e.Exception=0]="Exception",e[e.With=1]="With",e[e.Switch=2]="Switch",e[e.Loop=3]="Loop",e[e.Labeled=4]="Labeled"}(i||(i={})),function(e){e[e.Try=0]="Try",e[e.Catch=1]="Catch",e[e.Finally=2]="Finally",e[e.Done=3]="Done"}(a||(a={})),function(e){e[e.Next=0]="Next",e[e.Throw=1]="Throw",e[e.Return=2]="Return",e[e.Break=3]="Break",e[e.Yield=4]="Yield",e[e.YieldStar=5]="YieldStar",e[e.Catch=6]="Catch",e[e.Endfinally=7]="Endfinally"}(o||(o={})),e.transformGenerators=function(t){var n,i,a,o,s,c,l,u,d,_,p=t.factory,f=t.getEmitHelperFactory,m=t.resumeLexicalEnvironment,g=t.endLexicalEnvironment,y=t.hoistFunctionDeclaration,h=t.hoistVariableDeclaration,v=t.getCompilerOptions(),b=e.getEmitScriptTarget(v),x=t.getEmitResolver(),S=t.onSubstituteNode;t.onSubstituteNode=function(t,r){if(r=S(t,r),1===t)return function(t){if(e.isIdentifier(t))return function(t){if(!e.isGeneratedIdentifier(t)&&n&&n.has(e.idText(t))){var r=e.getOriginalNode(t);if(e.isIdentifier(r)&&r.parent){var a=x.getReferencedValueDeclaration(r);if(a){var o=i[e.getOriginalNodeId(a)];if(o){var s=e.setParent(e.setTextRange(p.cloneNode(o),o),o.parent);return e.setSourceMapRange(s,t),e.setCommentRange(s,t),s}}}}return t}(t);return t}(r);return r};var D,C,T,E,k,A,N,w,F,P,I,O,M=1,L=0,R=0;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||0==(2048&r.transformFlags))return r;var n=e.visitEachChild(r,B,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function B(r){var n=r.transformFlags;return o?function(r){switch(r.kind){case 240:case 241:return function(r){return o?(oe(),r=e.visitEachChild(r,B,t),ce(),r):e.visitEachChild(r,B,t)}(r);case 249:return function(r){o&&re({kind:2,isScript:!0,breakLabel:-1});r=e.visitEachChild(r,B,t),o&&le();return r}(r);case 250:return function(r){o&&re({kind:4,isScript:!0,labelText:e.idText(r.label),breakLabel:-1});r=e.visitEachChild(r,B,t),o&&ue();return r}(r);default:return J(r)}}(r):a?J(r):e.isFunctionLikeDeclaration(r)&&r.asteriskToken?function(t){switch(t.kind){case 256:return j(t);case 213:return U(t);default:return e.Debug.failBadSyntaxKind(t)}}(r):2048&n?e.visitEachChild(r,B,t):r}function J(r){switch(r.kind){case 256:return j(r);case 213:return U(r);case 172:case 173:return function(r){var n=a,i=o;return a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i,r}(r);case 237:return function(t){if(524288&t.transformFlags)return void H(t.declarationList);if(1048576&e.getEmitFlags(t))return t;for(var r=0,n=t.declarationList.declarations;r0?p.inlineExpressions(e.map(c,Q)):void 0,e.visitNode(r.condition,B,e.isExpression),e.visitNode(r.incrementor,B,e.isExpression),e.visitIterationBody(r.statement,B,t))}else r=e.visitEachChild(r,B,t);o&&ce();return r}(r);case 243:return function(r){o&&oe();var n=r.initializer;if(e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i0)return ve(n,r)}return e.visitEachChild(r,B,t)}(r);case 245:return function(r){if(o){var n=ge(r.label&&e.idText(r.label));if(n>0)return ve(n,r)}return e.visitEachChild(r,B,t)}(r);case 247:return function(t){return r=e.visitNode(t.expression,B,e.isExpression),n=t,e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(r?[he(2),r]:[he(2)])),n);var r,n}(r);default:return 524288&r.transformFlags?function(r){switch(r.kind){case 221:return function(r){var n=e.getExpressionAssociativity(r);switch(n){case 0:return function(r){if(X(r.right))return e.isLogicalOperator(r.operatorToken.kind)?function(t){var r=ee(),n=Z();Se(n,e.visitNode(t.left,B,e.isExpression),t.left),55===t.operatorToken.kind?Te(r,n,t.left):Ce(r,n,t.left);return Se(n,e.visitNode(t.right,B,e.isExpression),t.right),te(r),n}(r):27===r.operatorToken.kind?K(r):p.updateBinaryExpression(r,Y(e.visitNode(r.left,B,e.isExpression)),r.operatorToken,e.visitNode(r.right,B,e.isExpression));return e.visitEachChild(r,B,t)}(r);case 1:return function(r){var n=r.left,i=r.right;if(X(i)){var a=void 0;switch(n.kind){case 206:a=p.updatePropertyAccessExpression(n,Y(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),n.name);break;case 207:a=p.updateElementAccessExpression(n,Y(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),Y(e.visitNode(n.argumentExpression,B,e.isExpression)));break;default:a=e.visitNode(n,B,e.isExpression)}var o=r.operatorToken.kind;return e.isCompoundAssignment(o)?e.setTextRange(p.createAssignment(a,e.setTextRange(p.createBinaryExpression(Y(a),e.getNonAssignmentOperatorForCompoundAssignment(o),e.visitNode(i,B,e.isExpression)),r)),r):p.updateBinaryExpression(r,a,r.operatorToken,e.visitNode(i,B,e.isExpression))}return e.visitEachChild(r,B,t)}(r);default:return e.Debug.assertNever(n)}}(r);case 351:return function(t){for(var r=[],n=0,i=t.elements;n0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(a,B,e.isExpression)))}return p.inlineExpressions(r)}(r);case 222:return function(r){if(X(r.whenTrue)||X(r.whenFalse)){var n=ee(),i=ee(),a=Z();return Te(n,e.visitNode(r.condition,B,e.isExpression),r.condition),Se(a,e.visitNode(r.whenTrue,B,e.isExpression),r.whenTrue),De(i),te(n),Se(a,e.visitNode(r.whenFalse,B,e.isExpression),r.whenFalse),te(i),a}return e.visitEachChild(r,B,t)}(r);case 224:return function(t){var r=ee(),n=e.visitNode(t.expression,B,e.isExpression);if(t.asteriskToken){!function(e,t){Ee(7,[e],t)}(0==(8388608&e.getEmitFlags(t.expression))?e.setTextRange(f().createValuesHelper(n),t):n,t)}else!function(e,t){Ee(6,[e],t)}(n,t);return te(r),function(t){return e.setTextRange(p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[]),t)}(t)}(r);case 204:return function(e){return z(e.elements,void 0,void 0,e.multiLine)}(r);case 205:return function(t){var r=t.properties,n=t.multiLine,i=$(r),a=Z();Se(a,p.createObjectLiteralExpression(e.visitNodes(r,B,e.isObjectLiteralElementLike,0,i),n));var o=e.reduceLeft(r,s,[],i);return o.push(n?e.startOnNewLine(e.setParent(e.setTextRange(p.cloneNode(a),a),a.parent)):a),p.inlineExpressions(o);function s(r,i){X(i)&&r.length>0&&(xe(p.createExpressionStatement(p.inlineExpressions(r))),r=[]);var o=e.createExpressionForObjectLiteralElementLike(p,t,i,a),s=e.visitNode(o,B,e.isExpression);return s&&(n&&e.startOnNewLine(s),r.push(s)),r}}(r);case 207:return function(r){if(X(r.argumentExpression))return p.updateElementAccessExpression(r,Y(e.visitNode(r.expression,B,e.isLeftHandSideExpression)),e.visitNode(r.argumentExpression,B,e.isExpression));return e.visitEachChild(r,B,t)}(r);case 208:return function(r){if(!e.isImportCall(r)&&e.forEach(r.arguments,X)){var n=p.createCallBinding(r.expression,h,b,!0),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createFunctionApplyCall(Y(e.visitNode(i,B,e.isLeftHandSideExpression)),a,z(r.arguments)),r),r)}return e.visitEachChild(r,B,t)}(r);case 209:return function(r){if(e.forEach(r.arguments,X)){var n=p.createCallBinding(p.createPropertyAccessExpression(r.expression,"bind"),h),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createNewExpression(p.createFunctionApplyCall(Y(e.visitNode(i,B,e.isExpression)),a,z(r.arguments,p.createVoidZero())),void 0,[]),r),r)}return e.visitEachChild(r,B,t)}(r);default:return e.visitEachChild(r,B,t)}}(r):2099200&r.transformFlags?e.visitEachChild(r,B,t):r}}function j(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionDeclaration(void 0,r.modifiers,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,V(r.body)),r),r);else{var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i}return a?void y(r):r}function U(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionExpression(void 0,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,V(r.body)),r),r);else{var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i}return r}function V(t){var r=[],n=a,i=o,f=s,y=c,h=l,v=u,b=d,x=_,S=M,k=D,A=C,N=T,w=E;a=!0,o=!1,s=void 0,c=void 0,l=void 0,u=void 0,d=void 0,_=void 0,M=1,D=void 0,C=void 0,T=void 0,E=p.createTempVariable(void 0),m();var F=p.copyPrologue(t.statements,r,!1,B);G(t.statements,F);var P=ke();return e.insertStatementsAfterStandardPrologue(r,g()),r.push(p.createReturnStatement(P)),a=n,o=i,s=f,c=y,l=h,u=v,d=b,_=x,M=S,D=k,C=A,T=N,E=w,e.setTextRange(p.createBlock(r,t.multiLine),t)}function K(t){var r=[];return n(t.left),n(t.right),p.inlineExpressions(r);function n(t){e.isBinaryExpression(t)&&27===t.operatorToken.kind?(n(t.left),n(t.right)):(X(t)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(t,B,e.isExpression)))}}function z(t,n,i,a){var o,s=$(t);if(s>0){o=Z();var c=e.visitNodes(t,B,e.isExpression,0,s);Se(o,p.createArrayLiteralExpression(n?r([n],c,!0):c)),n=void 0}var l=e.reduceLeft(t,(function(t,i){if(X(i)&&t.length>0){var s=void 0!==o;o||(o=Z()),Se(o,s?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(t,a)]):p.createArrayLiteralExpression(n?r([n],t,!0):t,a)),n=void 0,t=[]}return t.push(e.visitNode(i,B,e.isExpression)),t}),[],s);return o?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(l,a)]):e.setTextRange(p.createArrayLiteralExpression(n?r([n],l,!0):l,a),i)}function G(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n0?De(r,t):xe(t)}(r);case 246:return function(t){var r=me(t.label?e.idText(t.label):void 0);r>0?De(r,t):xe(t)}(r);case 247:return function(t){r=e.visitNode(t.expression,B,e.isExpression),n=t,Ee(8,[r],n);var r,n}(r);case 248:return function(t){X(t)?(r=Y(e.visitNode(t.expression,B,e.isExpression)),n=ee(),i=ee(),te(n),re({kind:1,expression:r,startLabel:n,endLabel:i}),q(t.statement),e.Debug.assert(1===ae()),te(ne().endLabel)):xe(e.visitNode(t,B,e.isStatement));var r,n,i}(r);case 249:return function(t){if(X(t.caseBlock)){for(var r=t.caseBlock,n=r.clauses.length,i=(re({kind:2,isScript:!1,breakLabel:f=ee()}),f),a=Y(e.visitNode(t.expression,B,e.isExpression)),o=[],s=-1,c=0;c0)break;d.push(p.createCaseClause(e.visitNode(l.expression,B,e.isExpression),[ve(o[c],l.expression)]))}else _++}d.length&&(xe(p.createSwitchStatement(a,p.createCaseBlock(d))),u+=d.length,d=[]),_>0&&(u+=_,_=0)}De(s>=0?o[s]:i);for(c=0;c0)break;l.push(Q(i))}l.length&&(xe(p.createExpressionStatement(p.inlineExpressions(l))),c+=l.length,l=[])}}function Q(t){return e.setSourceMapRange(p.createAssignment(e.setSourceMapRange(p.cloneNode(t.name),t.name),e.visitNode(t.initializer,B,e.isExpression)),t)}function X(e){return!!e&&0!=(524288&e.transformFlags)}function $(e){for(var t=e.length,r=0;r=0;r--){var n=u[r];if(!_e(n))break;if(n.labelText===e)return!0}return!1}function me(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(_e(r=u[t])&&r.labelText===e)return r.breakLabel;if(de(r)&&fe(e,t-1))return r.breakLabel}else for(t=u.length-1;t>=0;t--){var r;if(de(r=u[t]))return r.breakLabel}return 0}function ge(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(pe(r=u[t])&&fe(e,t-1))return r.continueLabel}else for(t=u.length-1;t>=0;t--){var r;if(pe(r=u[t]))return r.continueLabel}return 0}function ye(e){if(void 0!==e&&e>0){void 0===_&&(_=[]);var t=p.createNumericLiteral(-1);return void 0===_[e]?_[e]=[t]:_[e].push(t),t}return p.createOmittedExpression()}function he(t){var r=p.createNumericLiteral(t);return e.addSyntheticTrailingComment(r,3,function(e){switch(e){case 2:return"return";case 3:return"break";case 4:return"yield";case 5:return"yield*";case 7:return"endfinally";default:return}}(t)),r}function ve(t,r){return e.Debug.assertLessThan(0,t,"Invalid label"),e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([he(3),ye(t)])),r)}function be(){Ee(0)}function xe(e){e?Ee(1,[e]):be()}function Se(e,t,r){Ee(2,[e,t],r)}function De(e,t){Ee(3,[e],t)}function Ce(e,t,r){Ee(4,[e,t],r)}function Te(e,t,r){Ee(5,[e,t],r)}function Ee(e,t,r){void 0===D&&(D=[],C=[],T=[]),void 0===d&&te(ee());var n=D.length;D[n]=e,C[n]=t,T[n]=r}function ke(){L=0,R=0,k=void 0,A=!1,N=!1,w=void 0,F=void 0,P=void 0,I=void 0,O=void 0;var t=function(){if(D){for(var t=0;t0)),524288))}function Ae(e){(function(e){if(!N)return!0;if(!d||!_)return!1;for(var t=0;t=0;t--){var r=O[t];F=[p.createWithStatement(r.expression,p.createBlock(F))]}if(I){var n=I.startLabel,i=I.catchLabel,a=I.finallyLabel,o=I.endLabel;F.unshift(p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(p.createPropertyAccessExpression(E,"trys"),"push"),void 0,[p.createArrayLiteralExpression([ye(n),ye(i),ye(a),ye(o)])]))),I=void 0}e&&F.push(p.createExpressionStatement(p.createAssignment(p.createPropertyAccessExpression(E,"label"),p.createNumericLiteral(R+1))))}w.push(p.createCaseClause(p.createNumericLiteral(R),F||[])),F=void 0}function we(e){if(d)for(var t=0;t=2?2:0)),t),t))}else n&&e.isDefaultImport(t)&&(r=e.append(r,i.createVariableStatement(void 0,i.createVariableDeclarationList([e.setOriginalNode(e.setTextRange(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)),t),t)],_>=2?2:0))));if(U(t)){var o=e.getOriginalNodeId(t);b[o]=V(b[o],t)}else r=V(r,t);return e.singleOrMany(r)}(t);case 265:return function(t){var r;e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),p!==e.ModuleKind.AMD?r=e.hasSyntacticModifier(t,1)?e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(t.name,B(t))),t),t)):e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(i.cloneNode(t.name),void 0,void 0,B(t))],_>=2?2:0)),t),t)):e.hasSyntacticModifier(t,1)&&(r=e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(t),i.getLocalName(t))),t),t)));if(U(t)){var n=e.getOriginalNodeId(t);b[n]=K(b[n],t)}else r=K(r,t);return e.singleOrMany(r)}(t);case 272:return function(t){if(!t.moduleSpecifier)return;var r=i.getGeneratedNameForNode(t);if(t.exportClause&&e.isNamedExports(t.exportClause)){var n=[];p!==e.ModuleKind.AMD&&n.push(e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(r,void 0,void 0,B(t))])),t),t));for(var o=0,s=t.exportClause.elements;o(e.isExportName(t)?1:0);return!1}function M(t,r){var n,o=i.createUniqueName("resolve"),s=i.createUniqueName("reject"),c=[i.createParameterDeclaration(void 0,void 0,void 0,o),i.createParameterDeclaration(void 0,void 0,void 0,s)],u=i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("require"),void 0,[i.createArrayLiteralExpression([t||i.createOmittedExpression()]),o,s]))]);_>=2?n=i.createArrowFunction(void 0,void 0,c,void 0,void 0,u):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,u),r&&e.setEmitFlags(n,8));var d=i.createNewExpression(i.createIdentifier("Promise"),void 0,[n]);return e.getESModuleInterop(l)?i.createCallExpression(i.createPropertyAccessExpression(d,i.createIdentifier("then")),void 0,[a().createImportStarCallbackHelper()]):d}function L(t,r){var n,o=i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Promise"),"resolve"),void 0,[]),s=i.createCallExpression(i.createIdentifier("require"),void 0,t?[t]:[]);return e.getESModuleInterop(l)&&(s=a().createImportStarHelper(s)),_>=2?n=i.createArrowFunction(void 0,void 0,[],void 0,void 0,s):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(s)])),r&&e.setEmitFlags(n,8)),i.createCallExpression(i.createPropertyAccessExpression(o,"then"),void 0,[n])}function R(t,r){return!e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getImportNeedsImportStarHelper(t)?a().createImportStarHelper(r):e.getImportNeedsImportDefaultHelper(t)?a().createImportDefaultHelper(r):r}function B(t){var r=e.getExternalModuleNameLiteral(i,t,g,d,u,l),n=[];return r&&n.push(r),i.createCallExpression(i.createIdentifier("require"),void 0,n)}function J(t,r,n){var a=Z(t);if(a){for(var o=e.isExportName(t)?r:i.createAssignment(t,r),s=0,c=a;s=e.ModuleKind.ES2020?function(t){var r;return e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),r=function(t,r){e.hasSyntacticModifier(r,1)&&(t=e.append(t,o.createExportDeclaration(void 0,void 0,r.isTypeOnly,o.createNamedExports([o.createExportSpecifier(!1,void 0,e.idText(r.name))]))));return t}(r=e.append(r,e.setOriginalNode(e.setTextRange(o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(o.cloneNode(t.name),void 0,void 0,m(t))],d>=2?2:0)),t),t)),t),e.singleOrMany(r)}(t):void 0;case 271:return function(e){return e.isExportEquals?void 0:e}(t);case 272:return function(t){if(void 0!==u.module&&u.module>e.ModuleKind.ES2015)return t;if(!t.exportClause||!e.isNamespaceExport(t.exportClause)||!t.moduleSpecifier)return t;var r=t.exportClause.name,n=o.getGeneratedNameForNode(r),i=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamespaceImport(n)),t.moduleSpecifier,t.assertClause);e.setOriginalNode(i,t.exportClause);var a=e.isExportNamespaceAsDefaultDeclaration(t)?o.createExportDefault(n):o.createExportDeclaration(void 0,void 0,!1,o.createNamedExports([o.createExportSpecifier(!1,n,r)]));return e.setOriginalNode(a,t),[i,a]}(t)}return t}function m(t){var r=e.getExternalModuleNameLiteral(o,t,e.Debug.checkDefined(i),c,l,u),n=[];if(r&&n.push(r),!a){var s=o.createUniqueName("_createRequire",48),_=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamedImports([o.createImportSpecifier(!1,o.createIdentifier("createRequire"),s)])),o.createStringLiteral("module")),p=o.createUniqueName("__require",48),f=o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(p,void 0,void 0,o.createCallExpression(o.cloneNode(s),void 0,[o.createPropertyAccessExpression(o.createMetaProperty(100,o.createIdentifier("meta")),o.createIdentifier("url"))]))],d>=2?2:0));a=[_,f]}var m=a[1].declarationList.declarations[0].name;return e.Debug.assertNode(m,e.isIdentifier),o.createCallExpression(o.cloneNode(m),void 0,n)}}}(c||(c={})),function(e){e.transformNodeModule=function(t){var r=t.onSubstituteNode,n=t.onEmitNode,i=e.transformECMAScriptModule(t),a=t.onSubstituteNode,o=t.onEmitNode;t.onSubstituteNode=r,t.onEmitNode=n;var s,c=e.transformModule(t),l=t.onSubstituteNode,u=t.onEmitNode;return t.onSubstituteNode=function(t,n){return e.isSourceFile(n)?(s=n,r(t,n)):s?s.impliedNodeFormat===e.ModuleKind.ESNext?a(t,n):l(t,n):r(t,n)},t.onEmitNode=function(t,r,i){e.isSourceFile(r)&&(s=r);if(!s)return n(t,r,i);if(s.impliedNodeFormat===e.ModuleKind.ESNext)return o(t,r,i);return u(t,r,i)},t.enableSubstitution(305),t.enableEmitNotification(305),function(r){return 305===r.kind?d(r):function(r){return t.factory.createBundle(e.map(r.sourceFiles,d),r.prepends)}(r)};function d(t){if(t.isDeclarationFile)return t;s=t;var r=(t.impliedNodeFormat===e.ModuleKind.ESNext?i:c)(t);return s=void 0,e.Debug.assert(e.isSourceFile(r)),r}}}(c||(c={})),function(e){function t(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isPropertyAccessExpression(t)||e.isBindingElement(t)||e.isConstructorDeclaration(t)?r:e.isSetAccessor(t)||e.isGetAccessor(t)?function(r){var n;n=173===t.kind?e.isStatic(t)?r.errorModuleName?e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1;return{diagnosticMessage:n,errorNode:t.name,typeName:t.name}}:e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isIndexSignatureDeclaration(t)?function(r){var n;switch(t.kind){case 175:n=r.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 174:n=r.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 176:n=r.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 169:case 168:n=e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:257===t.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 256:n=r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return e.Debug.fail("This is unknown kind for signature: "+t.kind)}return{diagnosticMessage:n,errorNode:t.name||t}}:e.isParameter(t)?e.isParameterPropertyDeclaration(t,t.parent)&&e.hasSyntacticModifier(t.parent,8)?r:function(r){var n=function(r){switch(t.parent.kind){case 171:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 175:case 180:return r.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 174:return r.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 176:return r.errorModuleName?e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 169:case 168:return e.isStatic(t.parent)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:257===t.parent.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 256:case 179:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 173:case 172:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return e.Debug.fail("Unknown parent for parameter: ".concat(e.SyntaxKind[t.parent.kind]))}}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}:e.isTypeParameterDeclaration(t)?function(){var r;switch(t.parent.kind){case 257:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 258:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 195:r=e.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 180:case 175:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 174:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 169:case 168:r=e.isStatic(t.parent)?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:257===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 179:case 256:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 259:r=e.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return{diagnosticMessage:r,errorNode:t,typeName:t.name}}:e.isExpressionWithTypeArguments(t)?function(){var r;r=e.isClassDeclaration(t.parent.parent)?e.isHeritageClause(t.parent)&&117===t.parent.token?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t.parent.parent.name?e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0:e.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1;return{diagnosticMessage:r,errorNode:t,typeName:e.getNameOfDeclaration(t.parent.parent)}}:e.isImportEqualsDeclaration(t)?function(){return{diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}:e.isTypeAliasDeclaration(t)||e.isJSDocTypeAlias(t)?function(r){return{diagnosticMessage:r.errorModuleName?e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:e.isJSDocTypeAlias(t)?e.Debug.checkDefined(t.typeExpression):t.type,typeName:e.isJSDocTypeAlias(t)?e.getNameOfDeclaration(t):t.name}}:e.Debug.assertNever(t,"Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(e.SyntaxKind[t.kind]));function r(r){var n=function(r){return 254===t.kind||203===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:167===t.kind||206===t.kind||166===t.kind||164===t.kind&&e.hasSyntacticModifier(t.parent,8)?e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:257===t.parent.kind||164===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}}e.canProduceDiagnostics=function(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isBindingElement(t)||e.isSetAccessor(t)||e.isGetAccessor(t)||e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isParameter(t)||e.isTypeParameterDeclaration(t)||e.isExpressionWithTypeArguments(t)||e.isImportEqualsDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isConstructorDeclaration(t)||e.isIndexSignatureDeclaration(t)||e.isPropertyAccessExpression(t)||e.isJSDocTypeAlias(t)},e.createGetSymbolAccessibilityDiagnosticForNodeName=function(r){return e.isSetAccessor(r)||e.isGetAccessor(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:257===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:e.isMethodSignature(r)||e.isMethodDeclaration(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:257===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:t(r)},e.createGetSymbolAccessibilityDiagnosticForNode=t}(c||(c={})),function(e){function t(t,r){var n=r.text.substring(t.pos,t.end);return e.stringContains(n,"@internal")}function i(r,n){var i=e.getParseTreeNode(r);if(i&&164===i.kind){var a=i.parent.parameters.indexOf(i),o=a>0?i.parent.parameters[a-1]:void 0,s=n.text,c=o?e.concatenate(e.getTrailingCommentRanges(s,e.skipTrivia(s,o.end+1,!1,!0)),e.getLeadingCommentRanges(s,r.pos)):e.getTrailingCommentRanges(s,e.skipTrivia(s,r.pos,!1,!0));return c&&c.length&&t(e.last(c),n)}var l=i&&e.getLeadingCommentRangesOfNode(i,n);return!!e.forEach(l,(function(e){return t(e,n)}))}e.getDeclarationDiagnostics=function(t,r,n){var i=t.getCompilerOptions();return e.transformNodes(r,t,e.factory,i,n?[n]:e.filter(t.getSourceFiles(),e.isSourceFileNotJson),[o],!1).diagnostics},e.isInternalDeclaration=i;var a=531469;function o(t){var o,l,u,d,_,p,f,m,g,y,h,v,b=function(){return e.Debug.fail("Diagnostic emitted without context")},x=b,S=!0,D=!1,C=!1,T=!1,E=!1,k=t.factory,A=t.getEmitHost(),N={trackSymbol:function(e,t,r){if(262144&e.flags)return!1;var n=M(w.isSymbolAccessible(e,t,r,!0));return O(w.getTypeReferenceDirectivesForSymbol(e,r)),n},reportInaccessibleThisError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"this"))},reportInaccessibleUniqueSymbolError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,L(),"unique symbol"))},reportCyclicStructureError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,L()))},reportPrivateInBaseOfClassExpression:function(r){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected,r))},reportLikelyUnsafeImportRequiredError:function(r){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,L(),r))},reportTruncationError:function(){(f||m)&&t.addDiagnostic(e.createDiagnosticForNode(f||m,e.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed))},moduleResolverHost:A,trackReferencedAmbientModule:function(t,r){var n=w.getTypeReferenceDirectivesForSymbol(r,67108863);if(e.length(n))return O(n);var i=e.getSourceFileOfNode(t);y.set(e.getOriginalNodeId(i),i)},trackExternalModuleSymbolOfImportTypeNode:function(e){D||(p||(p=[])).push(e)},reportNonlocalAugmentation:function(r,n,i){var a,o=null===(a=n.declarations)||void 0===a?void 0:a.find((function(t){return e.getSourceFileOfNode(t)===r})),s=e.filter(i.declarations,(function(t){return e.getSourceFileOfNode(t)!==r}));if(s)for(var c=0,l=s;c0?e.parameters[0].type:void 0}e.transformDeclarations=o}(c||(c={})),function(e){var t,n;function i(t,r,n){if(n)return e.emptyArray;var i=e.getEmitScriptTarget(t),a=e.getEmitModuleKind(t),o=[];return e.addRange(o,r&&e.map(r.before,s)),o.push(e.transformTypeScript),o.push(e.transformClassFields),e.getJSXTransformEnabled(t)&&o.push(e.transformJsx),i<99&&o.push(e.transformESNext),i<8&&o.push(e.transformES2021),i<7&&o.push(e.transformES2020),i<6&&o.push(e.transformES2019),i<5&&o.push(e.transformES2018),i<4&&o.push(e.transformES2017),i<3&&o.push(e.transformES2016),i<2&&(o.push(e.transformES2015),o.push(e.transformGenerators)),o.push(function(t){switch(t){case e.ModuleKind.ESNext:case e.ModuleKind.ES2022:case e.ModuleKind.ES2020:case e.ModuleKind.ES2015:return e.transformECMAScriptModule;case e.ModuleKind.System:return e.transformSystemModule;case e.ModuleKind.Node16:case e.ModuleKind.NodeNext:return e.transformNodeModule;default:return e.transformModule}}(a)),i<1&&o.push(e.transformES5),e.addRange(o,r&&e.map(r.after,s)),o}function a(t){var r=[];return r.push(e.transformDeclarations),e.addRange(r,t&&e.map(t.afterDeclarations,c)),r}function o(t,r){return function(n){var i=t(n);return"function"==typeof i?r(n,i):function(t){return function(r){return e.isBundle(r)?t.transformBundle(r):t.transformSourceFile(r)}}(i)}}function s(t){return o(t,e.chainBundle)}function c(e){return o(e,(function(e,t){return t}))}function l(e,t){return t}function u(e,t,r){r(e,t)}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Completed=2]="Completed",e[e.Disposed=3]="Disposed"}(t||(t={})),function(e){e[e.Substitution=1]="Substitution",e[e.EmitNotifications=2]="EmitNotifications"}(n||(n={})),e.noTransformers={scriptTransformers:e.emptyArray,declarationTransformers:e.emptyArray},e.getTransformers=function(e,t,r){return{scriptTransformers:i(e,t,r),declarationTransformers:a(t)}},e.noEmitSubstitution=l,e.noEmitNotification=u,e.transformNodes=function(t,n,i,a,o,s,c){for(var d,_,p,f,m,g=new Array(355),y=0,h=[],v=[],b=[],x=[],S=0,D=!1,C=[],T=0,E=l,k=u,A=0,N=[],w={factory:i,getCompilerOptions:function(){return a},getEmitResolver:function(){return t},getEmitHost:function(){return n},getEmitHelperFactory:e.memoize((function(){return e.createEmitHelperFactory(w)})),startLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is suspended."),h[S]=d,v[S]=_,b[S]=p,x[S]=y,S++,d=void 0,_=void 0,p=void 0,y=0},suspendLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is already suspended."),D=!0},resumeLexicalEnvironment:function(){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(D,"Lexical environment is not suspended."),D=!1},endLexicalEnvironment:function(){var t;if(e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!D,"Lexical environment is suspended."),d||_||p){if(_&&(t=r([],_,!0)),d){var n=i.createVariableStatement(void 0,i.createVariableDeclarationList(d));e.setEmitFlags(n,1048576),t?t.push(n):t=[n]}p&&(t=r(t?r([],t,!0):[],p,!0))}S--,d=h[S],_=v[S],p=b[S],y=x[S],0===S&&(h=[],v=[],b=[],x=[]);return t},setLexicalEnvironmentFlags:function(e,t){y=t?y|e:y&~e},getLexicalEnvironmentFlags:function(){return y},hoistVariableDeclaration:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed.");var r=e.setEmitFlags(i.createVariableDeclaration(t),64);d?d.push(r):d=[r];1&y&&(y|=2)},hoistFunctionDeclaration:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),_?_.push(t):_=[t]},addInitializationStatement:function(t){e.Debug.assert(A>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(A<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),p?p.push(t):p=[t]},startBlockScope:function(){e.Debug.assert(A>0,"Cannot start a block scope during initialization."),e.Debug.assert(A<2,"Cannot start a block scope after transformation has completed."),C[T]=f,T++,f=void 0},endBlockScope:function(){e.Debug.assert(A>0,"Cannot end a block scope during initialization."),e.Debug.assert(A<2,"Cannot end a block scope after transformation has completed.");var t=e.some(f)?[i.createVariableStatement(void 0,i.createVariableDeclarationList(f.map((function(e){return i.createVariableDeclaration(e)})),1))]:void 0;T--,f=C[T],0===T&&(C=[]);return t},addBlockScopedVariable:function(t){e.Debug.assert(T>0,"Cannot add a block scoped variable outside of an iteration body."),(f||(f=[])).push(t)},requestEmitHelper:function t(r){if(e.Debug.assert(A>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),e.Debug.assert(!r.scoped,"Cannot request a scoped emit helper."),r.dependencies)for(var n=0,i=r.dependencies;n0,"Cannot modify the transformation context during initialization."),e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed.");var t=m;return m=void 0,t},enableSubstitution:function(t){e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),g[t]|=1},enableEmitNotification:function(t){e.Debug.assert(A<2,"Cannot modify the transformation context after transformation has completed."),g[t]|=2},isSubstitutionEnabled:j,isEmitNotificationEnabled:U,get onSubstituteNode(){return E},set onSubstituteNode(t){e.Debug.assert(A<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),E=t},get onEmitNode(){return k},set onEmitNode(t){e.Debug.assert(A<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),k=t},addDiagnostic:function(e){N.push(e)}},F=0,P=o;F"],e[8192]=["[","]"],e}();function a(t,r,n,i,a,s){void 0===i&&(i=!1);var l=e.isArray(n)?n:e.getSourceFilesToEmit(t,n,i),u=t.getCompilerOptions();if(e.outFile(u)){var d=t.getPrependNodes();if(l.length||d.length){var _=e.factory.createBundle(l,d);if(m=r(c(_,t,i),_))return m}}else{if(!a)for(var p=0,f=l;p0){var i=t.preserveSourceNewlinesStack[t.stackIndex],a=t.containerPosStack[t.stackIndex],o=t.containerEndStack[t.stackIndex],s=t.declarationListContainerEndStack[t.stackIndex],c=t.shouldEmitCommentsStack[t.stackIndex],l=t.shouldEmitSourceMapsStack[t.stackIndex];Pe(i),l&&sn(e),c&&Br(e,a,o,s),null==I||I(e),t.stackIndex--}}),void 0);function t(t,r,n){var i="left"===n?oe.getParenthesizeLeftSideOfBinaryForOperator(r.operatorToken.kind):oe.getParenthesizeRightSideOfBinaryForOperator(r.operatorToken.kind),a=Le(0,1,t);if(a===Ue&&(e.Debug.assertIsDefined(x),a=Re(1,1,t=i(e.cast(x,e.isExpression))),x=void 0),(a===Lr||a===an||a===Je)&&e.isBinaryExpression(t))return t;S=i,a(1,t)}}();return Te(),{printNode:function(t,r,n){switch(t){case 0:e.Debug.assert(e.isSourceFile(r),"Expected a SourceFile node.");break;case 2:e.Debug.assert(e.isIdentifier(r),"Expected an Identifier node.");break;case 1:e.Debug.assert(e.isExpression(r),"Expected an Expression node.")}switch(r.kind){case 305:return ue(r);case 306:return le(r);case 307:return function(e,t){var r=p;Ce(t,void 0),Se(4,e,void 0),Te(),p=r}(r,be()),xe()}return de(t,r,n,be()),xe()},printList:function(e,t,r){return _e(e,t,r,be()),xe()},printFile:ue,printBundle:le,writeNode:de,writeList:_e,writeFile:ve,writeBundle:he,bundleFileInfo:z};function le(e){return he(e,be(),void 0),xe()}function ue(e){return ve(e,be(),void 0),xe()}function de(e,t,r,n){var i=p;Ce(n,void 0),Se(e,t,r),Te(),p=i}function _e(e,t,r,n){var i=p;Ce(n,void 0),r&&De(r),Ut(void 0,t,e),Te(),p=i}function pe(){return p.getTextPosWithWriteLine?p.getTextPosWithWriteLine():p.getTextPos()}function fe(t,r,n){var i=e.lastOrUndefined(z.sections);i&&i.kind===n?i.end=r:z.sections.push({pos:t,end:r,kind:n})}function me(t){if(q&&z&&n&&(e.isDeclaration(t)||e.isVariableStatement(t))&&e.isInternalDeclaration(t,n)&&"internal"!==H){var r=H;return ye(p.getTextPos()),W=pe(),H="internal",r}}function ge(e){e&&(ye(p.getTextPos()),W=pe(),H=e)}function ye(e){return W"),Yt(),ke(e.type),Cr(e)}(r);case 180:return function(e){Dr(e),Nt(e,e.modifiers),Ht("new"),Yt(),Rt(e,e.typeParameters),Bt(e,e.parameters),Yt(),qt("=>"),Yt(),ke(e.type),Cr(e)}(r);case 181:return function(e){Ht("typeof"),Yt(),ke(e.exprName),Lt(e,e.typeArguments)}(r);case 182:return function(t){qt("{");var r=1&e.getEmitFlags(t)?768:32897;Ut(t,t.members,524288|r),qt("}")}(r);case 183:return function(e){ke(e.elementType,oe.parenthesizeNonArrayTypeOfPostfixType),qt("["),qt("]")}(r);case 184:return function(t){et(22,t.pos,qt,t);var r=1&e.getEmitFlags(t)?528:657;Ut(t,t.elements,524288|r,oe.parenthesizeElementTypeOfTupleType),et(23,t.elements.end,qt,t)}(r);case 185:return function(e){ke(e.type,oe.parenthesizeTypeOfOptionalType),qt("?")}(r);case 187:return function(e){Ut(e,e.types,516,oe.parenthesizeConstituentTypeOfUnionType)}(r);case 188:return function(e){Ut(e,e.types,520,oe.parenthesizeConstituentTypeOfIntersectionType)}(r);case 189:return function(e){ke(e.checkType,oe.parenthesizeCheckTypeOfConditionalType),Yt(),Ht("extends"),Yt(),ke(e.extendsType,oe.parenthesizeExtendsTypeOfConditionalType),Yt(),qt("?"),Yt(),ke(e.trueType),Yt(),qt(":"),Yt(),ke(e.falseType)}(r);case 190:return function(e){Ht("infer"),Yt(),ke(e.typeParameter)}(r);case 191:return function(e){qt("("),ke(e.type),qt(")")}(r);case 228:return Qe(r);case 192:return void Ht("this");case 193:return function(e){or(e.operator,Ht),Yt();var t=145===e.operator?oe.parenthesizeOperandOfReadonlyTypeOperator:oe.parenthesizeOperandOfTypeOperator;ke(e.type,t)}(r);case 194:return function(e){ke(e.objectType,oe.parenthesizeNonArrayTypeOfPostfixType),qt("["),ke(e.indexType),qt("]")}(r);case 195:return function(t){var r=e.getEmitFlags(t);qt("{"),1&r?Yt():(tr(),rr());t.readonlyToken&&(ke(t.readonlyToken),145!==t.readonlyToken.kind&&Ht("readonly"),Yt());qt("["),Ie(3,t.typeParameter),t.nameType&&(Yt(),Ht("as"),Yt(),ke(t.nameType));qt("]"),t.questionToken&&(ke(t.questionToken),57!==t.questionToken.kind&&qt("?"));qt(":"),Yt(),ke(t.type),Wt(),1&r?Yt():(tr(),nr());Ut(t,t.members,2),qt("}")}(r);case 196:return function(e){Ne(e.literal)}(r);case 197:return function(e){ke(e.dotDotDotToken),ke(e.name),ke(e.questionToken),et(58,e.name.end,qt,e),Yt(),ke(e.type)}(r);case 198:return function(e){ke(e.head),Ut(e,e.templateSpans,262144)}(r);case 199:return function(e){ke(e.type),ke(e.literal)}(r);case 200:return function(e){e.isTypeOf&&(Ht("typeof"),Yt());if(Ht("import"),qt("("),ke(e.argument),e.assertions){qt(","),Yt(),qt("{"),Yt(),Ht("assert"),qt(":"),Yt();var t=e.assertions.assertClause.elements;Ut(e.assertions.assertClause,t,526226),Yt(),qt("}")}qt(")"),e.qualifier&&(qt("."),ke(e.qualifier));Lt(e,e.typeArguments)}(r);case 201:return function(e){qt("{"),Ut(e,e.elements,525136),qt("}")}(r);case 202:return function(e){qt("["),Ut(e,e.elements,524880),qt("]")}(r);case 203:return function(e){ke(e.dotDotDotToken),e.propertyName&&(ke(e.propertyName),qt(":"),Yt());ke(e.name),Ft(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 233:return function(e){Ne(e.expression),ke(e.literal)}(r);case 234:return void Wt();case 235:return function(e){Xe(e,!e.multiLine&&vr(e))}(r);case 237:return function(e){Nt(e,e.modifiers),ke(e.declarationList),Wt()}(r);case 236:return $e(!1);case 238:return function(t){Ne(t.expression,oe.parenthesizeExpressionOfExpressionStatement),n&&e.isJsonSourceFile(n)&&!e.nodeIsSynthesized(t.expression)||Wt()}(r);case 239:return function(e){var t=et(99,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.thenStatement),e.elseStatement&&(sr(e,e.thenStatement,e.elseStatement),et(91,e.thenStatement.end,Ht,e),239===e.elseStatement.kind?(Yt(),ke(e.elseStatement)):Ot(e,e.elseStatement))}(r);case 240:return function(t){et(90,t.pos,Ht,t),Ot(t,t.statement),e.isBlock(t.statement)&&!V?Yt():sr(t,t.statement,t.expression);Ye(t,t.statement.end),Wt()}(r);case 241:return function(e){Ye(e,e.pos),Ot(e,e.statement)}(r);case 242:return function(e){var t=et(97,e.pos,Ht,e);Yt();var r=et(20,t,qt,e);Ze(e.initializer),r=et(26,e.initializer?e.initializer.end:r,qt,e),It(e.condition),r=et(26,e.condition?e.condition.end:r,qt,e),It(e.incrementor),et(21,e.incrementor?e.incrementor.end:r,qt,e),Ot(e,e.statement)}(r);case 243:return function(e){var t=et(97,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ze(e.initializer),Yt(),et(101,e.initializer.end,Ht,e),Yt(),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 244:return function(e){var t=et(97,e.pos,Ht,e);Yt(),function(e){e&&(ke(e),Yt())}(e.awaitModifier),et(20,t,qt,e),Ze(e.initializer),Yt(),et(160,e.initializer.end,Ht,e),Yt(),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 245:return function(e){et(86,e.pos,Ht,e),Pt(e.label),Wt()}(r);case 246:return function(e){et(81,e.pos,Ht,e),Pt(e.label),Wt()}(r);case 247:return function(e){et(105,e.pos,Ht,e),It(e.expression&&nt(e.expression),nt),Wt()}(r);case 248:return function(e){var t=et(116,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Ot(e,e.statement)}(r);case 249:return function(e){var t=et(107,e.pos,Ht,e);Yt(),et(20,t,qt,e),Ne(e.expression),et(21,e.expression.end,qt,e),Yt(),ke(e.caseBlock)}(r);case 250:return function(e){ke(e.label),et(58,e.label.end,qt,e),Yt(),ke(e.statement)}(r);case 251:return function(e){et(109,e.pos,Ht,e),It(nt(e.expression),nt),Wt()}(r);case 252:return function(e){et(111,e.pos,Ht,e),Yt(),ke(e.tryBlock),e.catchClause&&(sr(e,e.tryBlock,e.catchClause),ke(e.catchClause));e.finallyBlock&&(sr(e,e.catchClause||e.tryBlock,e.finallyBlock),et(96,(e.catchClause||e.tryBlock).end,Ht,e),Yt(),ke(e.finallyBlock))}(r);case 253:return function(e){ir(87,e.pos,Ht),Wt()}(r);case 254:return function(e){var t,r,n,i,a;ke(e.name),ke(e.exclamationToken),wt(e.type),Ft(e.initializer,null!==(a=null!==(r=null===(t=e.type)||void 0===t?void 0:t.end)&&void 0!==r?r:null===(i=null===(n=e.name.emitNode)||void 0===n?void 0:n.typeNode)||void 0===i?void 0:i.end)&&void 0!==a?a:e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 255:return function(t){Ht(e.isLet(t)?"let":e.isVarConst(t)?"const":"var"),Yt(),Ut(t,t.declarations,528)}(r);case 256:return function(e){at(e)}(r);case 257:return function(e){dt(e)}(r);case 258:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),Ht("interface"),Yt(),ke(e.name),Rt(e,e.typeParameters),Ut(e,e.heritageClauses,512),Yt(),qt("{"),Ut(e,e.members,129),qt("}")}(r);case 259:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),Ht("type"),Yt(),ke(e.name),Rt(e,e.typeParameters),Yt(),qt("="),Yt(),ke(e.type),Wt()}(r);case 260:return function(e){Nt(e,e.modifiers),Ht("enum"),Yt(),ke(e.name),Yt(),qt("{"),Ut(e,e.members,145),qt("}")}(r);case 261:return function(t){Nt(t,t.modifiers),1024&~t.flags&&(Ht(16&t.flags?"namespace":"module"),Yt());ke(t.name);var r=t.body;if(!r)return Wt();for(;r&&e.isModuleDeclaration(r);)qt("."),ke(r.name),r=r.body;Yt(),ke(r)}(r);case 262:return function(t){Dr(t),e.forEach(t.statements,Er),Xe(t,vr(t)),Cr(t)}(r);case 263:return function(e){et(18,e.pos,qt,e),Ut(e,e.clauses,129),et(19,e.clauses.end,qt,e,!0)}(r);case 264:return function(e){var t=et(93,e.pos,Ht,e);Yt(),t=et(127,t,Ht,e),Yt(),t=et(142,t,Ht,e),Yt(),ke(e.name),Wt()}(r);case 265:return function(e){Nt(e,e.modifiers),et(100,e.modifiers?e.modifiers.end:e.pos,Ht,e),Yt(),e.isTypeOnly&&(et(152,e.pos,Ht,e),Yt());ke(e.name),Yt(),et(63,e.name.end,qt,e),Yt(),function(e){79===e.kind?Ne(e):ke(e)}(e.moduleReference),Wt()}(r);case 266:return function(e){Nt(e,e.modifiers),et(100,e.modifiers?e.modifiers.end:e.pos,Ht,e),Yt(),e.importClause&&(ke(e.importClause),Yt(),et(156,e.importClause.end,Ht,e),Yt());Ne(e.moduleSpecifier),e.assertClause&&Pt(e.assertClause);Wt()}(r);case 267:return function(e){e.isTypeOnly&&(et(152,e.pos,Ht,e),Yt());ke(e.name),e.name&&e.namedBindings&&(et(27,e.name.end,qt,e),Yt());ke(e.namedBindings)}(r);case 268:return function(e){var t=et(41,e.pos,qt,e);Yt(),et(127,t,Ht,e),Yt(),ke(e.name)}(r);case 274:return function(e){var t=et(41,e.pos,qt,e);Yt(),et(127,t,Ht,e),Yt(),ke(e.name)}(r);case 269:case 273:return function(e){_t(e)}(r);case 270:case 275:return function(e){pt(e)}(r);case 271:return function(e){var t=et(93,e.pos,Ht,e);Yt(),e.isExportEquals?et(63,t,Qt,e):et(88,t,Ht,e);Yt(),Ne(e.expression,e.isExportEquals?oe.getParenthesizeRightSideOfBinaryForOperator(63):oe.parenthesizeExpressionOfExportDefault),Wt()}(r);case 272:return function(e){var t=et(93,e.pos,Ht,e);Yt(),e.isTypeOnly&&(t=et(152,t,Ht,e),Yt());e.exportClause?ke(e.exportClause):t=et(41,t,qt,e);if(e.moduleSpecifier){Yt(),et(156,e.exportClause?e.exportClause.end:t,Ht,e),Yt(),Ne(e.moduleSpecifier)}e.assertClause&&Pt(e.assertClause);Wt()}(r);case 293:return function(e){et(129,e.pos,Ht,e),Yt();var t=e.elements;Ut(e,t,526226)}(r);case 294:return function(t){ke(t.name),qt(":"),Yt();var r=t.value;if(0==(512&e.getEmitFlags(r))){$r(e.getCommentRange(r).pos)}ke(r)}(r);case 276:case 319:case 330:case 331:case 333:case 334:case 335:case 336:case 349:case 353:case 352:return;case 277:return function(e){Ht("require"),qt("("),Ne(e.expression),qt(")")}(r);case 11:return function(e){p.writeLiteral(e.text)}(r);case 280:case 283:return function(t){if(qt("<"),e.isJsxOpeningElement(t)){var r=mr(t.tagName,t);ft(t.tagName),Lt(t,t.typeArguments),t.attributes.properties&&t.attributes.properties.length>0&&Yt(),ke(t.attributes),gr(t.attributes,t),ur(r)}qt(">")}(r);case 281:case 284:return function(t){qt("")}(r);case 285:return function(e){ke(e.name),function(e,t,r,n){r&&(t(e),n(r))}("=",qt,e.initializer,we)}(r);case 286:return function(e){Ut(e,e.properties,262656)}(r);case 287:return function(e){qt("{..."),Ne(e.expression),qt("}")}(r);case 288:return function(t){var r;if(t.expression||!re&&!e.nodeIsSynthesized(t)&&(o=t.pos,function(t){var r=!1;return e.forEachTrailingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(o)||function(t){var r=!1;return e.forEachLeadingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(o))){var i=n&&!e.nodeIsSynthesized(t)&&e.getLineAndCharacterOfPosition(n,t.pos).line!==e.getLineAndCharacterOfPosition(n,t.end).line;i&&p.increaseIndent();var a=et(18,t.pos,qt,t);ke(t.dotDotDotToken),Ne(t.expression),et(19,(null===(r=t.expression)||void 0===r?void 0:r.end)||a,qt,t),i&&p.decreaseIndent()}var o}(r);case 289:return function(e){et(82,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma),mt(e,e.statements,e.expression.end)}(r);case 290:return function(e){var t=et(88,e.pos,Ht,e);mt(e,e.statements,t)}(r);case 291:return function(e){Yt(),or(e.token,Ht),Yt(),Ut(e,e.types,528)}(r);case 292:return function(e){var t=et(83,e.pos,Ht,e);Yt(),e.variableDeclaration&&(et(20,t,qt,e),ke(e.variableDeclaration),et(21,e.variableDeclaration.end,qt,e),Yt());ke(e.block)}(r);case 296:return function(t){ke(t.name),qt(":"),Yt();var r=t.initializer;if(0==(512&e.getEmitFlags(r))){$r(e.getCommentRange(r).pos)}Ne(r,oe.parenthesizeExpressionForDisallowedComma)}(r);case 297:return function(e){ke(e.name),e.objectAssignmentInitializer&&(Yt(),qt("="),Yt(),Ne(e.objectAssignmentInitializer,oe.parenthesizeExpressionForDisallowedComma))}(r);case 298:return function(e){e.expression&&(et(25,e.pos,qt,e),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma))}(r);case 299:return function(e){ke(e.name),Ft(e.initializer,e.name.end,e,oe.parenthesizeExpressionForDisallowedComma)}(r);case 300:return Ge(r);case 307:case 301:return function(e){for(var t=0,r=e.texts;t=1&&!e.isJsonSourceFile(n)?64:0;Ut(t,t.properties,526226|a|i),r&&nr()}(r);case 206:return function(t){Ne(t.expression,oe.parenthesizeLeftSideOfAccess);var r=t.questionDotToken||e.setTextRangePosEnd(e.factory.createToken(24),t.expression.end,t.name.pos),n=hr(t,t.expression,r),i=hr(t,r,t.name);lr(n,!1),28===r.kind||!function(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isNumericLiteral(t)){var r=Sr(t,!0,!1);return!t.numericLiteralFlags&&!e.stringContains(r,e.tokenToString(24))}if(e.isAccessExpression(t)){var n=e.getConstantValue(t);return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n}}(t.expression)||p.hasTrailingComment()||p.hasTrailingWhitespace()||qt(".");t.questionDotToken?ke(r):et(r.kind,t.expression.end,qt,t);lr(i,!1),ke(t.name),ur(n,i)}(r);case 207:return function(e){Ne(e.expression,oe.parenthesizeLeftSideOfAccess),ke(e.questionDotToken),et(22,e.expression.end,qt,e),Ne(e.argumentExpression),et(23,e.argumentExpression.end,qt,e)}(r);case 208:return function(t){var r=536870912&e.getEmitFlags(t);r&&(qt("("),zt("0"),qt(","),Yt());Ne(t.expression,oe.parenthesizeLeftSideOfAccess),r&&qt(")");ke(t.questionDotToken),Lt(t,t.typeArguments),Vt(t,t.arguments,2576,oe.parenthesizeExpressionForDisallowedComma)}(r);case 209:return function(e){et(103,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeExpressionOfNew),Lt(e,e.typeArguments),Vt(e,e.arguments,18960,oe.parenthesizeExpressionForDisallowedComma)}(r);case 210:return function(t){var r=536870912&e.getEmitFlags(t);r&&(qt("("),zt("0"),qt(","),Yt());Ne(t.tag,oe.parenthesizeLeftSideOfAccess),r&&qt(")");Lt(t,t.typeArguments),Yt(),Ne(t.template)}(r);case 211:return function(e){qt("<"),ke(e.type),qt(">"),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 212:return function(e){var t=et(20,e.pos,qt,e),r=mr(e.expression,e);Ne(e.expression,void 0),gr(e.expression,e),ur(r),et(21,e.expression?e.expression.end:t,qt,e)}(r);case 213:return function(e){Ar(e.name),at(e)}(r);case 214:return function(e){Mt(e,e.decorators),Nt(e,e.modifiers),ot(e,He)}(r);case 215:return function(e){et(89,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 216:return function(e){et(112,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 217:return function(e){et(114,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 218:return function(e){et(132,e.pos,Ht,e),Yt(),Ne(e.expression,oe.parenthesizeOperandOfPrefixUnary)}(r);case 219:return function(e){or(e.operator,Qt),function(e){var t=e.operand;return 219===t.kind&&(39===e.operator&&(39===t.operator||45===t.operator)||40===e.operator&&(40===t.operator||46===t.operator))}(e)&&Yt();Ne(e.operand,oe.parenthesizeOperandOfPrefixUnary)}(r);case 220:return function(e){Ne(e.operand,oe.parenthesizeOperandOfPostfixUnary),or(e.operator,Qt)}(r);case 221:return ce(r);case 222:return function(e){var t=hr(e,e.condition,e.questionToken),r=hr(e,e.questionToken,e.whenTrue),n=hr(e,e.whenTrue,e.colonToken),i=hr(e,e.colonToken,e.whenFalse);Ne(e.condition,oe.parenthesizeConditionOfConditionalExpression),lr(t,!0),ke(e.questionToken),lr(r,!0),Ne(e.whenTrue,oe.parenthesizeBranchOfConditionalExpression),ur(t,r),lr(n,!0),ke(e.colonToken),lr(i,!0),Ne(e.whenFalse,oe.parenthesizeBranchOfConditionalExpression),ur(n,i)}(r);case 223:return function(e){ke(e.head),Ut(e,e.templateSpans,262144)}(r);case 224:return function(e){et(125,e.pos,Ht,e),ke(e.asteriskToken),It(e.expression&&nt(e.expression),it)}(r);case 225:return function(e){et(25,e.pos,qt,e),Ne(e.expression,oe.parenthesizeExpressionForDisallowedComma)}(r);case 226:return function(e){Ar(e.name),dt(e)}(r);case 227:case 349:case 352:case 353:return;case 229:return function(e){Ne(e.expression,void 0),e.type&&(Yt(),Ht("as"),Yt(),ke(e.type))}(r);case 230:return function(e){Ne(e.expression,oe.parenthesizeLeftSideOfAccess),Qt("!")}(r);case 228:return Qe(r);case 231:return function(e){ir(e.keywordToken,e.pos,qt),qt("."),ke(e.name)}(r);case 232:return e.Debug.fail("SyntheticExpression should never be printed.");case 278:return function(e){ke(e.openingElement),Ut(e,e.children,262144),ke(e.closingElement)}(r);case 279:return function(e){qt("<"),ft(e.tagName),Lt(e,e.typeArguments),Yt(),ke(e.attributes),qt("/>")}(r);case 282:return function(e){ke(e.openingFragment),Ut(e,e.children,262144),ke(e.closingFragment)}(r);case 348:return e.Debug.fail("SyntaxList should not be printed");case 350:return function(t){var r=e.getEmitFlags(t);512&r||t.pos===t.expression.pos||$r(t.expression.pos);Ne(t.expression),1024&r||t.end===t.expression.end||Qr(t.expression.end)}(r);case 351:return function(e){Vt(e,e.elements,528,void 0)}(r);case 354:return e.Debug.fail("SyntheticReferenceExpression should not be printed")}return e.isKeyword(r.kind)?ar(r,Ht):e.isTokenKind(r.kind)?ar(r,qt):void e.Debug.fail("Unhandled SyntaxKind: ".concat(e.Debug.formatSyntaxKind(r.kind),"."))}function Ue(t,r){var n=Re(1,t,r);e.Debug.assertIsDefined(x),r=x,x=void 0,n(t,r)}function Ve(r){var i=!1,a=306===r.kind?r:void 0;if(!a||j!==e.ModuleKind.None){for(var o=a?a.prepends.length:0,s=a?a.sourceFiles.length+o:1,c=0;c0)return!1;r=o}return!0}(t)?lt:ut;Kr(t,t.statements,r),nr(),ir(19,t.statements.end,qt,t),null==I||I(t)}function lt(e){ut(e,!0)}function ut(e,t){var r=Ct(e.statements),n=p.getTextPos();Ve(e),0===r&&n===p.getTextPos()&&t?(nr(),Ut(e,e.statements,768),rr()):Ut(e,e.statements,1,void 0,r)}function dt(t){e.forEach(t.members,kr),Mt(t,t.decorators),Nt(t,t.modifiers),Ht("class"),t.name&&(Yt(),Ae(t.name));var r=65536&e.getEmitFlags(t);r&&rr(),Rt(t,t.typeParameters),Ut(t,t.heritageClauses,0),Yt(),qt("{"),Ut(t,t.members,129),qt("}"),r&&nr()}function _t(e){qt("{"),Ut(e,e.elements,525136),qt("}")}function pt(e){e.isTypeOnly&&(Ht("type"),Yt()),e.propertyName&&(ke(e.propertyName),Yt(),et(127,e.propertyName.end,Ht,e),Yt()),ke(e.name)}function ft(e){79===e.kind?Ne(e):ke(e)}function mt(t,r,i){var a=163969;1===r.length&&(!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r[0])||e.rangeStartPositionsAreOnSameLine(t,r[0],n))?(ir(58,i,qt,t),Yt(),a&=-130):et(58,i,qt,t),Ut(t,r,a)}function gt(t){Ut(t,e.factory.createNodeArray(t.jsDocPropertyTags),33)}function yt(t){t.typeParameters&&Ut(t,e.factory.createNodeArray(t.typeParameters),33),t.parameters&&Ut(t,e.factory.createNodeArray(t.parameters),33),t.type&&(tr(),Yt(),qt("*"),Yt(),ke(t.type))}function ht(e){qt("@"),ke(e)}function vt(t){var r=e.getTextOfJSDocComment(t);r&&(Yt(),K(r))}function bt(e){e&&(Yt(),qt("{"),ke(e.type),qt("}"))}function xt(t){tr();var r=t.statements;0===r.length||!e.isPrologueDirective(r[0])||e.nodeIsSynthesized(r[0])?Kr(t,r,Dt):Dt(t)}function St(t,r,i,a){if(t){var o=p.getTextPos();$t('/// '),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"no-default-lib"}),tr()}if(n&&n.moduleName&&($t('/// ')),tr()),n&&n.amdDependencies)for(var s=0,c=n.amdDependencies;s')):$t('/// ')),tr()}for(var u=0,d=r;u')),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"reference",data:_.fileName}),tr()}for(var f=0,m=i;f")),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:_.resolutionMode?_.resolutionMode===e.ModuleKind.ESNext?"type-import":"type-require":"type",data:_.fileName}),tr()}for(var y=0,h=a;y')),z&&z.sections.push({pos:o,end:p.getTextPos(),kind:"lib",data:_.fileName}),tr()}}function Dt(t){var r=t.statements;Dr(t),e.forEach(t.statements,Er),Ve(t);var n=e.findIndex(r,(function(t){return!e.isPrologueDirective(t)}));!function(e){e.isDeclarationFile&&St(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives)}(t),Ut(t,r,1,void 0,-1===n?r.length:n),Cr(t)}function Ct(t,r,n,i){for(var a=!!r,o=0;o=a.length||0===l;if(u&&32768&o)return O&&O(a),void(M&&M(a));if(15360&o&&(qt(function(e){return i[15360&e][0]}(o)),u&&a&&$r(a.pos,!0)),O&&O(a),u)!(1&o)||V&&(!r||n&&e.rangeIsOnSingleLine(r,n))?256&o&&!(524288&o)&&Yt():tr();else{e.Debug.type(a);var d=0==(262144&o),p=d,f=dr(r,a,o);f?(tr(f),p=!1):256&o&&Yt(),128&o&&rr();for(var m=function(e,t){return 1===e.length?D:"object"==typeof t?C:T}(t,s),g=void 0,y=void 0,h=!1,v=0;v0?(0==(131&o)&&(rr(),h=!0),tr(x),p=!1):g&&512&o&&Yt()}if(y=me(b),p)$r(e.getCommentRange(b).pos);else p=d;_=b.pos,m(b,t,s,v),h&&(nr(),h=!1),g=b}var S=g?e.getEmitFlags(g):0,E=re||!!(1024&S),k=(null==a?void 0:a.hasTrailingComma)&&64&o&&16&o;k&&(g&&!E?et(27,g.end,qt,g):qt(",")),g&&(r?r.end:-1)!==g.end&&60&o&&!E&&Qr(k&&(null==a?void 0:a.end)?a.end:g.end),128&o&&nr(),ge(y);var A=pr(r,a,o);A?tr(A):2097408&o&&Yt()}M&&M(a),15360&o&&(u&&a&&Qr(a.end),qt(function(e){return i[15360&e][1]}(o)))}}function zt(e){p.writeLiteral(e)}function Gt(e,t){p.writeSymbol(e,t)}function qt(e){p.writePunctuation(e)}function Wt(){p.writeTrailingSemicolon(";")}function Ht(e){p.writeKeyword(e)}function Qt(e){p.writeOperator(e)}function Xt(e){p.writeParameter(e)}function $t(e){p.writeComment(e)}function Yt(){p.writeSpace(" ")}function Zt(e){p.writeProperty(e)}function er(e){p.nonEscapingWrite?p.nonEscapingWrite(e):p.write(e)}function tr(e){void 0===e&&(e=1);for(var t=0;t0)}function rr(){p.increaseIndent()}function nr(){p.decreaseIndent()}function ir(t,r,n,i){return Q?or(t,n,r):function(t,r,n,i,a){if(Q||t&&e.isInJsonFile(t))return a(r,n,i);var o=t&&t.emitNode,s=o&&o.flags||0,c=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[r],l=c&&c.source||y;i=cn(l,c?c.pos:i),0==(128&s)&&i>=0&&un(l,i);i=a(r,n,i),c&&(i=c.end);0==(256&s)&&i>=0&&un(l,i);return i}(i,t,n,r,or)}function ar(t,r){L&&L(t),r(e.tokenToString(t.kind)),R&&R(t)}function or(t,r,n){var i=e.tokenToString(t);return r(i),n<0?n:n+i.length}function sr(t,r,n){if(1&e.getEmitFlags(t))Yt();else if(V){var i=hr(t,r,n);i?tr(i):Yt()}else tr()}function cr(t){for(var r=t.split(/\r\n?|\n/g),n=e.guessIndentation(r),i=0,a=r;i-1&&i.indexOf(r)===a+1}(t,r)?fr((function(i){return e.getLinesBetweenRangeEndAndRangeStart(t,r,n,i)})):!V&&(a=t,o=r,(a=e.getOriginalNode(a)).parent&&a.parent===e.getOriginalNode(o).parent)?e.rangeEndIsOnSameLineAsRangeStart(t,r,n)?0:1:65536&i?1:0;if(yr(t,i)||yr(r,i))return 1}else if(e.getStartsOnNewLine(r))return 1;var a,o;return 1&i?1:0}function pr(t,r,i){if(2&i||V){if(65536&i)return 1;var a=e.lastOrUndefined(r);if(void 0===a)return!t||n&&e.rangeIsOnSingleLine(t,n)?0:1;if(n&&t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||a.parent===t)){if(V){var o=e.isNodeArray(r)&&!e.positionIsSynthesized(r.end)?r.end:a.end;return fr((function(r){return e.getLinesBetweenPositionAndNextNonWhitespaceCharacter(o,t.end,n,r)}))}return e.rangeEndPositionsAreOnSameLine(t,a,n)?0:1}if(yr(a,i))return 1}return 1&i&&!(131072&i)?1:0}function fr(t){e.Debug.assert(!!V);var r=t(!0);return 0===r?t(!1):r}function mr(e,t){var r=V&&dr(t,[e],0);return r&&lr(r,!1),!!r}function gr(e,t){var r=V&&pr(t,[e],0);r&&tr(r)}function yr(t,r){if(e.nodeIsSynthesized(t)){var n=e.getStartsOnNewLine(t);return void 0===n?0!=(65536&r):n}return 0!=(65536&r)}function hr(t,r,i){return 131072&e.getEmitFlags(t)?0:(t=br(t),r=br(r),i=br(i),e.getStartsOnNewLine(i)?1:!n||e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r)||e.nodeIsSynthesized(i)?0:V?fr((function(t){return e.getLinesBetweenRangeEndAndRangeStart(r,i,n,t)})):e.rangeEndIsOnSameLineAsRangeStart(r,i,n)?0:1)}function vr(t){return 0===t.statements.length&&(!n||e.rangeEndIsOnSameLineAsRangeStart(t,t,n))}function br(t){for(;212===t.kind&&e.nodeIsSynthesized(t);)t=t.expression;return t}function xr(t,r){if(e.isGeneratedIdentifier(t))return Nr(t);if(e.isStringLiteral(t)&&t.textSourceNode)return xr(t.textSourceNode,r);var i=n,a=!!i&&!!t.parent&&!e.nodeIsSynthesized(t);if(e.isMemberName(t)){if(!a||e.getSourceFileOfNode(t)!==e.getOriginalNode(i))return e.idText(t)}else if(e.Debug.assertNode(t,e.isLiteralExpression),!a)return t.text;return e.getSourceTextOfNodeFromSourceFile(i,t,r)}function Sr(r,i,a){if(10===r.kind&&r.textSourceNode){var o=r.textSourceNode;if(e.isIdentifier(o)||e.isNumericLiteral(o)){var s=e.isNumericLiteral(o)?o.text:xr(o);return a?'"'.concat(e.escapeJsxAttributeString(s),'"'):i||16777216&e.getEmitFlags(r)?'"'.concat(e.escapeString(s),'"'):'"'.concat(e.escapeNonAsciiString(s),'"')}return Sr(o,i,a)}var c=(i?1:0)|(a?2:0)|(t.terminateUnterminatedLiterals?4:0)|(t.target&&99===t.target?8:0);return e.getLiteralText(r,n,c)}function Dr(t){t&&524288&e.getEmitFlags(t)||(c.push(l),l=0,u.push(d))}function Cr(t){t&&524288&e.getEmitFlags(t)||(l=c.pop(),d=u.pop())}function Tr(t){d&&d!==e.lastOrUndefined(u)||(d=new e.Set),d.add(t)}function Er(t){if(t)switch(t.kind){case 235:case 289:case 290:e.forEach(t.statements,Er);break;case 250:case 248:case 240:case 241:Er(t.statement);break;case 239:Er(t.thenStatement),Er(t.elseStatement);break;case 242:case 244:case 243:Er(t.initializer),Er(t.statement);break;case 249:Er(t.caseBlock);break;case 263:e.forEach(t.clauses,Er);break;case 252:Er(t.tryBlock),Er(t.catchClause),Er(t.finallyBlock);break;case 292:Er(t.variableDeclaration),Er(t.block);break;case 237:Er(t.declarationList);break;case 255:e.forEach(t.declarations,Er);break;case 254:case 164:case 203:case 257:case 268:case 274:Ar(t.name);break;case 256:Ar(t.name),524288&e.getEmitFlags(t)&&(e.forEach(t.parameters,Er),Er(t.body));break;case 201:case 202:case 269:e.forEach(t.elements,Er);break;case 266:Er(t.importClause);break;case 267:Ar(t.name),Er(t.namedBindings);break;case 270:Ar(t.propertyName||t.name)}}function kr(e){if(e)switch(e.kind){case 296:case 297:case 167:case 169:case 172:case 173:Ar(e.name)}}function Ar(t){t&&(e.isGeneratedIdentifier(t)?Nr(t):e.isBindingPattern(t)&&Er(t))}function Nr(t){if(4==(7&t.autoGenerateFlags))return wr(function(t){var r=t.autoGenerateId,n=t,i=n.original;for(;i&&(n=i,!(e.isIdentifier(n)&&4&n.autoGenerateFlags&&n.autoGenerateId!==r));)i=n.original;return n}(t),t.autoGenerateFlags);var r=t.autoGenerateId;return o[r]||(o[r]=function(t){switch(7&t.autoGenerateFlags){case 1:return Ir(0,!!(8&t.autoGenerateFlags));case 2:return Ir(268435456,!!(8&t.autoGenerateFlags));case 3:return Or(e.idText(t),32&t.autoGenerateFlags?Pr:Fr,!!(16&t.autoGenerateFlags),!!(8&t.autoGenerateFlags))}return e.Debug.fail("Unsupported GeneratedIdentifierKind.")}(t))}function wr(t,r){var n=e.getNodeId(t);return a[n]||(a[n]=function(t,r){switch(t.kind){case 79:return Or(xr(t),Fr,!!(16&r),!!(8&r));case 261:case 260:return function(t){var r=xr(t.name);return function(t,r){for(var n=r;e.isNodeDescendantOf(n,r);n=n.nextContainer)if(n.locals){var i=n.locals.get(e.escapeLeadingUnderscores(t));if(i&&3257279&i.flags)return!1}return!0}(r,t)?r:Or(r)}(t);case 266:case 272:return function(t){var r=e.getExternalModuleName(t);return Or(e.isStringLiteral(r)?e.makeIdentifierFromModuleName(r.text):"module")}(t);case 256:case 257:case 271:return Or("default");case 226:return Or("class");case 169:case 172:case 173:return function(t){if(e.isIdentifier(t.name))return wr(t.name);return Ir(0)}(t);case 162:return Ir(0,!0);default:return Ir(0)}}(t,r))}function Fr(e){return Pr(e)&&!s.has(e)&&!(d&&d.has(e))}function Pr(t){return!n||e.isFileLevelUniqueName(n,t,E)}function Ir(e,t){if(e&&!(l&e)&&Fr(r=268435456===e?"_i":"_n"))return l|=e,t&&Tr(r),r;for(;;){var r,n=268435455&l;if(l++,8!==n&&13!==n)if(Fr(r=n<26?"_"+String.fromCharCode(97+n):"_"+(n-26)))return t&&Tr(r),r}}function Or(e,t,r,n){if(void 0===t&&(t=Fr),r&&t(e))return n?Tr(e):s.add(e),e;95!==e.charCodeAt(e.length-1)&&(e+="_");for(var i=1;;){var a=e+i;if(t(a))return n?Tr(a):s.add(a),a;i++}}function Mr(e){return Or(e,Pr,!0)}function Lr(e,t){var r=Re(2,e,t),n=Y,i=Z,a=ee;Rr(t),r(e,t),Br(t,n,i,a)}function Rr(t){var r=e.getEmitFlags(t),n=e.getCommentRange(t);!function(t,r,n,i){ie(),te=!1;var a=n<0||0!=(512&r)||11===t.kind,o=i<0||0!=(1024&r)||11===t.kind;(n>0||i>0)&&n!==i&&(a||zr(n,349!==t.kind),(!a||n>=0&&0!=(512&r))&&(Y=n),(!o||i>=0&&0!=(1024&r))&&(Z=i,255===t.kind&&(ee=i)));e.forEach(e.getSyntheticLeadingComments(t),jr),ae()}(t,r,n.pos,n.end),2048&r&&(re=!0)}function Br(t,r,n,i){var a=e.getEmitFlags(t),o=e.getCommentRange(t);2048&a&&(re=!1),Jr(t,a,o.pos,o.end,r,n,i);var s=e.getTypeNode(t);s&&Jr(t,a,s.pos,s.end,r,n,i)}function Jr(t,r,n,i,a,o,s){ie();var c=i<0||0!=(1024&r)||11===t.kind;e.forEach(e.getSyntheticTrailingComments(t),Ur),(n>0||i>0)&&n!==i&&(Y=a,Z=o,ee=s,c||349===t.kind||function(e){tn(e,Xr)}(i)),ae()}function jr(e){(e.hasLeadingNewline||2===e.kind)&&p.writeLine(),Vr(e),e.hasTrailingNewLine||2===e.kind?p.writeLine():p.writeSpace(" ")}function Ur(e){p.isAtStartOfLine()||p.writeSpace(" "),Vr(e),e.hasTrailingNewLine&&p.writeLine()}function Vr(t){var r=function(e){return 3===e.kind?"/*".concat(e.text,"*/"):"//".concat(e.text)}(t),n=3===t.kind?e.computeLineStarts(r):void 0;e.writeCommentRange(r,n,p,0,r.length,J)}function Kr(t,r,i){ie();var a=r.pos,o=r.end,s=e.getEmitFlags(t),c=re||o<0||0!=(1024&s);a<0||0!=(512&s)||function(t){var r=n&&e.emitDetachedComments(n.text,Ee(),p,rn,t,J,re);r&&(b?b.push(r):b=[r])}(r),ae(),2048&s&&!re?(re=!0,i(t),re=!1):i(t),ie(),c||(zr(r.end,!0),te&&!p.isAtStartOfLine()&&p.writeLine()),ae()}function zr(e,t){te=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?en(e,qr):en(e,Hr):0===e&&en(e,Gr)}function Gr(e,t,r,n,i){nn(e,t)&&Hr(e,t,r,n,i)}function qr(e,t,r,n,i){nn(e,t)||Hr(e,t,r,n,i)}function Wr(r,n){return!t.onlyPrintJsDocStyle||(e.isJSDocLikeText(r,n)||e.isPinnedComment(r,n))}function Hr(t,r,i,a,o){n&&Wr(n.text,t)&&(te||(e.emitNewLineBeforeLeadingCommentOfPosition(Ee(),p,o,t),te=!0),ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a?p.writeLine():3===i&&p.writeSpace(" "))}function Qr(e){re||-1===e||zr(e,!0)}function Xr(t,r,i,a){n&&Wr(n.text,t)&&(p.isAtStartOfLine()||p.writeSpace(" "),ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a&&p.writeLine())}function $r(e,t,r){re||(ie(),tn(e,t?Xr:r?Yr:Zr),ae())}function Yr(t,r,i){n&&(ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),2===i&&p.writeLine())}function Zr(t,r,i,a){n&&(ln(t),e.writeCommentRange(n.text,Ee(),p,t,r,J),ln(r),a?p.writeLine():p.writeSpace(" "))}function en(t,r){!n||-1!==Y&&t===Y||(function(t){return void 0!==b&&e.last(b).nodePos===t}(t)?function(t){if(!n)return;var r=e.last(b).detachedCommentEndPos;b.length-1?b.pop():b=void 0;e.forEachLeadingCommentRange(n.text,r,t,r)}(r):e.forEachLeadingCommentRange(n.text,t,r,t))}function tn(t,r){n&&(-1===Z||t!==Z&&t!==ee)&&e.forEachTrailingCommentRange(n.text,t,r)}function rn(t,r,i,a,o,s){n&&Wr(n.text,a)&&(ln(a),e.writeCommentRange(t,r,i,a,o,s),ln(o))}function nn(t,r){return!!n&&e.isRecognizedTripleSlashComment(n.text,t,r)}function an(e,t){var r=Re(3,e,t);on(t),r(e,t),sn(t)}function on(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);if(e.isUnparsedNode(t)){e.Debug.assertIsDefined(t.parent,"UnparsedNodes must have parent pointers");var i=function(t){return void 0===t.parsedSourceMap&&void 0!==t.sourceMapText&&(t.parsedSourceMap=e.tryParseRawSourceMap(t.sourceMapText)||!1),t.parsedSourceMap||void 0}(t.parent);i&&g&&g.appendSourceMap(p.getLine(),p.getColumn(),i,t.parent.sourceMapPath,t.parent.getLineAndCharacterOfPosition(t.pos),t.parent.getLineAndCharacterOfPosition(t.end))}else{var a=n.source||y;349!==t.kind&&0==(16&r)&&n.pos>=0&&un(n.source||y,cn(a,n.pos)),64&r&&(Q=!0)}}function sn(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);e.isUnparsedNode(t)||(64&r&&(Q=!1),349!==t.kind&&0==(32&r)&&n.end>=0&&un(n.source||y,n.end))}function cn(t,r){return t.skipTrivia?t.skipTrivia(r):e.skipTrivia(t.text,r)}function ln(t){if(!(Q||e.positionIsSynthesized(t)||_n(y))){var r=e.getLineAndCharacterOfPosition(y,t),n=r.line,i=r.character;g.addMapping(p.getLine(),p.getColumn(),X,n,i,void 0)}}function un(e,t){if(e!==y){var r=y,n=X;dn(e),ln(t),function(e,t){y=e,X=t}(r,n)}else ln(t)}function dn(e){Q||(y=e,e!==h?_n(e)||(X=g.addSource(e.fileName),t.inlineSources&&g.setSourceContent(X,e.text),h=e,$=X):X=$)}function _n(t){return e.fileExtensionIs(t.fileName,".json")}}function D(e,t,r,n){t(e)}function C(e,t,r,n){t(e,r.select(n))}function T(e,t,r,n){t(e,r)}e.isBuildInfoFile=function(t){return e.fileExtensionIs(t,".tsbuildinfo")},e.forEachEmittedFile=a,e.getTsBuildInfoEmitOutputFilePath=o,e.getOutputPathsForBundle=s,e.getOutputPathsFor=c,e.getOutputExtension=u,e.getOutputDeclarationFileName=_,e.getCommonSourceDirectory=y,e.getCommonSourceDirectoryOfConfig=h,e.getAllProjectOutputs=function(t,r){var n=f(),i=n.addOutput,a=n.getOutputs;if(e.outFile(t.options))m(t,i);else{for(var s=e.memoize((function(){return h(t,r)})),c=0,l=t.fileNames;c=4,h=(f+1+"").length;y&&(h=Math.max("...".length,h));for(var v="",b=u;b<=f;b++){v+=o.getNewLine(),y&&u+11}))&&ir(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir")}J.useDefineForClassFields&&0===d&&ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields");J.checkJs&&!e.getAllowJSCompilerOption(J)&&ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs"));J.emitDeclarationOnly&&(e.getEmitDeclarations(J)||ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),J.noEmit&&ir(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit"));J.emitDecoratorMetadata&&!J.experimentalDecorators&&ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators");J.jsxFactory?(J.reactNamespace&&ir(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFactory,d)||ar("jsxFactory",e.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFactory)):J.reactNamespace&&!e.isIdentifierText(J.reactNamespace,d)&&ar("reactNamespace",e.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,J.reactNamespace);J.jsxFragmentFactory&&(J.jsxFactory||ir(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e.inverseJsxOptionMap.get(""+J.jsx)),e.parseIsolatedEntityName(J.jsxFragmentFactory,d)||ar("jsxFragmentFactory",e.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,J.jsxFragmentFactory));J.reactNamespace&&(4!==J.jsx&&5!==J.jsx||ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e.inverseJsxOptionMap.get(""+J.jsx)));J.jsxImportSource&&2===J.jsx&&ir(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e.inverseJsxOptionMap.get(""+J.jsx));J.preserveValueImports&&e.getEmitModuleKind(J)=e.length(null==o?void 0:o.imports)+e.length(null==o?void 0:o.moduleAugmentations))return!1;var n=e.getResolvedModule(o,t,o&&y(o,r)),i=n&&V.getSourceFile(n.resolvedFileName);if(n&&i)return!1;var a=K.get(t);return!!a&&(e.isTraceEnabled(J,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified,t,a),!0)}}function et(t){return{getPrependNodes:nt,getCanonicalFileName:Wt,getCommonSourceDirectory:ze.getCommonSourceDirectory,getCompilerOptions:ze.getCompilerOptions,getCurrentDirectory:function(){return le},getNewLine:function(){return ne.getNewLine()},getSourceFile:ze.getSourceFile,getSourceFileByPath:ze.getSourceFileByPath,getSourceFiles:ze.getSourceFiles,getLibFileFromReference:ze.getLibFileFromReference,isSourceFileFromExternalLibrary:it,getResolvedProjectReferenceToRedirect:Rt,getProjectReferenceRedirect:Ot,isSourceOfProjectReferenceRedirect:jt,getSymlinkCache:_r,writeFile:t||tt,isEmitBlocked:ot,readFile:function(e){return ne.readFile(e)},fileExists:function(t){var r=$e(t);return!!ct(r)||!e.contains(ge,r)&&ne.fileExists(t)},useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getProgramBuildInfo:function(){return ze.getProgramBuildInfo&&ze.getProgramBuildInfo()},getSourceFileFromReference:function(e,t){return ze.getSourceFileFromReference(e,t)},redirectTargetsMap:De,getFileIncludeReasons:ze.getFileIncludeReasons}}function tt(e,t,r,n,i,a){ne.writeFile(e,t,r,n,i,a)}function rt(){return ye}function nt(){return w(U,(function(e,t){var r;return null===(r=ye[t])||void 0===r?void 0:r.commandLine}),(function(e){var t=$e(e),r=ct(t);return r?r.text:Te.has(t)?void 0:ne.readFile(t)}))}function it(e){return!!$.get(e.path)}function at(){return O||(O=e.createTypeChecker(ze))}function ot(e){return _e.has($e(e))}function st(e){return ct($e(e))}function ct(e){return Te.get(e)||void 0}function lt(t,r,n){return t?r(t,n):e.sortAndDeduplicateDiagnostics(e.flatMap(ze.getSourceFiles(),(function(e){return n&&n.throwIfCancellationRequested(),r(e,n)})))}function ut(t){var r;if(e.skipTypeChecking(t,J,ze))return e.emptyArray;var n=ce.getDiagnostics(t.fileName);return(null===(r=t.commentDirectives)||void 0===r?void 0:r.length)?gt(t,t.commentDirectives,n).diagnostics:n}function dt(t){return e.isSourceFileJS(t)?(t.additionalSyntacticDiagnostics||(t.additionalSyntacticDiagnostics=function(t){return _t((function(){var r=[];return n(t,t),e.forEachChildRecursively(t,n,i),r;function n(t,n){switch(n.kind){case 164:case 167:case 169:if(n.questionToken===t)return r.push(s(t,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 168:case 171:case 172:case 173:case 213:case 256:case 214:case 254:if(n.type===t)return r.push(s(t,e.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(t.kind){case 267:if(t.isTypeOnly)return r.push(s(n,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 272:if(t.isTypeOnly)return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 270:case 275:if(t.isTypeOnly)return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,e.isImportSpecifier(t)?"import...type":"export...type")),"skip";break;case 265:return r.push(s(t,e.Diagnostics.import_can_only_be_used_in_TypeScript_files)),"skip";case 271:if(t.isExportEquals)return r.push(s(t,e.Diagnostics.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 291:if(117===t.token)return r.push(s(t,e.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 258:var i=e.tokenToString(118);return e.Debug.assertIsDefined(i),r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 261:var a=16&t.flags?e.tokenToString(142):e.tokenToString(141);return e.Debug.assertIsDefined(a),r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,a)),"skip";case 259:return r.push(s(t,e.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 260:var o=e.Debug.checkDefined(e.tokenToString(92));return r.push(s(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 230:return r.push(s(t,e.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 229:return r.push(s(t.type,e.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 211:e.Debug.fail()}}function i(t,n){switch(n.decorators!==t||J.experimentalDecorators||r.push(s(n,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)),n.kind){case 257:case 226:case 169:case 171:case 172:case 173:case 213:case 256:case 214:if(t===n.typeParameters)return r.push(o(t,e.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 237:if(t===n.modifiers)return a(n.modifiers,237===n.kind),"skip";break;case 167:if(t===n.modifiers){for(var i=0,c=t;i=0;){if(r.markUsed(o))return o;var s=n.text.slice(a[o],a[o+1]).trim();if(""!==s&&!/^(\s*)\/\/(.*)$/.test(s))return-1;o--}return-1}(t,i)}));return{diagnostics:a,directives:i}}function yt(e,t){return vt(e,t,q,ht)}function ht(t,r){return _t((function(){var n=at().getEmitResolver(t,r);return e.getDeclarationDiagnostics(et(e.noop),n,t)||e.emptyArray}))}function vt(t,r,n,i){var a,o=t?null===(a=n.perFile)||void 0===a?void 0:a.get(t.path):n.allDiagnostics;if(o)return o;var s=i(t,r);return t?(n.perFile||(n.perFile=new e.Map)).set(t.path,s):n.allDiagnostics=s,s}function bt(e,t){return e.isDeclarationFile?[]:yt(e,t)}function xt(t,r,n,i){kt(e.normalizePath(t),r,n,void 0,i)}function St(e,t){return e.fileName===t.fileName}function Dt(e,t){return 79===e.kind?79===t.kind&&e.escapedText===t.escapedText:10===t.kind&&e.text===t.text}function Ct(t,r){var n=e.factory.createStringLiteral(t),i=e.factory.createImportDeclaration(void 0,void 0,void 0,n,void 0);return e.addEmitFlags(i,67108864),e.setParent(n,i),e.setParent(i,r),n.flags&=-9,i.flags&=-9,n}function Tt(t){if(!t.imports){var r,n,i,a=e.isSourceFileJS(t),o=e.isExternalModule(t);if((J.isolatedModules||o)&&!t.isDeclarationFile){J.importHelpers&&(r=[Ct(e.externalHelpersModuleNameText,t)]);var s=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(J,t),J);s&&(r||(r=[])).push(Ct(s,t))}for(var c=0,l=t.statements;c=1&&e.isStringLiteralLike(i.arguments[0])?(e.setParentRecursive(i,!1),r=e.append(r,i.arguments[0])):e.isLiteralImportTypeNode(i)&&(e.setParentRecursive(i,!1),r=e.append(r,i.argument.literal))}}(t),t.imports=r||e.emptyArray,t.moduleAugmentations=n||e.emptyArray,void(t.ambientModuleNames=i||e.emptyArray)}function u(a,s){if(e.isAnyImportOrReExport(a)){var c=e.getExternalModuleName(a);!(c&&e.isStringLiteral(c)&&c.text)||s&&e.isExternalModuleNameRelative(c.text)||(e.setParentRecursive(a,!1),r=e.append(r,c),Ce||0!==Q||t.isDeclarationFile||(Ce=e.startsWith(c.text,"node:")))}else if(e.isModuleDeclaration(a)&&e.isAmbientModule(a)&&(s||e.hasSyntacticModifier(a,2)||t.isDeclarationFile)){a.name.parent=a;var l=e.getTextOfIdentifierOrLiteral(a.name);if(o||s&&!e.isExternalModuleNameRelative(l))(n||(n=[])).push(a.name);else if(!s){t.isDeclarationFile&&(i||(i=[])).push(l);var d=a.body;if(d)for(var _=0,p=d.statements;_0),Object.defineProperties(o,{id:{get:function(){return this.redirectInfo.redirectTarget.id},set:function(e){this.redirectInfo.redirectTarget.id=e}},symbol:{get:function(){return this.redirectInfo.redirectTarget.symbol},set:function(e){this.redirectInfo.redirectTarget.symbol=e}}}),o}(b,h,t,o,$e(t),d);return De.add(b.path,t),It(x,o,u),Pt(x,i),Se.set(o,e.packageIdToPackageName(a)),f.push(x),x}h&&(xe.set(v,h),Se.set(o,e.packageIdToPackageName(a)))}if(It(h,o,u),h){if($.set(o,Q>0),h.fileName=t,h.path=o,h.resolvedPath=$e(t),h.originalFileName=d,Pt(h,i),ne.useCaseSensitiveFileNames()){var S=e.toFileNameLowerCase(o),C=Ee.get(S);C?Nt(t,C,i):Ee.set(S,h)}ae=ae||h.hasNoDefaultLib&&!n,J.noResolve||(Vt(h,r),Kt(h)),J.noLib||qt(h),Ht(h),r?p.push(h):f.push(h)}return h}(t,r,n,i,a);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function Ft(t,r,n,i){var a=E($e(t),null==r?void 0:r.getPackageJsonInfoCache(),n,i);return{languageVersion:e.getEmitScriptTarget(i),impliedNodeFormat:a,setExternalModuleIndicator:e.getSetExternalModuleIndicator(i)}}function Pt(e,t){e&&z.add(e.path,t)}function It(e,t,r){r?(Te.set(r,e),Te.set(t,e||!1)):Te.set(t,e)}function Ot(e){var t=Mt(e);return t&&Lt(t,e)}function Mt(t){if(ye&&ye.length&&!e.isDeclarationFileName(t)&&!e.fileExtensionIs(t,".json"))return Rt(t)}function Lt(t,r){var n=e.outFile(t.commandLine.options);return n?e.changeExtension(n,".d.ts"):e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames())}function Rt(t){void 0===ve&&(ve=new e.Map,Bt((function(e){$e(J.configFilePath)!==e.sourceFile.path&&e.commandLine.fileNames.forEach((function(t){return ve.set($e(t),e.sourceFile.path)}))})));var r=ve.get($e(t));return r&&Ut(r)}function Bt(t){return e.forEachResolvedProjectReference(ye,t)}function Jt(t){if(e.isDeclarationFileName(t))return void 0===be&&(be=new e.Map,Bt((function(t){var r=e.outFile(t.commandLine.options);if(r){var n=e.changeExtension(r,".d.ts");be.set($e(n),!0)}else{var i=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())}));e.forEach(t.commandLine.fileNames,(function(r){if(!e.isDeclarationFileName(r)&&!e.fileExtensionIs(r,".json")){var n=e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames(),i);be.set($e(n),r)}}))}}))),be.get(t)}function jt(e){return ke&&!!Rt(e)}function Ut(e){if(he)return he.get(e)||void 0}function Vt(r,n){e.forEach(r.referencedFiles,(function(i,a){kt(t(i.fileName,r.fileName),n,!1,void 0,{kind:e.FileIncludeKind.ReferenceFile,file:r.path,index:a})}))}function Kt(t){var r=t.typeReferenceDirectives;if(r)for(var n=We(r,t),i=0;iH,p=d&&!P(a,s)&&!a.noResolve&&o_?e.createDiagnosticForNodeInSourceFile(d,p.elements[_],t.kind===e.FileIncludeKind.OutputFromProjectReference?e.Diagnostics.File_is_output_from_referenced_project_specified_here:e.Diagnostics.File_is_source_from_referenced_project_specified_here):void 0;case e.FileIncludeKind.AutomaticTypeDirectiveFile:if(!J.types)return;i=nr("types",t.typeReference),a=e.Diagnostics.File_is_entry_point_of_type_library_specified_here;break;case e.FileIncludeKind.LibFile:if(void 0!==t.index){i=nr("lib",J.lib[t.index]),a=e.Diagnostics.File_is_library_specified_here;break}var f=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(J)?r:void 0}));i=f?function(t,r){var n=tr(t);return n&&e.firstDefined(n,(function(t){return e.isStringLiteral(t.initializer)&&t.initializer.text===r?t.initializer:void 0}))}("target",f):void 0,a=e.Diagnostics.File_is_default_library_for_target_specified_here;break;default:e.Debug.assertNever(t)}return i&&e.createDiagnosticForNodeInSourceFile(J.configFile,i,a)}(t))),t===n&&(n=void 0)}}function $t(e,t,r,n){(L||(L=[])).push({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:r,args:n})}function Yt(e,t,r){ce.add(Xt(e,void 0,t,r))}function Zt(t,r,n,i,a,o){for(var s=!0,c=0,l=rr();cr&&(ce.add(e.createDiagnosticForNodeInSourceFile(J.configFile,p.elements[r],n,i,a,o)),s=!1)}}s&&ce.add(e.createCompilerDiagnostic(n,i,a,o))}function er(t,r,n,i){for(var a=!0,o=0,s=rr();or?ce.add(e.createDiagnosticForNodeInSourceFile(t||J.configFile,o.elements[r],n,i,a)):ce.add(e.createCompilerDiagnostic(n,i,a))}function sr(t,r,n,i,a,o,s){var c=cr();(!c||!lr(c,t,r,n,i,a,o,s))&&ce.add(e.createCompilerDiagnostic(i,a,o,s))}function cr(){if(void 0===Y){Y=!1;var t=e.getTsConfigObjectLiteralExpression(J.configFile);if(t)for(var r=0,n=e.getPropertyAssignment(t,"compilerOptions");r0)for(var a=t.getTypeChecker(),c=0,l=r.imports;c0)for(var _=0,p=r.referencedFiles;_1&&S(x)}return i;function S(t){if(t.declarations)for(var n=0,i=t.declarations;n0;){var d=u.pop();if(!l.has(d)){var p=r.getSourceFileByPath(d);l.set(d,p),p&&_(t,r,p,i,a,o,s)&&u.push.apply(u,m(t,p.resolvedPath))}}return e.arrayFrom(e.mapDefinedIterator(l.values(),(function(e){return e})))}r.createManyToManyPathMap=n,r.canReuseOldState=l,r.create=function(t,r,i,a){var o=new e.Map,s=t.getCompilerOptions().module!==e.ModuleKind.None?n():void 0,u=s?n():void 0,d=new e.Set,_=l(s,i);t.getTypeChecker();for(var p=0,f=t.getSourceFiles();p0;){var c=s.pop();if(!o.has(c)){if(o.set(c,!0),m(t,c,n,i,a))return;if(d(t,c,n,i,a),p(t,c)){var l=e.Debug.checkDefined(t.program).getSourceFileByPath(c);s.push.apply(s,e.BuilderState.getReferencedByPaths(t,l.resolvedPath))}}}}e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap);var u=new e.Set;f(t,r.resolvedPath,(function(r){if(m(t,r,n,i,a))return!0;var o=t.referencedMap.getKeys(r);return o&&e.forEachKey(o,(function(e){return g(t,e,u,n,i,a)}))}))}(t,r,n,i,a)}function d(t,r,n,i,a){if(_(t,r),!t.changedFilesSet.has(r)){var o=e.Debug.checkDefined(t.program),s=o.getSourceFileByPath(r);s&&(e.BuilderState.updateShapeSignature(t,o,s,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap,!a.disableUseFileVersionAsSignature),e.getEmitDeclarations(t.compilerOptions)&&T(t,r,0))}}function _(e,t){return!e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function p(t,r){return e.Debug.checkDefined(t.currentAffectedFilesSignatures).get(r)!==e.Debug.checkDefined(t.fileInfos.get(r)).signature}function f(t,r,n){var i=t.currentAffectedFilesExportedModulesMap.getKeys(r),a=i&&e.forEachKey(i,n);return a||(i=t.exportedModulesMap.getKeys(r))&&e.forEachKey(i,(function(e){var r;return t.currentAffectedFilesExportedModulesMap.hasKey(e)||(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))?void 0:n(e)}))}function m(t,r,n,i,a){var o;return!!(null===(o=t.fileInfos.get(r))||void 0===o?void 0:o.affectsGlobalScope)&&(e.BuilderState.getAllFilesExcludingDefaultLibraryFile(t,t.program,void 0).forEach((function(e){return d(t,e.resolvedPath,n,i,a)})),l(t),!0)}function g(t,r,n,i,a,o){var s;if(e.tryAddToSet(n,r)){if(m(t,r,i,a,o))return!0;d(t,r,i,a,o),e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap),f(t,r,(function(e){return g(t,e,n,i,a,o)})),null===(s=t.referencedMap.getKeys(r))||void 0===s||s.forEach((function(e){return!n.has(e)&&d(t,e,i,a,o)}))}}function y(t,r,n,i,a){a?t.buildInfoEmitPending=!1:r===t.program?(t.changedFilesSet.clear(),t.programEmitComplete=!0):(t.seenAffectedFiles.add(r.resolvedPath),void 0!==n&&(t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map)).set(r.resolvedPath,n),i?(t.affectedFilesPendingEmitIndex++,t.buildInfoEmitPending=!0):t.affectedFilesIndex++)}function h(e,t,r){return y(e,r),{result:t,affected:r}}function v(e,t,r,n,i,a){return y(e,r,n,i,a),{result:t,affected:r}}function b(t,r,n){return e.concatenate(function(t,r,n){var i=r.resolvedPath;if(t.semanticDiagnosticsPerFile){var a=t.semanticDiagnosticsPerFile.get(i);if(a)return e.filterSemanticDiagnostics(a,t.compilerOptions)}var o=e.Debug.checkDefined(t.program).getBindAndCheckDiagnostics(r,n);t.semanticDiagnosticsPerFile&&t.semanticDiagnosticsPerFile.set(i,o);return e.filterSemanticDiagnostics(o,t.compilerOptions)}(t,r,n),e.Debug.checkDefined(t.program).getProgramDiagnostics(r))}function x(t,r){for(var n,i=e.getOptionsNameMap().optionsNameMap,a=0,o=e.getOwnKeys(t).sort(e.compareStringsCaseSensitive);a1||47!==t.charCodeAt(0);if(a&&0!==t.search(/[a-zA-Z]:/)&&0===i.search(/[a-zA-z]\$\//)){if(-1===(n=t.indexOf(e.directorySeparator,n+1)))return!1;i=t.substring(r+i.length,n+1)}if(a&&0!==i.search(/users\//i))return!0;for(var o=n+1,s=2;s>0;s--)if(0===(o=t.indexOf(e.directorySeparator,o)+1))return!1;return!0}function n(e){var t,r;return!(!(null===(t=e.resolvedModule)||void 0===t?void 0:t.originalPath)&&!(null===(r=e.resolvedTypeReferenceDirective)||void 0===r?void 0:r.originalPath))}e.removeIgnoredPath=t,e.canWatchDirectory=r,e.createResolutionCache=function(i,a,o){var s,c,l,u,d,_,p=e.createMultiMap(),f=[],m=e.createMultiMap(),g=!1,y=e.memoize((function(){return i.getCurrentDirectory()})),h=i.getCachedDirectoryStructureHost(),v=new e.Map,b=e.createCacheWithRedirects(),x=e.createCacheWithRedirects(),S=e.createModuleResolutionCache(y(),i.getCanonicalFileName,void 0,b,x),D=new e.Map,C=e.createCacheWithRedirects(),T=e.createTypeReferenceDirectiveResolutionCache(y(),i.getCanonicalFileName,void 0,S.getPackageJsonInfoCache(),C),E=[".ts",".tsx",".js",".jsx",".json"],k=new e.Map,A=new e.Map,N=a&&e.removeTrailingDirectorySeparator(e.getNormalizedAbsolutePath(a,y())),w=N&&i.toPath(N),F=void 0!==w?w.split(e.directorySeparator).length:0,P=new e.Map;return{getModuleResolutionCache:function(){return S},startRecordingFilesWithChangedResolutions:function(){s=[]},finishRecordingFilesWithChangedResolutions:function(){var e=s;return s=void 0,e},startCachingPerDirectoryResolution:R,finishCachingPerDirectoryResolution:function(){l=void 0,R(),A.forEach((function(e,t){0===e.refCount&&(A.delete(t),e.watcher.close())})),g=!1},resolveModuleNames:function(t,r,n,i,a){return j({names:t,containingFile:r,redirectedReference:i,cache:v,perDirectoryCacheWithRedirects:b,loader:B,getResolutionWithResolvedFileName:I,shouldRetryResolution:function(t){return!t.resolvedModule||!e.resolutionExtensionIsTSOrJson(t.resolvedModule.extension)},reusedNames:n,logChanges:o,containingSourceFile:a})},getResolvedModuleWithFailedLookupLocationsFromCache:function(e,t,r){var n=v.get(i.toPath(t));return n?n.get(e,r):void 0},resolveTypeReferenceDirectives:function(e,t,r,n){return j({names:e,containingFile:t,redirectedReference:r,cache:D,perDirectoryCacheWithRedirects:C,loader:J,getResolutionWithResolvedFileName:O,shouldRetryResolution:function(e){return void 0===e.resolvedTypeReferenceDirective},containingSourceFileMode:n})},removeResolutionsFromProjectReferenceRedirects:function(t){if(!e.fileExtensionIs(t,".json"))return;var r=i.getCurrentProgram();if(!r)return;var n=r.getResolvedProjectReferenceByPath(t);if(!n)return;n.commandLine.fileNames.forEach((function(e){return Z(i.toPath(e))}))},removeResolutionsOfFile:Z,hasChangedAutomaticTypeDirectiveNames:function(){return g},invalidateResolutionOfFile:function(t){Z(t);var r=g;ee(m.get(t),e.returnTrue)&&g&&!r&&i.onChangedAutomaticTypeDirectiveNames()},invalidateResolutionsOfFailedLookupLocations:re,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(t){e.Debug.assert(l===t||void 0===l),l=t},createHasInvalidatedResolution:function(t){if(re(),t)return c=void 0,e.returnTrue;var r=c;return c=void 0,function(e){return!!r&&r.has(e)||L(e)}},isFileWithInvalidatedNonRelativeUnresolvedImports:L,updateTypeRootsWatch:function(){var t=i.getCompilationSettings();if(t.types)return void ie();var r=e.getEffectiveTypeRoots(t,{directoryExists:oe,getCurrentDirectory:y});r?e.mutateMap(P,e.arrayToMap(r,(function(e){return i.toPath(e)})),{createNewValue:ae,onDeleteValue:e.closeFileWatcher}):ie()},closeTypeRootsWatch:ie,clear:function(){e.clearMap(A,e.closeFileWatcherOf),k.clear(),p.clear(),ie(),v.clear(),D.clear(),m.clear(),f.length=0,u=void 0,d=void 0,_=void 0,R(),g=!1}};function I(e){return e.resolvedModule}function O(e){return e.resolvedTypeReferenceDirective}function M(t,r){return!(void 0===t||r.length<=t.length)&&(e.startsWith(r,t)&&r[t.length]===e.directorySeparator)}function L(e){if(!l)return!1;var t=l.get(e);return!!t&&!!t.length}function R(){S.clear(),T.clear(),p.forEach(W),p.clear()}function B(t,r,n,a,o,s,c){var l,u=e.resolveModuleName(t,r,n,a,S,o,c);if(!i.getGlobalCache)return u;var d=i.getGlobalCache();if(!(void 0===d||e.isExternalModuleNameRelative(t)||u.resolvedModule&&e.extensionIsTS(u.resolvedModule.extension))){var _=e.loadModuleFromGlobalCache(e.Debug.checkDefined(i.globalCacheResolutionModuleName)(t),i.projectName,n,a,d,S),p=_.resolvedModule,f=_.failedLookupLocations;if(p)return u.resolvedModule=p,(l=u.failedLookupLocations).push.apply(l,f),u}return u}function J(t,r,n,i,a,o,s){return e.resolveTypeReferenceDirective(t,r,n,i,a,T,s)}function j(t){var r,a,o,c=t.names,l=t.containingFile,u=t.redirectedReference,d=t.cache,_=t.perDirectoryCacheWithRedirects,p=t.loader,f=t.getResolutionWithResolvedFileName,m=t.shouldRetryResolution,g=t.reusedNames,y=t.logChanges,h=t.containingSourceFile,v=t.containingSourceFileMode,b=i.toPath(l),x=d.get(b)||d.set(b,e.createModeAwareCache()).get(b),S=e.getDirectoryPath(b),D=_.getOrCreateMapOfCacheRedirects(u),C=D.get(S);C||(C=e.createModeAwareCache(),D.set(S,C));for(var T=[],E=i.getCompilationSettings(),k=y&&L(b),A=i.getCurrentProgram(),N=A&&A.getResolvedProjectReferenceToRedirect(l),w=N?!u||u.sourceFile.path!==N.sourceFile.path:!!u,F=e.createModeAwareCache(),P=0,I=0,O=c;IF+1?{dir:i.slice(0,F+1).join(e.directorySeparator),dirPath:n.slice(0,F+1).join(e.directorySeparator)}:{dir:N,dirPath:w,nonRecursive:!1}}return K(e.getDirectoryPath(e.getNormalizedAbsolutePath(t,y())),e.getDirectoryPath(r))}function K(t,n){for(;e.pathContainsNodeModules(n);)t=e.getDirectoryPath(t),n=e.getDirectoryPath(n);if(e.isNodeModulesDirectory(n))return r(e.getDirectoryPath(n))?{dir:t,dirPath:n}:void 0;var i,a,o=!0;if(void 0!==w)for(;!M(n,w);){var s=e.getDirectoryPath(n);if(s===n)break;o=!1,i=n,a=t,n=s,t=e.getDirectoryPath(t)}return r(n)?{dir:a||t,dirPath:i||n,nonRecursive:o}:void 0}function z(t){return e.fileExtensionIsOneOf(t,E)}function G(t,r,n,a){if(r.refCount)r.refCount++,e.Debug.assertIsDefined(r.files);else{r.refCount=1,e.Debug.assert(0===e.length(r.files)),e.isExternalModuleNameRelative(t)?q(r):p.add(t,r);var o=a(r);o&&o.resolvedFileName&&m.add(i.toPath(o.resolvedFileName),r)}(r.files||(r.files=[])).push(n)}function q(t){e.Debug.assert(!!t.refCount);var r=t.failedLookupLocations;if(r.length){f.push(t);for(var n=!1,a=0,o=r;a1),k.set(u,p-1))),_===w?o=!0:X(_)}}o&&X(w)}}}function X(e){A.get(e).refCount--}function $(e,t,r){return i.watchDirectoryOfFailedLookupLocation(e,(function(e){var r=i.toPath(e);h&&h.addOrDeleteFileOrDirectory(e,r),te(r,t===r)}),r?0:1)}function Y(e,t,r){var n=e.get(t);n&&(n.forEach((function(e){return Q(e,t,r)})),e.delete(t))}function Z(e){Y(v,e,I),Y(D,e,O)}function ee(t,r){if(!t)return!1;for(var n=!1,i=0,a=t;i1&&r.sort(m),s.push.apply(s,r));var i=e.getDirectoryPath(t);if(i===t)return o=t,"break";o=t=i},l=e.getDirectoryPath(t);0!==a.size;){var u=c(l);if(l=o,"break"===u)break}if(a.size){var d=e.arrayFrom(a.values());d.length>1&&d.sort(m),s.push.apply(s,d)}return s}function b(t,r,n){for(var i in n)for(var a=0,o=n[i];a=u.length+d.length&&e.startsWith(r,u)&&e.endsWith(r,d)||!d&&r===e.removeTrailingDirectorySeparator(u)){var _=r.substr(u.length,r.length-d.length-u.length);return i.replace("*",_)}}else if(c===r||c===t)return i}}function x(t,r,n,i,a,o,s){if(void 0===s&&(s=0),"string"==typeof a){var c=e.getNormalizedAbsolutePath(e.combinePaths(n,a),void 0),l=e.hasTSFileExtension(r)?e.removeFileExtension(r)+E(r,t):void 0;switch(s){case 0:if(0===e.comparePaths(r,c)||l&&0===e.comparePaths(l,c))return{moduleFileToTry:i};break;case 1:if(e.containsPath(c,r)){var u=e.getRelativePathFromDirectory(c,r,!1);return{moduleFileToTry:e.getNormalizedAbsolutePath(e.combinePaths(e.combinePaths(i,a),u),void 0)}}break;case 2:var d=c.indexOf("*"),_=c.slice(0,d),p=c.slice(d+1);if(e.startsWith(r,_)&&e.endsWith(r,p)){var f=r.slice(_.length,r.length-p.length);return{moduleFileToTry:i.replace("*",f)}}if(l&&e.startsWith(l,_)&&e.endsWith(l,p)){f=l.slice(_.length,l.length-p.length);return{moduleFileToTry:i.replace("*",f)}}}}else{if(Array.isArray(a))return e.forEach(a,(function(e){return x(t,r,n,i,e,o)}));if("object"==typeof a&&null!==a){if(e.allKeysStartWithDot(a))return e.forEach(e.getOwnKeys(a),(function(s){var c=e.getNormalizedAbsolutePath(e.combinePaths(i,s),void 0),l=e.endsWith(s,"/")?1:e.stringContains(s,"*")?2:0;return x(t,r,n,c,a[s],o,l)}));for(var m=0,g=e.getOwnKeys(a);m=0||e.isApplicableVersionedTypesKey(o,y)){var h=a[y],v=x(t,r,n,i,h,o);if(v)return v}}}}}function S(t,r,i,a,o,c,l,u){var d=t.path,_=t.isRedirect,p=r.getCanonicalFileName,f=r.sourceDirectory;if(a.fileExists&&a.readFile){var m=e.getNodeModulePathParts(d);if(m){var g=d,y=!1;if(!l)for(var h=s(a,c,o,i),v=m.packageRootIndex,S=void 0;;){var D=O(v),T=D.moduleFileToTry,k=D.packageRootPath,A=D.blockedByExports,N=D.verbatimFromExports;if(e.getEmitModuleResolutionKind(o)!==e.ModuleResolutionKind.Classic){if(A)return;if(N)return T}if(k){g=k,y=!0;break}if(S||(S=T),-1===(v=d.indexOf(e.directorySeparator,v+1))){g=C(S,h.ending,o,a);break}}if(!_||y){var w=a.getGlobalTypingsCacheLocation&&a.getGlobalTypingsCacheLocation(),F=p(g.substring(0,m.topLevelNodeModulesIndex));if(e.startsWith(f,F)||w&&e.startsWith(p(w),F)){var P=g.substring(m.topLevelPackageNameIndex+1),I=e.getPackageNameFromTypesPackageName(P);return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Classic&&I===P?void 0:I}}}}function O(t){var r,s,c=d.substring(0,t),l=e.combinePaths(c,"package.json"),_=d,f=null===(s=null===(r=a.getPackageJsonInfoCache)||void 0===r?void 0:r.call(a))||void 0===s?void 0:s.getPackageJsonInfo(l);if("object"==typeof f||void 0===f&&a.fileExists(l)){var g=(null==f?void 0:f.packageJsonContent)||JSON.parse(a.readFile(l));if(e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.Node16||e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeNext){var y=["node",u||i.impliedNodeFormat===e.ModuleKind.ESNext?"import":"require","types"],h=g.exports&&"string"==typeof g.name?x(o,d,c,e.getPackageNameFromTypesPackageName(g.name),g.exports,y):void 0;if(h){var v=e.hasTSFileExtension(h.moduleFileToTry)?{moduleFileToTry:e.removeFileExtension(h.moduleFileToTry)+E(h.moduleFileToTry,o)}:h;return n(n({},v),{verbatimFromExports:!0})}if(g.exports)return{moduleFileToTry:d,blockedByExports:!0}}var S=g.typesVersions?e.getPackageJsonTypesVersionsPaths(g.typesVersions):void 0;if(S){var D=d.slice(c.length+1),T=b(e.removeFileExtension(D),C(D,0,o),S.paths);void 0!==T&&(_=e.combinePaths(c,T))}var k=g.typings||g.types||g.main||"index.js";if(e.isString(k)){var A=e.toPath(k,c,p);if(e.removeFileExtension(A)===e.removeFileExtension(p(_)))return{packageRootPath:c,moduleFileToTry:_}}}else{var N=p(_.substring(m.packageRootIndex+1));if("index.d.ts"===N||"index.js"===N||"index.ts"===N||"index.tsx"===N)return{moduleFileToTry:_,packageRootPath:c}}return{moduleFileToTry:_}}}function D(t,r,n){return e.firstDefined(r,(function(e){var r=k(t,e,n);return void 0!==r&&A(r)?void 0:r}))}function C(t,r,n,i){if(e.fileExtensionIsOneOf(t,[".json",".mjs",".cjs"]))return t;var a=e.removeFileExtension(t);if(t===a)return t;if(e.fileExtensionIsOneOf(t,[".d.mts",".mts",".d.cts",".cts"]))return a+T(t,n);switch(r){case 0:var o=e.removeSuffix(a,"/index");return i&&o!==a&&function(t,r){if(t.fileExists)for(var n=0,i=e.flatten(e.getSupportedExtensions({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));n1?function(t,r){var n=t.filter((function(e,t,r){return t===r.findIndex((function(t){return(null==t?void 0:t.fileName)===(null==e?void 0:e.fileName)}))}));if(0===n.length)return"";var i=function(e){return Math.log(e)*Math.LOG10E+1},a=n.map((function(r){return[r,e.countWhere(t,(function(e){return e.fileName===r.fileName}))]})),o=a.reduce((function(e,t){return Math.max(e,t[1]||0)}),0),s=e.Diagnostics.Errors_Files.message,c=s.split(" ")[0].length,l=Math.max(c,i(o)),d=Math.max(i(o)-c,0),_="";return _+=" ".repeat(d)+s+"\n",a.forEach((function(e){var t=e[0],n=e[1],i=Math.log(n)*Math.LOG10E+1|0,a=i0?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:d.length>0?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.Success}function S(t,r){return void 0===t&&(t=e.sys),{onWatchStatusChange:r||o(t),watchFile:e.maybeBind(t,t.watchFile)||e.returnNoopFileWatcher,watchDirectory:e.maybeBind(t,t.watchDirectory)||e.returnNoopFileWatcher,setTimeout:e.maybeBind(t,t.setTimeout)||e.noop,clearTimeout:e.maybeBind(t,t.clearTimeout)||e.noop}}function D(t,r){var n=e.memoize((function(){return e.getDirectoryPath(e.normalizePath(t.getExecutingFilePath()))}));return{useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames},getNewLine:function(){return t.newLine},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),getDefaultLibLocation:n,getDefaultLibFileName:function(t){return e.combinePaths(n(),e.getDefaultLibFileName(t))},fileExists:function(e){return t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:function(e){return t.directoryExists(e)},getDirectories:function(e){return t.getDirectories(e)},readDirectory:function(e,r,n,i,a){return t.readDirectory(e,r,n,i,a)},realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable),trace:function(e){return t.write(e+t.newLine)},createDirectory:function(e){return t.createDirectory(e)},writeFile:function(e,r,n){return t.writeFile(e,r,n)},createHash:e.maybeBind(t,t.createHash),createProgram:r||e.createEmitAndSemanticDiagnosticsBuilderProgram,disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit}}function C(t,r,n,i){void 0===t&&(t=e.sys);var a=function(e){return t.write(e+t.newLine)},o=D(t,r);return e.copyProperties(o,S(t,i)),o.afterProgramCreate=function(r){var i=r.getCompilerOptions(),s=e.getNewLineCharacter(i,(function(){return t.newLine}));b(r,n,a,(function(t){return o.onWatchStatusChange(e.createCompilerDiagnostic(l(t),t),s,i,t)}))},o}function T(t,r,n){r(n),t.exit(e.ExitStatus.DiagnosticsPresent_OutputsSkipped)}e.createDiagnosticReporter=n,e.screenStartingMessageCodes=[e.Diagnostics.Starting_compilation_in_watch_mode.code,e.Diagnostics.File_change_detected_Starting_incremental_compilation.code],e.getLocaleTimeString=a,e.createWatchStatusReporter=o,e.parseConfigFileWithSystem=function(t,r,n,i,a,o){var s=a;s.onUnRecoverableConfigFileDiagnostic=function(e){return T(a,o,e)};var c=e.getParsedCommandLineOfConfigFile(t,r,s,n,i);return s.onUnRecoverableConfigFileDiagnostic=void 0,c},e.getErrorCountForSummary=s,e.getFilesInErrorForSummary=c,e.getWatchErrorSummaryDiagnosticMessage=l,e.getErrorSummaryText=d,e.isBuilderProgram=_,e.listFiles=p,e.explainFiles=f,e.explainIfFileIsRedirect=m,e.getMatchedFileSpec=g,e.getMatchedIncludeSpec=y,e.fileIncludeReasonToDiagnostics=h,e.emitFilesAndReportErrors=b,e.emitFilesAndReportErrorsAndGetExitStatus=x,e.noopFileWatcher={close:e.noop},e.returnNoopFileWatcher=function(){return e.noopFileWatcher},e.createWatchHost=S,e.WatchType={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file"},e.createWatchFactory=function(t,r){var n=t.trace?r.extendedDiagnostics?e.WatchLogLevel.Verbose:r.diagnostics?e.WatchLogLevel.TriggerOnly:e.WatchLogLevel.None:e.WatchLogLevel.None,i=n!==e.WatchLogLevel.None?function(e){return t.trace(e)}:e.noop,a=e.getWatchFactory(t,n,i);return a.writeLog=i,a},e.createCompilerHostFromProgramHost=function(t,r,n){void 0===n&&(n=t);var i=t.useCaseSensitiveFileNames(),a=e.memoize((function(){return t.getNewLine()}));return{getSourceFile:function(n,i,a){var o;try{e.performance.mark("beforeIORead"),o=t.readFile(n,r().charset),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead")}catch(e){a&&a(e.message),o=""}return void 0!==o?e.createSourceFile(n,o,i):void 0},getDefaultLibLocation:e.maybeBind(t,t.getDefaultLibLocation),getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:function(r,n,i,a){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,n,i,(function(e,r,n){return t.writeFile(e,r,n)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite")}catch(e){a&&a(e.message)}},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return i},getCanonicalFileName:e.createGetCanonicalFileName(i),getNewLine:function(){return e.getNewLineCharacter(r(),a)},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile(e)},trace:e.maybeBind(t,t.trace),directoryExists:e.maybeBind(n,n.directoryExists),getDirectories:e.maybeBind(n,n.getDirectories),realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable)||function(){return""},createHash:e.maybeBind(t,t.createHash),readDirectory:e.maybeBind(t,t.readDirectory),disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature,storeFilesChangingSignatureDuringEmit:t.storeFilesChangingSignatureDuringEmit}},e.setGetSourceFileAsHashVersioned=function(t,n){var i=t.getSourceFile,a=e.maybeBind(n,n.createHash)||e.generateDjb2Hash;t.getSourceFile=function(){for(var e=[],n=0;ne?t:e}function l(e){return!!e&&!!e.buildOrder}function u(e){return l(e)?e.buildOrder:e}function d(t,r){return function(n){var i=r?"[".concat(e.formatColorAndReset(e.getLocaleTimeString(t),e.ForegroundColorEscapeSequences.Grey),"] "):"".concat(e.getLocaleTimeString(t)," - ");i+="".concat(e.flattenDiagnosticMessageText(n.messageText,t.newLine)).concat(t.newLine+t.newLine),t.write(i)}}function _(t,r,n,i){var a=e.createProgramHost(t,r);return a.getModifiedTime=t.getModifiedTime?function(e){return t.getModifiedTime(e)}:e.returnUndefined,a.setModifiedTime=t.setModifiedTime?function(e,r){return t.setModifiedTime(e,r)}:e.noop,a.deleteFile=t.deleteFile?function(e){return t.deleteFile(e)}:e.noop,a.reportDiagnostic=n||e.createDiagnosticReporter(t),a.reportSolutionBuilderStatus=i||d(t),a.now=e.maybeBind(t,t.now),a}function p(t,r,n,i,a){var o,s,c=r,l=r,u=c.getCurrentDirectory(),d=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),_=(o=i,s={},e.commonOptionsWithBuild.forEach((function(t){e.hasProperty(o,t.name)&&(s[t.name]=o[t.name])})),s),p=e.createCompilerHostFromProgramHost(c,(function(){return C.projectCompilerOptions}));e.setGetSourceFileAsHashVersioned(p,c),p.getParsedCommandLine=function(e){return h(C,e,m(C,e))},p.resolveModuleNames=e.maybeBind(c,c.resolveModuleNames),p.resolveTypeReferenceDirectives=e.maybeBind(c,c.resolveTypeReferenceDirectives);var f=p.resolveModuleNames?void 0:e.createModuleResolutionCache(u,d),g=p.resolveTypeReferenceDirectives?void 0:e.createTypeReferenceDirectiveResolutionCache(u,d,void 0,null==f?void 0:f.getPackageJsonInfoCache());if(!p.resolveModuleNames){var y=function(t,r,n,i){return e.resolveModuleName(t,n,C.projectCompilerOptions,p,f,i,r).resolvedModule};p.resolveModuleNames=function(t,r,n,i,a,o){return e.loadWithModeAwareCache(e.Debug.checkEachDefined(t),e.Debug.checkDefined(o),r,i,y)},p.getModuleResolutionCache=function(){return f}}if(!p.resolveTypeReferenceDirectives){var v=function(t,r,n,i){return e.resolveTypeReferenceDirective(t,r,C.projectCompilerOptions,p,n,C.typeReferenceDirectiveResolutionCache,i).resolvedTypeReferenceDirective};p.resolveTypeReferenceDirectives=function(t,r,n,i,a){return e.loadWithTypeDirectiveCache(e.Debug.checkEachDefined(t),r,n,a,v)}}var b=e.createWatchFactory(l,i),x=b.watchFile,S=b.watchDirectory,D=b.writeLog,C={host:c,hostWithWatch:l,currentDirectory:u,getCanonicalFileName:d,parseConfigFileHost:e.parseConfigHostFromCompilerHostLike(c),write:e.maybeBind(c,c.trace),options:i,baseCompilerOptions:_,rootNames:n,baseWatchOptions:a,resolvedConfigFilePaths:new e.Map,configFileCache:new e.Map,projectStatus:new e.Map,buildInfoChecked:new e.Map,extendedConfigCache:new e.Map,builderPrograms:new e.Map,diagnostics:new e.Map,projectPendingBuild:new e.Map,projectErrorsReported:new e.Map,compilerHost:p,moduleResolutionCache:f,typeReferenceDirectiveResolutionCache:g,buildOrder:void 0,readFileWithCache:function(e){return c.readFile(e)},projectCompilerOptions:_,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:t,currentInvalidatedProject:void 0,watch:t,allWatchedWildcardDirectories:new e.Map,allWatchedInputFiles:new e.Map,allWatchedConfigFiles:new e.Map,allWatchedExtendedConfigFiles:new e.Map,allWatchedPackageJsonFiles:new e.Map,lastCachedPackageJsonLookups:new e.Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:x,watchDirectory:S,writeLog:D};return C}function f(t,r){return e.toPath(r,t.currentDirectory,t.getCanonicalFileName)}function m(e,t){var r=e.resolvedConfigFilePaths,n=r.get(t);if(void 0!==n)return n;var i=f(e,t);return r.set(t,i),i}function g(e){return!!e.options}function y(e,t){var r=e.configFileCache.get(t);return r&&g(r)?r:void 0}function h(t,r,n){var i,a=t.configFileCache,o=a.get(n);if(o)return g(o)?o:void 0;var s,c=t.parseConfigFileHost,l=t.baseCompilerOptions,u=t.baseWatchOptions,d=t.extendedConfigCache,_=t.host;return _.getParsedCommandLine?(s=_.getParsedCommandLine(r))||(i=e.createCompilerDiagnostic(e.Diagnostics.File_0_not_found,r)):(c.onUnRecoverableConfigFileDiagnostic=function(e){return i=e},s=e.getParsedCommandLineOfConfigFile(r,l,c,d,u),c.onUnRecoverableConfigFileDiagnostic=e.noop),a.set(n,s||i),s}function v(t,r){return e.resolveConfigFileProjectName(e.resolvePath(t.currentDirectory,r))}function b(t,r){for(var n,i,a=new e.Map,o=new e.Map,s=[],c=0,l=r;co)}}}function F(t,r,n){var i=t.options;return!(r.type===e.UpToDateStatusType.OutOfDateWithPrepend&&!i.force)||(0===n.fileNames.length||!!e.getConfigFileParsingDiagnostics(n).length||!e.isIncrementalCompilation(n.options))}function P(t,r,i){if(t.projectPendingBuild.size&&!l(r)){if(t.currentInvalidatedProject)return e.arrayIsEqualTo(t.currentInvalidatedProject.buildOrder,r)?t.currentInvalidatedProject:void 0;for(var a=t.options,o=t.projectPendingBuild,s=0;sl&&(s=p,l=f)}}if(!r.fileNames.length&&!e.canJsonReportNoInputFiles(r.raw))return{type:e.UpToDateStatusType.ContainerOnly};var g,y=e.getAllProjectOutputs(r,!u.useCaseSensitiveFileNames()),v="(none)",b=o,x="(none)",S=a,D=a,C=!1;if(!i)for(var T=0,E=y;TS&&(S=A,x=k),e.isDeclarationFileName(k)&&(D=c(D,e.getModifiedTime(u,k)))}var N,w=!1,F=!1;if(r.projectReferences){t.projectStatus.set(n,{type:e.UpToDateStatusType.ComputingUpstream});for(var P=0,I=r.projectReferences;P=0},t.findArgument=function(t){var r=e.sys.args.indexOf(t);return r>=0&&r214)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){var r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){var n=s(r[1],!1);if(0!==n)return{name:r[1],isScopeName:!0,result:n};var i=s(r[2],!1);return 0!==i?{name:r[2],isScopeName:!1,result:i}:0}}return encodeURIComponent(e)!==e?5:0}function c(t,r,n,i){var a=i?"Scope":"Package";switch(r){case 1:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot be empty");case 2:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' should be less than ").concat(214," characters");case 3:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '.'");case 4:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '_'");case 5:return"'".concat(t,"':: ").concat(a," name '").concat(n,"' contains non URI safe characters");case 0:return e.Debug.fail();default:throw e.Debug.assertNever(r)}}t.validatePackageName=function(e){return s(e,!0)},t.renderPackageNameValidationFailure=function(e,t){return"object"==typeof e?c(t,e.result,e.name,e.isScopeName):c(t,e,t,!1)}}(e.JsTyping||(e.JsTyping={}))}(c||(c={})),function(e){var t,r,n,i,a,o,s,c,l,u,d,_,p,f,m,g,y,h,v,b,x;function S(e){return{indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:u.Smart,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:d.Ignore,trimTrailingWhitespace:!0}}t=e.ScriptSnapshot||(e.ScriptSnapshot={}),r=function(){function e(e){this.text=e}return e.prototype.getText=function(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(){},e}(),t.fromString=function(e){return new r(e)},(n=e.PackageJsonDependencyGroup||(e.PackageJsonDependencyGroup={}))[n.Dependencies=1]="Dependencies",n[n.DevDependencies=2]="DevDependencies",n[n.PeerDependencies=4]="PeerDependencies",n[n.OptionalDependencies=8]="OptionalDependencies",n[n.All=15]="All",(i=e.PackageJsonAutoImportPreference||(e.PackageJsonAutoImportPreference={}))[i.Off=0]="Off",i[i.On=1]="On",i[i.Auto=2]="Auto",(a=e.LanguageServiceMode||(e.LanguageServiceMode={}))[a.Semantic=0]="Semantic",a[a.PartialSemantic=1]="PartialSemantic",a[a.Syntactic=2]="Syntactic",e.emptyOptions={},(o=e.SemanticClassificationFormat||(e.SemanticClassificationFormat={})).Original="original",o.TwentyTwenty="2020",(s=e.CompletionTriggerKind||(e.CompletionTriggerKind={}))[s.Invoked=1]="Invoked",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",(c=e.InlayHintKind||(e.InlayHintKind={})).Type="Type",c.Parameter="Parameter",c.Enum="Enum",(l=e.HighlightSpanKind||(e.HighlightSpanKind={})).none="none",l.definition="definition",l.reference="reference",l.writtenReference="writtenReference",function(e){e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart"}(u=e.IndentStyle||(e.IndentStyle={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(d=e.SemicolonPreference||(e.SemicolonPreference={})),e.getDefaultFormatCodeSettings=S,e.testFormatSettings=S("\n"),(_=e.SymbolDisplayPartKind||(e.SymbolDisplayPartKind={}))[_.aliasName=0]="aliasName",_[_.className=1]="className",_[_.enumName=2]="enumName",_[_.fieldName=3]="fieldName",_[_.interfaceName=4]="interfaceName",_[_.keyword=5]="keyword",_[_.lineBreak=6]="lineBreak",_[_.numericLiteral=7]="numericLiteral",_[_.stringLiteral=8]="stringLiteral",_[_.localName=9]="localName",_[_.methodName=10]="methodName",_[_.moduleName=11]="moduleName",_[_.operator=12]="operator",_[_.parameterName=13]="parameterName",_[_.propertyName=14]="propertyName",_[_.punctuation=15]="punctuation",_[_.space=16]="space",_[_.text=17]="text",_[_.typeParameterName=18]="typeParameterName",_[_.enumMemberName=19]="enumMemberName",_[_.functionName=20]="functionName",_[_.regularExpressionLiteral=21]="regularExpressionLiteral",_[_.link=22]="link",_[_.linkName=23]="linkName",_[_.linkText=24]="linkText",(p=e.CompletionInfoFlags||(e.CompletionInfoFlags={}))[p.None=0]="None",p[p.MayIncludeAutoImports=1]="MayIncludeAutoImports",p[p.IsImportStatementCompletion=2]="IsImportStatementCompletion",p[p.IsContinuation=4]="IsContinuation",p[p.ResolvedModuleSpecifiers=8]="ResolvedModuleSpecifiers",p[p.ResolvedModuleSpecifiersBeyondLimit=16]="ResolvedModuleSpecifiersBeyondLimit",p[p.MayIncludeMethodSnippets=32]="MayIncludeMethodSnippets",(f=e.OutliningSpanKind||(e.OutliningSpanKind={})).Comment="comment",f.Region="region",f.Code="code",f.Imports="imports",(m=e.OutputFileType||(e.OutputFileType={}))[m.JavaScript=0]="JavaScript",m[m.SourceMap=1]="SourceMap",m[m.Declaration=2]="Declaration",(g=e.EndOfLineState||(e.EndOfLineState={}))[g.None=0]="None",g[g.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",g[g.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",g[g.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",g[g.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",g[g.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",g[g.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",(y=e.TokenClass||(e.TokenClass={}))[y.Punctuation=0]="Punctuation",y[y.Keyword=1]="Keyword",y[y.Operator=2]="Operator",y[y.Comment=3]="Comment",y[y.Whitespace=4]="Whitespace",y[y.Identifier=5]="Identifier",y[y.NumberLiteral=6]="NumberLiteral",y[y.BigIntLiteral=7]="BigIntLiteral",y[y.StringLiteral=8]="StringLiteral",y[y.RegExpLiteral=9]="RegExpLiteral",(h=e.ScriptElementKind||(e.ScriptElementKind={})).unknown="",h.warning="warning",h.keyword="keyword",h.scriptElement="script",h.moduleElement="module",h.classElement="class",h.localClassElement="local class",h.interfaceElement="interface",h.typeElement="type",h.enumElement="enum",h.enumMemberElement="enum member",h.variableElement="var",h.localVariableElement="local var",h.functionElement="function",h.localFunctionElement="local function",h.memberFunctionElement="method",h.memberGetAccessorElement="getter",h.memberSetAccessorElement="setter",h.memberVariableElement="property",h.constructorImplementationElement="constructor",h.callSignatureElement="call",h.indexSignatureElement="index",h.constructSignatureElement="construct",h.parameterElement="parameter",h.typeParameterElement="type parameter",h.primitiveType="primitive type",h.label="label",h.alias="alias",h.constElement="const",h.letElement="let",h.directory="directory",h.externalModuleName="external module name",h.jsxAttribute="JSX attribute",h.string="string",h.link="link",h.linkName="link name",h.linkText="link text",(v=e.ScriptElementKindModifier||(e.ScriptElementKindModifier={})).none="",v.publicMemberModifier="public",v.privateMemberModifier="private",v.protectedMemberModifier="protected",v.exportedModifier="export",v.ambientModifier="declare",v.staticModifier="static",v.abstractModifier="abstract",v.optionalModifier="optional",v.deprecatedModifier="deprecated",v.dtsModifier=".d.ts",v.tsModifier=".ts",v.tsxModifier=".tsx",v.jsModifier=".js",v.jsxModifier=".jsx",v.jsonModifier=".json",v.dmtsModifier=".d.mts",v.mtsModifier=".mts",v.mjsModifier=".mjs",v.dctsModifier=".d.cts",v.ctsModifier=".cts",v.cjsModifier=".cjs",(b=e.ClassificationTypeNames||(e.ClassificationTypeNames={})).comment="comment",b.identifier="identifier",b.keyword="keyword",b.numericLiteral="number",b.bigintLiteral="bigint",b.operator="operator",b.stringLiteral="string",b.whiteSpace="whitespace",b.text="text",b.punctuation="punctuation",b.className="class name",b.enumName="enum name",b.interfaceName="interface name",b.moduleName="module name",b.typeParameterName="type parameter name",b.typeAliasName="type alias name",b.parameterName="parameter name",b.docCommentTagName="doc comment tag name",b.jsxOpenTagName="jsx open tag name",b.jsxCloseTagName="jsx close tag name",b.jsxSelfClosingTagName="jsx self closing tag name",b.jsxAttribute="jsx attribute",b.jsxText="jsx text",b.jsxAttributeStringLiteralValue="jsx attribute string literal value",(x=e.ClassificationType||(e.ClassificationType={}))[x.comment=1]="comment",x[x.identifier=2]="identifier",x[x.keyword=3]="keyword",x[x.numericLiteral=4]="numericLiteral",x[x.operator=5]="operator",x[x.stringLiteral=6]="stringLiteral",x[x.regularExpressionLiteral=7]="regularExpressionLiteral",x[x.whiteSpace=8]="whiteSpace",x[x.text=9]="text",x[x.punctuation=10]="punctuation",x[x.className=11]="className",x[x.enumName=12]="enumName",x[x.interfaceName=13]="interfaceName",x[x.moduleName=14]="moduleName",x[x.typeParameterName=15]="typeParameterName",x[x.typeAliasName=16]="typeAliasName",x[x.parameterName=17]="parameterName",x[x.docCommentTagName=18]="docCommentTagName",x[x.jsxOpenTagName=19]="jsxOpenTagName",x[x.jsxCloseTagName=20]="jsxCloseTagName",x[x.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",x[x.jsxAttribute=22]="jsxAttribute",x[x.jsxText=23]="jsxText",x[x.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",x[x.bigintLiteral=25]="bigintLiteral"}(c||(c={})),function(e){var t;function r(t){switch(t.kind){case 254:return e.isInJSFile(t)&&e.getJSDocEnumTag(t)?7:1;case 164:case 203:case 167:case 166:case 296:case 297:case 169:case 168:case 171:case 172:case 173:case 256:case 213:case 214:case 292:case 285:return 1;case 163:case 258:case 259:case 182:return 2;case 345:return void 0===t.name?3:2;case 299:case 257:return 3;case 261:return e.isAmbientModule(t)||1===e.getModuleInstanceState(t)?5:4;case 260:case 269:case 270:case 265:case 266:case 271:case 272:return 7;case 305:return 5}return 7}function i(t){for(;161===t.parent.kind;)t=t.parent;return e.isInternalModuleImportEqualsDeclaration(t.parent)&&t.parent.moduleReference===t}function a(e){return e.expression}function o(e){return e.tag}function s(e){return e.tagName}function c(t,r,n,i,a){var o=i?u(t):l(t);return a&&(o=e.skipOuterExpressions(o)),!!o&&!!o.parent&&r(o.parent)&&n(o.parent)===o}function l(e){return p(e)?e.parent:e}function u(e){return p(e)||f(e)?e.parent:e}function d(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isBreakOrContinueStatement))||void 0===r?void 0:r.label)===t}function _(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isLabeledStatement))||void 0===r?void 0:r.label)===t}function p(t){var r;return(null===(r=e.tryCast(t.parent,e.isPropertyAccessExpression))||void 0===r?void 0:r.name)===t}function f(t){var r;return(null===(r=e.tryCast(t.parent,e.isElementAccessExpression))||void 0===r?void 0:r.argumentExpression)===t}e.scanner=e.createScanner(99,!0),(t=e.SemanticMeaning||(e.SemanticMeaning={}))[t.None=0]="None",t[t.Value=1]="Value",t[t.Type=2]="Type",t[t.Namespace=4]="Namespace",t[t.All=7]="All",e.getMeaningFromDeclaration=r,e.getMeaningFromLocation=function(t){var n=(t=I(t)).parent;return 305===t.kind?1:e.isExportAssignment(n)||e.isExportSpecifier(n)||e.isExternalModuleReference(n)||e.isImportSpecifier(n)||e.isImportClause(n)||e.isImportEqualsDeclaration(n)&&t===n.name?7:i(t)?function(t){var r=161===t.kind?t:e.isQualifiedName(t.parent)&&t.parent.right===t?t.parent:void 0;return r&&265===r.parent.kind?7:4}(t):e.isDeclarationName(t)?r(n):e.isEntityName(t)&&e.findAncestor(t,e.or(e.isJSDocNameReference,e.isJSDocLinkLike,e.isJSDocMemberName))?7:function(t){e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent);switch(t.kind){case 108:return!e.isExpressionNode(t);case 192:return!0}switch(t.parent.kind){case 178:return!0;case 200:return!t.parent.isTypeOf;case 228:return e.isPartOfTypeNode(t.parent)}return!1}(t)?2:function(e){return function(e){var t=e,r=!0;if(161===t.parent.kind){for(;t.parent&&161===t.parent.kind;)t=t.parent;r=t.right===e}return 178===t.parent.kind&&!r}(e)||function(e){var t=e,r=!0;if(206===t.parent.kind){for(;t.parent&&206===t.parent.kind;)t=t.parent;r=t.name===e}if(!r&&228===t.parent.kind&&291===t.parent.parent.kind){var n=t.parent.parent.parent;return 257===n.kind&&117===t.parent.parent.token||258===n.kind&&94===t.parent.parent.token}return!1}(e)}(t)?4:e.isTypeParameterDeclaration(n)?(e.Debug.assert(e.isJSDocTemplateTag(n.parent)),2):e.isLiteralTypeNode(n)?3:1},e.isInRightSideOfInternalImportEqualsDeclaration=i,e.isCallExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isCallExpression,a,r,n)},e.isNewExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isNewExpression,a,r,n)},e.isCallOrNewExpressionTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isCallOrNewExpression,a,r,n)},e.isTaggedTemplateTag=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isTaggedTemplateExpression,o,r,n)},e.isDecoratorTarget=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isDecorator,a,r,n)},e.isJsxOpeningLikeElementTagName=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),c(t,e.isJsxOpeningLikeElement,s,r,n)},e.climbPastPropertyAccess=l,e.climbPastPropertyOrElementAccess=u,e.getTargetLabel=function(e,t){for(;e;){if(250===e.kind&&e.label.escapedText===t)return e.label;e=e.parent}},e.hasPropertyAccessExpressionWithName=function(t,r){return!!e.isPropertyAccessExpression(t.expression)&&t.expression.name.text===r},e.isJumpStatementTarget=d,e.isLabelOfLabeledStatement=_,e.isLabelName=function(e){return _(e)||d(e)},e.isTagName=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isJSDocTag))||void 0===r?void 0:r.tagName)===t},e.isRightSideOfQualifiedName=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isQualifiedName))||void 0===r?void 0:r.right)===t},e.isRightSideOfPropertyAccess=p,e.isArgumentExpressionOfElementAccess=f,e.isNameOfModuleDeclaration=function(t){var r;return(null===(r=e.tryCast(t.parent,e.isModuleDeclaration))||void 0===r?void 0:r.name)===t},e.isNameOfFunctionDeclaration=function(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isFunctionLike))||void 0===r?void 0:r.name)===t},e.isLiteralNameOfPropertyDeclarationOrIndexAccess=function(t){switch(t.parent.kind){case 167:case 166:case 296:case 299:case 169:case 168:case 172:case 173:case 261:return e.getNameOfDeclaration(t.parent)===t;case 207:return t.parent.argumentExpression===t;case 162:return!0;case 196:return 194===t.parent.parent.kind;default:return!1}},e.isExpressionOfExternalModuleImportEqualsDeclaration=function(t){return e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t},e.getContainerNode=function(t){for(e.isJSDocTypeAlias(t)&&(t=t.parent.parent);;){if(!(t=t.parent))return;switch(t.kind){case 305:case 169:case 168:case 256:case 213:case 172:case 173:case 257:case 258:case 260:case 261:return t}}},e.getNodeKind=function t(r){switch(r.kind){case 305:return e.isExternalModule(r)?"module":"script";case 261:return"module";case 257:case 226:return"class";case 258:return"interface";case 259:case 338:case 345:return"type";case 260:return"enum";case 254:return c(r);case 203:return c(e.getRootDeclaration(r));case 214:case 256:case 213:return"function";case 172:return"getter";case 173:return"setter";case 169:case 168:return"method";case 296:var n=r.initializer;return e.isFunctionLike(n)?"method":"property";case 167:case 166:case 297:case 298:return"property";case 176:return"index";case 175:return"construct";case 174:return"call";case 171:case 170:return"constructor";case 163:return"type parameter";case 299:return"enum member";case 164:return e.hasSyntacticModifier(r,16476)?"property":"parameter";case 265:case 270:case 275:case 268:case 274:return"alias";case 221:var i=e.getAssignmentDeclarationKind(r),a=r.right;switch(i){case 7:case 8:case 9:case 0:return"";case 1:case 2:var o=t(a);return""===o?"const":o;case 3:case 5:return e.isFunctionExpression(a)?"method":"property";case 4:return"property";case 6:return"local class";default:return e.assertType(i),""}case 79:return e.isImportClause(r.parent)?"alias":"";case 271:var s=t(r.expression);return""===s?"const":s;default:return""}function c(t){return e.isVarConst(t)?"const":e.isLet(t)?"let":"var"}},e.isThis=function(t){switch(t.kind){case 108:return!0;case 79:return e.identifierIsThisKeyword(t)&&164===t.parent.kind;default:return!1}};var m,g=/^\/\/\/\s*=r.end}function b(e,t,r,n){return Math.max(e,r)r?1:u(a[e])?a[e-1]&&u(a[e-1])?1:0:i&&s===r&&a[e-1]&&a[e-1].getEnd()===r&&u(a[e-1])?1:-1}));return o?{value:o}:c>=0&&a[c]?(s=a[c],"continue-outer"):{value:s}};;){var l=c();if("object"==typeof l)return l.value}function u(e){if((n?e.getFullStart():e.getStart(t,!0))>r)return!1;var s=e.getEnd();if(rt.end||e.pos===t.end)&&H(e,n)?r(e):void 0}))}(r)}function B(t,r,n,i){var a=function a(o){if(J(o)&&1!==o.kind)return o;var s=o.getChildren(r),c=e.binarySearchKey(s,t,(function(e,t){return t}),(function(e,r){return t=s[e-1].end?0:1:-1}));if(c>=0&&s[c]){var l=s[c];if(t=t||!H(l,r)||V(l)){var u=U(s,c,r,o.kind);return u&&j(u,r)}return a(l)}}e.Debug.assert(void 0!==n||305===o.kind||1===o.kind||e.isJSDocCommentContainingNode(o));var d=U(s,s.length,r,o.kind);return d&&j(d,r)}(n||r);return e.Debug.assert(!(a&&V(a))),a}function J(t){return e.isToken(t)&&!V(t)}function j(e,t){if(J(e))return e;var r=e.getChildren(t);if(0===r.length)return e;var n=U(r,r.length,t,e.kind);return n&&j(n,t)}function U(t,r,n,i){for(var a=r-1;a>=0;a--){if(V(t[a]))0!==a||11!==i&&279!==i||e.Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(H(t[a],n))return t[a]}}function V(t){return e.isJsxText(t)&&t.containsOnlyTriviaWhiteSpaces}function K(t,r,n){var i=e.tokenToString(t.kind),a=e.tokenToString(r),o=t.getFullStart(),s=n.text.lastIndexOf(a,o);if(-1!==s){if(n.text.lastIndexOf(i,o-1)=r}))}function q(t,r){if(-1!==r.text.lastIndexOf("<",t?t.pos:r.text.length))for(var n=t,i=0,a=0;n;){switch(n.kind){case 29:if((n=B(n.getFullStart(),r))&&28===n.kind&&(n=B(n.getFullStart(),r)),!n||!e.isIdentifier(n))return;if(!i)return e.isDeclarationName(n)?void 0:{called:n,nTypeArguments:a};i--;break;case 49:i=3;break;case 48:i=2;break;case 31:i++;break;case 19:if(!(n=K(n,18,r)))return;break;case 21:if(!(n=K(n,20,r)))return;break;case 23:if(!(n=K(n,22,r)))return;break;case 27:a++;break;case 38:case 79:case 10:case 8:case 9:case 110:case 95:case 112:case 94:case 140:case 24:case 51:case 57:case 58:break;default:if(e.isTypeNode(n))break;return}n=B(n.getFullStart(),r)}}function W(t,r,n){return e.formatting.getRangeOfEnclosingComment(t,r,void 0,n)}function H(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function Q(e,t,r){var n=W(e,t,void 0);return!!n&&r===g.test(e.text.substring(n.pos,n.end))}function X(t,r,n){return e.createTextSpanFromBounds(t.getStart(r),(n||t).getEnd())}function $(t){if(!t.isUnterminated)return e.createTextSpanFromBounds(t.getStart()+1,t.getEnd()-1)}function Y(e,t){return{span:e,newText:t}}function Z(e){return 152===e.kind}function ee(t,r){return{fileExists:function(e){return t.fileExists(e)},getCurrentDirectory:function(){return r.getCurrentDirectory()},readFile:e.maybeBind(r,r.readFile),useCaseSensitiveFileNames:e.maybeBind(r,r.useCaseSensitiveFileNames),getSymlinkCache:e.maybeBind(r,r.getSymlinkCache)||t.getSymlinkCache,getModuleSpecifierCache:e.maybeBind(r,r.getModuleSpecifierCache),getPackageJsonInfoCache:function(){var e;return null===(e=t.getModuleResolutionCache())||void 0===e?void 0:e.getPackageJsonInfoCache()},getGlobalTypingsCacheLocation:e.maybeBind(r,r.getGlobalTypingsCacheLocation),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},getNearestAncestorDirectoryWithPackageJson:e.maybeBind(r,r.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:function(){return t.getFileIncludeReasons()}}}function te(e,t){return n(n({},ee(e,t)),{getCommonSourceDirectory:function(){return e.getCommonSourceDirectory()}})}function re(t,r,n,i,a){return e.factory.createImportDeclaration(void 0,void 0,t||r?e.factory.createImportClause(!!a,t,r&&r.length?e.factory.createNamedImports(r):void 0):void 0,"string"==typeof n?ne(n,i):n,void 0)}function ne(t,r){return e.factory.createStringLiteral(t,0===r)}function ie(t,r){return e.isStringDoubleQuoted(t,r)?1:0}function ae(t,r){if(r.quotePreference&&"auto"!==r.quotePreference)return"single"===r.quotePreference?0:1;var n=t.imports&&e.find(t.imports,(function(t){return e.isStringLiteral(t)&&!e.nodeIsSynthesized(t.parent)}));return n?ie(n,t):1}function oe(t){return"default"!==t.escapedName?t.escapedName:e.firstDefined(t.declarations,(function(t){var r=e.getNameOfDeclaration(t);return r&&79===r.kind?r.escapedText:void 0}))}function se(t,r,n){return e.textSpanContainsPosition(t,r.getStart(n))&&r.getEnd()<=e.textSpanEnd(t)}function ce(e,t){return!!e&&!!t&&e.start===t.start&&e.length===t.length}function le(t){var r=t.declarations?e.firstOrUndefined(t.declarations):void 0;return!!e.findAncestor(r,(function(t){return!!e.isParameter(t)||!(e.isBindingElement(t)||e.isObjectBindingPattern(t)||e.isArrayBindingPattern(t))&&"quit"}))}e.getLineStartPositionForPosition=function(t,r){return e.getLineStarts(r)[r.getLineAndCharacterOfPosition(t).line]},e.rangeContainsRange=y,e.rangeContainsRangeExclusive=function(e,t){return h(e,t.pos)&&h(e,t.end)},e.rangeContainsPosition=function(e,t){return e.pos<=t&&t<=e.end},e.rangeContainsPositionExclusive=h,e.startEndContainsRange=v,e.rangeContainsStartEnd=function(e,t,r){return e.pos<=t&&e.end>=r},e.rangeOverlapsWithStartEnd=function(e,t,r){return b(e.pos,e.end,t,r)},e.nodeOverlapsWithStartEnd=function(e,t,r,n){return b(e.getStart(t),e.end,r,n)},e.startEndOverlapsWithStartEnd=b,e.positionBelongsToNode=function(t,r,n){return e.Debug.assert(t.pos<=r),rn.getStart(t)&&rn.getStart(t)},e.isInJSXText=function(t,r){var n=M(t,r);return!!e.isJsxText(n)||(!(18!==n.kind||!e.isJsxExpression(n.parent)||!e.isJsxElement(n.parent.parent))||!(29!==n.kind||!e.isJsxOpeningLikeElement(n.parent)||!e.isJsxElement(n.parent.parent)))},e.isInsideJsxElement=function(e,t){return function(r){for(;r;)if(r.kind>=279&&r.kind<=288||11===r.kind||29===r.kind||31===r.kind||79===r.kind||19===r.kind||18===r.kind||43===r.kind)r=r.parent;else{if(278!==r.kind)return!1;if(t>r.getStart(e))return!0;r=r.parent}return!1}(M(e,t))},e.findPrecedingMatchingToken=K,e.removeOptionality=z,e.isPossiblyTypeArgumentPosition=function t(r,n,i){var a=q(r,n);return void 0!==a&&(e.isPartOfTypeNode(a.called)||0!==G(a.called,a.nTypeArguments,i).length||t(a.called,n,i))},e.getPossibleGenericSignatures=G,e.getPossibleTypeArgumentsInfo=q,e.isInComment=W,e.hasDocComment=function(t,r){var n=M(t,r);return!!e.findAncestor(n,e.isJSDoc)},e.getNodeModifiers=function(t,r){void 0===r&&(r=0);var n=[],i=e.isDeclaration(t)?e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t)&~r:0;return 8&i&&n.push("private"),16&i&&n.push("protected"),4&i&&n.push("public"),(32&i||e.isClassStaticBlockDeclaration(t))&&n.push("static"),128&i&&n.push("abstract"),1&i&&n.push("export"),8192&i&&n.push("deprecated"),16777216&t.flags&&n.push("declare"),271===t.kind&&n.push("export"),n.length>0?n.join(","):""},e.getTypeArgumentOrTypeParameterList=function(t){return 178===t.kind||208===t.kind?t.typeArguments:e.isFunctionLike(t)||257===t.kind||258===t.kind?t.typeParameters:void 0},e.isComment=function(e){return 2===e||3===e},e.isStringOrRegularExpressionOrTemplateLiteral=function(t){return!(10!==t&&13!==t&&!e.isTemplateLiteralKind(t))},e.isPunctuation=function(e){return 18<=e&&e<=78},e.isInsideTemplateLiteral=function(t,r,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart(n)=2||!!t.noEmit},e.createModuleSpecifierResolutionHost=ee,e.getModuleSpecifierResolverHost=te,e.moduleResolutionRespectsExports=function(t){return t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.moduleResolutionUsesNodeModules=function(t){return t===e.ModuleResolutionKind.NodeJs||t>=e.ModuleResolutionKind.Node16&&t<=e.ModuleResolutionKind.NodeNext},e.makeImportIfNecessary=function(e,t,r,n){return e||t&&t.length?re(e,t,r,n):void 0},e.makeImport=re,e.makeStringLiteral=ne,(m=e.QuotePreference||(e.QuotePreference={}))[m.Single=0]="Single",m[m.Double=1]="Double",e.quotePreferenceFromString=ie,e.getQuotePreference=ae,e.getQuoteFromPreference=function(t){switch(t){case 0:return"'";case 1:return'"';default:return e.Debug.assertNever(t)}},e.symbolNameNoDefault=function(t){var r=oe(t);return void 0===r?void 0:e.unescapeLeadingUnderscores(r)},e.symbolEscapedNameNoDefault=oe,e.isModuleSpecifierLike=function(t){return e.isStringLiteralLike(t)&&(e.isExternalModuleReference(t.parent)||e.isImportDeclaration(t.parent)||e.isRequireCall(t.parent,!1)&&t.parent.arguments[0]===t||e.isImportCall(t.parent)&&t.parent.arguments[0]===t)},e.isObjectBindingElementWithoutPropertyName=function(t){return e.isBindingElement(t)&&e.isObjectBindingPattern(t.parent)&&e.isIdentifier(t.name)&&!t.propertyName},e.getPropertySymbolFromBindingElement=function(e,t){var r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)},e.getParentNodeInSpan=function(t,r,n){if(t)for(;t.parent;){if(e.isSourceFile(t.parent)||!se(n,t.parent,r))return t;t=t.parent}},e.findModifier=function(t,r){return t.modifiers&&e.find(t.modifiers,(function(e){return e.kind===r}))},e.insertImports=function(t,r,n,i){var a=237===(e.isArray(n)?n[0]:n).kind?e.isRequireVariableStatement:e.isAnyImportSyntax,o=e.filter(r.statements,a),s=e.isArray(n)?e.stableSort(n,e.OrganizeImports.compareImportsOrRequireStatements):[n];if(o.length)if(o&&e.OrganizeImports.importsAreSorted(o))for(var c=0,l=s;ca&&r&&"..."!==r&&(e.isWhiteSpaceLike(r.charCodeAt(r.length-1))||t.push(_e(" ",e.SymbolDisplayPartKind.space)),t.push(_e("...",e.SymbolDisplayPartKind.punctuation))),t},writeKeyword:function(t){return c(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return c(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeTrailingSemicolon:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return c(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return c(t,e.SymbolDisplayPartKind.parameterName)},writeProperty:function(t){return c(t,e.SymbolDisplayPartKind.propertyName)},writeLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeSymbol:function(e,r){if(i>a)return;s(),i+=e.length,t.push(de(e,r))},writeLine:function(){if(i>a)return;i+=1,t.push(he()),r=!0},write:o,writeComment:o,getText:function(){return""},getTextPos:function(){return 0},getColumn:function(){return 0},getLine:function(){return 0},isAtStartOfLine:function(){return!1},hasTrailingWhitespace:function(){return!1},hasTrailingComment:function(){return!1},rawWrite:e.notImplemented,getIndent:function(){return n},increaseIndent:function(){n++},decreaseIndent:function(){n--},clear:l,trackSymbol:function(){return!1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop};function s(){if(!(i>a)&&r){var o=e.getIndentString(n);o&&(i+=o.length,t.push(_e(o,e.SymbolDisplayPartKind.space))),r=!1}}function c(e,r){i>a||(s(),i+=e.length,t.push(_e(e,r)))}function l(){t=[],r=!0,n=0,i=0}}();function de(t,r){return _e(t,function(t){var r=t.flags;if(3&r)return le(t)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName;return 4&r||32768&r||65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r||2097152&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(r))}function _e(t,r){return{text:t,kind:e.SymbolDisplayPartKind[r]}}function pe(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function fe(t){return _e(t,e.SymbolDisplayPartKind.text)}function me(t){return _e(t,e.SymbolDisplayPartKind.linkText)}function ge(t,r){return{text:t,kind:e.SymbolDisplayPartKind[e.SymbolDisplayPartKind.linkName],target:{fileName:e.getSourceFileOfNode(r).fileName,textSpan:X(r)}}}function ye(t){return _e(t,e.SymbolDisplayPartKind.link)}e.symbolPart=de,e.displayPart=_e,e.spacePart=function(){return _e(" ",e.SymbolDisplayPartKind.space)},e.keywordPart=pe,e.punctuationPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)},e.operatorPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.operator)},e.parameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.parameterName)},e.propertyNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.propertyName)},e.textOrKeywordPart=function(t){var r=e.stringToToken(t);return void 0===r?fe(t):pe(r)},e.textPart=fe,e.typeAliasNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.aliasName)},e.typeParameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.typeParameterName)},e.linkTextPart=me,e.linkNamePart=ge,e.linkPart=ye,e.buildLinkParts=function(t,r){var n,i=e.isJSDocLink(t)?"link":e.isJSDocLinkCode(t)?"linkcode":"linkplain",a=[ye("{@".concat(i," "))];if(t.name){var o=null==r?void 0:r.getSymbolAtLocation(t.name),s=function(e){if(0===e.indexOf("()"))return 2;if("<"!==e[0])return 0;var t=0,r=0;for(;r"===e[r]&&t--,r++,!t)return r;return 0}(t.text),c=e.getTextOfNode(t.name)+t.text.slice(0,s),l=function(e){var t=0;if(124===e.charCodeAt(t++)){for(;t=5||e.forEachChild(a,i)})),0===r&&n<=1||r/n>.2}function Ge(e,t){return We(e,e.fileExists,t)}function qe(e){try{return e()}catch(e){return}}function We(e,t){for(var r=[],n=2;n-1&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));)r-=1;return r+1},e.getSynthesizedDeepClone=Se,e.getSynthesizedDeepCloneWithReplacements=De,e.getSynthesizedDeepClones=Te,e.getSynthesizedDeepClonesWithReplacements=Ee,e.suppressLeadingAndTrailingTrivia=ke,e.suppressLeadingTrivia=Ae,e.suppressTrailingTrivia=Ne,e.copyComments=function(e,t){var r=e.getSourceFile();!function(e,t){for(var r=e.getFullStart(),n=e.getStart(),i=r;i=0),o},e.copyLeadingComments=Pe,e.copyTrailingComments=Ie,e.copyTrailingAsLeadingComments=Oe,e.needsParentheses=function(t){return e.isBinaryExpression(t)&&27===t.operatorToken.kind||e.isObjectLiteralExpression(t)||e.isAsExpression(t)&&e.isObjectLiteralExpression(t.expression)},e.getContextualTypeFromParent=Re,e.quote=function(t,r,n){var i=ae(t,r),a=JSON.stringify(n);return 0===i?"'".concat(e.stripQuotes(a).replace(/'/g,"\\'").replace(/\\"/g,'"'),"'"):a},e.isEqualityOperatorKind=Be,e.isStringLiteralOrTemplate=function(e){switch(e.kind){case 10:case 14:case 223:case 210:return!0;default:return!1}},e.hasIndexSignature=function(e){return!!e.getStringIndexType()||!!e.getNumberIndexType()},e.getSwitchedType=Je,e.ANONYMOUS="anonymous function",e.getTypeNodeIfAccessible=function(e,t,r,n){var i=r.getTypeChecker(),a=!0,o=function(){return a=!1},s=i.typeToTypeNode(e,t,1,{trackSymbol:function(e,t,r){return!(a=a&&0===i.isSymbolAccessible(e,t,r,!1).accessibility)},reportInaccessibleThisError:o,reportPrivateInBaseOfClassExpression:o,reportInaccessibleUniqueSymbolError:o,moduleResolverHost:te(r,n)});return a?s:void 0},e.syntaxRequiresTrailingSemicolonOrASI=Ke,e.syntaxMayBeASICandidate=e.or(je,Ue,Ve,Ke),e.positionIsASICandidate=function(t,r,n){var i=e.findAncestor(r,(function(r){return r.end!==t?"quit":e.syntaxMayBeASICandidate(r.kind)}));return!!i&&function(t,r){var n=t.getLastToken(r);if(n&&26===n.kind)return!1;if(je(t.kind)){if(n&&27===n.kind)return!1}else if(Ve(t.kind)){if((i=e.last(t.getChildren(r)))&&e.isModuleBlock(i))return!1}else if(Ue(t.kind)){var i;if((i=e.last(t.getChildren(r)))&&e.isFunctionBlock(i))return!1}else if(!Ke(t.kind))return!1;if(240===t.kind)return!0;var a=R(t,e.findAncestor(t,(function(e){return!e.parent})),r);return!a||19===a.kind||r.getLineAndCharacterOfPosition(t.getEnd()).line!==r.getLineAndCharacterOfPosition(a.getStart(r)).line}(i,n)},e.probablyUsesSemicolons=ze,e.tryGetDirectories=function(e,t){return We(e,e.getDirectories,t)||[]},e.tryReadDirectory=function(t,r,n,i,a){return We(t,t.readDirectory,r,n,i,a)||e.emptyArray},e.tryFileExists=Ge,e.tryDirectoryExists=function(t,r){return qe((function(){return e.directoryProbablyExists(r,t)}))||!1},e.tryAndIgnoreErrors=qe,e.tryIOAndConsumeErrors=We,e.findPackageJsons=function(t,r,n){var i=[];return e.forEachAncestorDirectory(t,(function(t){if(t===n)return!0;var a=e.combinePaths(t,"package.json");Ge(r,a)&&i.push(a)})),i},e.findPackageJson=function(t,r){var n;return e.forEachAncestorDirectory(t,(function(t){return"node_modules"===t||(n=e.findConfigFile(t,(function(e){return Ge(r,e)}),"package.json"),!!n||void 0)})),n},e.getPackageJsonsVisibleToFile=He,e.createPackageJsonInfo=Qe,e.createPackageJsonImportFilter=function(t,r,n){var i,a=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(t.fileName)||He(t.fileName,n)).filter((function(e){return e.parseable}));return{allowsImportingAmbientModule:function(t,r){if(!a.length||!t.valueDeclaration)return!0;var n=c(t.valueDeclaration.getSourceFile().fileName,r);if(void 0===n)return!0;var i=e.stripQuotes(t.getName());if(s(i))return!0;return o(n)||o(i)},allowsImportingSourceFile:function(e,t){if(!a.length)return!0;var r=c(e.fileName,t);if(!r)return!0;return o(r)},allowsImportingSpecifier:function(t){if(!a.length||s(t))return!0;if(e.pathIsRelative(t)||e.isRootedDiskPath(t))return!0;return o(t)}};function o(t){for(var r=l(t),n=0,i=a;n=0){var a=r[i];return e.Debug.assertEqual(a.file,t.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),e.cast(a,$e)}},e.getDiagnosticsWithinSpan=function(t,r){var n,i=e.binarySearchKey(r,t.start,(function(e){return e.start}),e.compareValues);for(i<0&&(i=~i);(null===(n=r[i-1])||void 0===n?void 0:n.start)===t.start;)i--;for(var a=[],o=e.textSpanEnd(t);;){var s=e.tryCast(r[i],$e);if(!s||s.start>o)break;e.textSpanContainsTextSpan(t,s)&&a.push(s),i++}return a},e.getRefactorContextSpan=function(t){var r=t.startPosition,n=t.endPosition;return e.createTextSpanFromBounds(r,void 0===n?r:n)},e.getFixableErrorSpanExpression=function(t,r){var n=M(t,r.start),i=e.findAncestor(n,(function(n){return n.getStart(t)e.textSpanEnd(r)?"quit":e.isExpression(n)&&ce(r,X(n,t))}));return i},e.mapOneOrMany=function(t,r,n){return void 0===n&&(n=e.identity),t?e.isArray(t)?n(e.map(t,r)):r(t,0):void 0},e.firstOrOnly=function(t){return e.isArray(t)?e.first(t):t},e.getNamesForExportedSymbol=function(t,r){if(Ye(t)){var n=Ze(t);if(n)return n;var i=e.codefix.moduleSymbolToValidIdentifier(et(t),r,!1),a=e.codefix.moduleSymbolToValidIdentifier(et(t),r,!0);return i===a?i:[i,a]}return t.name},e.getNameForExportedSymbol=function(t,r,n){return Ye(t)?Ze(t)||e.codefix.moduleSymbolToValidIdentifier(et(t),r,!!n):t.name},e.stringContainsAt=function(e,t,r){var n=t.length;if(n+r>e.length)return!1;for(var i=0;ib.indexOf(e.nodeModulesPathPart)&&o.set(m,x);else o.set(m,x)}}}var S=1===_&&e.getLocalSymbolForExportDefault(c)||c,D=0===_||e.isExternalModuleSymbol(S)?e.unescapeLeadingUnderscores(l):e.getNamesForExportedSymbol(S,void 0),C="string"==typeof D?D:D[0],T="string"==typeof D?void 0:D[1],E=e.stripQuotes(u.name),k=n++,A=e.skipAlias(c,f),N=33554432&c.flags?void 0:c,w=33554432&u.flags?void 0:u;N&&w||a.set(k,[c,u]),i.add(function(t,r,n,i){var a=n||"";return"".concat(t,"|").concat(e.getSymbolId(e.skipAlias(r,i)),"|").concat(a)}(C,c,e.isExternalModuleNameRelative(E)?void 0:E,f),{id:k,symbolTableKey:l,symbolName:C,capitalizedSymbolName:T,moduleName:E,moduleFile:d,moduleFileName:null==d?void 0:d.fileName,packageName:m,exportKind:_,targetFlags:A.flags,isFromPackageJson:p,symbol:N,moduleSymbol:w})},get:function(e,t){if(e===r){var n=i.get(t);return null==n?void 0:n.map(c)}},search:function(n,a,s,l){n===r&&i.forEach((function(r,n){var i=function(e){var t=e.substring(0,e.indexOf("|")),r=e.substring(e.lastIndexOf("|")+1),n=""===r?void 0:r;return{symbolName:t,ambientModuleName:n}}(n),u=i.symbolName,d=i.ambientModuleName,_=a&&r[0].capitalizedSymbolName||u;if(s(_,r[0].targetFlags)){var p=r.map(c).filter((function(n,i){return function(r,n){if(!n||!r.moduleFileName)return!0;var i=t.getGlobalTypingsCacheLocation();if(i&&e.startsWith(r.moduleFileName,i))return!0;var a=o.get(n);return!a||e.startsWith(r.moduleFileName,a)}(n,r[i].packageName)}));p.length&&l(p,_,!!d,n)}}))},releaseSymbols:function(){a.clear()},onFileChanged:function(t,n,i){return(!l(t)||!l(n))&&(r&&r!==n.path||i&&e.consumesNodeCoreModules(t)!==e.consumesNodeCoreModules(n)||!e.arrayIsEqualTo(t.moduleAugmentations,n.moduleAugmentations)||!function(t,r){if(!e.arrayIsEqualTo(t.ambientModuleNames,r.ambientModuleNames))return!1;for(var n=-1,i=-1,a=function(a){var o=function(t){return e.isNonGlobalAmbientModule(t)&&t.name.text===a};if(n=e.findIndex(t.statements,o,n+1),i=e.findIndex(r.statements,o,i+1),t.statements[n]!==r.statements[i])return{value:!1}},o=0,s=r.ambientModuleNames;o=i.length){var b=r(o,l,e.lastOrUndefined(d));void 0!==b&&(g=b)}}while(1!==l);function x(){switch(l){case 43:case 68:t[u]||13!==o.reScanSlashToken()||(l=13);break;case 29:79===u&&h++;break;case 31:h>0&&h--;break;case 130:case 150:case 147:case 133:case 151:h>0&&!c&&(l=79);break;case 15:d.push(l);break;case 18:d.length>0&&d.push(l);break;case 19:if(d.length>0){var r=e.lastOrUndefined(d);15===r?17===(l=o.reScanTemplateToken(!1))?d.pop():e.Debug.assertEqual(l,16,"Should have been a template middle."):(e.Debug.assertEqual(r,18,"Should have been an open brace"),d.pop())}break;default:if(!e.isKeyword(l))break;(24===u||e.isKeyword(u)&&e.isKeyword(l)&&!function(t,r){if(!e.isAccessibilityModifier(t))return!0;switch(r){case 136:case 149:case 134:case 124:return!0;default:return!1}}(u,l))&&(l=79)}}return{endOfLineState:g,spans:y}}return{getClassificationsForLine:function(t,r,n){return function(t,r){for(var n=[],a=t.spans,o=0,s=0;s=0){var d=c-o;d>0&&n.push({length:d,classification:e.TokenClass.Whitespace})}n.push({length:l,classification:i(u)}),o=c+l}var _=r.length-o;_>0&&n.push({length:_,classification:e.TokenClass.Whitespace});return{entries:n,finalLexState:t.endOfLineState}}(s(t,r,n),t)},getEncodedLexicalClassifications:s}};var t=e.arrayToNumericMap([79,10,8,9,13,108,45,46,21,23,19,110,95],(function(e){return e}),(function(){return!0}));function r(t,r,n){switch(r){case 10:if(!t.isUnterminated())return;for(var i=t.getTokenText(),a=i.length-1,o=0;92===i.charCodeAt(a-o);)o++;if(0==(1&o))return;return 34===i.charCodeAt(0)?3:2;case 3:return t.isUnterminated()?1:void 0;default:if(e.isTemplateLiteralKind(r)){if(!t.isUnterminated())return;switch(r){case 17:return 5;case 14:return 4;default:return e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+r)}}return 15===n?6:void 0}}function n(e,t,r,n,i){if(8!==n){0===e&&r>0&&(e+=r);var a=t-e;a>0&&i.push(e-r,a,n)}}function i(t){switch(t){case 1:return e.TokenClass.Comment;case 3:return e.TokenClass.Keyword;case 4:return e.TokenClass.NumberLiteral;case 25:return e.TokenClass.BigIntLiteral;case 5:return e.TokenClass.Operator;case 6:return e.TokenClass.StringLiteral;case 8:return e.TokenClass.Whitespace;case 10:return e.TokenClass.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return e.TokenClass.Identifier;default:return}}function a(t){if(e.isKeyword(t))return 3;if(function(e){switch(e){case 41:case 43:case 44:case 39:case 40:case 47:case 48:case 49:case 29:case 31:case 32:case 33:case 102:case 101:case 127:case 34:case 35:case 36:case 37:case 50:case 52:case 51:case 55:case 56:case 74:case 73:case 78:case 70:case 71:case 72:case 64:case 65:case 66:case 68:case 69:case 63:case 27:case 60:case 75:case 76:case 77:return!0;default:return!1}}(t)||function(e){switch(e){case 39:case 40:case 54:case 53:case 45:case 46:return!0;default:return!1}}(t))return 5;if(t>=18&&t<=78)return 10;switch(t){case 8:return 4;case 9:return 25;case 10:return 6;case 13:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;default:return e.isTemplateLiteralKind(t)?6:2}}function o(e,t){switch(t){case 261:case 257:case 258:case 256:case 226:case 213:case 214:e.throwIfCancellationRequested()}}function s(t,r,n,i,a){var s=[];return n.forEachChild((function l(u){if(u&&e.textSpanIntersectsWith(a,u.pos,u.getFullWidth())){if(o(r,u.kind),e.isIdentifier(u)&&!e.nodeIsMissing(u)&&i.has(u.escapedText)){var d=t.getSymbolAtLocation(u),_=d&&c(d,e.getMeaningFromLocation(u),t);_&&function(t,r,n){var i=r-t;e.Debug.assert(i>0,"Classification had non-positive length of ".concat(i)),s.push(t),s.push(i),s.push(n)}(u.getStart(n),u.getEnd(),_)}u.forEachChild(l)}})),{spans:s,endOfLineState:0}}function c(t,r,n){var i=t.getFlags();return 0==(2885600&i)?void 0:32&i?11:384&i?12:524288&i?16:1536&i?4&r||1&r&&function(t){return e.some(t.declarations,(function(t){return e.isModuleDeclaration(t)&&1===e.getModuleInstanceState(t)}))}(t)?14:void 0:2097152&i?c(n.getAliasedSymbol(t),r,n):2&r?64&i?13:262144&i?15:void 0:void 0}function l(e){switch(e){case 1:return"comment";case 2:return"identifier";case 3:return"keyword";case 4:return"number";case 25:return"bigint";case 5:return"operator";case 6:return"string";case 8:return"whitespace";case 9:return"text";case 10:return"punctuation";case 11:return"class name";case 12:return"enum name";case 13:return"interface name";case 14:return"module name";case 15:return"type parameter name";case 16:return"type alias name";case 17:return"parameter name";case 18:return"doc comment tag name";case 19:return"jsx open tag name";case 20:return"jsx close tag name";case 21:return"jsx self closing tag name";case 22:return"jsx attribute";case 23:return"jsx text";case 24:return"jsx attribute string literal value";default:return}}function u(t){e.Debug.assert(t.spans.length%3==0);for(var r=t.spans,n=[],i=0;i])*)(\/>)?)?/im,a=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/gim,o=r.text.substr(t,n),s=i.exec(o);if(!s)return!1;if(!s[3]||!(s[3]in e.commentPragmas))return!1;var c=t;_(c,s[1].length),u(c+=s[1].length,s[2].length,10),u(c+=s[2].length,s[3].length,21),c+=s[3].length;var l=s[4],d=c;for(;;){var p=a.exec(l);if(!p)break;var f=c+p.index+p[1].length;f>d&&(_(d,f-d),d=f),u(d,p[2].length,22),d+=p[2].length,p[3].length&&(_(d,p[3].length),d+=p[3].length),u(d,p[4].length,5),d+=p[4].length,p[5].length&&(_(d,p[5].length),d+=p[5].length),u(d,p[6].length,24),d+=p[6].length}(c+=s[4].length)>d&&_(d,c-d);s[5]&&(u(c,s[5].length,10),c+=s[5].length);var m=t+n;c=0),a>0){var o=n||y(t.kind,t);o&&u(i,a,o)}return!0}function y(t,r){if(e.isKeyword(t))return 3;if((29===t||31===t)&&r&&e.getTypeArgumentOrTypeParameterList(r.parent))return 10;if(e.isPunctuation(t)){if(r){var n=r.parent;if(63===t&&(254===n.kind||167===n.kind||164===n.kind||285===n.kind))return 5;if(221===n.kind||219===n.kind||220===n.kind||222===n.kind)return 5}return 10}if(8===t)return 4;if(9===t)return 25;if(10===t)return r&&285===r.parent.kind?24:6;if(13===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(11===t)return 23;if(79===t){if(r){switch(r.parent.kind){case 257:return r.parent.name===r?11:void 0;case 163:return r.parent.name===r?15:void 0;case 258:return r.parent.name===r?13:void 0;case 260:return r.parent.name===r?12:void 0;case 261:return r.parent.name===r?14:void 0;case 164:return r.parent.name===r?e.isThisIdentifier(r)?3:17:void 0}if(e.isConstTypeReference(r.parent))return 3}return 2}}function h(n){if(n&&e.decodedTextSpanIntersectsWith(i,a,n.pos,n.getFullWidth())){o(t,n.kind);for(var s=0,c=n.getChildren(r);s0})))return 0;if(a((function(e){return e.getCallSignatures().length>0}))&&!a((function(e){return e.getProperties().length>0}))||function(t){for(;c(t);)t=t.parent;return e.isCallExpression(t.parent)&&t.parent.expression===t}(r))return 9===n?11:10}}return n}(o,_,m);var y=f.valueDeclaration;if(y){var h=e.getCombinedModifierFlags(y),v=e.getCombinedNodeFlags(y);32&h&&(g|=2),256&h&&(g|=4),0!==m&&2!==m&&(64&h||2&v||8&f.getFlags())&&(g|=8),7!==m&&10!==m||!function(t,r){return e.isBindingElement(t)&&(t=s(t)),e.isVariableDeclaration(t)?(!e.isSourceFile(t.parent.parent.parent)||e.isCatchClause(t.parent))&&t.getSourceFile()===r:!!e.isFunctionDeclaration(t)&&(!e.isSourceFile(t.parent)&&t.getSourceFile()===r)}(y,r)||(g|=32),t.isSourceFileDefaultLibrary(y.getSourceFile())&&(g|=16)}else f.declarations&&f.declarations.some((function(e){return t.isSourceFileDefaultLibrary(e.getSourceFile())}))&&(g|=16);i(_,m,g)}}}e.forEachChild(_,d),u=p}}d(r)}(t,r,n,(function(e,t,n){a.push(e.getStart(r),e.getWidth(r),(t+1<<8)+n)}),i),a}function s(t){for(;;){if(!e.isBindingElement(t.parent.parent))return t.parent.parent;t=t.parent.parent}}function c(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t}(r=t.TokenEncodingConsts||(t.TokenEncodingConsts={}))[r.typeOffset=8]="typeOffset",r[r.modifierMask=255]="modifierMask",(n=t.TokenType||(t.TokenType={}))[n.class=0]="class",n[n.enum=1]="enum",n[n.interface=2]="interface",n[n.namespace=3]="namespace",n[n.typeParameter=4]="typeParameter",n[n.type=5]="type",n[n.parameter=6]="parameter",n[n.variable=7]="variable",n[n.enumMember=8]="enumMember",n[n.property=9]="property",n[n.function=10]="function",n[n.member=11]="member",(i=t.TokenModifier||(t.TokenModifier={}))[i.declaration=0]="declaration",i[i.static=1]="static",i[i.async=2]="async",i[i.readonly=3]="readonly",i[i.defaultLibrary=4]="defaultLibrary",i[i.local=5]="local",t.getSemanticClassifications=function(t,r,n,i){var o=a(t,r,n,i);e.Debug.assert(o.spans.length%3==0);for(var s=o.spans,c=[],l=0;lr.parameters.length)){var s=r.getTypeParameterAtPosition(n.argumentIndex);if(e.isJsxOpeningLikeElement(t)){var l=i.getTypeOfPropertyOfType(s,c.name.text);l&&(s=l)}return a=a||!!(4&s.flags),d(s,o)}})),isNewIdentifier:a}}(E.invocation,n,E,a):k()}case 266:case 272:case 277:return{kind:0,paths:m(r,n,o,s,a,c)};default:return k()}function k(){return{kind:2,types:d(e.getContextualTypeFromParent(n,a)),isNewIdentifier:!1}}}function l(t){switch(t.kind){case 191:return e.walkUpParenthesizedTypes(t);case 212:return e.walkUpParenthesizedExpressions(t);default:return t}}function u(t){return t&&{kind:1,symbols:e.filter(t.getApparentProperties(),(function(t){return!(t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))})),hasIndexSignature:e.hasIndexSignature(t)}}function d(t,r){return void 0===r&&(r=new e.Map),t?(t=e.skipConstraint(t)).isUnion()?e.flatMap(t.types,(function(e){return d(e,r)})):!t.isStringLiteral()||1024&t.flags||!e.addToSeen(r,t.value)?e.emptyArray:[t]:e.emptyArray}function _(e,t,r){return{name:e,kind:t,extension:r}}function p(e){return _(e,"directory",void 0)}function f(t,r,n){var i=function(t,r){var n=Math.max(t.lastIndexOf(e.directorySeparator),t.lastIndexOf(e.altDirectorySeparator)),i=-1!==n?n+1:0,a=t.length-i;return 0===a||e.isIdentifierText(t.substr(i,a),99)?void 0:e.createTextSpan(r+i,a)}(t,r),a=0===t.length?void 0:e.createTextSpan(r,t.length);return n.map((function(t){var r=t.name,n=t.kind,o=t.extension;return-1!==Math.max(r.indexOf(e.directorySeparator),r.indexOf(e.altDirectorySeparator))?{name:r,kind:n,extension:o,span:a}:{name:r,kind:n,extension:o,span:i}}))}function m(t,n,i,a,o,s){return f(n.text,n.getStart(t)+1,function(t,n,i,a,o,s){var c=e.normalizeSlashes(n.text),l=t.path,u=e.getDirectoryPath(l);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){var t=e.length>=3&&46===e.charCodeAt(1)?2:1,r=e.charCodeAt(t);return 47===r||92===r}return!1}(c)||!i.baseUrl&&(e.isRootedDiskPath(c)||e.isUrl(c))?function(t,n,i,a,o,s){var c=g(i,s);return i.rootDirs?function(t,n,i,a,o,s,c){var l=o.project||s.getCurrentDirectory(),u=!(s.useCaseSensitiveFileNames&&s.useCaseSensitiveFileNames()),d=function(t,n,i,a){t=t.map((function(t){return e.normalizePath(e.isRootedDiskPath(t)?t:e.combinePaths(n,t))}));var o=e.firstDefined(t,(function(t){return e.containsPath(t,i,n,a)?i.substr(t.length):void 0}));return e.deduplicate(r(r([],t.map((function(t){return e.combinePaths(t,o)})),!0),[i],!1),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive)}(t,l,i,u);return e.flatMap(d,(function(e){return v(n,e,a,s,c)}))}(i.rootDirs,t,n,c,i,a,o):v(t,n,c,a,o)}(c,u,i,a,l,d()):function(t,r,n,i,a){var o=n.baseUrl,s=n.paths,c=[],l=g(n);if(o){var u=n.project||i.getCurrentDirectory(),d=e.normalizePath(e.combinePaths(u,o));v(t,d,l,i,void 0,c),s&&b(c,t,d,l.extensions,s,i)}for(var p=x(t),f=0,m=function(t,r,n){var i=n.getAmbientModules().map((function(t){return e.stripQuotes(t.name)})).filter((function(r){return e.startsWith(r,t)}));if(void 0!==r){var a=e.ensureTrailingDirectorySeparator(r);return i.map((function(t){return e.removePrefix(t,a)}))}return i}(t,p,a);f=e.pos&&r<=e.end}));if(s){var c=t.text.slice(s.pos,r),l=C.exec(c);if(l){var u=l[1],d=l[2],_=l[3],p=e.getDirectoryPath(t.path),m="path"===d?v(_,p,g(n,1),i,t.path):"types"===d?D(i,n,p,x(_),g(n)):e.Debug.fail();return f(_,s.pos+u.length,m)}}}(r,n,o,s);return _&&i(_)}if(e.isInString(r,n,a)){if(!a||!e.isStringLiteralLike(a))return;return function(r,n,a,o,s,c,l,u){if(void 0!==r){var d=e.createTextSpanFromStringLiteralLikeContent(n);switch(r.kind){case 0:return i(r.paths);case 1:var _=e.createSortedArray();return t.getCompletionEntriesFromSymbols(r.symbols,_,n,n,a,a,o,s,99,c,4,u,l,void 0),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:r.hasIndexSignature,optionalReplacementSpan:d,entries:_};case 2:return _=r.types.map((function(r){return{name:r.value,kindModifiers:"",kind:"string",sortText:t.SortText.LocationPriority,replacementSpan:e.getReplacementSpanForContextToken(n)}})),{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:r.isNewIdentifier,optionalReplacementSpan:d,entries:_};default:return e.Debug.assertNever(r)}}}(_=c(r,a,n,l.getTypeChecker(),o,s,d),a,r,s,l,u,o,d)}},n.getStringLiteralCompletionDetails=function(r,n,i,o,s,l,u,d,_){if(o&&e.isStringLiteralLike(o)){var p=c(n,o,i,s,l,u,_);return p&&function(r,n,i,o,s,c){switch(i.kind){case 0:return(l=e.find(i.paths,(function(e){return e.name===r})))&&t.createCompletionDetails(r,a(l.extension),l.kind,[e.textPart(r)]);case 1:var l=e.find(i.symbols,(function(e){return e.name===r}));return l&&t.createCompletionDetailsForSymbol(l,s,o,n,c);case 2:return e.find(i.types,(function(e){return e.value===r}))?t.createCompletionDetails(r,"","type",[e.textPart(r)]):void 0;default:return e.Debug.assertNever(i)}}(r,o,p,n,s,d)}},function(e){e[e.Paths=0]="Paths",e[e.Properties=1]="Properties",e[e.Types=2]="Types"}(o||(o={})),function(e){e[e.Exclude=0]="Exclude",e[e.Include=1]="Include",e[e.ModuleSpecifierCompletion=2]="ModuleSpecifierCompletion"}(s||(s={}));var C=/^(\/\/\/\s*0},resolvedBeyondLimit:function(){return v>t.moduleSpecifierResolutionLimit}}),D=x?" (".concat((b/x*100).toFixed(1),"% hit rate)"):"";return null===(d=n.log)||void 0===d||d.call(n,"".concat(r,": resolved ").concat(v," module specifiers, plus ").concat(h," ambient and ").concat(b," from cache").concat(D)),null===(_=n.log)||void 0===_||_.call(n,"".concat(r,": response is ").concat(y?"incomplete":"complete")),null===(p=n.log)||void 0===p||p.call(n,"".concat(r,": ").concat(e.timestamp()-f)),S}function m(t,r){var n,i,a=e.compareStringsCaseSensitiveUI(t.sortText,r.sortText);return 0===a&&(a=e.compareStringsCaseSensitiveUI(t.name,r.name)),0===a&&(null===(n=t.data)||void 0===n?void 0:n.moduleSpecifier)&&(null===(i=r.data)||void 0===i?void 0:i.moduleSpecifier)&&(a=e.compareNumberOfDirectorySeparators(t.data.moduleSpecifier,r.data.moduleSpecifier)),0===a?-1:a}function g(e){return!!(null==e?void 0:e.moduleSpecifier)}function y(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function h(e,t,r){return{kind:4,keywordCompletions:G(e,t),isNewIdentifierLocation:r}}function v(t){return 79===(null==t?void 0:t.kind)?e.createTextSpanFromNode(t):void 0}function b(t,r){return e.isSourceFileJS(t)&&!e.isCheckJsEnabledForFile(t,r)}function x(e){switch(e){case 0:case 3:case 2:return!0;default:return!1}}function S(t,r,n){return"object"==typeof n?e.pseudoBigIntToString(n)+"n":e.isString(n)?e.quote(t,r,n):JSON.stringify(n)}function D(e,r,n){return{name:S(e,r,n),kind:"string",kindModifiers:"",sortText:t.SortText.LocationPriority}}function C(n,i,a,o,s,c,_,f,m,g,y,h,v,b,x,S,D,C,E,k,N,I){var O,M,L,R,B,J,j,U,V=e.getReplacementSpanForContextToken(a),K=P(y),z=f.getTypeChecker(),G=y&&function(e){return!!(16&e.kind)}(y),q=y&&function(e){return!!(2&e.kind)}(y)||g;if(y&&function(e){return!!(1&e.kind)}(y))L=g?"this".concat(G?"?.":"","[").concat(w(c,C,m),"]"):"this".concat(G?"?.":".").concat(m);else if((q||G)&&v){L=q?"[".concat(g?w(c,C,m):m,"]"):m,(G||v.questionDotToken)&&(L="?.".concat(L));var W=e.findChildOfKind(v,24,c)||e.findChildOfKind(v,28,c);if(!W)return;var H=e.startsWith(m,v.name.text)?v.name.end:W.end;V=e.createTextSpanFromBounds(W.getStart(c),H)}if(b&&(void 0===L&&(L=m),L="{".concat(L,"}"),"boolean"!=typeof b&&(V=e.createTextSpanFromNode(b,c))),y&&function(e){return!!(8&e.kind)}(y)&&v){void 0===L&&(L=m);var Q=e.findPrecedingToken(v.pos,c),X="";Q&&e.positionIsASICandidate(Q.end,Q.parent,c)&&(X=";"),X+="(await ".concat(v.expression.getText(),")"),L=g?"".concat(X).concat(L):"".concat(X).concat(G?"?.":".").concat(L),V=e.createTextSpanFromBounds(v.getStart(c),v.end)}if(u(y)&&(J=[e.textPart(y.moduleSpecifier)],x&&(O=function(t,r,n,i,a,o,s){var c,l,u,d=r.getSourceFile(),_=e.createTextSpanFromNode(e.findAncestor(r,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration))||r,d),p=e.quote(d,s,i.moduleSpecifier),f=i.isDefaultExport?1:"export="===i.exportName?2:0,m=s.includeCompletionsWithSnippetText?"$1":"",g=e.codefix.getImportKind(d,f,o,!0),y=(null===(l=null===(c=e.tryCast(r,e.isImportDeclaration))||void 0===c?void 0:c.importClause)||void 0===l?void 0:l.isTypeOnly)||(null===(u=e.tryCast(r,e.isImportEqualsDeclaration))||void 0===u?void 0:u.isTypeOnly),h=ie(r,n),v=y?" ".concat(e.tokenToString(152)," "):" ",b=h?"".concat(e.tokenToString(152)," "):"",x=a?";":"";switch(g){case 3:return{replacementSpan:_,insertText:"import".concat(v).concat(e.escapeSnippetText(t)).concat(m," = require(").concat(p,")").concat(x)};case 1:return{replacementSpan:_,insertText:"import".concat(v).concat(e.escapeSnippetText(t)).concat(m," from ").concat(p).concat(x)};case 2:return{replacementSpan:_,insertText:"import".concat(v,"* as ").concat(e.escapeSnippetText(t)," from ").concat(p).concat(x)};case 0:return{replacementSpan:_,insertText:"import".concat(v,"{ ").concat(b).concat(e.escapeSnippetText(t)).concat(m," } from ").concat(p).concat(x)}}}(m,x,o,y,S,D,C),L=O.insertText,V=O.replacementSpan,B=!!C.includeCompletionsWithSnippetText||void 0)),64===(null==y?void 0:y.kind)&&(j=!0),C.includeCompletionsWithClassMemberSnippets&&C.includeCompletionsWithInsertText&&3===E&&function(t,r){if(e.isInJSFile(r))return!1;var n=106500;return!!(t.flags&n)&&(e.isClassLike(r)||r.parent&&r.parent.parent&&e.isClassElement(r.parent)&&r===r.parent.name&&e.isClassLike(r.parent.parent)||r.parent&&e.isSyntaxList(r)&&e.isClassLike(r.parent))}(n,s)){var $=void 0;L=(M=T(_,f,D,C,m,n,s,o,k)).insertText,B=M.isSnippet,$=M.importAdder,V=M.replacementSpan,i=t.SortText.ClassMemberSnippets,(null==$?void 0:$.hasFixes())&&(j=!0,K=r.ClassMemberSnippet)}if(y&&p(y)&&(L=y.insertText,B=y.isSnippet,U=y.labelDetails,C.useLabelDetailsInCompletionEntries||(m+=U.detail,U=void 0),K=r.ObjectLiteralMethodSnippet,i=t.SortText.SortBelow(i)),N&&!I&&C.includeCompletionsWithSnippetText&&C.jsxAttributeCompletionStyle&&"none"!==C.jsxAttributeCompletionStyle){var Y="braces"===C.jsxAttributeCompletionStyle,Z=z.getTypeOfSymbolAtLocation(n,s);"auto"!==C.jsxAttributeCompletionStyle||528&Z.flags||1048576&Z.flags&&e.find(Z.types,(function(e){return!!(528&e.flags)}))||(402653316&Z.flags||1048576&Z.flags&&e.every(Z.types,(function(e){return!!(402686084&e.flags)}))?(L="".concat(e.escapeSnippetText(m),"=").concat(e.quote(c,C,"$1")),B=!0):Y=!0),Y&&(L="".concat(e.escapeSnippetText(m),"={$1}"),B=!0)}if(void 0===L||C.includeCompletionsWithInsertText)return(l(y)||u(y))&&(R=A(y),j=!x),{name:m,kind:e.SymbolDisplay.getSymbolKind(z,n,s),kindModifiers:e.SymbolDisplay.getSymbolModifiers(z,n),sortText:i,source:K,hasAction:!!j||void 0,isRecommended:F(n,h,z)||void 0,insertText:L,replacementSpan:V,sourceDisplay:J,labelDetails:U,isSnippet:B,isPackageJsonImport:d(y)||void 0,isImportStatementCompletion:!!x||void 0,data:R}}function T(t,r,n,i,a,o,s,c,l){var u,d,_=e.findAncestor(s,e.isClassLike);if(!_)return{insertText:a};var p,f=a,m=r.getTypeChecker(),g=s.getSourceFile(),y=k({removeComments:!0,module:n.module,target:n.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(n,e.maybeBind(t,t.getNewLine)))}),h=e.codefix.createImportAdder(g,r,i,t);if(i.includeCompletionsWithSnippetText){u=!0;var v=e.factory.createEmptyStatement();p=e.factory.createBlock([v],!0),e.setSnippetElement(v,{kind:0,order:0})}else p=e.factory.createBlock([],!0);var b=0,x=function(t){if(!t)return{modifiers:0};var r,n,i=0;(n=function(t){if(e.isModifier(t))return t.kind;if(e.isIdentifier(t)&&t.originalKeywordKind&&e.isModifierKind(t.originalKeywordKind))return t.originalKeywordKind;return}(t))&&(i|=e.modifierToFlag(n),r=e.createTextSpanFromNode(t));e.isPropertyDeclaration(t.parent)&&(i|=e.modifiersToFlags(t.parent.modifiers),r=e.createTextSpanFromNode(t.parent));return{modifiers:i,span:r}}(c),S=x.modifiers,D=x.span,C=!!(128&S),T=[];if(e.codefix.addNewNodeForMemberSymbol(o,_,g,{program:r,host:t},i,h,(function(t){var r=0;C&&(r|=128),e.isClassElement(t)&&1===m.getMemberOverrideModifierStatus(_,t)&&(r|=16384),T.length||(b=t.modifierFlagsCache|r|S),t=e.factory.updateModifiers(t,b),T.push(t)}),p,2,C),T.length){var E=131073;d=D,f=l?y.printAndFormatSnippetList(E,e.factory.createNodeArray(T),g,l):y.printSnippetList(E,e.factory.createNodeArray(T),g)}return{insertText:f,isSnippet:u,importAdder:h,replacementSpan:d}}function E(t,r,n,i,a,o,s,c){var l=s.includeCompletionsWithSnippetText||void 0,u=r,d=n.getSourceFile(),_=function(t,r,n,i,a,o){var s=t.getDeclarations();if(!s||!s.length)return;var c=i.getTypeChecker(),l=s[0],u=e.getSynthesizedDeepClone(e.getNameOfDeclaration(l),!1),d=c.getWidenedType(c.getTypeOfSymbolAtLocation(t,r)),_=0===e.getQuotePreference(n,o)?268435456:void 0;switch(l.kind){case 166:case 167:case 168:case 169:var p=1048576&d.flags&&d.types.length<10?c.getUnionType(d.types,2):d;if(1048576&p.flags){var f=e.filter(p.types,(function(e){return c.getSignaturesOfType(e,0).length>0}));if(1!==f.length)return;p=f[0]}if(1!==c.getSignaturesOfType(p,0).length)return;var m=c.typeToTypeNode(p,r,_,e.codefix.getNoopSymbolTrackerWithResolver({program:i,host:a}));if(!m||!e.isFunctionTypeNode(m))return;var g=void 0;if(o.includeCompletionsWithSnippetText){var y=e.factory.createEmptyStatement();g=e.factory.createBlock([y],!0),e.setSnippetElement(y,{kind:0,order:0})}else g=e.factory.createBlock([],!0);var h=m.parameters.map((function(t){return e.factory.createParameterDeclaration(void 0,void 0,t.dotDotDotToken,t.name,t.questionToken,void 0,t.initializer)}));return e.factory.createMethodDeclaration(void 0,void 0,void 0,u,void 0,void 0,h,void 0,g);default:return}}(t,n,d,i,a,s);if(_){var p=k({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(o,e.maybeBind(a,a.getNewLine)))});u=c?p.printAndFormatSnippetList(80,e.factory.createNodeArray([_],!0),d,c):p.printSnippetList(80,e.factory.createNodeArray([_],!0),d);var f=e.createPrinter({removeComments:!0,module:o.module,target:o.target,omitTrailingSemicolon:!0}),m=e.factory.createMethodSignature(void 0,"",_.questionToken,_.typeParameters,_.parameters,_.type);return{isSnippet:l,insertText:u,labelDetails:{detail:f.printNode(4,m,d)}}}}function k(t){var r,i=e.textChanges.createWriter(e.getNewLineCharacter(t)),a=e.createPrinter(t,i),o=n(n({},i),{write:function(e){return s(e,(function(){return i.write(e)}))},nonEscapingWrite:i.write,writeLiteral:function(e){return s(e,(function(){return i.writeLiteral(e)}))},writeStringLiteral:function(e){return s(e,(function(){return i.writeStringLiteral(e)}))},writeSymbol:function(e,t){return s(e,(function(){return i.writeSymbol(e,t)}))},writeParameter:function(e){return s(e,(function(){return i.writeParameter(e)}))},writeComment:function(e){return s(e,(function(){return i.writeComment(e)}))},writeProperty:function(e){return s(e,(function(){return i.writeProperty(e)}))}});return{printSnippetList:function(t,n,i){var a=c(t,n,i);return r?e.textChanges.applyChanges(a,r):a},printAndFormatSnippetList:function(t,i,a,o){var s={text:c(t,i,a),getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}},l=e.getFormatCodeSettingsForWriting(o,a),u=e.flatMap(i,(function(t){var r=e.textChanges.assignPositionsToNode(t);return e.formatting.formatNodeGivenIndentation(r,s,a.languageVariant,0,0,n(n({},o),{options:l}))})),d=r?e.stableSort(e.concatenate(u,r),(function(t,r){return e.compareTextSpans(t.span,r.span)})):u;return e.textChanges.applyChanges(s.text,d)}};function s(t,n){var a=e.escapeSnippetText(t);if(a!==t){var o=i.getTextPos();n();var s=i.getTextPos();r=e.append(r||(r=[]),{newText:a,span:{start:o,length:s-o}})}else n()}function c(e,t,n){return r=void 0,o.clear(),a.writeList(e,t,n,o),o.getText()}}function A(t){var r=t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),n=!!t.isFromPackageJson||void 0;return u(t)?{exportName:t.exportName,moduleSpecifier:t.moduleSpecifier,ambientModuleName:r,fileName:t.fileName,isPackageJsonImport:n}:{exportName:t.exportName,exportMapKey:t.exportMapKey,fileName:t.fileName,ambientModuleName:t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),isPackageJsonImport:!!t.isFromPackageJson||void 0}}function N(e,t,r){var n="default"===e.exportName,i=!!e.isPackageJsonImport;return g(e)?{kind:32,exportName:e.exportName,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}}function w(t,r,n){return/^\d+$/.test(n)?n:e.quote(t,r,n)}function F(e,t,r){return e===t||!!(1048576&e.flags)&&r.getExportSymbolOfSymbol(e)===t}function P(t){return l(t)?e.stripQuotes(t.moduleSymbol.name):u(t)?t.moduleSpecifier:1===(null==t?void 0:t.kind)?r.ThisProperty:64===(null==t?void 0:t.kind)?r.TypeOnlyAlias:void 0}function I(r,n,i,a,o,s,c,l,u,d,f,g,y,h,v,b,x,S,D,T,E,k,A,N){for(var w,F=e.timestamp(),P=function(t){var r=e.findAncestor(t,(function(t){return e.isFunctionBlock(t)||function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t}(t)||e.isBindingPattern(t)?"quit":e.isVariableDeclaration(t)}));return r}(o),I=e.probablyUsesSemicolons(s),O=l.getTypeChecker(),M=new e.Map,L=0;L=t.pos;case 24:case 22:return 202===n;case 58:return 203===n;case 20:return 292===n||Pe(n);case 18:return 260===n;case 29:return 257===n||226===n||258===n||259===n||e.isFunctionLikeKind(n);case 124:return 167===n&&!e.isClassLike(r.parent);case 25:return 164===n||!!r.parent&&202===r.parent.kind;case 123:case 121:case 122:return 164===n&&!e.isConstructorDeclaration(r.parent);case 127:return 270===n||275===n||268===n;case 136:case 149:return!te(t);case 79:if(270===n&&t===r.name&&"type"===t.text)return!1;break;case 84:case 92:case 118:case 98:case 113:case 100:case 119:case 85:case 137:return!0;case 152:return 270!==n;case 41:return e.isFunctionLike(t.parent)&&!e.isMethodDeclaration(t.parent)}if(H(X(t))&&te(t))return!1;if(we(t)&&(!e.isIdentifier(t)||e.isParameterPropertyModifier(X(t))||Le(t)))return!1;switch(X(t)){case 126:case 84:case 85:case 135:case 92:case 98:case 118:case 119:case 121:case 122:case 123:case 124:case 113:return!0;case 131:return e.isPropertyDeclaration(t.parent)}if(e.findAncestor(t.parent,e.isClassLike)&&t===N&&Fe(t,s))return!1;var i=e.getAncestor(t.parent,167);if(i&&t!==N&&e.isClassLike(N.parent.parent)&&s<=N.end){if(Fe(t,N.end))return!1;if(63!==t.kind&&(e.isInitializedProperty(i)||e.hasType(i)))return!0}return e.isDeclarationName(t)&&!e.isShorthandPropertyAssignment(t.parent)&&!e.isJsxAttribute(t.parent)&&!(e.isClassLike(t.parent)&&(t!==N||s>N.end))}(t)||function(e){if(8===e.kind){var t=e.getFullText();return"."===t.charAt(t.length-1)}return!1}(t)||function(e){if(11===e.kind)return!0;if(31===e.kind&&e.parent){if(z===e.parent&&(280===z.kind||279===z.kind))return!1;if(280===e.parent.kind)return 280!==z.parent.kind;if(281===e.parent.kind||279===e.parent.kind)return!!e.parent.parent&&278===e.parent.parent.kind}return!1}(t)||e.isBigIntLiteral(t);return i("getCompletionsAtPosition: isCompletionListBlocker: "+(e.timestamp()-r)),n}(w))return i("Returning an empty list because completion was requested in an invalid position."),G?h(G,k,Ne()):void 0;var ae=w.parent;if(24===w.kind||28===w.kind)switch(M=24===w.kind,L=28===w.kind,ae.kind){case 206:O=(F=ae).expression;var oe=e.getLeftmostAccessExpression(F);if(e.nodeIsMissing(oe)||(e.isCallExpression(O)||e.isFunctionLike(O))&&O.end===w.pos&&O.getChildCount(a)&&21!==e.last(O.getChildren(a)).kind)return;break;case 161:O=ae.left;break;case 261:O=ae.name;break;case 200:O=ae;break;case 231:O=ae.getFirstToken(a),e.Debug.assert(100===O.kind||103===O.kind);break;default:return}else if(!P&&1===a.languageVariant){if(ae&&206===ae.kind&&(w=ae,ae=ae.parent),y.parent===z)switch(y.kind){case 31:278!==y.parent.kind&&280!==y.parent.kind||(z=y);break;case 43:279===y.parent.kind&&(z=y)}switch(ae.kind){case 281:43===w.kind&&(J=!0,z=w);break;case 221:if(!re(ae))break;case 279:case 278:case 280:K=!0,29===w.kind&&(R=!0,z=w);break;case 288:case 287:19===N.kind&&31===y.kind&&(K=!0);break;case 285:if(ae.initializer===N&&N.end0){var b=function(t,r){if(0===r.length)return t;for(var n=new e.Set,i=new e.Set,a=0,o=r;a90))&&(!!l||le(t,o))}),(function(n,i,a,o){var s;if(!l||e.some(n,(function(t){return l.source===e.stripQuotes(t.moduleSymbol.name)}))){var c=e.find(n,y);if(c){var u=r.tryResolve(n,i,a)||{};if("failed"!==u){var d,_=c;"skipped"!==u&&(_=void 0===(s=u.exportInfo)?c:s,d=u.moduleSpecifier);var p=1===_.exportKind;!function(r,n){var i=e.getSymbolId(r);if(me[i]===t.SortText.GlobalsOrKeywords)return;fe[pe.length]=n,me[i]=P?t.SortText.LocationPriority:t.SortText.AutoImportSuggestions,pe.push(r)}(p&&e.getLocalSymbolForExportDefault(_.symbol)||_.symbol,{kind:d?32:4,moduleSpecifier:d,symbolName:i,exportMapKey:o,exportName:2===_.exportKind?"export=":_.symbol.name,fileName:_.moduleFileName,isDefaultExport:p,moduleSymbol:_.moduleSymbol,isFromPackageJson:_.isFromPackageJson})}}}})),_e=r.skippedAny(),Q|=r.resolvedAny()?8:0,Q|=r.resolvedBeyondLimit()?16:0}))}function y(t){var n=e.tryCast(t.moduleSymbol.valueDeclaration,e.isSourceFile);if(!n){var i=e.stripQuotes(t.moduleSymbol.name);return(!e.JsTyping.nodeCoreModules.has(i)||e.startsWith(i,"node:")===e.shouldUseUriStyleNodeCoreModules(a,r))&&(!g||g.allowsImportingAmbientModule(t.moduleSymbol,he(t.isFromPackageJson)))}return e.isImportableFile(t.isFromPackageJson?m:r,a,n,c,g,he(t.isFromPackageJson),d)}}function Ne(){if(w){var e=w.parent.kind,t=X(w);switch(t){case 27:return 208===e||171===e||209===e||204===e||221===e||179===e||205===e;case 20:return 208===e||171===e||209===e||212===e||191===e;case 22:return 204===e||176===e||162===e;case 141:case 142:case 100:return!0;case 24:return 261===e;case 18:return 257===e||205===e;case 63:return 254===e||221===e;case 15:return 223===e;case 16:return 233===e;case 131:return 169===e||297===e;case 41:return 169===e}if(H(t))return!0}return!1}function we(t){return!!t.parent&&e.isParameter(t.parent)&&e.isConstructorDeclaration(t.parent.parent)&&(e.isParameterPropertyModifier(t.kind)||e.isDeclarationName(t))}function Fe(t,r){return 63!==t.kind&&(26===t.kind||!e.positionsAreOnSameLine(t.end,r,a))}function Pe(t){return e.isFunctionLikeKind(t)&&171!==t}function Ie(e,t){var r=e.expression,n=p.getSymbolAtLocation(r),i=n&&p.getTypeOfSymbolAtLocation(n,r),a=i&&i.properties;a&&a.forEach((function(e){t.add(e.name)}))}function Oe(){pe.forEach((function(r){var n;if(16777216&r.flags){var i=e.getSymbolId(r);me[i]=null!==(n=me[i])&&void 0!==n?n:t.SortText.OptionalMember}}))}function Me(r,n){if(0!==r.size)for(var i=0,a=n;i");return{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:e.createTextSpanFromNode(i.tagName),entries:[{name:o,kind:"class",kindModifiers:void 0,sortText:t.SortText.LocationPriority}]}}return}(y,r);if(L)return L}var R=e.createSortedArray();if(b(r,a)){var B=I(d,R,void 0,_,y,r,n,i,e.getEmitScriptTarget(a),o,p,c,a,l,A,h,N,k,F,E,T,O,N,w);!function(r,n,i,a,o){e.getNameTable(r).forEach((function(r,s){if(r!==n){var c=e.unescapeLeadingUnderscores(s);!i.has(c)&&e.isIdentifierText(c,a)&&(i.add(c),e.insertSorted(o,{name:c,kind:"warning",kindModifiers:"",sortText:t.SortText.JavascriptIdentifiers,isFromUncheckedFile:!0},m))}}))}(r,y.pos,B,e.getEmitScriptTarget(a),R)}else{if(!(g||d&&0!==d.length||0!==S))return;I(d,R,void 0,_,y,r,n,i,e.getEmitScriptTarget(a),o,p,c,a,l,A,h,N,k,F,E,T,O,N,w)}if(0!==S)for(var J=new e.Set(R.map((function(e){return e.name}))),j=0,U=G(S,!P&&e.isSourceFileJS(r));j=0&&!l(r,n[i],115);i--);return e.forEach(a(t.statement),(function(e){s(t,e)&&l(r,e.getFirstToken(),81,86)})),r}function d(e){var t=c(e);if(t)switch(t.kind){case 242:case 243:case 244:case 240:case 241:return u(t);case 249:return _(t)}}function _(t){var r=[];return l(r,t.getFirstToken(),107),e.forEach(t.caseBlock.clauses,(function(n){l(r,n.getFirstToken(),82,88),e.forEach(a(n),(function(e){s(t,e)&&l(r,e.getFirstToken(),81)}))})),r}function p(t,r){var n=[];(l(n,t.getFirstToken(),111),t.catchClause&&l(n,t.catchClause.getFirstToken(),83),t.finallyBlock)&&l(n,e.findChildOfKind(t,96,r),96);return n}function f(t,r){var n=function(t){for(var r=t;r.parent;){var n=r.parent;if(e.isFunctionBlock(n)||305===n.kind)return n;if(e.isTryStatement(n)&&n.tryBlock===r&&n.catchClause)return r;r=n}}(t);if(n){var a=[];return e.forEach(i(n),(function(t){a.push(e.findChildOfKind(t,109,r))})),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,(function(t){a.push(e.findChildOfKind(t,105,r))})),a}}function m(t,r){var n=e.getContainingFunction(t);if(n){var a=[];return e.forEachReturnStatement(e.cast(n.body,e.isBlock),(function(t){a.push(e.findChildOfKind(t,105,r))})),e.forEach(i(n.body),(function(t){a.push(e.findChildOfKind(t,109,r))})),a}}function g(t){var r=e.getContainingFunction(t);if(r){var n=[];return r.modifiers&&r.modifiers.forEach((function(e){l(n,e,131)})),e.forEachChild(r,(function(t){y(t,(function(t){e.isAwaitExpression(t)&&l(n,t.getFirstToken(),132)}))})),n}}function y(t,r){r(t),e.isFunctionLike(t)||e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isModuleDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isTypeNode(t)||e.forEachChild(t,(function(e){return y(e,r)}))}t.getDocumentHighlights=function(t,i,a,o,s){var c=e.getTouchingPropertyName(a,o);if(c.parent&&(e.isJsxOpeningElement(c.parent)&&c.parent.tagName===c||e.isJsxClosingElement(c.parent))){var h=c.parent.parent,v=[h.openingElement,h.closingElement].map((function(e){return n(e.tagName,a)}));return[{fileName:a.fileName,highlightSpans:v}]}return function(t,r,n,i,a){var o=new e.Set(a.map((function(e){return e.fileName}))),s=e.FindAllReferences.getReferenceEntriesForNode(t,r,n,a,i,void 0,o);if(!s)return;var c=e.arrayToMultiMap(s.map(e.FindAllReferences.toHighlightSpan),(function(e){return e.fileName}),(function(e){return e.span})),l=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames());return e.mapDefined(e.arrayFrom(c.entries()),(function(t){var r=t[0],i=t[1];if(!o.has(r)){if(!n.redirectTargetsMap.has(e.toPath(r,n.getCurrentDirectory(),l)))return;var s=n.getSourceFile(r),c=e.find(a,(function(e){return!!e.redirectInfo&&e.redirectInfo.redirectTarget===s}));r=c.fileName,e.Debug.assert(o.has(r))}return{fileName:r,highlightSpans:i}}))}(o,c,t,i,s)||function(t,i){var a=function(t,i){switch(t.kind){case 99:case 91:return e.isIfStatement(t.parent)?function(t,r){for(var i=function(t,r){var n=[];for(;e.isIfStatement(t.parent)&&t.parent.elseStatement===t;)t=t.parent;for(;;){var i=t.getChildren(r);l(n,i[0],99);for(var a=i.length-1;a>=0&&!l(n,i[a],91);a--);if(!t.elseStatement||!e.isIfStatement(t.elseStatement))break;t=t.elseStatement}return n}(t,r),a=[],o=0;o=s.end;d--)if(!e.isWhiteSpaceSingleLine(r.text.charCodeAt(d))){u=!1;break}if(u){a.push({fileName:r.fileName,textSpan:e.createTextSpanFromBounds(s.getStart(),c.end),kind:"reference"}),o++;continue}}a.push(n(i[o],r))}return a}(t.parent,i):void 0;case 105:return c(t.parent,e.isReturnStatement,m);case 109:return c(t.parent,e.isThrowStatement,f);case 111:case 83:case 96:return c(83===t.kind?t.parent.parent:t.parent,e.isTryStatement,p);case 107:return c(t.parent,e.isSwitchStatement,_);case 82:case 88:return e.isDefaultClause(t.parent)||e.isCaseClause(t.parent)?c(t.parent.parent.parent,e.isSwitchStatement,_):void 0;case 81:case 86:return c(t.parent,e.isBreakOrContinueStatement,d);case 97:case 115:case 90:return c(t.parent,(function(t){return e.isIterationStatement(t,!0)}),u);case 134:return s(e.isConstructorDeclaration,[134]);case 136:case 149:return s(e.isAccessor,[136,149]);case 132:return c(t.parent,e.isAwaitExpression,g);case 131:return h(g(t));case 125:return h(function(t){var r=e.getContainingFunction(t);if(!r)return;var n=[];return e.forEachChild(r,(function(t){y(t,(function(t){e.isYieldExpression(t)&&l(n,t.getFirstToken(),125)}))})),n}(t));case 101:return;default:return e.isModifierKind(t.kind)&&(e.isDeclaration(t.parent)||e.isVariableStatement(t.parent))?h((a=t.kind,o=t.parent,e.mapDefined(function(t,n){var i=t.parent;switch(i.kind){case 262:case 305:case 235:case 289:case 290:return 128&n&&e.isClassDeclaration(t)?r(r([],t.members,!0),[t],!1):i.statements;case 171:case 169:case 256:return r(r([],i.parameters,!0),e.isClassLike(i.parent)?i.parent.members:[],!0);case 257:case 226:case 258:case 182:var a=i.members;if(92&n){var o=e.find(i.members,e.isConstructorDeclaration);if(o)return r(r([],a,!0),o.parameters,!0)}else if(128&n)return r(r([],a,!0),[i],!1);return a;case 205:return;default:e.Debug.assertNever(i,"Invalid container kind.")}}(o,e.modifierToFlag(a)),(function(t){return e.findModifier(t,a)})))):void 0}var a,o;function s(r,n){return c(t.parent,r,(function(t){return e.mapDefined(t.symbol.declarations,(function(t){return r(t)?e.find(t.getChildren(i),(function(t){return e.contains(n,t.kind)})):void 0}))}))}function c(e,t,r){return t(e)?h(r(e,i)):void 0}function h(e){return e&&e.map((function(e){return n(e,i)}))}}(t,i);return a&&[{fileName:i.fileName,highlightSpans:a}]}(c,a)}}(e.DocumentHighlights||(e.DocumentHighlights={}))}(c||(c={})),function(e){function t(e){return!!e.sourceFile}function r(r,n,a){void 0===n&&(n="");var o=new e.Map,s=e.createGetCanonicalFileName(!!r);function c(e){return"function"==typeof e.getCompilationSettings?e.getCompilationSettings():e}function l(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!0,o)}function u(e,t,r,n,i,a,o){return _(e,t,c(r),n,i,a,!1,o)}function d(r,n){var i=t(r)?r:r.get(e.Debug.checkDefined(n,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return e.Debug.assert(void 0===n||!i||i.sourceFile.scriptKind===n,"Script kind should match provided ScriptKind:".concat(n," and sourceFile.scriptKind: ").concat(null==i?void 0:i.sourceFile.scriptKind,", !entry: ").concat(!i)),i}function _(r,n,i,s,l,u,_,p){var f,m,g,y;p=e.ensureScriptKind(r,p);var h=c(i),v=i===h?void 0:i,b={languageVersion:6===p?100:e.getEmitScriptTarget(h),impliedNodeFormat:v&&e.getImpliedNodeFormatForFile(n,null===(y=null===(g=null===(m=null===(f=v.getCompilerHost)||void 0===f?void 0:f.call(v))||void 0===m?void 0:m.getModuleResolutionCache)||void 0===g?void 0:g.call(m))||void 0===y?void 0:y.getPackageJsonInfoCache(),v,h),setExternalModuleIndicator:e.getSetExternalModuleIndicator(h)},x=o.size,S=e.getOrUpdate(o,s,(function(){return new e.Map}));if(e.tracing){o.size>x&&e.tracing.instant("session","createdDocumentRegistryBucket",{configFilePath:h.configFilePath,key:s});var D=!e.isDeclarationFileName(n)&&e.forEachEntry(o,(function(e,t){return t!==s&&e.has(n)&&t}));D&&e.tracing.instant("session","documentRegistryBucketOverlap",{path:n,key1:D,key2:s})}var C=S.get(n),T=C&&d(C,p);!T&&a&&((E=a.getDocument(s,n))&&(e.Debug.assert(_),T={sourceFile:E,languageServiceRefCount:0},k()));if(T)T.sourceFile.version!==u&&(T.sourceFile=e.updateLanguageServiceSourceFile(T.sourceFile,l,u,l.getChangeRange(T.sourceFile.scriptSnapshot)),a&&a.setDocument(s,n,T.sourceFile)),_&&T.languageServiceRefCount++;else{var E=e.createLanguageServiceSourceFile(r,l,b,u,!1,p);a&&a.setDocument(s,n,E),T={sourceFile:E,languageServiceRefCount:1},k()}return e.Debug.assert(0!==T.languageServiceRefCount),T.sourceFile;function k(){if(C)if(t(C)){var r=new e.Map;r.set(C.sourceFile.scriptKind,C),r.set(p,T),S.set(n,r)}else C.set(p,T);else S.set(n,T)}}function p(r,n,i){var a=e.Debug.checkDefined(o.get(n)),s=a.get(r),c=d(s,i);c.languageServiceRefCount--,e.Debug.assert(c.languageServiceRefCount>=0),0===c.languageServiceRefCount&&(t(s)?a.delete(r):(s.delete(i),1===s.size&&a.set(r,e.firstDefinedIterator(s.values(),e.identity))))}return{acquireDocument:function(t,r,a,o,u){return l(t,e.toPath(t,n,s),r,i(c(r)),a,o,u)},acquireDocumentWithKey:l,updateDocument:function(t,r,a,o,l){return u(t,e.toPath(t,n,s),r,i(c(r)),a,o,l)},updateDocumentWithKey:u,releaseDocument:function(t,r,a){return p(e.toPath(t,n,s),i(r),a)},releaseDocumentWithKey:p,getLanguageServiceRefCounts:function(t,r){return e.arrayFrom(o.entries(),(function(e){var n=e[0],i=e[1].get(t),a=i&&d(i,r);return[n,a&&a.languageServiceRefCount]}))},reportStats:function(){var r=e.arrayFrom(o.keys()).filter((function(e){return e&&"_"===e.charAt(0)})).map((function(e){var r=o.get(e),n=[];return r.forEach((function(e,r){t(e)?n.push({name:r,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((function(e,t){return n.push({name:r,scriptKind:t,refCount:e.languageServiceRefCount})}))})),n.sort((function(e,t){return t.refCount-e.refCount})),{bucket:e,sourceFiles:n}}));return JSON.stringify(r,void 0,2)},getKeyForCompilationSettings:i}}function n(t){var r;if(null===t||"object"!=typeof t)return""+t;if(e.isArray(t))return"[".concat(null===(r=e.map(t,(function(e){return n(e)})))||void 0===r?void 0:r.join(","),"]");var i="{";for(var a in t)e.hasOwnProperty.call(t,a)&&(i+="".concat(a,": ").concat(n(t[a])));return i+"}"}function i(t){return e.sourceFileAffectingCompilerOptions.map((function(r){return n(e.getCompilerOptionValue(t,r))})).join("|")+(t.pathsBasePath?"|".concat(t.pathsBasePath):void 0)}e.createDocumentRegistry=function(e,t){return r(e,t)},e.createDocumentRegistryInternal=r}(c||(c={})),function(e){!function(t){var r,i;function a(t,r){return e.forEach(305===t.kind?t.statements:t.body.statements,(function(t){return r(t)||u(t)&&e.forEach(t.body&&t.body.statements,r)}))}function o(t,r){if(t.externalModuleIndicator||void 0!==t.imports)for(var n=0,i=t.imports;n2&&(e.Debug.assert(void 0===n),i+=1,a-=1),e.createTextSpanFromBounds(i,a)}function x(e){return 0===e.kind?e.textSpan:b(e.node,e.node.getSourceFile())}function S(t){var r=e.getDeclarationFromName(t);return!!r&&function(t){if(16777216&t.flags)return!0;switch(t.kind){case 221:case 203:case 257:case 226:case 88:case 260:case 299:case 275:case 267:case 265:case 270:case 258:case 338:case 345:case 285:case 261:case 264:case 268:case 274:case 164:case 297:case 259:case 163:return!0;case 296:return!e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent);case 256:case 213:case 171:case 169:case 172:case 173:return!!t.body;case 254:case 167:return!!t.initializer||e.isCatchClause(t.parent);case 168:case 166:case 347:case 340:return!1;default:return e.Debug.failBadSyntaxKind(t)}}(r)||88===t.kind||e.isWriteAccess(t)}function D(t,r){var n;if(!r)return!1;var i=e.getDeclarationFromName(t)||(88===t.kind?t.parent:e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)?t.parent.parent:void 0),a=i&&e.isBinaryExpression(i)?i.left:void 0;return!(!i||!(null===(n=r.declarations)||void 0===n?void 0:n.some((function(e){return e===i||e===a}))))}(i=t.DefinitionKind||(t.DefinitionKind={}))[i.Symbol=0]="Symbol",i[i.Label=1]="Label",i[i.Keyword=2]="Keyword",i[i.This=3]="This",i[i.String=4]="String",i[i.TripleSlashReference=5]="TripleSlashReference",(a=t.EntryKind||(t.EntryKind={}))[a.Span=0]="Span",a[a.Node=1]="Node",a[a.StringLiteral=2]="StringLiteral",a[a.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",a[a.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",t.nodeEntry=c,t.isContextWithStartAndEndNode=l,t.getContextNode=d,t.toContextSpan=_,(o=t.FindReferencesUse||(t.FindReferencesUse={}))[o.Other=0]="Other",o[o.References=1]="References",o[o.Rename=2]="Rename",t.findReferencedSymbols=function(t,r,i,a,o){var c=e.getTouchingPropertyName(a,o),l={use:1},u=s.getReferencedSymbolsForNode(o,c,t,i,r,l),p=t.getTypeChecker(),f=s.getAdjustedNode(c,l),m=function(t){return 88===t.kind||!!e.getDeclarationFromName(t)||e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)}(f)?p.getSymbolAtLocation(f):void 0;return u&&u.length?e.mapDefined(u,(function(t){var i=t.definition,a=t.references;return i&&{definition:p.runWithCancellationToken(r,(function(t){return function(t,r,i){var a=function(){switch(t.type){case 0:var a=y(p=t.symbol,r,i),o=a.displayParts,s=a.kind,c=o.map((function(e){return e.text})).join(""),l=p.declarations&&e.firstOrUndefined(p.declarations),u=l?e.getNameOfDeclaration(l)||l:i;return n(n({},g(u)),{name:c,kind:s,displayParts:o,context:d(l)});case 1:u=t.node;return n(n({},g(u)),{name:u.text,kind:"label",displayParts:[e.displayPart(u.text,e.SymbolDisplayPartKind.text)]});case 2:u=t.node;var _=e.tokenToString(u.kind);return n(n({},g(u)),{name:_,kind:"keyword",displayParts:[{text:_,kind:"keyword"}]});case 3:u=t.node;var p,f=(p=r.getSymbolAtLocation(u))&&e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,p,u.getSourceFile(),e.getContainerNode(u),u).displayParts||[e.textPart("this")];return n(n({},g(u)),{name:"this",kind:"var",displayParts:f});case 4:u=t.node;return n(n({},g(u)),{name:u.text,kind:"var",displayParts:[e.displayPart(e.getTextOfNode(u),e.SymbolDisplayPartKind.stringLiteral)]});case 5:return{textSpan:e.createTextSpanFromRange(t.reference),sourceFile:t.file,name:t.reference.fileName,kind:"string",displayParts:[e.displayPart('"'.concat(t.reference.fileName,'"'),e.SymbolDisplayPartKind.stringLiteral)]};default:return e.Debug.assertNever(t)}}(),o=a.sourceFile,s=a.textSpan,c=a.name,l=a.kind,u=a.displayParts,p=a.context;return n({containerKind:"",containerName:"",fileName:o.fileName,kind:l,name:c,textSpan:s,displayParts:u},_(s,o,p))}(i,t,c)})),references:a.map((function(e){return function(e,t){var r=h(e);return t?n(n({},r),{isDefinition:0!==e.kind&&D(e.node,t)}):r}(e,m)}))}})):void 0},t.getImplementationsAtPosition=function(t,i,a,o,s){var c,l=e.getTouchingPropertyName(o,s),u=p(t,i,a,l,s);if(206===l.parent.kind||203===l.parent.kind||207===l.parent.kind||106===l.kind)c=u&&r([],u,!0);else for(var d=u&&r([],u,!0),_=new e.Map;d&&d.length;){var f=d.shift();if(e.addToSeen(_,e.getNodeId(f.node))){c=e.append(c,f);var m=p(t,i,a,f.node,f.node.pos);m&&d.push.apply(d,m)}}var g=t.getTypeChecker();return e.map(c,(function(t){return function(t,r){var i=v(t);if(0!==t.kind){var a=t.node;return n(n({},i),function(t,r){var n=r.getSymbolAtLocation(e.isDeclaration(t)&&t.name?t.name:t);return n?y(n,r,t):205===t.kind?{kind:"interface",displayParts:[e.punctuationPart(20),e.textPart("object literal"),e.punctuationPart(21)]}:226===t.kind?{kind:"local class",displayParts:[e.punctuationPart(20),e.textPart("anonymous local class"),e.punctuationPart(21)]}:{kind:e.getNodeKind(t),displayParts:[]}}(a,r))}return n(n({},i),{kind:"",displayParts:[]})}(t,g)}))},t.findReferenceOrRenameEntries=function(t,r,n,i,a,o,c){return e.map(m(s.getReferencedSymbolsForNode(a,i,t,n,r,o)),(function(e){return c(e,i,t.getTypeChecker())}))},t.getReferenceEntriesForNode=f,t.toRenameLocation=function(t,r,i,a){return n(n({},v(t)),a&&function(t,r,n){if(0!==t.kind&&e.isIdentifier(r)){var i=t.node,a=t.kind,o=i.parent,s=r.text,c=e.isShorthandPropertyAssignment(o);if(c||e.isObjectBindingElementWithoutPropertyName(o)&&o.name===i&&void 0===o.dotDotDotToken){var l={prefixText:s+": "},u={suffixText:": "+s};if(3===a)return l;if(4===a)return u;if(c){var d=o.parent;return e.isObjectLiteralExpression(d)&&e.isBinaryExpression(d.parent)&&e.isModuleExportsAccessExpression(d.parent.left)?l:u}return l}if(e.isImportSpecifier(o)&&!o.propertyName){var _=e.isExportSpecifier(r.parent)?n.getExportSpecifierLocalTargetSymbol(r.parent):n.getSymbolAtLocation(r);return e.contains(_.declarations,o)?{prefixText:s+" as "}:e.emptyOptions}if(e.isExportSpecifier(o)&&!o.propertyName)return r===t.node||n.getSymbolAtLocation(r)===n.getSymbolAtLocation(t.node)?{prefixText:s+" as "}:{suffixText:" as "+s}}return e.emptyOptions}(t,r,i))},t.toReferenceEntry=h,t.toHighlightSpan=function(e){var t=v(e);if(0===e.kind)return{fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};var r=S(e.node),i=n({textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:2===e.kind||void 0},t.contextSpan&&{contextSpan:t.contextSpan});return{fileName:t.fileName,span:i}},t.getTextSpanOfEntry=x,function(r){function n(t,r){return 1===r.use?t=e.getAdjustedReferenceLocation(t):2===r.use&&(t=e.getAdjustedRenameLocation(t)),t}function i(t,r,n){for(var i,a=0,o=r.get(t.path)||e.emptyArray;a=0&&!(c>n.end);){var l=c+s;0!==c&&e.isIdentifierPart(a.charCodeAt(c-1),99)||l!==o&&e.isIdentifierPart(a.charCodeAt(l),99)||i.push(c),c=a.indexOf(r,c+s+1)}return i}function C(t,r){var n=t.getSourceFile(),i=r.text,a=e.mapDefined(S(n,i,t),(function(t){return t===r||e.isJumpStatementTarget(t)&&e.getTargetLabel(t,i)===r?c(t):void 0}));return[{definition:{type:1,node:r},references:a}]}function T(e,t,r,n){return void 0===n&&(n=!0),r.cancellationToken.throwIfCancellationRequested(),E(e,e,t,r,n)}function E(e,t,r,n,i){if(n.markSearchedSymbols(t,r.allSearchSymbols))for(var a=0,o=D(t,r.text,e);a0;o--){S(t,i=n[o])}return[n.length-1,n[0]]}function S(e,t){var r=h(e,t);m(o,r),l.push(o),u.push(s),s=void 0,o=r}function D(){o.children&&(A(o.children,o),O(o.children)),o=l.pop(),s=u.pop()}function C(e,t,r){S(e,r),k(t),D()}function T(t){t.initializer&&function(e){switch(e.kind){case 214:case 213:case 226:return!0;default:return!1}}(t.initializer)?(S(t),e.forEachChild(t.initializer,k),D()):C(t,t.initializer)}function E(t){return!e.hasDynamicName(t)||221!==t.kind&&e.isPropertyAccessExpression(t.name.expression)&&e.isIdentifier(t.name.expression.expression)&&"Symbol"===e.idText(t.name.expression.expression)}function k(t){var r;if(i.throwIfCancellationRequested(),t&&!e.isToken(t))switch(t.kind){case 171:var n=t;C(n,n.body);for(var a=0,o=n.parameters;a0&&(S(j,L),e.forEachChild(j.right,k),D()):e.isFunctionExpression(j.right)||e.isArrowFunction(j.right)?C(t,j.right,L):(S(j,L),C(t,j.right,I.name),D()),void b(M);case 7:case 9:var R=t,B=(L=7===P?R.arguments[0]:R.arguments[0].expression,R.arguments[1]),J=x(t,L);M=J[0];return S(t,J[1]),S(t,e.setTextRange(e.factory.createIdentifier(B.text),B)),k(t.arguments[2]),D(),D(),void b(M);case 5:var j,U=(I=(j=t).left).expression;if(e.isIdentifier(U)&&"prototype"!==e.getElementOrPropertyAccessName(I)&&s&&s.has(U.text))return void(e.isFunctionExpression(j.right)||e.isArrowFunction(j.right)?C(t,j.right,U):e.isBindableStaticAccessExpression(I)&&(S(j,U),C(j.left,j.right,e.getNameOrArgument(I)),D()));break;case 4:case 0:case 8:break;default:e.Debug.assertNever(P)}default:e.hasJSDocNodes(t)&&e.forEach(t.jsDoc,(function(t){e.forEach(t.tags,(function(t){e.isJSDocTypeAlias(t)&&y(t)}))})),e.forEachChild(t,k)}}function A(t,r){var n=new e.Map;e.filterMutate(t,(function(t,i){var a=t.name||e.getNameOfDeclaration(t.node),o=a&&p(a);if(!o)return!0;var s=n.get(o);if(!s)return n.set(o,t),!0;if(s instanceof Array){for(var c=0,l=s;c0)return Q(n)}switch(t.kind){case 305:var i=t;return e.isExternalModule(i)?'"'.concat(e.escapeString(e.getBaseFileName(e.removeFileExtension(e.normalizePath(i.fileName)))),'"'):"";case 271:return e.isExportAssignment(t)&&t.isExportEquals?"export=":"default";case 214:case 256:case 213:case 257:case 226:return 512&e.getSyntacticModifierFlags(t)?"default":W(t);case 171:return"constructor";case 175:return"new()";case 174:return"()";case 176:return"[]";default:return""}}function B(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:q(t.node),spans:j(t),nameSpan:t.name&&G(t.name),childItems:e.map(t.children,B)}}function J(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:q(t.node),spans:j(t),childItems:e.map(t.children,(function(t){return{text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:e.getNodeModifiers(t.node),spans:j(t),childItems:d,indent:0,bolded:!1,grayed:!1}}))||d,indent:t.indent,bolded:!1,grayed:!1}}function j(e){var t=[G(e.node)];if(e.additionalNodes)for(var r=0,n=e.additionalNodes;r0)return Q(e.declarationNameToString(t.name));if(e.isVariableDeclaration(r))return Q(e.declarationNameToString(r.name));if(e.isBinaryExpression(r)&&63===r.operatorToken.kind)return p(r.left).replace(c,"");if(e.isPropertyAssignment(r))return p(r.name);if(512&e.getSyntacticModifierFlags(t))return"default";if(e.isClassLike(t))return"";if(e.isCallExpression(r)){var n=H(r.expression);if(void 0!==n){if((n=Q(n)).length>150)return"".concat(n," callback");var i=Q(e.mapDefined(r.arguments,(function(t){return e.isStringLiteralLike(t)?t.getText(a):void 0})).join(", "));return"".concat(n,"(").concat(i,") callback")}}return""}function H(t){if(e.isIdentifier(t))return t.text;if(e.isPropertyAccessExpression(t)){var r=H(t.expression),n=t.name.text;return void 0===r?n:"".concat(r,".").concat(n)}}function Q(e){return(e=e.length>150?e.substring(0,150)+"...":e).replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}}(e.NavigationBar||(e.NavigationBar={}))}(c||(c={})),function(e){!function(t){function r(t,r){for(var i=e.createScanner(t.languageVersion,!1,t.languageVariant),a=[],o=0,s=0,c=r;s=2)return!0}return!1}function i(t,r){var n=e.isStringLiteral(r)&&r.text;return e.isString(n)&&e.some(t.moduleAugmentations,(function(t){return e.isStringLiteral(t)&&t.text===n}))}function a(t){return void 0!==t&&e.isStringLiteralLike(t)?t.text:void 0}function o(t){var r;if(0===t.length)return t;var n=function(t){for(var r,n={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]},a=0,o=t;a0?m[0]:h[0],A=0===E.length?S?void 0:e.factory.createNamedImports(e.emptyArray):0===h.length?e.factory.createNamedImports(E):e.factory.updateNamedImports(h[0].importClause.namedBindings,E);f&&S&&A?(s.push(c(k,S,void 0)),s.push(c(null!==(r=h[0])&&void 0!==r?r:k,void 0,A))):s.push(c(k,S,A))}}else{var N=m[0];s.push(c(N,N.importClause.name,y[0].importClause.namedBindings))}}return s}function s(t){if(0===t.length)return t;var r=function(e){for(var t,r=[],n=[],i=0,a=e;i...")}function d(t){var n=e.createTextSpanFromBounds(t.openingFragment.getStart(r),t.closingFragment.getEnd());return l(n,"code",n,!1,"<>...")}function _(e){if(0!==e.properties.length)return s(e.getStart(r),e.getEnd(),"code")}function p(e){if(14!==e.kind||0!==e.text.length)return s(e.getStart(r),e.getEnd(),"code")}function f(t,r){return void 0===r&&(r=18),m(t,!1,!e.isArrayLiteralExpression(t.parent)&&!e.isCallExpression(t.parent),r)}function m(n,i,a,o,s){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=18),void 0===s&&(s=18===o?19:23);var l=e.findChildOfKind(t,o,r),u=e.findChildOfKind(t,s,r);return l&&u&&c(l,u,n,r,i,a)}function g(t){return t.length?l(e.createTextSpanFromRange(t),"code"):void 0}function y(t){if(!e.positionsAreOnSameLine(t.getStart(),t.getEnd(),r))return l(e.createTextSpanFromBounds(t.getStart(),t.getEnd()),"code",e.createTextSpanFromNode(t))}}(r,t);_&&i.push(_),u--,e.isCallExpression(r)?(u++,g(r.expression),u--,r.arguments.forEach(g),null===(d=r.typeArguments)||void 0===d||d.forEach(g)):e.isIfStatement(r)&&r.elseStatement&&e.isIfStatement(r.elseStatement)?(g(r.expression),g(r.thenStatement),u++,g(r.elseStatement),u--):r.forEachChild(g),u++}}}(t,n,u),function(t,r){for(var n=[],a=t.getLineStarts(),o=0,s=a;o1&&a.push(s(c,l,"comment"))}}function o(t,r,n,i){e.isJsxText(t)||a(t.pos,r,n,i)}function s(t,r,n){return l(e.createTextSpanFromBounds(t,r),n)}function c(t,r,n,i,a,o){return void 0===a&&(a=!1),void 0===o&&(o=!0),l(e.createTextSpanFromBounds(o?t.getFullStart():t.getStart(i),r.getEnd()),"code",e.createTextSpanFromNode(n,i),a)}function l(e,t,r,n,i){return void 0===r&&(r=e),void 0===n&&(n=!1),void 0===i&&(i="..."),{textSpan:e,kind:t,hintSpan:r,bannerText:i,autoCollapse:n}}}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}))}(c||(c={})),function(e){var t;function r(e,t){return{kind:e,isCaseSensitive:t}}function n(e,t){var r=t.get(e);return r||t.set(e,r=h(e)),r}function i(i,a,o){var s=function(e,t){for(var r=e.length-t.length,n=function(r){if(T(t,(function(t,n){return _(e.charCodeAt(n+r))===t})))return{value:r}},i=0;i<=r;i++){var a=n(i);if("object"==typeof a)return a.value}return-1}(i,a.textLowerCase);if(0===s)return r(a.text.length===i.length?t.exact:t.prefix,e.startsWith(i,a.text));if(a.isLowerCase){if(-1===s)return;for(var d=0,p=n(i,o);d0)return r(t.substring,!0);if(a.characterSpans.length>0){var m=n(i,o),g=!!l(i,m,a,!1)||!l(i,m,a,!0)&&void 0;if(void 0!==g)return r(t.camelCase,g)}}}function a(e,t,r){if(T(t.totalTextChunk.text,(function(e){return 32!==e&&42!==e}))){var n=i(e,t.totalTextChunk,r);if(n)return n}for(var a,s=0,c=t.subWordTextChunks;s=65&&t<=90)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return!1;var r=String.fromCharCode(t);return r===r.toUpperCase()}function d(t){if(t>=97&&t<=122)return!0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return!1;var r=String.fromCharCode(t);return r===r.toLowerCase()}function _(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){return u(e)||d(e)||p(e)||95===e||36===e}function m(e){for(var t=[],r=0,n=0,i=0;i0&&(t.push(g(e.substr(r,n))),n=0)}return n>0&&t.push(g(e.substr(r,n))),t}function g(e){var t=e.toLowerCase();return{text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:y(e)}}function y(e){return v(e,!1)}function h(e){return v(e,!0)}function v(t,r){for(var n=[],i=0,a=1;at.length)return;for(var c=n.length-2,l=t.length-1;c>=0;c-=1,l-=1)s=o(s,a(t[l],n[c],i));return s}(t,i,n,r)},getMatchForLastSegmentOfPattern:function(t){return a(t,e.last(n),r)},patternContainsDots:n.length>1}},e.breakIntoCharacterSpans=y,e.breakIntoWordSpans=h}(c||(c={})),function(e){e.preProcessFile=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i,a,o,s={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},c=[],l=0,u=!1;function d(){return a=o,18===(o=e.scanner.scan())?l++:19===o&&l--,o}function _(){var t=e.scanner.getTokenValue(),r=e.scanner.getTokenPos();return{fileName:t,pos:r,end:r+t.length}}function p(){c.push(_()),f()}function f(){0===l&&(u=!0)}function m(){var t=e.scanner.getToken();return 135===t&&(141===(t=d())&&10===(t=d())&&(i||(i=[]),i.push({ref:_(),depth:l})),!0)}function g(){if(24===a)return!1;var t=e.scanner.getToken();if(100===t){if(20===(t=d())){if(10===(t=d())||14===t)return p(),!0}else{if(10===t)return p(),!0;if(152===t){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 156!==t&&(41===t||18===t||79===t||e.isKeyword(t))}));r&&(t=d())}if(79===t||e.isKeyword(t))if(156===(t=d())){if(10===(t=d()))return p(),!0}else if(63===t){if(h(!0))return!0}else{if(27!==t)return!0;t=d()}if(18===t){for(t=d();19!==t&&1!==t;)t=d();19===t&&156===(t=d())&&10===(t=d())&&p()}else 41===t&&127===(t=d())&&(79===(t=d())||e.isKeyword(t))&&156===(t=d())&&10===(t=d())&&p()}return!0}return!1}function y(){var t=e.scanner.getToken();if(93===t){if(f(),152===(t=d())){var r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 41===t||18===t}));r&&(t=d())}if(18===t){for(t=d();19!==t&&1!==t;)t=d();19===t&&156===(t=d())&&10===(t=d())&&p()}else if(41===t)156===(t=d())&&10===(t=d())&&p();else if(100===t){if(152===(t=d())){r=e.scanner.lookAhead((function(){var t=e.scanner.scan();return 79===t||e.isKeyword(t)}));r&&(t=d())}if((79===t||e.isKeyword(t))&&63===(t=d())&&h(!0))return!0}return!0}return!1}function h(t,r){void 0===r&&(r=!1);var n=t?d():e.scanner.getToken();return 146===n&&(20===(n=d())&&(10===(n=d())||r&&14===n)&&p(),!0)}function v(){var t=e.scanner.getToken();if(79===t&&"define"===e.scanner.getTokenValue()){if(20!==(t=d()))return!0;if(10===(t=d())||14===t){if(27!==(t=d()))return!0;t=d()}if(22!==t)return!0;for(t=d();23!==t&&1!==t;)10!==t&&14!==t||p(),t=d();return!0}return!1}if(r&&function(){for(e.scanner.setText(t),d();1!==e.scanner.getToken();){if(15===e.scanner.getToken()){var r=[e.scanner.getToken()],i=e.scanner.scan();e:for(;e.length(r);){switch(i){case 1:break e;case 100:g();break;case 15:r.push(i);break;case 18:e.length(r)&&r.push(i);break;case 19:e.length(r)&&(15===e.lastOrUndefined(r)?17===e.scanner.reScanTemplateToken(!1)&&r.pop():r.pop())}i=e.scanner.scan()}d()}m()||g()||y()||n&&(h(!1,!0)||v())||d()}e.scanner.setText(void 0)}(),e.processCommentPragmas(s,t),e.processPragmasIntoFields(s,e.noop),u){if(i)for(var b=0,x=i;bt)break e;var h=e.singleOrUndefined(e.getTrailingCommentRanges(i.text,g.end));if(h&&2===h.kind&&D(h.pos,h.end),r(i,t,g)){if(e.isBlock(g)||e.isTemplateSpan(g)||e.isTemplateHead(g)||e.isTemplateTail(g)||m&&e.isTemplateHead(m)||e.isVariableDeclarationList(g)&&e.isVariableStatement(_)||e.isSyntaxList(g)&&e.isVariableDeclarationList(_)||e.isVariableDeclaration(g)&&e.isSyntaxList(_)&&1===p.length||e.isJSDocTypeExpression(g)||e.isJSDocSignature(g)||e.isJSDocTypeLiteral(g)){_=g;break}if(e.isTemplateSpan(_)&&y&&e.isTemplateMiddleOrTemplateTail(y))S(g.getFullStart()-"${".length,y.getStart()+"}".length);var v=e.isSyntaxList(g)&&(c=void 0,18===(c=(s=m)&&s.kind)||22===c||20===c||280===c)&&l(y)&&!e.positionsAreOnSameLine(m.getStart(),y.getStart(),i),b=v?m.getEnd():g.getStart(),x=v?y.getStart():u(i,g);e.hasJSDocNodes(g)&&(null===(o=g.jsDoc)||void 0===o?void 0:o.length)&&S(e.first(g.jsDoc).getStart(),x),S(b,x),(e.isStringLiteral(g)||e.isTemplateLiteral(g))&&S(b+1,x-1),_=g;break}if(f===p.length-1)break e}}return d;function S(r,i){if(r!==i){var a=e.createTextSpanFromBounds(r,i);(!d||!e.textSpansEqual(a,d.textSpan)&&e.textSpanIntersectsWithPosition(a,t))&&(d=n({textSpan:a},d&&{parent:d}))}}function D(e,t){S(e,t);for(var r=e;47===i.text.charCodeAt(r);)r++;S(r,t)}};var i=e.or(e.isImportDeclaration,e.isImportEqualsDeclaration);function a(t){if(e.isSourceFile(t))return o(t.getChildAt(0).getChildren(),i);if(e.isMappedTypeNode(t)){var r=t.getChildren(),n=r[0],a=r.slice(1),l=e.Debug.checkDefined(a.pop());e.Debug.assertEqual(n.kind,18),e.Debug.assertEqual(l.kind,19);var u=o(a,(function(e){return e===t.readonlyToken||145===e.kind||e===t.questionToken||57===e.kind})),d=o(u,(function(e){var t=e.kind;return 22===t||163===t||23===t}));return[n,c(s(d,(function(e){return 58===e.kind}))),l]}if(e.isPropertySignature(t))return s(a=o(t.getChildren(),(function(r){return r===t.name||e.contains(t.modifiers,r)})),(function(e){return 58===e.kind}));if(e.isParameter(t)){var _=o(t.getChildren(),(function(e){return e===t.dotDotDotToken||e===t.name}));return s(o(_,(function(e){return e===_[0]||e===t.questionToken})),(function(e){return 63===e.kind}))}return e.isBindingElement(t)?s(t.getChildren(),(function(e){return 63===e.kind})):t.getChildren()}function o(e,t){for(var r,n=[],i=0,a=e;i0&&27===e.last(n).kind&&i++;return i}(a,e.isInString(n,r,t));0!==o&&e.Debug.assertLessThan(o,s);var c=function(t,r){var n=t.getFullStart(),i=e.skipTrivia(r.text,t.getEnd(),!1);return e.createTextSpan(n,i-n)}(a,n);return{list:a,argumentIndex:o,argumentCount:s,argumentsSpan:c}}}function s(t,r,n){var i=t.parent;if(e.isCallOrNewExpression(i)){var a=i,s=o(t,r,n);if(!s)return;var c=s.list,l=s.argumentIndex,u=s.argumentCount,d=s.argumentsSpan;return{isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:a},argumentsSpan:d,argumentIndex:l,argumentCount:u}}if(e.isNoSubstitutionTemplateLiteral(t)&&e.isTaggedTemplateExpression(i))return e.isInsideTemplateLiteral(t,r,n)?_(i,0,n):void 0;if(e.isTemplateHead(t)&&210===i.parent.kind){var p=i,f=p.parent;return e.Debug.assert(223===p.kind),_(f,l=e.isInsideTemplateLiteral(t,r,n)?0:1,n)}if(e.isTemplateSpan(i)&&e.isTaggedTemplateExpression(i.parent.parent)){var m=i;f=i.parent.parent;if(e.isTemplateTail(t)&&!e.isInsideTemplateLiteral(t,r,n))return;l=function(t,r,n,i){if(e.Debug.assert(n>=r.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralToken(r))return e.isInsideTemplateLiteral(r,n,i)?0:t+2;return t+1}(m.parent.templateSpans.indexOf(m),t,r,n);return _(f,l,n)}if(e.isJsxOpeningLikeElement(i)){var g=i.attributes.pos,y=e.skipTrivia(n.text,i.attributes.end,!1);return{isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:e.createTextSpan(g,y-g),argumentIndex:0,argumentCount:1}}var h=e.getPossibleTypeArgumentsInfo(t,n);if(h){var v=h.called,b=h.nTypeArguments;return{isTypeParameterList:!0,invocation:a={kind:1,called:v},argumentsSpan:d=e.createTextSpanFromBounds(v.getStart(n),t.end),argumentIndex:b,argumentCount:b+1}}}function c(t){return e.isBinaryExpression(t.parent)?c(t.parent):t}function l(t){return e.isBinaryExpression(t.left)?l(t.left)+1:2}function u(t){return"__type"===t.name&&e.firstDefined(t.declarations,(function(t){return e.isFunctionTypeNode(t)?t.parent.symbol:void 0}))||t}function d(e,t){for(var r=0,n=0,i=e.getChildren();n=0&&i.length>a+1),i[a+1]}function m(t){return 0===t.kind?e.getInvokedExpression(t.node):t.called}function g(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}!function(e){e[e.Call=0]="Call",e[e.TypeArgs=1]="TypeArgs",e[e.Contextual=2]="Contextual"}(n||(n={})),t.getSignatureHelpItems=function(t,r,n,i,d){var _=t.getTypeChecker(),p=e.findTokenOnLeftOfPosition(r,n);if(p){var f=!!i&&"characterTyped"===i.kind;if(!f||!e.isInString(r,n,p)&&!e.isInComment(r,n)){var y=!!i&&"invoked"===i.kind,b=function(t,r,n,i,a){for(var d=function(t){e.Debug.assert(e.rangeContainsRange(t.parent,t),"Not a subspan",(function(){return"Child: ".concat(e.Debug.formatSyntaxKind(t.kind),", parent: ").concat(e.Debug.formatSyntaxKind(t.parent.kind))}));var a=function(t,r,n,i){return function(t,r,n,i){var a=function(t,r,n,i){if(20!==t.kind&&27!==t.kind)return;var a=t.parent;switch(a.kind){case 212:case 169:case 213:case 214:var s=o(t,n,r);if(!s)return;var u=s.argumentIndex,d=s.argumentCount,_=s.argumentsSpan,p=e.isMethodDeclaration(a)?i.getContextualTypeForObjectLiteralElement(a):i.getContextualType(a);return p&&{contextualType:p,argumentIndex:u,argumentCount:d,argumentsSpan:_};case 221:var f=c(a),m=i.getContextualType(f),g=20===t.kind?0:l(a)-1,y=l(f);return m&&{contextualType:m,argumentIndex:g,argumentCount:y,argumentsSpan:e.createTextSpanFromNode(a)};default:return}}(t,n,r,i);if(!a)return;var s=a.contextualType,d=a.argumentIndex,_=a.argumentCount,p=a.argumentsSpan,f=s.getNonNullableType(),m=f.symbol;if(void 0===m)return;var g=e.lastOrUndefined(f.getCallSignatures());return void 0===g?void 0:{isTypeParameterList:!1,invocation:{kind:2,signature:g,node:t,symbol:u(m)},argumentsSpan:p,argumentIndex:d,argumentCount:_}}(t,r,n,i)||s(t,r,n)}(t,r,n,i);if(a)return{value:a}},_=t;!e.isSourceFile(_)&&(a||!e.isBlock(_));_=_.parent){var p=d(_);if("object"==typeof p)return p.value}return}(p,n,r,_,y);if(b){d.throwIfCancellationRequested();var x=function(t,r,n,i,o){var s=t.invocation,c=t.argumentCount;switch(s.kind){case 0:if(o&&!function(t,r,n){if(!e.isCallOrNewExpression(r))return!1;var i=r.getChildren(n);switch(t.kind){case 20:return e.contains(i,t);case 27:var o=e.findContainingList(t);return!!o&&e.contains(i,o);case 29:return a(t,n,r.expression);default:return!1}}(i,s.node,n))return;var l=[],u=r.getResolvedSignatureForSignatureHelp(s.node,l,c);return 0===l.length?void 0:{kind:0,candidates:l,resolvedSignature:u};case 1:var d=s.called;if(o&&!a(i,n,e.isIdentifier(d)?d.parent:d))return;if(0!==(l=e.getPossibleGenericSignatures(d,c,r)).length)return{kind:0,candidates:l,resolvedSignature:e.first(l)};var _=r.getSymbolAtLocation(d);return _&&{kind:1,symbol:_};case 2:return{kind:0,candidates:[s.signature],resolvedSignature:s.signature};default:return e.Debug.assertNever(s)}}(b,_,r,p,f);return d.throwIfCancellationRequested(),x?_.runWithCancellationToken(d,(function(e){return 0===x.kind?h(x.candidates,x.resolvedSignature,b,r,e):function(e,t,r,n){var i=t.argumentCount,a=t.argumentsSpan,o=t.invocation,s=t.argumentIndex,c=n.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);return c?{items:[v(e,c,n,g(o),r)],applicableSpan:a,selectedItemIndex:0,argumentIndex:s,argumentCount:i}:void 0}(x.symbol,b,r,e)})):e.isSourceFileJS(r)?function(t,r,n){if(2===t.invocation.kind)return;var i=m(t.invocation),a=e.isPropertyAccessExpression(i)?i.name.text:void 0,o=r.getTypeChecker();return void 0===a?void 0:e.firstDefined(r.getSourceFiles(),(function(r){return e.firstDefined(r.getNamedDeclarations().get(a),(function(e){var i=e.symbol&&o.getTypeOfSymbolAtLocation(e.symbol,e),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,(function(e){return h(a,a[0],t,r,e,!0)}))}))}))}(b,t,d):void 0}}}},function(e){e[e.Candidate=0]="Candidate",e[e.Type=1]="Type"}(i||(i={})),t.getArgumentInfoForCompletions=function(e,t,r){var n=s(e,t,r);return!n||n.isTypeParameterList||0!==n.invocation.kind?void 0:{invocation:n.invocation.node,argumentCount:n.argumentCount,argumentIndex:n.argumentIndex}};var y=70246400;function h(t,n,i,a,o,s){var c,l=i.isTypeParameterList,u=i.argumentCount,d=i.argumentsSpan,_=i.invocation,p=i.argumentIndex,f=g(_),y=2===_.kind?_.symbol:o.getSymbolAtLocation(m(_))||s&&(null===(c=n.declaration)||void 0===c?void 0:c.symbol),h=y?e.symbolToDisplayParts(o,y,s?a:void 0,void 0):e.emptyArray,v=e.map(t,(function(t){return function(t,n,i,a,o,s){var c=(i?x:S)(t,a,o,s);return e.map(c,(function(i){var s=i.isVariadic,c=i.parameters,l=i.prefix,u=i.suffix,d=r(r([],n,!0),l,!0),_=r(r([],u,!0),function(t,r,n){return e.mapToDisplayParts((function(e){e.writePunctuation(":"),e.writeSpace(" ");var i=n.getTypePredicateOfSignature(t);i?n.writeTypePredicate(i,r,void 0,e):n.writeType(n.getReturnTypeOfSignature(t),r,void 0,e)}))}(t,o,a),!0),p=t.getDocumentationComment(a),f=t.getJsDocTags();return{isVariadic:s,prefixDisplayParts:d,suffixDisplayParts:_,separatorDisplayParts:b,parameters:c,documentation:p,tags:f}}))}(t,h,l,o,f,a)}));0!==p&&e.Debug.assertLessThan(p,u);for(var D=0,C=0,T=0;T1))for(var k=0,A=0,N=E;A=u){D=C+k;break}k++}C+=E.length}e.Debug.assert(-1!==D);var F={items:e.flatMapToMutable(v,e.identity),applicableSpan:d,selectedItemIndex:D,argumentIndex:p,argumentCount:u},P=F.items[D];if(P.isVariadic){var I=e.findIndex(P.parameters,(function(e){return!!e.isRest}));-1t?e.substr(0,t-"...".length)+"...":e}function x(t){var r=e.createPrinter({removeComments:!0});return e.usingSingleLineStringWriter((function(i){var a=u.typeToTypeNode(t,void 0,71286784,i);e.Debug.assertIsDefined(a,"should always get typenode"),r.writeNode(4,a,n,i)}))}}}(e.InlayHints||(e.InlayHints={}))}(c||(c={})),function(e){var t=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;function r(t,r,n){var i=e.tryParseRawSourceMap(r);if(i&&i.sources&&i.file&&i.mappings&&(!i.sourcesContent||!i.sourcesContent.some(e.isString)))return e.createDocumentPositionMapper(t,i,n)}e.getSourceMapper=function(t){var r=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),n=t.getCurrentDirectory(),i=new e.Map,a=new e.Map;return{tryGetSourcePosition:function t(r){if(!e.isDeclarationFileName(r.fileName))return;if(!c(r.fileName))return;var n=s(r.fileName).getSourcePosition(r);return n&&n!==r?t(n)||n:void 0},tryGetGeneratedPosition:function(i){if(e.isDeclarationFileName(i.fileName))return;var a=c(i.fileName);if(!a)return;var o=t.getProgram();if(o.isSourceOfProjectReferenceRedirect(a.fileName))return;var l=o.getCompilerOptions(),u=e.outFile(l),d=u?e.removeFileExtension(u)+".d.ts":e.getDeclarationEmitOutputFilePathWorker(i.fileName,o.getCompilerOptions(),n,o.getCommonSourceDirectory(),r);if(void 0===d)return;var _=s(d,i.fileName).getGeneratedPosition(i);return _===i?void 0:_},toLineColumnOffset:function(e,t){return u(e).getLineAndCharacterOfPosition(t)},clearCache:function(){i.clear(),a.clear()}};function o(t){return e.toPath(t,n,r)}function s(n,i){var s,c=o(n),l=a.get(c);if(l)return l;if(t.getDocumentPositionMapper)s=t.getDocumentPositionMapper(n,i);else if(t.readFile){var d=u(n);s=d&&e.getDocumentPositionMapper({getSourceFileLike:u,getCanonicalFileName:r,log:function(e){return t.log(e)}},n,e.getLineInfo(d.text,e.getLineStarts(d)),(function(e){return!t.fileExists||t.fileExists(e)?t.readFile(e):void 0}))}return a.set(c,s||e.identitySourceMapConsumer),s||e.identitySourceMapConsumer}function c(e){var r=t.getProgram();if(r){var n=o(e),i=r.getSourceFileByPath(n);return i&&i.resolvedPath===n?i:void 0}}function l(r){var n=o(r),a=i.get(n);if(void 0!==a)return a||void 0;if(t.readFile&&(!t.fileExists||t.fileExists(n))){var s=t.readFile(n),c=!!s&&function(t,r){return{text:t,lineMap:r,getLineAndCharacterOfPosition:function(t){return e.computeLineAndCharacterOfPosition(e.getLineStarts(this),t)}}}(s);return i.set(n,c),c||void 0}i.set(n,!1)}function u(e){return t.getSourceFileLike?t.getSourceFileLike(e):c(e)||l(e)}},e.getDocumentPositionMapper=function(n,i,a,o){var s=e.tryGetSourceMappingURL(a);if(s){var c=t.exec(s);if(c){if(c[1]){var l=c[1];return r(n,e.base64decode(e.sys,l),i)}s=void 0}}var u=[];s&&u.push(s),u.push(i+".map");for(var d=s&&e.getNormalizedAbsolutePath(s,e.getDirectoryPath(i)),_=0,p=u;_n)&&(t.arguments.length0?e.arrayFrom(n.values()).join(","):""},t.getSymbolDisplayPartsDocumentationAndSymbolKind=function t(a,o,s,c,l,u,d){var _;void 0===u&&(u=e.getMeaningFromLocation(l));var p,f,m,g,y=[],h=[],v=[],b=e.getCombinedLocalAndExportSymbolFlags(o),x=1&u?i(a,o,l):"",S=!1,D=108===l.kind&&e.isInExpressionContext(l)||e.isThisInTypeQuery(l),C=!1;if(108===l.kind&&!D)return{displayParts:[e.keywordPart(108)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==x||32&b||2097152&b){if("getter"===x||"setter"===x)if(q=e.find(o.declarations,(function(e){return e.name===l})))switch(q.kind){case 172:x="getter";break;case 173:x="setter";break;default:e.Debug.assertNever(q)}else x="property";var T=void 0;if(p=D?a.getTypeAtLocation(l):a.getTypeOfSymbolAtLocation(o,l),l.parent&&206===l.parent.kind){var E=l.parent.name;(E===l||E&&0===E.getFullWidth())&&(l=l.parent)}var k=void 0;if(e.isCallOrNewExpression(l)?k=l:(e.isCallExpressionTarget(l)||e.isNewExpressionTarget(l)||l.parent&&(e.isJsxOpeningLikeElement(l.parent)||e.isTaggedTemplateExpression(l.parent))&&e.isFunctionLike(o.valueDeclaration))&&(k=l.parent),k){T=a.getResolvedSignature(k);var A=209===k.kind||e.isCallExpression(k)&&106===k.expression.kind,N=A?p.getConstructSignatures():p.getCallSignatures();if(!T||e.contains(N,T.target)||e.contains(N,T)||(T=N.length?N[0]:void 0),T){switch(A&&32&b?(x="constructor",te(p.symbol,x)):2097152&b?(re(x="alias"),y.push(e.spacePart()),A&&(4&T.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ee(o)):te(o,x),x){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":y.push(e.punctuationPart(58)),y.push(e.spacePart()),16&e.getObjectFlags(p)||!p.symbol||(e.addRange(y,e.symbolToDisplayParts(a,p.symbol,c,void 0,5)),y.push(e.lineBreakPart())),A&&(4&T.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),ne(T,N,262144);break;default:ne(T,N)}S=!0,C=N.length>1}}else if(e.isNameOfFunctionDeclaration(l)&&!(98304&b)||134===l.kind&&171===l.parent.kind){var w=l.parent,F=o.declarations&&e.find(o.declarations,(function(e){return e===(134===l.kind?w.parent:w)}));if(F){N=171===w.kind?p.getNonNullableType().getConstructSignatures():p.getNonNullableType().getCallSignatures();T=a.isImplementationOfOverload(w)?N[0]:a.getSignatureFromDeclaration(w),171===w.kind?(x="constructor",te(p.symbol,x)):te(174!==w.kind||2048&p.symbol.flags||4096&p.symbol.flags?o:p.symbol,x),T&&ne(T,N),S=!0,C=N.length>1}}}if(32&b&&!S&&!D&&(Y(),e.getDeclarationOfKind(o,226)?re("local class"):y.push(e.keywordPart(84)),y.push(e.spacePart()),ee(o),ie(o,s)),64&b&&2&u&&($(),y.push(e.keywordPart(118)),y.push(e.spacePart()),ee(o),ie(o,s)),524288&b&&2&u&&($(),y.push(e.keywordPart(152)),y.push(e.spacePart()),ee(o),ie(o,s),y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(a,e.isConstTypeReference(l.parent)?a.getTypeAtLocation(l.parent):a.getDeclaredTypeOfSymbol(o),c,8388608))),384&b&&($(),e.some(o.declarations,(function(t){return e.isEnumDeclaration(t)&&e.isEnumConst(t)}))&&(y.push(e.keywordPart(85)),y.push(e.spacePart())),y.push(e.keywordPart(92)),y.push(e.spacePart()),ee(o)),1536&b&&!D){$();var P=(q=e.getDeclarationOfKind(o,261))&&q.name&&79===q.name.kind;y.push(e.keywordPart(P?142:141)),y.push(e.spacePart()),ee(o)}if(262144&b&&2&u)if($(),y.push(e.punctuationPart(20)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(21)),y.push(e.spacePart()),ee(o),o.parent)Z(),ee(o.parent,c),ie(o.parent,c);else{var I=e.getDeclarationOfKind(o,163);if(void 0===I)return e.Debug.fail();if(q=I.parent)if(e.isFunctionLikeKind(q.kind)){Z();T=a.getSignatureFromDeclaration(q);175===q.kind?(y.push(e.keywordPart(103)),y.push(e.spacePart())):174!==q.kind&&q.name&&ee(q.symbol),e.addRange(y,e.signatureToDisplayParts(a,T,s,32))}else 259===q.kind&&(Z(),y.push(e.keywordPart(152)),y.push(e.spacePart()),ee(q.symbol),ie(q.symbol,s))}if(8&b&&(x="enum member",te(o,"enum member"),299===(null==(q=null===(_=o.declarations)||void 0===_?void 0:_[0])?void 0:q.kind))){var O=a.getConstantValue(q);void 0!==O&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.displayPart(e.getTextOfConstantValue(O),"number"==typeof O?e.SymbolDisplayPartKind.numericLiteral:e.SymbolDisplayPartKind.stringLiteral)))}if(2097152&o.flags){if($(),!S){var M=a.getAliasedSymbol(o);if(M!==o&&M.declarations&&M.declarations.length>0){var L=M.declarations[0],R=e.getNameOfDeclaration(L);if(R){var B=e.isModuleWithStringLiteralName(L)&&e.hasSyntacticModifier(L,2),J="default"!==o.name&&!B,j=t(a,M,e.getSourceFileOfNode(L),L,R,u,J?o:M);y.push.apply(y,j.displayParts),y.push(e.lineBreakPart()),m=j.documentation,g=j.tags}else m=M.getContextualDocumentationComment(L,a),g=M.getJsDocTags(a)}}if(o.declarations)switch(o.declarations[0].kind){case 264:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(142));break;case 271:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(o.declarations[0].isExportEquals?63:88));break;case 275:y.push(e.keywordPart(93));break;default:y.push(e.keywordPart(100))}y.push(e.spacePart()),ee(o),e.forEach(o.declarations,(function(t){if(265===t.kind){var r=t;if(e.isExternalModuleImportEqualsDeclaration(r))y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.keywordPart(146)),y.push(e.punctuationPart(20)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(r)),e.SymbolDisplayPartKind.stringLiteral)),y.push(e.punctuationPart(21));else{var n=a.getSymbolAtLocation(r.moduleReference);n&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),ee(n,c))}return!0}}))}if(!S)if(""!==x){if(p)if(D?($(),y.push(e.keywordPart(108))):te(o,x),"property"===x||"getter"===x||"setter"===x||"JSX attribute"===x||3&b||"local var"===x||D){if(y.push(e.punctuationPart(58)),y.push(e.spacePart()),p.symbol&&262144&p.symbol.flags){var U=e.mapToDisplayParts((function(t){var n=a.typeParameterToDeclaration(p,c,r);X().writeNode(4,n,e.getSourceFileOfNode(e.getParseTreeNode(c)),t)}));e.addRange(y,U)}else e.addRange(y,e.typeToDisplayParts(a,p,c));if(o.target&&o.target.tupleLabelDeclaration){var V=o.target.tupleLabelDeclaration;e.Debug.assertNode(V.name,e.isIdentifier),y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.textPart(e.idText(V.name))),y.push(e.punctuationPart(21))}}else if(16&b||8192&b||16384&b||131072&b||98304&b||"method"===x){(N=p.getNonNullableType().getCallSignatures()).length&&(ne(N[0],N),C=N.length>1)}}else x=n(a,o,l);if(0!==h.length||C||(h=o.getContextualDocumentationComment(c,a)),0===h.length&&4&b&&o.parent&&o.declarations&&e.forEach(o.parent.declarations,(function(e){return 305===e.kind})))for(var K=0,z=o.declarations;K0))break}}if(0===h.length&&e.isIdentifier(l)&&o.valueDeclaration&&e.isBindingElement(o.valueDeclaration)){var q,W=(q=o.valueDeclaration).parent;if(e.isIdentifier(q.name)&&e.isObjectBindingPattern(W)){var H=e.getTextOfIdentifierOrLiteral(q.name),Q=a.getTypeAtLocation(W);h=e.firstDefined(Q.isUnion()?Q.types:[Q],(function(e){var t=e.getProperty(H);return t?t.getDocumentationComment(a):void 0}))||e.emptyArray}}return 0!==v.length||C||(v=o.getContextualJsDocTags(c,a)),0===h.length&&m&&(h=m),0===v.length&&g&&(v=g),{displayParts:y,documentation:h,symbolKind:x,tags:0===v.length?void 0:v};function X(){return f||(f=e.createPrinter({removeComments:!0})),f}function $(){y.length&&y.push(e.lineBreakPart()),Y()}function Y(){d&&(re("alias"),y.push(e.spacePart()))}function Z(){y.push(e.spacePart()),y.push(e.keywordPart(101)),y.push(e.spacePart())}function ee(t,r){d&&t===o&&(t=d);var n=e.symbolToDisplayParts(a,t,r||s,void 0,7);e.addRange(y,n),16777216&o.flags&&y.push(e.punctuationPart(57))}function te(t,r){$(),r&&(re(r),t&&!e.some(t.declarations,(function(t){return e.isArrowFunction(t)||(e.isFunctionExpression(t)||e.isClassExpression(t))&&!t.name}))&&(y.push(e.spacePart()),ee(t)))}function re(t){switch(t){case"var":case"function":case"let":case"const":case"constructor":return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(20)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(21))}}function ne(t,r,n){void 0===n&&(n=0),e.addRange(y,e.signatureToDisplayParts(a,t,c,32|n)),r.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.operatorPart(39)),y.push(e.displayPart((r.length-1).toString(),e.SymbolDisplayPartKind.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===r.length?"overload":"overloads")),y.push(e.punctuationPart(21))),h=t.getDocumentationComment(a),v=t.getJsDocTags(),r.length>1&&0===h.length&&0===v.length&&(h=r[0].getDocumentationComment(a),v=r[0].getJsDocTags())}function ie(t,n){var i=e.mapToDisplayParts((function(i){var o=a.symbolToTypeParameterDeclarations(t,n,r);X().writeList(53776,o,e.getSourceFileOfNode(e.getParseTreeNode(n)),i)}));e.addRange(y,i)}}}(e.SymbolDisplay||(e.SymbolDisplay={}))}(c||(c={})),function(e){function t(t,r){var i=[],a=r.compilerOptions?n(r.compilerOptions,i):{},o=e.getDefaultCompilerOptions();for(var s in o)e.hasProperty(o,s)&&void 0===a[s]&&(a[s]=o[s]);for(var c=0,l=e.transpileOptionValueCompilerOptions;c>=5;return r}(p,_),0,n),a[c]=(d=1+((l=p)>>(u=_)&s),e.Debug.assert((d&s)===d,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),l&~(s<=r.pos?t.pos:a.end:t.pos}(o,r,n),r.end,(function(s){return _(r,o,t.SmartIndenter.getIndentationForNode(o,r,n,i.options),function(e,r,n){for(var i,a=-1;e;){var o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==a&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(r,e,i,n))return r.indentSize;a=o,i=e,e=e.parent}return 0}(o,i.options,n),s,i,a,function(t,r){if(!t.length)return a;var n=t.filter((function(t){return e.rangeOverlapsWithStartEnd(r,t.start,t.start+t.length)})).sort((function(e,t){return e.start-t.start}));if(!n.length)return a;var i=0;return function(t){for(;;){if(i>=n.length)return!1;var r=n[i];if(t.end<=r.start)return!1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,r.start,r.start+r.length))return!0;i++}};function a(){return!1}}(n.parseDiagnostics,r),n)}))}function _(r,n,i,a,o,s,c,l,u){var d,_,f,m,g,y=s.options,h=s.getRules,v=s.host,b=new t.FormattingContext(u,c,y),x=-1,S=[];if(o.advance(),o.isOnToken()){var D=u.getLineAndCharacterOfPosition(n.getStart(u)).line,C=D;n.decorators&&(C=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(n,u)).line),function n(i,a,s,c,d,p){if(!e.rangeOverlapsWithStartEnd(r,i.getStart(u),i.getEnd()))return;var f=N(i,s,d,p),m=a;e.forEachChild(i,(function(e){v(e,-1,i,f,s,c,!1)}),(function(e){b(e,i,s,f)}));for(;o.isOnToken()&&o.getStartPos()Math.min(i.end,r.end))break;S(h,i,f,i)}function v(a,s,c,l,d,_,p,f){if(e.nodeIsMissing(a))return s;var h=a.getStart(u),v=u.getLineAndCharacterOfPosition(h).line,b=v;a.decorators&&(b=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(a,u)).line);var D=-1;if(p&&e.rangeContainsRange(r,c)&&(D=function(r,n,i,a,o){if(e.rangeOverlapsWithStartEnd(a,r,n)||e.rangeContainsStartEnd(a,r,n)){if(-1!==o)return o}else{var s=u.getLineAndCharacterOfPosition(r).line,c=e.getLineStartPositionForPosition(r,u),l=t.SmartIndenter.findFirstNonWhitespaceColumn(c,r,u,y);if(s!==i||r===l){var d=t.SmartIndenter.getBaseIndentation(y);return d>l?d:l}}return-1}(h,a.end,d,r,s),-1!==D&&(s=D)),!e.rangeOverlapsWithStartEnd(r,a.pos,a.end))return a.endr.end)return s;if(C.token.end>h){C.token.pos>h&&o.skipToStartOf(a);break}S(C,i,l,i)}if(!o.isOnToken()||o.getStartPos()>=r.end)return s;if(e.isToken(a)){var C=o.readTokenInfo(a);if(11!==a.kind)return e.Debug.assert(C.token.end===a.end,"Token end is child end"),S(C,i,l,a),s}var T=165===a.kind?v:_,E=function(e,r,n,i,a,o){var s=t.SmartIndenter.shouldIndentChildNode(y,e)?y.indentSize:0;return o===r?{indentation:r===g?x:a.getIndentation(),delta:Math.min(y.indentSize,a.getDelta(e)+s)}:-1===n?20===e.kind&&r===g?{indentation:x,delta:a.getDelta(e)}:t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(i,e,r,u)||t.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(i,e,r,u)||t.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(i,e,r,u)?{indentation:a.getIndentation(),delta:s}:{indentation:a.getIndentation()+a.getDelta(e),delta:s}:{indentation:n,delta:s}}(a,v,D,i,l,T);return n(a,m,v,b,E.indentation,E.delta),m=i,f&&204===c.kind&&-1===s&&(s=E.indentation),s}function b(n,a,s,c){e.Debug.assert(e.isNodeArray(n));var l=function(e,t){switch(e.kind){case 171:case 256:case 213:case 169:case 168:case 214:if(e.typeParameters===t)return 29;if(e.parameters===t)return 20;break;case 208:case 209:if(e.typeArguments===t)return 29;if(e.arguments===t)return 20;break;case 178:if(e.typeArguments===t)return 29;break;case 182:return 18}return 0}(a,n),d=c,_=s;if(e.rangeOverlapsWithStartEnd(r,n.pos,n.end)){if(0!==l)for(;o.isOnToken()&&o.getStartPos()n.pos)break;if(b.token.kind===l){_=u.getLineAndCharacterOfPosition(b.token.pos).line,S(b,a,c,a);var p=void 0;if(-1!==x)p=x;else{var f=e.getLineStartPositionForPosition(b.token.pos,u);p=t.SmartIndenter.findFirstNonWhitespaceColumn(f,b.token.pos,u,y)}d=N(a,s,p,y.indentSize)}else S(b,a,c,a)}for(var m=-1,g=0;g=r.end){var k=o.isOnEOF()?o.readEOFTokenRange():o.isOnToken()?o.readTokenInfo(n).token:void 0;if(k){var A=(null===(d=e.findPrecedingToken(k.end,u,n))||void 0===d?void 0:d.parent)||f;I(k,u.getLineAndCharacterOfPosition(k.pos).line,A,_,m,f,A,void 0)}}return S;function N(r,n,i,a){return{getIndentationForComment:function(e,t,r){switch(e){case 19:case 23:case 21:return i+o(r)}return-1!==t?t:i},getIndentationForToken:function(t,a,s,c){return!c&&function(t,i,a){switch(i){case 18:case 19:case 21:case 91:case 115:case 59:return!1;case 43:case 31:switch(a.kind){case 280:case 281:case 279:case 228:return!1}break;case 22:case 23:if(195!==a.kind)return!1}return n!==t&&!(r.decorators&&i===function(t){if(t.modifiers&&t.modifiers.length)return t.modifiers[0].kind;switch(t.kind){case 257:return 84;case 258:return 118;case 256:return 98;case 260:return 260;case 172:return 136;case 173:return 149;case 169:if(t.asteriskToken)return 41;case 167:case 164:var r=e.getNameOfDeclaration(t);if(r)return r.kind}}(r))}(t,a,s)?i+o(s):i},getIndentation:function(){return i},getDelta:o,recomputeIndentation:function(e,n){t.SmartIndenter.shouldIndentChildNode(y,n,r,u)&&(i+=e?y.indentSize:-y.indentSize,a=t.SmartIndenter.shouldIndentChildNode(y,r)?y.indentSize:0)}};function o(e){return t.SmartIndenter.nodeWillIndentChild(y,r,e,u,!0)?a:0}}function w(t,n,i,a){for(var o=0,s=t;o0){var D=p(S,y);j(b,x.character,D)}else J(b,x.character)}}}else i||O(r.pos,n,!1)}function L(t,r,n){for(var i=t;io)){var s=R(a,o);-1!==s&&(e.Debug.assert(s===a||!e.isWhiteSpaceSingleLine(u.text.charCodeAt(s-1))),J(s,o+1-s))}}}function R(t,r){for(var n=r;n>=t&&e.isWhiteSpaceSingleLine(u.text.charCodeAt(n));)n--;return n!==r?n+1:-1}function B(e,t,r){L(u.getLineAndCharacterOfPosition(e).line,u.getLineAndCharacterOfPosition(t).line+1,r)}function J(t,r){r&&S.push(e.createTextChangeFromStartLength(t,r,""))}function j(t,r,n){(r||n)&&S.push(e.createTextChangeFromStartLength(t,r,n))}}function p(t,r){if((!i||i.tabSize!==r.tabSize||i.indentSize!==r.indentSize)&&(i={tabSize:r.tabSize,indentSize:r.indentSize},a=o=void 0),r.convertTabsToSpaces){var n=void 0,s=Math.floor(t/r.indentSize),c=t%r.indentSize;return o||(o=[]),void 0===o[s]?(n=e.repeatString(" ",r.indentSize*s),o[s]=n):n=o[s],c?n+e.repeatString(" ",c):n}var l=Math.floor(t/r.tabSize),u=t-l*r.tabSize,d=void 0;return a||(a=[]),void 0===a[l]?a[l]=d=e.repeatString("\t",l):d=a[l],u?d+e.repeatString(" ",u):d}t.createTextRangeWithKind=function(t,r,n){var i={pos:t,end:r,kind:n};return e.Debug.isDebugging&&Object.defineProperty(i,"__debugKind",{get:function(){return e.Debug.formatSyntaxKind(n)}}),i},function(e){e[e.Unknown=-1]="Unknown"}(r||(r={})),t.formatOnEnter=function(t,r,n){var i=r.getLineAndCharacterOfPosition(t).line;if(0===i)return[];for(var a=e.getEndLinePosition(i,r);e.isWhiteSpaceSingleLine(r.text.charCodeAt(a));)a--;return e.isLineBreak(r.text.charCodeAt(a))&&a--,d({pos:e.getStartPositionOfLine(i-1,r),end:a+1},r,n,2)},t.formatOnSemicolon=function(e,t,r){return u(c(s(e,26,t)),t,r,3)},t.formatOnOpeningCurly=function(t,r,n){var i=s(t,18,r);if(!i)return[];var a=c(i.parent);return d({pos:e.getLineStartPositionForPosition(a.getStart(r),r),end:t},r,n,4)},t.formatOnClosingCurly=function(e,t,r){return u(c(s(e,19,t)),t,r,5)},t.formatDocument=function(e,t){return d({pos:0,end:e.text.length},e,t,0)},t.formatSelection=function(t,r,n,i){return d({pos:e.getLineStartPositionForPosition(t,n),end:r},n,i,1)},t.formatNodeGivenIndentation=function(e,r,n,i,a,o){var s={pos:e.pos,end:e.end};return t.getFormattingScanner(r.text,n,s.pos,s.end,(function(t){return _(s,e,i,a,t,o,1,(function(e){return!1}),r)}))},function(e){e[e.None=0]="None",e[e.LineAdded=1]="LineAdded",e[e.LineRemoved=2]="LineRemoved"}(n||(n={})),t.getRangeOfEnclosingComment=function(t,r,n,i){void 0===i&&(i=e.getTokenAtPosition(t,r));var a=e.findAncestor(i,e.isJSDoc);if(a&&(i=a.parent),!(i.getStart(t)<=r&&rr.end}var v=s(m,e,i),b=v.line===t.line||_(m,e,t.line,i);if(y){var x=null===(f=p(e,i))||void 0===f?void 0:f[0],D=g(e,i,l,!!x&&u(x,i).line>v.line);if(-1!==D)return D+n;if(-1!==(D=c(e,m,t,b,i,l)))return D+n}S(l,m,e,i,o)&&!b&&(n+=l.indentSize);var C=d(m,e,t.line,i);m=(e=m).parent,t=C?i.getLineAndCharacterOfPosition(e.getStart(i)):v}return n+a(l)}function s(e,t,r){var n=p(t,r),i=n?n.pos:e.getStart(r);return r.getLineAndCharacterOfPosition(i)}function c(t,r,n,i,a,o){return!e.isDeclaration(t)&&!e.isStatementButNotDeclaration(t)||305!==r.kind&&i?-1:h(n,a,o)}function l(t,r,n,i){var a=e.findNextToken(t,r,i);return a?18===a.kind?1:19===a.kind&&n===u(a,i).line?2:0:0}function u(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function d(t,r,n,i){if(!e.isCallExpression(t)||!e.contains(t.arguments,r))return!1;var a=t.expression.getEnd();return e.getLineAndCharacterOfPosition(i,a).line===n}function _(t,r,n,i){if(239===t.kind&&t.elseStatement===r){var a=e.findChildOfKind(t,91,i);return e.Debug.assert(void 0!==a),u(a,i).line===n}return!1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(t,r,n,i){switch(n.kind){case 178:return a(n.typeArguments);case 205:return a(n.properties);case 204:case 269:case 273:case 201:case 202:return a(n.elements);case 182:return a(n.members);case 256:case 213:case 214:case 169:case 168:case 174:case 171:case 180:case 175:return a(n.typeParameters)||a(n.parameters);case 172:return a(n.parameters);case 257:case 226:case 258:case 259:case 344:return a(n.typeParameters);case 209:case 208:return a(n.typeArguments)||a(n.arguments);case 255:return a(n.declarations)}function a(a){return a&&e.rangeContainsStartEnd(function(e,t,r){for(var n=e.getChildren(r),i=1;i=0&&r=0;o--)if(27!==t[o].kind){if(n.getLineAndCharacterOfPosition(t[o].end).line!==a.line)return h(a,n,i);a=u(t[o],n)}return-1}function h(e,t,r){var n=t.getPositionOfLineAndCharacter(e.line,0);return b(n,n+e.character,t,r)}function v(t,r,n,i){for(var a=0,o=0,s=t;sn.text.length)return a(i);if(i.indentStyle===e.IndentStyle.None)return 0;var c=e.findPrecedingToken(r,n,void 0,!0),d=t.getRangeOfEnclosingComment(n,r,c||null);if(d&&3===d.kind)return function(t,r,n,i){var a=e.getLineAndCharacterOfPosition(t,r).line-1,o=e.getLineAndCharacterOfPosition(t,i.pos).line;if(e.Debug.assert(o>=0),a<=o)return b(e.getStartPositionOfLine(o,t),r,t,n);var s=e.getStartPositionOfLine(a,t),c=v(s,r,t,n),l=c.column,u=c.character;return 0===l?l:42===t.text.charCodeAt(s+u)?l-1:l}(n,r,i,d);if(!c)return a(i);if(e.isStringOrRegularExpressionOrTemplateLiteral(c.kind)&&c.getStart(n)<=r&&r0;){var a=t.text.charCodeAt(i);if(!e.isWhiteSpaceLike(a))break;i--}return b(e.getLineStartPositionForPosition(i,t),i,t,n)}(n,r,i);if(27===c.kind&&221!==c.parent.kind){var x=function(t,r,n){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?y(i.list.getChildren(),i.listItemIndex-1,r,n):-1}(c,n,i);if(-1!==x)return x}var D=function(e,t,r){return t&&f(e,e,t,r)}(r,c.parent,n);if(D&&!e.rangeContainsRange(D,c)){var C=-1!==[213,214].indexOf(p.parent.kind)?0:i.indentSize;return m(D,n,i)+C}return function(t,r,n,i,s,c){for(var d,_=n;_;){if(e.positionBelongsToNode(_,r,t)&&S(c,_,d,t,!0)){var p=u(_,t),f=l(n,_,i,t);return o(_,p,void 0,0!==f?s&&2===f?c.indentSize:0:i!==p.line?c.indentSize:0,t,!0,c)}var m=g(_,t,c,!0);if(-1!==m)return m;d=_,_=_.parent}return a(c)}(n,r,c,_,s,i)},r.getIndentationForNode=function(e,t,r,n){var i=r.getLineAndCharacterOfPosition(e.getStart(r));return o(e,i,t,0,r,!1,n)},r.getBaseIndentation=a,function(e){e[e.Unknown=0]="Unknown",e[e.OpenBrace=1]="OpenBrace",e[e.CloseBrace=2]="CloseBrace"}(i||(i={})),r.isArgumentAndStartLineOverlapsExpressionBeingCalled=d,r.childStartsOnTheSameLineWithElseInIfStatement=_,r.childIsUnindentedBranchOfConditionalExpression=function(t,r,n,i){if(e.isConditionalExpression(t)&&(r===t.whenTrue||r===t.whenFalse)){var a=e.getLineAndCharacterOfPosition(i,t.condition.end).line;if(r===t.whenTrue)return n===a;var o=u(t.whenTrue,i).line,s=e.getLineAndCharacterOfPosition(i,t.whenTrue.end).line;return a===o&&s===n}return!1},r.argumentStartsOnSameLineAsPreviousArgument=function(t,r,n,i){if(e.isCallOrNewExpression(t)){if(!t.arguments)return!1;var a=e.find(t.arguments,(function(e){return e.pos===r.pos}));if(!a)return!1;var o=t.arguments.indexOf(a);if(0===o)return!1;var s=t.arguments[o-1];if(n===e.getLineAndCharacterOfPosition(i,s.getEnd()).line)return!0}return!1},r.getContainingList=p,r.findFirstNonWhitespaceCharacterAndColumn=v,r.findFirstNonWhitespaceColumn=b,r.nodeWillIndentChild=x,r.shouldIndentChildNode=S})((t=e.formatting||(e.formatting={})).SmartIndenter||(t.SmartIndenter={}))}(c||(c={})),function(e){!function(t){function i(t){var r=t.__pos;return e.Debug.assert("number"==typeof r),r}function a(t,r){e.Debug.assert("number"==typeof r),t.__pos=r}function o(t){var r=t.__end;return e.Debug.assert("number"==typeof r),r}function s(t,r){e.Debug.assert("number"==typeof r),t.__end=r}var c,l;function u(t,r){return e.skipTrivia(t,r,!1,!0)}!function(e){e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine"}(c=t.LeadingTriviaOption||(t.LeadingTriviaOption={})),function(e){e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include"}(l=t.TrailingTriviaOption||(t.TrailingTriviaOption={}));var d,_={leadingTriviaOption:c.Exclude,trailingTriviaOption:l.Exclude};function p(e,t,r,n){return{pos:f(e,t,n),end:g(e,r,n)}}function f(t,r,n,i){var a,o;void 0===i&&(i=!1);var s=n.leadingTriviaOption;if(s===c.Exclude)return r.getStart(t);if(s===c.StartLine){var l=r.getStart(t),d=e.getLineStartPositionForPosition(l,t);return e.rangeContainsPosition(r,d)?d:l}if(s===c.JSDoc){var _=e.getJSDocCommentRanges(r,t.text);if(null==_?void 0:_.length)return e.getLineStartPositionForPosition(_[0].pos,t)}var p=r.getFullStart(),f=r.getStart(t);if(p===f)return f;var m=e.getLineStartPositionForPosition(p,t);if(e.getLineStartPositionForPosition(f,t)===m)return s===c.IncludeAll?p:f;if(i){var g=(null===(a=e.getLeadingCommentRanges(t.text,p))||void 0===a?void 0:a[0])||(null===(o=e.getTrailingCommentRanges(t.text,p))||void 0===o?void 0:o[0]);if(g)return e.skipTrivia(t.text,g.end,!0,!0)}var y=p>0?1:0,h=e.getStartPositionOfLine(e.getLineOfLocalPosition(t,m)+y,t);return h=u(t.text,h),e.getStartPositionOfLine(e.getLineOfLocalPosition(t,h),t)}function m(t,r,n){var i=r.end;if(n.trailingTriviaOption===l.Include){var a=e.getTrailingCommentRanges(t.text,i);if(a)for(var o=e.getLineOfLocalPosition(t,r.end),s=0,c=a;so)break;if(e.getLineOfLocalPosition(t,u.end)>o)return e.skipTrivia(t.text,u.end,!0,!0)}}}function g(t,r,n){var i,a=r.end,o=n.trailingTriviaOption;if(o===l.Exclude)return a;if(o===l.ExcludeWhitespace){var s=e.concatenate(e.getTrailingCommentRanges(t.text,a),e.getLeadingCommentRanges(t.text,a)),c=null===(i=null==s?void 0:s[s.length-1])||void 0===i?void 0:i.end;return c||a}var u=m(t,r,n);if(u)return u;var d=e.skipTrivia(t.text,a,!0);return d===a||o!==l.Include&&!e.isLineBreak(t.text.charCodeAt(d-1))?a:d}function y(e,t){return!!t&&!!e.parent&&(27===t.kind||26===t.kind&&205===e.parent.kind)}!function(e){e[e.Remove=0]="Remove",e[e.ReplaceWithSingleNode=1]="ReplaceWithSingleNode",e[e.ReplaceWithMultipleNodes=2]="ReplaceWithMultipleNodes",e[e.Text=3]="Text"}(d||(d={})),t.isThisTypeAnnotatable=function(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)};var h,v=function(){function t(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.newFiles=[],this.classesWithNodesInsertedAtStart=new e.Map,this.deletedNodes=[]}return t.fromContext=function(r){return new t(e.getNewLineOrDefaultFromHost(r.host,r.formatContext.options),r.formatContext)},t.with=function(e,r){var n=t.fromContext(e);return r(n),n.getChanges()},t.prototype.pushRaw=function(t,r){e.Debug.assertEqual(t.fileName,r.fileName);for(var n=0,i=r.textChanges;n=t.getLineAndCharacterOfPosition(l.range.end).line+2)break}if(t.statements.length)if(void 0===u&&(u=t.getLineAndCharacterOfPosition(t.statements[0].getStart()).line),u",joiner:", "})},t.prototype.getOptionsForInsertNodeBefore=function(t,r,n){return e.isStatement(t)||e.isClassElement(t)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:e.isVariableDeclaration(t)?{suffix:", "}:e.isParameter(t)?e.isParameter(r)?{suffix:", "}:{}:e.isStringLiteral(t)&&e.isImportDeclaration(t.parent)||e.isNamedImports(t)?{suffix:", "}:e.isImportSpecifier(t)?{suffix:","+(n?this.newLineCharacter:" ")}:e.Debug.failBadSyntaxKind(t)},t.prototype.insertNodeAtConstructorStart=function(t,n,i){var a=e.firstOrUndefined(n.body.statements);a&&n.body.multiLine?this.insertNodeBefore(t,a,i):this.replaceConstructorBody(t,n,r([i],n.body.statements,!0))},t.prototype.insertNodeAtConstructorStartAfterSuperCall=function(t,n,i){var a=e.find(n.body.statements,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}));a&&n.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,n,r(r([],n.body.statements,!0),[i],!1))},t.prototype.insertNodeAtConstructorEnd=function(t,n,i){var a=e.lastOrUndefined(n.body.statements);a&&n.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,n,r(r([],n.body.statements,!0),[i],!1))},t.prototype.replaceConstructorBody=function(t,r,n){this.replaceNode(t,r.body,e.factory.createBlock(n,!0))},t.prototype.insertNodeAtEndOfScope=function(t,r,n){var i=f(t,r.getLastToken(),{});this.insertNodeAt(t,i,n,{prefix:e.isLineBreak(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter})},t.prototype.insertMemberAtStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r)},t.prototype.insertNodeAtObjectStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r)},t.prototype.insertNodeAtStartWorker=function(e,t,r){var n,i=null!==(n=this.guessIndentationFromExistingMembers(e,t))&&void 0!==n?n:this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,x(t).pos,r,this.getInsertNodeAtStartInsertOptions(e,t,i))},t.prototype.guessIndentationFromExistingMembers=function(t,r){for(var n,i=r,a=0,o=x(r);a=0;n--){var i=r[n],a=i.span,o=i.newText;t="".concat(t.substring(0,a.start)).concat(o).concat(t.substring(e.textSpanEnd(a)))}return t}t.ChangeTracker=v,t.getNewFileText=function(e,t,r,n){return h.newFileChangesWorker(void 0,t,e,r,n)},function(t){function r(t,r,n,a,o){var s=n.map((function(e){return 4===e?"":i(e,t,a).text})).join(a),c=e.createSourceFile("any file name",s,99,!0,r);return S(s,e.formatting.formatDocument(c,o))+a}function i(t,r,n){var i=k(n),a=e.getNewLineKind(n);return e.createPrinter({newLine:a,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},i).writeNode(4,t,r,i),{text:i.getText(),node:T(t)}}t.getTextChangesFromChanges=function(t,r,a,o){return e.mapDefined(e.group(t,(function(e){return e.sourceFile.path})),(function(t){for(var s=t[0].sourceFile,c=e.stableSort(t,(function(e,t){return e.range.pos-t.range.pos||e.range.end-t.range.end})),l=function(t){e.Debug.assert(c[t].range.end<=c[t+1].range.pos,"Changes overlap",(function(){return"".concat(JSON.stringify(c[t].range)," and ").concat(JSON.stringify(c[t+1].range))}))},u=0;u0?{fileName:s.fileName,textChanges:_}:void 0}))},t.newFileChanges=function(t,n,i,a,o){var s=r(t,e.getScriptKindFromFileName(n),i,a,o);return{fileName:n,textChanges:[e.createTextChange(e.createTextSpan(0,0),s)],isNewFile:!0}},t.newFileChangesWorker=r,t.getNonformattedText=i}(h||(h={})),t.applyChanges=S;var D,C=n(n({},e.nullTransformationContext),{factory:e.createNodeFactory(1|e.nullTransformationContext.factory.flags,e.nullTransformationContext.factory.baseFactory)});function T(t){var r=e.visitEachChild(t,T,C,E,T),n=e.nodeIsSynthesized(r)?r:Object.create(r);return e.setTextRangePosEnd(n,i(t),o(t)),n}function E(t,r,n,a,s){var c=e.visitNodes(t,r,n,a,s);if(!c)return c;var l=c===t?e.factory.createNodeArray(c.slice(0)):c;return e.setTextRangePosEnd(l,i(t),o(t)),l}function k(t){var r=0,n=e.createTextWriter(t);function i(t,i){if(i||!function(t){return e.skipTrivia(t,0)===t.length}(t)){r=n.getTextPos();for(var a=0;e.isWhiteSpaceLike(t.charCodeAt(t.length-a-1));)a++;r-=a}}return{onBeforeEmitNode:function(e){e&&a(e,r)},onAfterEmitNode:function(e){e&&s(e,r)},onBeforeEmitNodeArray:function(e){e&&a(e,r)},onAfterEmitNodeArray:function(e){e&&s(e,r)},onBeforeEmitToken:function(e){e&&a(e,r)},onAfterEmitToken:function(e){e&&s(e,r)},write:function(e){n.write(e),i(e,!1)},writeComment:function(e){n.writeComment(e)},writeKeyword:function(e){n.writeKeyword(e),i(e,!1)},writeOperator:function(e){n.writeOperator(e),i(e,!1)},writePunctuation:function(e){n.writePunctuation(e),i(e,!1)},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),i(e,!1)},writeParameter:function(e){n.writeParameter(e),i(e,!1)},writeProperty:function(e){n.writeProperty(e),i(e,!1)},writeSpace:function(e){n.writeSpace(e),i(e,!1)},writeStringLiteral:function(e){n.writeStringLiteral(e),i(e,!1)},writeSymbol:function(e,t){n.writeSymbol(e,t),i(e,!1)},writeLine:function(e){n.writeLine(e)},increaseIndent:function(){n.increaseIndent()},decreaseIndent:function(){n.decreaseIndent()},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),i(e,!1)},writeLiteral:function(e){n.writeLiteral(e),i(e,!0)},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:function(){return n.hasTrailingComment()},hasTrailingWhitespace:function(){return n.hasTrailingWhitespace()},clear:function(){n.clear(),r=0}}}function A(t,r){return!(e.isInComment(t,r)||e.isInString(t,r)||e.isInTemplateString(t,r)||e.isInJSXText(t,r))}function N(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(t,r,n),a=g(t,r,n);e.deleteRange(t,{pos:i,end:a})}function w(t,r,n,i){var a=e.Debug.checkDefined(e.formatting.SmartIndenter.getContainingList(i,n)),o=e.indexOfNode(a,i);e.Debug.assert(-1!==o),1!==a.length?(e.Debug.assert(!r.has(i),"Deleting a node twice"),r.add(i),t.deleteRange(n,{pos:b(n,i),end:o===a.length-1?g(n,i,{}):b(n,a[o+1])})):N(t,n,i)}t.assignPositionsToNode=T,t.createWriter=k,t.isValidLocationToAddComment=A,function(t){function r(t,r,n){if(n.parent.name){var i=e.Debug.checkDefined(e.getTokenAtPosition(r,n.pos-1));t.deleteRange(r,{pos:i.getStart(r),end:n.end})}else{N(t,r,e.getAncestor(n,266))}}t.deleteDeclaration=function(t,n,i,a){switch(a.kind){case 164:var o=a.parent;e.isArrowFunction(o)&&1===o.parameters.length&&!e.findChildOfKind(o,20,i)?t.replaceNodeWithText(i,a,"()"):w(t,n,i,a);break;case 266:case 265:N(t,i,a,{leadingTriviaOption:i.imports.length&&a===e.first(i.imports).parent||a===e.find(i.statements,e.isAnyImportSyntax)?c.Exclude:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;case 203:var s=a.parent;202===s.kind&&a!==e.last(s.elements)?N(t,i,a):w(t,n,i,a);break;case 254:!function(t,r,n,i){var a=i.parent;if(292===a.kind)return void t.deleteNodeRange(n,e.findChildOfKind(a,20,n),e.findChildOfKind(a,21,n));if(1!==a.declarations.length)return void w(t,r,n,i);var o=a.parent;switch(o.kind){case 244:case 243:t.replaceNode(n,i,e.factory.createObjectLiteralExpression());break;case 242:N(t,n,a);break;case 237:N(t,n,o,{leadingTriviaOption:e.hasJSDocNodes(o)?c.JSDoc:c.StartLine});break;default:e.Debug.assertNever(o)}}(t,n,i,a);break;case 163:w(t,n,i,a);break;case 270:var u=a.parent;1===u.elements.length?r(t,i,u):w(t,n,i,a);break;case 268:r(t,i,a);break;case 26:N(t,i,a,{trailingTriviaOption:l.Exclude});break;case 98:N(t,i,a,{leadingTriviaOption:c.Exclude});break;case 257:case 256:N(t,i,a,{leadingTriviaOption:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;default:a.parent?e.isImportClause(a.parent)&&a.parent.name===a?function(t,r,n){if(n.namedBindings){var i=n.name.getStart(r),a=e.getTokenAtPosition(r,n.name.end);if(a&&27===a.kind){var o=e.skipTrivia(r.text,a.end,!1,!0);t.deleteRange(r,{pos:i,end:o})}else N(t,r,n.name)}else N(t,r,n.parent)}(t,i,a.parent):e.isCallExpression(a.parent)&&e.contains(a.parent.arguments,a)?w(t,n,i,a):N(t,i,a):N(t,i,a)}}}(D||(D={})),t.deleteNode=N}(e.textChanges||(e.textChanges={}))}(c||(c={})),function(e){!function(t){var i=e.createMultiMap(),a=new e.Map;function s(e,t,r,n,i,a){return{fixName:e,description:t,changes:r,fixId:n,fixAllDescription:i,commands:a?[a]:void 0}}function c(e,t){return{changes:e,commands:t}}function l(t,r,n){for(var i=0,a=u(t);i1)break}var u=a<2;return function(e){var t=e.fixId,r=e.fixAllDescription,i=o(e,["fixId","fixAllDescription"]);return u?i:n(n({},i),{fixId:t,fixAllDescription:r})}}(i,r))}))},t.getAllFixes=function(t){return a.get(e.cast(t.fixId,e.isString)).getAllCodeActions(t)},t.createCombinedCodeActions=c,t.createFileTextChanges=function(e,t){return{fileName:e,textChanges:t}},t.codeFixAll=function(t,r,n){var i=[];return c(e.textChanges.ChangeTracker.with(t,(function(e){return l(t,r,(function(t){return n(e,t,i)}))})),0===i.length?void 0:i)},t.eachDiagnostic=l}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r;t=e.refactor||(e.refactor={}),r=new e.Map,t.registerRefactor=function(e,t){r.set(e,t)},t.getApplicableRefactors=function(n){return e.arrayFrom(e.flatMapIterator(r.values(),(function(e){var r;return n.cancellationToken&&n.cancellationToken.isCancellationRequested()||!(null===(r=e.kinds)||void 0===r?void 0:r.some((function(e){return t.refactorKindBeginsWith(e,n.kind)})))?void 0:e.getAvailableActions(n)})))},t.getEditsForRefactor=function(e,t,n){var i=r.get(t);return i&&i.getEditsForAction(e,n)}}(c||(c={})),function(e){!function(t){var r="addConvertToUnknownForNonOverlappingTypes",n=[e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];function i(t,r,n){var i=e.isAsExpression(n)?e.factory.createAsExpression(n.expression,e.factory.createKeywordTypeNode(155)):e.factory.createTypeAssertion(e.factory.createKeywordTypeNode(155),n.expression);t.replaceNode(r,n.expression,i)}function a(t,r){if(!e.isInJSFile(t))return e.findAncestor(e.getTokenAtPosition(t,r),(function(t){return e.isAsExpression(t)||e.isTypeAssertionExpression(t)}))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(void 0!==o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return[t.createCodeFixAction(r,s,e.Diagnostics.Add_unknown_conversion_for_non_overlapping_types,r,e.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(r){var n=r.sourceFile,i=e.textChanges.ChangeTracker.with(r,(function(t){var r=e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([]),void 0);t.insertNodeAtEndOfScope(n,n,r)}));return[t.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",i,e.Diagnostics.Add_export_to_make_this_file_into_a_module)]}})}(c||(c={})),function(e){!function(t){var r="addMissingAsync",n=[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_comparable_to_type_1.code];function i(n,i,a,o){var s=a((function(t){return function(t,r,n,i){if(i&&i.has(e.getNodeId(n)))return;null==i||i.add(e.getNodeId(n));var a=e.factory.updateModifiers(e.getSynthesizedDeepClone(n,!0),e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(256|e.getSyntacticModifierFlags(n))));t.replaceNode(r,n,a)}(t,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)}function a(t,r){if(r){var n=e.getTokenAtPosition(t,r.start),i=e.findAncestor(n,(function(n){return n.getStart(t)e.textSpanEnd(r)?"quit":(e.isArrowFunction(n)||e.isMethodDeclaration(n)||e.isFunctionExpression(n)||e.isFunctionDeclaration(n))&&e.textSpansEqual(r,e.createTextSpanFromNode(n,t))}));return i}}t.registerCodeFix({fixIds:[r],errorCodes:n,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,o=t.cancellationToken,s=t.program,c=t.span,l=e.find(s.getTypeChecker().getDiagnostics(r,o),function(t,r){return function(n){var i=n.start,a=n.length,o=n.relatedInformation,s=n.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},t)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code}))}}(c,n)),u=l&&l.relatedInformation&&e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),d=a(r,u);if(d){return[i(t,d,(function(r){return e.textChanges.ChangeTracker.with(t,r)}))]}},getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Set;return t.codeFixAll(r,n,(function(t,n){var c=n.relatedInformation&&e.find(n.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),l=a(o,c);if(l){return i(r,l,(function(e){return e(t),[]}),s)}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="addMissingAwait",i=e.Diagnostics.Property_0_does_not_exist_on_type_1.code,a=[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],o=r([e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,e.Diagnostics.Type_0_is_not_an_array_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,i],a,!0);function s(t,r,n,i,a){var o=e.getFixableErrorSpanExpression(t,n);return o&&function(t,r,n,i,a){var o=a.getTypeChecker().getDiagnostics(t,i);return e.some(o,(function(t){var i=t.start,a=t.length,o=t.relatedInformation,s=t.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},n)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_forget_to_use_await.code}))}))}(t,r,n,i,a)&&u(o)?o:void 0}function c(r,n,i,a,s,c){var l=r.sourceFile,_=r.program,p=r.cancellationToken,f=function(t,r,n,i,a){var s=function(t,r){if(e.isPropertyAccessExpression(t.parent)&&e.isIdentifier(t.parent.expression))return{identifiers:[t.parent.expression],isCompleteFix:!0};if(e.isIdentifier(t))return{identifiers:[t],isCompleteFix:!0};if(e.isBinaryExpression(t)){for(var n=void 0,i=!0,a=0,o=[t.left,t.right];a0)return[t.createCodeFixAction(r,a,e.Diagnostics.Add_const_to_unresolved_variable,r,e.Diagnostics.Add_const_to_all_unresolved_variables)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,r.program,a)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addMissingDeclareProperty",n=[e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isIdentifier(a)){var o=a.parent;167!==o.kind||i&&!e.tryAddToSet(i,o)||t.insertModifierBefore(r,135,o)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));if(a.length>0)return[t.createCodeFixAction(r,a,e.Diagnostics.Prefix_with_declare,r,e.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,a)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addMissingInvocationForDecorator",n=[e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.findAncestor(i,e.isDecorator);e.Debug.assert(!!a,"Expected position to be owned by a decorator.");var o=e.factory.createCallExpression(a.expression,void 0,void 0);t.replaceNode(r,a.expression,o)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return[t.createCodeFixAction(r,a,e.Diagnostics.Call_decorator_expression,r,e.Diagnostics.Add_to_all_uncalled_decorators)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addNameToNamelessParameter",n=[e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=i.parent;if(!e.isParameter(a))return e.Debug.fail("Tried to add a parameter name to a non-parameter: "+e.Debug.formatSyntaxKind(i.kind));var o=a.parent.parameters.indexOf(a);e.Debug.assert(!a.type,"Tried to add a parameter name to a parameter that already had one."),e.Debug.assert(o>-1,"Parameter not found in parent parameter list.");var s=e.factory.createTypeReferenceNode(a.name,void 0),c=e.factory.createParameterDeclaration(void 0,a.modifiers,a.dotDotDotToken,"arg"+o,a.questionToken,a.dotDotDotToken?e.factory.createArrayTypeNode(s):s,a.initializer);t.replaceNode(r,a,c)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return[t.createCodeFixAction(r,a,e.Diagnostics.Add_parameter_name,r,e.Diagnostics.Add_names_to_all_parameters_without_names)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="addOptionalPropertyUndefined",i=[e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];function a(t,r){var n;if(t){if(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind)return{source:t.parent.right,target:t.parent.left};if(e.isVariableDeclaration(t.parent)&&t.parent.initializer)return{source:t.parent.initializer,target:t.parent.name};if(e.isCallExpression(t.parent)){var i=r.getSymbolAtLocation(t.parent.expression);if(!(null==i?void 0:i.valueDeclaration)||!e.isFunctionLikeKind(i.valueDeclaration.kind))return;if(!e.isExpression(t))return;var o=t.parent.arguments.indexOf(t);if(-1===o)return;var s=i.valueDeclaration.parameters[o].name;if(e.isIdentifier(s))return{source:t,target:s}}else if(e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)||e.isShorthandPropertyAssignment(t.parent)){var c=a(t.parent.parent,r);if(!c)return;var l=r.getPropertyOfType(r.getTypeAtLocation(c.target),t.parent.name.text),u=null===(n=null==l?void 0:l.declarations)||void 0===n?void 0:n[0];if(!u)return;return{source:e.isPropertyAssignment(t.parent)?t.parent.initializer:t.parent.name,target:u}}}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.program.getTypeChecker(),s=function(t,r,n){var i,o,s=a(e.getFixableErrorSpanExpression(t,r),n);if(!s)return e.emptyArray;var c=s.source,l=s.target,u=function(t,r,n){return e.isPropertyAccessExpression(r)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(r.expression)).length&&n.getTypeAtLocation(t)===n.getUndefinedType()}(c,l,n)?n.getTypeAtLocation(l.expression):n.getTypeAtLocation(l);if(null===(o=null===(i=u.symbol)||void 0===i?void 0:i.declarations)||void 0===o?void 0:o.some((function(t){return e.getSourceFileOfNode(t).fileName.match(/\.d\.ts$/)})))return e.emptyArray;return n.getExactOptionalProperties(u)}(i.sourceFile,i.span,o);if(s.length){var c=e.textChanges.ChangeTracker.with(i,(function(t){return function(t,n){for(var i=0,a=n;i1?(t.delete(r,u),t.insertNodeAfter(r,_,d)):t.replaceNode(r,_,d)}}function p(n){var i=[];return n.exports&&n.exports.forEach((function(t){if("prototype"===t.name&&t.declarations){var r=t.declarations[0];if(1===t.declarations.length&&e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind&&e.isObjectLiteralExpression(r.parent.right))l(r.parent.right.symbol,void 0,i)}else l(t,[e.factory.createToken(124)],i)})),n.members&&n.members.forEach((function(a,s){var c,u,d,_;if("constructor"===s&&a.valueDeclaration){var p=null===(_=null===(d=null===(u=null===(c=n.exports)||void 0===c?void 0:c.get("prototype"))||void 0===u?void 0:u.declarations)||void 0===d?void 0:d[0])||void 0===_?void 0:_.parent;p&&e.isBinaryExpression(p)&&e.isObjectLiteralExpression(p.right)&&e.some(p.right.properties,o)||t.delete(r,a.valueDeclaration.parent)}else l(a,void 0,i)})),i;function l(n,i,l){if(8192&n.flags||4096&n.flags){var u,d,_=n.valueDeclaration,p=_.parent,f=p.right;if(u=_,d=f,e.isAccessExpression(u)?e.isPropertyAccessExpression(u)&&o(u)||e.isFunctionLike(d):e.every(u.properties,(function(t){return!!(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)||e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&t.name||o(t))})))if(!e.some(l,(function(t){var r=e.getNameOfDeclaration(t);return!(!r||!e.isIdentifier(r)||e.idText(r)!==e.symbolName(n))}))){var m=p.parent&&238===p.parent.kind?p.parent:p;if(t.delete(r,m),f){if(e.isAccessExpression(_)&&(e.isFunctionExpression(f)||e.isArrowFunction(f))){var g=e.getQuotePreference(r,s),y=function(t,r,n){if(e.isPropertyAccessExpression(t))return t.name;var i=t.argumentExpression;if(e.isNumericLiteral(i))return i;if(e.isStringLiteralLike(i))return e.isIdentifierText(i.text,e.getEmitScriptTarget(r))?e.factory.createIdentifier(i.text):e.isNoSubstitutionTemplateLiteral(i)?e.factory.createStringLiteral(i.text,0===n):i;return}(_,c,g);y&&v(l,f,y)}else if(e.isObjectLiteralExpression(f))e.forEach(f.properties,(function(t){(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t))&&l.push(t),e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&v(l,t.initializer,t.name),o(t)}));else if(!e.isSourceFileJS(r)&&e.isPropertyAccessExpression(_)){var h=e.factory.createPropertyDeclaration(void 0,i,_.name,void 0,void 0,f);return e.copyLeadingComments(p.parent,h,r),void l.push(h)}}else l.push(e.factory.createPropertyDeclaration([],i,n.name,void 0,void 0,void 0))}}function v(t,n,o){return e.isFunctionExpression(n)?function(t,n,o){var s=e.concatenate(i,a(n,131)),c=e.factory.createMethodDeclaration(void 0,s,void 0,o,void 0,void 0,n.parameters,void 0,n.body);return e.copyLeadingComments(p,c,r),void t.push(c)}(t,n,o):function(t,n,o){var s,c=n.body;s=235===c.kind?c:e.factory.createBlock([e.factory.createReturnStatement(c)]);var l=e.concatenate(i,a(n,131)),u=e.factory.createMethodDeclaration(void 0,l,void 0,o,void 0,void 0,n.parameters,void 0,s);e.copyLeadingComments(p,u,r),t.push(u)}(t,n,o)}}}}function a(t,r){return e.filter(t.modifiers,(function(e){return e.kind===r}))}function o(t){return!!t.name&&!(!e.isIdentifier(t.name)||"constructor"!==t.name.text)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program.getTypeChecker(),n.preferences,n.program.getCompilerOptions())}));return[t.createCodeFixAction(r,a,e.Diagnostics.Convert_function_to_an_ES2015_class,r,e.Diagnostics.Convert_all_constructor_functions_to_classes)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n,i="convertToAsyncFunction",a=[e.Diagnostics.This_may_be_converted_to_an_async_function.code],o=!0;function s(t,r,n,i){var a,o=e.getTokenAtPosition(r,n);if(a=e.isIdentifier(o)&&e.isVariableDeclaration(o.parent)&&o.parent.initializer&&e.isFunctionLikeDeclaration(o.parent.initializer)?o.parent.initializer:e.tryCast(e.getContainingFunction(e.getTokenAtPosition(r,n)),e.canBeConvertedToAsync)){var s=new e.Map,l=e.isInJSFile(a),u=function(t,r){if(!t.body)return new e.Set;var n=new e.Set;return e.forEachChild(t.body,(function t(i){c(i,r,"then")?(n.add(e.getNodeId(i)),e.forEach(i.arguments,t)):c(i,r,"catch")||c(i,r,"finally")?(n.add(e.getNodeId(i)),e.forEachChild(i,t)):d(i,r)?n.add(e.getNodeId(i)):e.forEachChild(i,t)})),n}(a,i),f=function(t,r,n){var i=new e.Map,a=e.createMultiMap();return e.forEachChild(t,(function t(o){if(e.isIdentifier(o)){var s=r.getSymbolAtLocation(o);if(s){var c=C(r.getTypeAtLocation(o),r),l=e.getSymbolId(s).toString();if(!c||e.isParameter(o.parent)||e.isFunctionLikeDeclaration(o.parent)||n.has(l)){if(o.parent&&(e.isParameter(o.parent)||e.isVariableDeclaration(o.parent)||e.isBindingElement(o.parent))){var u=o.text,d=a.get(u);if(d&&d.some((function(e){return e!==s}))){var p=_(o,a);i.set(l,p.identifier),n.set(l,p),a.add(u,s)}else{var f=e.getSynthesizedDeepClone(o);n.set(l,A(f)),a.add(u,s)}}}else{var m=e.firstOrUndefined(c.parameters),g=(null==m?void 0:m.valueDeclaration)&&e.isParameter(m.valueDeclaration)&&e.tryCast(m.valueDeclaration.name,e.isIdentifier)||e.factory.createUniqueName("result",16),y=_(g,a);n.set(l,y),a.add(g.text,s)}}}else e.forEachChild(o,t)})),e.getSynthesizedDeepCloneWithReplacements(t,!0,(function(t){if(e.isBindingElement(t)&&e.isIdentifier(t.name)&&e.isObjectBindingPattern(t.parent)){if((a=(n=r.getSymbolAtLocation(t.name))&&i.get(String(e.getSymbolId(n))))&&a.text!==(t.name||t.propertyName).getText())return e.factory.createBindingElement(t.dotDotDotToken,t.propertyName||t.name,a,t.initializer)}else if(e.isIdentifier(t)){var n,a;if(a=(n=r.getSymbolAtLocation(t))&&i.get(String(e.getSymbolId(n))))return e.factory.createIdentifier(a.text)}}))}(a,i,s);if(e.returnsPromise(f,i)){var g=f.body&&e.isBlock(f.body)?function(t,r){var n=[];return e.forEachReturnStatement(t,(function(t){e.isReturnStatementWithFixablePromiseHandler(t,r)&&n.push(t)})),n}(f.body,i):e.emptyArray,y={checker:i,synthNamesMap:s,setOfExpressionsToReturn:u,isInJSFile:l};if(g.length){var h=a.modifiers?a.modifiers.end:a.decorators?e.skipTrivia(r.text,a.decorators.end):a.getStart(r),v=a.modifiers?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,h,131,v);for(var b=function(n){if(e.forEachChild(n,(function i(a){if(e.isCallExpression(a)){var o=m(a,a,y,!1);if(p())return!0;t.replaceNodeWithNodes(r,n,o)}else if(!e.isFunctionLike(a)&&(e.forEachChild(a,i),p()))return!0})),p())return{value:void 0}},x=0,S=g;x0)return F;if(y){A=D(o.checker,y,g);if(O(a,o))return x(A,u(a,t,o.checker));var P=b(n,A,void 0);return n&&n.types.push(o.checker.getAwaitedType(y)||y),P}return f();default:return f()}return e.emptyArray}function D(t,r,n){var i=e.getSynthesizedDeepClone(n);return t.getPromisedTypeOfPromise(r)?e.factory.createAwaitExpression(i):i}function C(t,r){var n=r.getSignaturesOfType(t,0);return e.lastOrUndefined(n)}function T(t,r,n,i){var a=[];return e.forEachChild(r,(function r(o){if(e.isCallExpression(o)){var s=m(o,o,t,n,i);if((a=a.concat(s)).length>0)return}else e.isFunctionLike(o)||e.forEachChild(o,r)})),a}function E(t,r){var n,i=[];e.isFunctionLikeDeclaration(t)?t.parameters.length>0&&(n=function t(r){if(e.isIdentifier(r))return a(r);var n=e.flatMap(r.elements,(function(r){return e.isOmittedExpression(r)?[]:[t(r.name)]}));return function(t,r,n){void 0===r&&(r=e.emptyArray);void 0===n&&(n=[]);return{kind:1,bindingPattern:t,elements:r,types:n}}(r,n)}(t.parameters[0].name)):e.isIdentifier(t)?n=a(t):e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&(n=a(t.name));if(n&&(!("identifier"in n)||"undefined"!==n.identifier.text))return n;function a(t){var n=function(e){return e.original?e.original:e}(t),a=function(e){return e.symbol?e.symbol:r.checker.getSymbolAtLocation(e)}(n);return a&&r.synthNamesMap.get(e.getSymbolId(a).toString())||A(t,i)}}function k(t){return!t||(I(t)?!t.identifier.text:e.every(t.elements,k))}function A(e,t){return void 0===t&&(t=[]),{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function N(e){return e.hasBeenReferenced=!0,e.identifier}function w(e){return I(e)?P(e):F(e)}function F(e){for(var t=0,r=e.elements;t1?[[o(n),s(n)],!0]:[[s(n)],!0]:[[o(n)],!1]}(d.arguments[0],r):void 0;return p?(i.replaceNodeWithNodes(t,n.parent,p[0]),p[1]):(i.replaceRangeWithText(t,e.createRange(u.getStart(t),d.pos),"export default"),!0)}i.delete(t,n.parent)}else e.isExportsOrModuleExportsOrAlias(t,u.expression)&&function(t,r,n,i){var a=r.left.name.text,o=i.get(a);if(void 0!==o){var s=[m(void 0,o,r.right),g([e.factory.createExportSpecifier(!1,o,a)])];n.replaceNodeWithNodes(t,r.parent,s)}else!function(t,r,n){var i=t.left,a=t.right,o=t.parent,s=i.name.text;if(!(e.isFunctionExpression(a)||e.isArrowFunction(a)||e.isClassExpression(a))||a.name&&a.name.text!==s)n.replaceNodeRangeWithNodes(r,i.expression,e.findChildOfKind(i,24,r),[e.factory.createToken(93),e.factory.createToken(85)],{joiner:" ",suffix:" "});else{n.replaceRange(r,{pos:i.getStart(r),end:a.getStart(r)},e.factory.createToken(93),{suffix:" "}),a.name||n.insertName(r,a,s);var c=e.findChildOfKind(o,26,r);c&&n.delete(r,c)}}(r,t,n)}(t,n,i,a);return!1}(t,n,y,i,d,p)}default:return!1}}function a(r,n,i,a,o,s,c){var u,d=n.declarationList,_=!1,g=e.map(d.declarations,(function(n){var i=n.name,u=n.initializer;if(u){if(e.isExportsOrModuleExportsOrAlias(r,u))return _=!0,y([]);if(e.isRequireCall(u,!0))return _=!0,function(r,n,i,a,o,s){switch(r.kind){case 201:var c=e.mapAllOrFail(r.elements,(function(t){return t.dotDotDotToken||t.initializer||t.propertyName&&!e.isIdentifier(t.propertyName)||!e.isIdentifier(t.name)?void 0:f(t.propertyName&&t.propertyName.text,t.name.text)}));if(c)return y([e.makeImport(void 0,c,n,s)]);case 202:var u=l(t.moduleSpecifierToValidIdentifier(n.text,o),a);return y([e.makeImport(e.factory.createIdentifier(u),void 0,n,s),m(void 0,e.getSynthesizedDeepClone(r),e.factory.createIdentifier(u))]);case 79:return function(t,r,n,i,a){for(var o,s=n.getSymbolAtLocation(t),c=new e.Map,u=!1,d=0,_=i.original.get(t.text);d<_.length;d++){var p=_[d];if(n.getSymbolAtLocation(p)===s&&p!==t){var f=p.parent;if(e.isPropertyAccessExpression(f)){var m=f.name.text;if("default"===m){u=!0;var g=p.getText();(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(g))}else{e.Debug.assert(f.expression===p,"Didn't expect expression === use");var h=c.get(m);void 0===h&&(h=l(m,i),c.set(m,h)),(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(h))}}else u=!0}}var v=0===c.size?void 0:e.arrayFrom(e.mapIterator(c.entries(),(function(t){var r=t[0],n=t[1];return e.factory.createImportSpecifier(!1,r===n?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(n))})));v||(u=!0);return y([e.makeImport(u?e.getSynthesizedDeepClone(t):void 0,v,r,a)],o)}(r,n,i,a,s);default:return e.Debug.assertNever(r,"Convert to ES module got invalid name kind ".concat(r.kind))}}(i,u.arguments[0],a,o,s,c);if(e.isPropertyAccessExpression(u)&&e.isRequireCall(u.expression,!0))return _=!0,function(t,r,n,i,a){switch(t.kind){case 201:case 202:var o=l(r,i);return y([p(o,r,n,a),m(void 0,t,e.factory.createIdentifier(o))]);case 79:return y([p(t.text,r,n,a)]);default:return e.Debug.assertNever(t,"Convert to ES module got invalid syntax form ".concat(t.kind))}}(i,u.name.text,u.expression.arguments[0],o,c)}return y([e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([n],d.flags))])}));if(_)return i.replaceNodeWithNodes(r,n,e.flatMap(g,(function(e){return e.newImports}))),e.forEach(g,(function(t){t.useSitesToUnqualify&&e.copyEntries(t.useSitesToUnqualify,null!=u?u:u=new e.Map)})),u}function o(e){return g(void 0,e)}function s(t){return g([e.factory.createExportSpecifier(!1,void 0,"default")],t)}function c(t,r){return r&&e.some(e.arrayFrom(r.keys()),(function(r){return e.rangeContainsRange(t,r)}))?e.isArray(t)?e.getSynthesizedDeepClonesWithReplacements(t,!0,n):e.getSynthesizedDeepCloneWithReplacements(t,!0,n):t;function n(e){if(206===e.kind){var t=r.get(e);return r.delete(e),t}}}function l(e,t){for(;t.original.has(e)||t.additional.has(e);)e="_".concat(e);return t.additional.add(e),e}function u(t){var r=e.createMultiMap();return d(t,(function(e){return r.add(e.text,e)})),r}function d(t,r){e.isIdentifier(t)&&function(e){var t=e.parent;switch(t.kind){case 206:return t.name!==e;case 203:case 270:return t.propertyName!==e;default:return!0}}(t)&&r(t),t.forEachChild((function(e){return d(e,r)}))}function _(t,r,n,i){return e.factory.createFunctionDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),e.getSynthesizedDeepClone(n.asteriskToken),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.parameters),e.getSynthesizedDeepClone(n.type),e.factory.converters.convertToFunctionBlock(c(n.body,i)))}function p(t,r,n,i){return"default"===r?e.makeImport(e.factory.createIdentifier(t),void 0,n,i):e.makeImport(void 0,[f(r,t)],n,i)}function f(t,r){return e.factory.createImportSpecifier(!1,void 0!==t&&t!==r?e.factory.createIdentifier(t):void 0,e.factory.createIdentifier(r))}function m(t,r,n){return e.factory.createVariableStatement(t,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(r,void 0,void 0,n)],2))}function g(t,r){return e.factory.createExportDeclaration(void 0,void 0,!1,t&&e.factory.createNamedExports(t),void 0===r?void 0:e.factory.createStringLiteral(r))}function y(e,t){return{newImports:e,useSitesToUnqualify:t}}t.registerCodeFix({errorCodes:[e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions:function(o){var s=o.sourceFile,c=o.program,d=o.preferences,_=e.textChanges.ChangeTracker.with(o,(function(t){var o=function(t,r,o,s,c){var d={original:u(t),additional:new e.Set},_=function(t,r,i){var a=new e.Map;return n(t,(function(t){var n=t.name,o=n.text,s=n.originalKeywordKind;!a.has(o)&&(void 0!==s&&e.isNonContextualKeyword(s)||r.resolveName(o,t,111551,!0))&&a.set(o,l("_".concat(o),i))})),a}(t,r,d);!function(t,r,i){n(t,(function(n,a){if(!a){var o=n.name.text;i.replaceNode(t,n,e.factory.createIdentifier(r.get(o)||o))}}))}(t,_,o);for(var p,f=!1,m=0,g=e.filter(t.statements,e.isVariableStatement);m0||c.length>0||u.size>0||d.size>0}};function p(t){var r,n,i=t.fixes,a=t.symbolName,o=e.first(i);switch(o.kind){case 0:s.push(o);break;case 1:c.push(o);break;case 2:var l=o.importClauseOrBindingPattern,_=o.importKind,p=o.addAsTypeOnly,f=String(e.getNodeId(l));if((h=u.get(f))||u.set(f,h={importClauseOrBindingPattern:l,defaultImport:void 0,namedImports:new e.Map}),0===_){var m=null==h?void 0:h.namedImports.get(a);h.namedImports.set(a,v(m,p))}else e.Debug.assert(void 0===h.defaultImport||h.defaultImport.name===a,"(Add to Existing) Default import should be missing or match symbolName"),h.defaultImport={name:a,addAsTypeOnly:v(null===(r=h.defaultImport)||void 0===r?void 0:r.addAsTypeOnly,p)};break;case 3:var g=o.moduleSpecifier,y=(_=o.importKind,o.useRequire),h=function(e,t,r,n){var i=b(e,!0),a=b(e,!1),o=d.get(i),s=d.get(a),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:r};if(1===t&&2===n)return o||(d.set(i,c),c);if(1===n&&(o||s))return o||s;if(s)return s;return d.set(a,c),c}(g,_,y,p=o.addAsTypeOnly);switch(e.Debug.assert(h.useRequire===y,"(Add new) Tried to add an `import` and a `require` for the same module"),_){case 1:e.Debug.assert(void 0===h.defaultImport||h.defaultImport.name===a,"(Add new) Default import should be missing or match symbolName"),h.defaultImport={name:a,addAsTypeOnly:v(null===(n=h.defaultImport)||void 0===n?void 0:n.addAsTypeOnly,p)};break;case 0:m=(h.namedImports||(h.namedImports=new e.Map)).get(a);h.namedImports.set(a,v(m,p));break;case 3:case 2:e.Debug.assert(void 0===h.namespaceLikeImport||h.namespaceLikeImport.name===a,"Namespacelike import shoudl be missing or match symbolName"),h.namespaceLikeImport={importKind:_,name:a,addAsTypeOnly:p}}break;case 4:break;default:e.Debug.assertNever(o,"fix wasn't never - got kind ".concat(o.kind))}function v(e,t){return Math.max(null!=e?e:0,t)}function b(e,t){return"".concat(t?1:0,"|").concat(e)}}}function l(t,r,n,i,a,o,s,c,l){e.Debug.assert(r.some((function(e){return e.moduleSymbol===n||e.symbol.parent===n})),"Some exportInfo should match the specified moduleSymbol");var u=e.createPackageJsonImportFilter(t,l,c);return h(p(r,a,o,s,i,t,c,l).fixes,t,i,u,c)}function u(e){return{description:e.description,changes:e.changes,commands:e.commands}}function d(t,r,n,i){var a,o,s=n.getCompilerOptions(),c=u(n.getTypeChecker(),!1);if(c)return c;var l=null===(o=null===(a=i.getPackageJsonAutoImportProvider)||void 0===a?void 0:a.call(i))||void 0===o?void 0:o.getTypeChecker();return e.Debug.checkDefined(l&&u(l,!0),"Could not find symbol in specified module for code actions");function u(n,i){var a=e.getDefaultLikeExportInfo(r,n,s);if(a&&e.skipAlias(a.symbol,n)===t)return{symbol:a.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:a.exportKind,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i};var o=n.tryGetMemberInModuleExportsAndProperties(t.name,r);return o&&e.skipAlias(o,n)===t?{symbol:o,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i}:void 0}}function _(t,r,n,i,a,o,s,c,l){var u=[],d=s.getCompilerOptions(),_=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?o.getPackageJsonAutoImportProvider():s,o)}));return e.forEachExternalModuleToImportFrom(s,o,l,(function(o,s,c,l){var _=c.getTypeChecker();if(!s||o===n||!e.startsWith(t.fileName,e.getDirectoryPath(s.fileName))){var f=e.getDefaultLikeExportInfo(o,_,d);f&&(f.name===i||M(o,e.getEmitScriptTarget(d),a)===i)&&e.skipAlias(f.symbol,_)===r&&p(c,s,l)&&u.push({symbol:f.symbol,moduleSymbol:o,moduleFileName:null==s?void 0:s.fileName,exportKind:f.exportKind,targetFlags:e.skipAlias(f.symbol,_).flags,isFromPackageJson:l});for(var m=0,g=_.getExportsAndPropertiesOfModule(o);m0}:{kind:3,moduleSpecifier:i,importKind:x(r,t.exportKind,d),useRequire:a,addAsTypeOnly:v,exportInfo:t,isReExport:o>0}}))}));return{computedWithoutCacheCount:y,fixes:h}}(n,i,a,o,s,t,c,l,u)}(t,_,o,s,null==n?void 0:n.position,i,a,c,l,u),y=g.fixes,h=g.computedWithoutCacheCount;return{computedWithoutCacheCount:void 0===h?0:h,fixes:r(r([],p?[p]:e.emptyArray,!0),y,!0)}}function f(e,t,r,n,i,a){return e?t&&2===a.importsNotUsedAsValues?2:!a.isolatedModules||!a.preserveValueImports||111551&n&&!i.getTypeOnlyAliasDeclaration(r)?1:2:4}function m(t,r){if(!e.isSourceFileJS(t))return!1;if(t.commonJsModuleIndicator&&!t.externalModuleIndicator)return!0;if(t.externalModuleIndicator&&!t.commonJsModuleIndicator)return!1;var n=r.getCompilerOptions();if(n.configFile)return e.getEmitModuleKind(n)=e.ModuleKind.ES2015)return i?1:2;if(a)return e.isExternalModule(t)||n?i?1:2:3;for(var o=0,s=t.statements;o1&&e.OrganizeImports.importSpecifiersAreSorted(r.parent.elements)){t.delete(i,r);var o=e.factory.updateImportSpecifier(r,!1,r.propertyName,r.name),s=e.OrganizeImports.getImportSpecifierInsertionIndex(r.parent.elements,o);t.insertImportSpecifierAtIndex(i,o,r.parent,s)}else t.deleteRange(i,r.getFirstToken());return r}return e.Debug.assert(r.parent.parent.isTypeOnly),c(r.parent.parent),r.parent.parent;case 267:return c(r),r;case 268:return c(r.parent),r.parent;case 265:return t.deleteRange(i,r.getChildAt(1)),r;default:e.Debug.failBadSyntaxKind(r)}function c(n){if(t.delete(i,e.getTypeKeywordOfTypeOnlyImport(n,i)),a){var o=e.tryCast(n.namedBindings,e.isNamedImports);if(o&&o.elements.length>1){e.OrganizeImports.importSpecifiersAreSorted(o.elements)&&270===r.kind&&0!==o.elements.indexOf(r)&&(t.delete(i,r),t.insertImportSpecifierAtIndex(i,r,o,0));for(var s=0,c=o.elements;s"),[e.Diagnostics.Convert_function_expression_0_to_arrow_function,c?c.text:e.ANONYMOUS]}return t.replaceNode(r,s,e.factory.createToken(85)),t.insertText(r,c.end," = "),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_declaration_0_to_arrow_function,c.text]}}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a,o=n.sourceFile,s=n.program,c=n.span,l=e.textChanges.ChangeTracker.with(n,(function(e){a=i(e,o,c.start,s.getTypeChecker())}));return a?[t.createCodeFixAction(r,l,a,r,e.Diagnostics.Fix_all_implicit_this_errors)]:e.emptyArray},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){i(t,r.file,r.start,e.program.getTypeChecker())}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixIncorrectNamedTupleSyntax",n=[e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=function(t,r){var n=e.getTokenAtPosition(t,r);return e.findAncestor(n,(function(e){return 197===e.kind}))}(i,a.start),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){if(n){for(var i=n.type,a=!1,o=!1;185===i.kind||186===i.kind||191===i.kind;)185===i.kind?a=!0:186===i.kind&&(o=!0),i=i.type;var s=e.factory.updateNamedTupleMember(n,n.dotDotDotToken||(o?e.factory.createToken(25):void 0),n.name,n.questionToken||(a?e.factory.createToken(57):void 0),i);s!==n&&t.replaceNode(r,n,s)}}(t,i,o)}));return[t.createCodeFixAction(r,s,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels,r,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="fixSpelling",n=[e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.No_overload_matches_this_call.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code];function i(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=a.parent;if(i!==e.Diagnostics.No_overload_matches_this_call.code&&i!==e.Diagnostics.Type_0_is_not_assignable_to_type_1.code||e.isJsxAttribute(o)){var s,c=n.program.getTypeChecker();if(e.isPropertyAccessExpression(o)&&o.name===a){e.Debug.assert(e.isMemberName(a),"Expected an identifier for spelling (property access)");var l=c.getTypeAtLocation(o.expression);32&o.flags&&(l=c.getNonNullableType(l)),s=c.getSuggestedSymbolForNonexistentProperty(a,l)}else if(e.isBinaryExpression(o)&&101===o.operatorToken.kind&&o.left===a&&e.isPrivateIdentifier(a)){var u=c.getTypeAtLocation(o.right);s=c.getSuggestedSymbolForNonexistentProperty(a,u)}else if(e.isQualifiedName(o)&&o.right===a){var d=c.getSymbolAtLocation(o.left);d&&1536&d.flags&&(s=c.getSuggestedSymbolForNonexistentModule(o.right,d))}else if(e.isImportSpecifier(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for spelling (import)");var _=function(t,r,n){if(!n||!e.isStringLiteralLike(n.moduleSpecifier))return;var i=e.getResolvedModule(t,n.moduleSpecifier.text,e.getModeForUsageLocation(t,n.moduleSpecifier));return i?r.program.getSourceFile(i.resolvedFileName):void 0}(t,n,e.findAncestor(a,e.isImportDeclaration));_&&_.symbol&&(s=c.getSuggestedSymbolForNonexistentModule(a,_.symbol))}else if(e.isJsxAttribute(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for JSX attribute");var p=e.findAncestor(a,e.isJsxOpeningLikeElement),f=c.getContextualTypeForArgumentAtIndex(p,0);s=c.getSuggestedSymbolForNonexistentJSXAttribute(a,f)}else if(e.hasSyntacticModifier(o,16384)&&e.isClassElement(o)&&o.name===a){var m=e.findAncestor(a,e.isClassLike),g=m?e.getEffectiveBaseTypeNode(m):void 0,y=g?c.getTypeAtLocation(g):void 0;y&&(s=c.getSuggestedSymbolForNonexistentClassMember(e.getTextOfNode(a),y))}else{var h=e.getMeaningFromLocation(a),v=e.getTextOfNode(a);e.Debug.assert(void 0!==v,"name should be defined"),s=c.getSuggestedSymbolForNonexistentSymbol(a,v,function(e){var t=0;4&e&&(t|=1920);2&e&&(t|=788968);1&e&&(t|=111551);return t}(h))}return void 0===s?void 0:{node:a,suggestedSymbol:s}}}function a(t,r,n,i,a){var o=e.symbolName(i);if(!e.isIdentifierText(o,a)&&e.isPropertyAccessExpression(n.parent)){var s=i.valueDeclaration;s&&e.isNamedDeclaration(s)&&e.isPrivateIdentifier(s.name)?t.replaceNode(r,n,e.factory.createIdentifier(o)):t.replaceNode(r,n.parent,e.factory.createElementAccessExpression(n.parent.expression,e.factory.createStringLiteral(o)))}else t.replaceNode(r,n,e.factory.createIdentifier(o))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.errorCode,c=i(o,n.span.start,n,s);if(c){var l=c.node,u=c.suggestedSymbol,d=e.getEmitScriptTarget(n.host.getCompilationSettings()),_=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l,u,d)}));return[t.createCodeFixAction("spelling",_,[e.Diagnostics.Change_spelling_to_0,e.symbolName(u)],r,e.Diagnostics.Fix_all_detected_spelling_errors)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(n.file,n.start,r,n.code),s=e.getEmitScriptTarget(r.host.getCompilationSettings());o&&a(t,r.sourceFile,o.node,o.suggestedSymbol,s)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r,n="returnValueCorrect",i="fixAddReturnStatement",a="fixRemoveBracesFromArrowFunctionBody",o="fixWrapTheBlockWithParen",s=[e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function c(t,r,n){var i=t.createSymbol(4,r.escapedText);i.type=t.getTypeAtLocation(n);var a=e.createSymbolTable([i]);return t.createAnonymousType(void 0,a,[],[],[])}function l(t,n,i,a){if(n.body&&e.isBlock(n.body)&&1===e.length(n.body.statements)){var o=e.first(n.body.statements);if(e.isExpressionStatement(o)&&u(t,n,t.getTypeAtLocation(o.expression),i,a))return{declaration:n,kind:r.MissingReturnStatement,expression:o.expression,statement:o,commentSource:o.expression};if(e.isLabeledStatement(o)&&e.isExpressionStatement(o.statement)){var s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(o.label,o.statement.expression)]);if(u(t,n,c(t,o.label,o.statement.expression),i,a))return e.isArrowFunction(n)?{declaration:n,kind:r.MissingParentheses,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:o.statement.expression}}else if(e.isBlock(o)&&1===e.length(o.statements)){var l=e.first(o.statements);if(e.isLabeledStatement(l)&&e.isExpressionStatement(l.statement)){s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(l.label,l.statement.expression)]);if(u(t,n,c(t,l.label,l.statement.expression),i,a))return{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:l}}}}}function u(t,r,n,i,a){if(a){var o=t.getSignatureFromDeclaration(r);if(o){e.hasSyntacticModifier(r,256)&&(n=t.createPromiseType(n));var s=t.createSignature(r,o.typeParameters,o.thisParameter,o.parameters,n,void 0,o.minArgumentCount,o.flags);n=t.createAnonymousType(void 0,e.createSymbolTable(),[s],[],[])}else n=t.getAnyType()}return t.isTypeAssignableTo(n,i)}function d(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(a.parent){var o=e.findAncestor(a.parent,e.isFunctionLikeDeclaration);switch(i){case e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&e.rangeContainsRange(o.type,a)))return;return l(t,o,t.getTypeFromTypeNode(o.type),!1);case e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!e.isCallExpression(o.parent)||!o.body)return;var s=o.parent.arguments.indexOf(o),c=t.getContextualTypeForArgumentAtIndex(o.parent,s);if(!c)return;return l(t,o,c,!0);case e.Diagnostics.Type_0_is_not_assignable_to_type_1.code:if(!e.isDeclarationName(a)||!e.isVariableLike(a.parent)&&!e.isJsxAttribute(a.parent))return;var u=function(t){switch(t.kind){case 254:case 164:case 203:case 167:case 296:return t.initializer;case 285:return t.initializer&&(e.isJsxExpression(t.initializer)?t.initializer.expression:void 0);case 297:case 166:case 299:case 347:case 340:return}}(a.parent);if(!u||!e.isFunctionLikeDeclaration(u)||!u.body)return;return l(t,u,t.getTypeAtLocation(a.parent),!0)}}}function _(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.probablyUsesSemicolons(r);t.replaceNode(r,i,e.factory.createReturnStatement(n),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,suffix:a?";":void 0})}function p(t,r,n,i,a,o){var s=o||e.needsParentheses(i)?e.factory.createParenthesizedExpression(i):i;e.suppressLeadingAndTrailingTrivia(a),e.copyComments(a,s),t.replaceNode(r,n.body,s)}function f(t,r,n,i){t.replaceNode(r,n.body,e.factory.createParenthesizedExpression(i))}function m(r,a,o){var s=e.textChanges.ChangeTracker.with(r,(function(e){return _(e,r.sourceFile,a,o)}));return t.createCodeFixAction(n,s,e.Diagnostics.Add_a_return_statement,i,e.Diagnostics.Add_all_missing_return_statement)}function g(r,i,a){var s=e.textChanges.ChangeTracker.with(r,(function(e){return f(e,r.sourceFile,i,a)}));return t.createCodeFixAction(n,s,e.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,o,e.Diagnostics.Wrap_all_object_literal_with_parentheses)}!function(e){e[e.MissingReturnStatement=0]="MissingReturnStatement",e[e.MissingParentheses=1]="MissingParentheses"}(r||(r={})),t.registerCodeFix({errorCodes:s,fixIds:[i,a,o],getCodeActions:function(i){var o=i.program,s=i.sourceFile,c=i.span.start,l=i.errorCode,u=d(o.getTypeChecker(),s,c,l);if(u)return u.kind===r.MissingReturnStatement?e.append([m(i,u.expression,u.statement)],e.isArrowFunction(u.declaration)?function(r,i,o,s){var c=e.textChanges.ChangeTracker.with(r,(function(e){return p(e,r.sourceFile,i,o,s,!1)}));return t.createCodeFixAction(n,c,e.Diagnostics.Remove_braces_from_arrow_function_body,a,e.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(i,u.declaration,u.expression,u.commentSource):void 0):[g(i,u.declaration,u.expression)]},getAllCodeActions:function(r){return t.codeFixAll(r,s,(function(t,n){var s=d(r.program.getTypeChecker(),n.file,n.start,n.code);if(s)switch(r.fixId){case i:_(t,n.file,s.expression,s.statement);break;case a:if(!e.isArrowFunction(s.declaration))return;p(t,n.file,s.declaration,s.expression,s.commentSource,!1);break;case o:if(!e.isArrowFunction(s.declaration))return;f(t,n.file,s.declaration,s.expression);break;default:e.Debug.fail(JSON.stringify(r.fixId))}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n,i="fixMissingMember",a="fixMissingProperties",o="fixMissingAttributes",s="fixMissingFunctionDeclaration",c=[e.Diagnostics.Property_0_does_not_exist_on_type_1.code,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Cannot_find_name_0.code];function l(t,r,n,i,a){var o=e.getTokenAtPosition(t,r),s=o.parent;if(n===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(18!==o.kind||!e.isObjectLiteralExpression(s)||!e.isCallExpression(s.parent))return;var c=e.findIndex(s.parent.arguments,(function(e){return e===s}));if(c<0)return;var l=e.singleOrUndefined(i.getSignaturesOfType(i.getTypeAtLocation(s.parent.expression),0));if(!(l&&l.declaration&&l.parameters[c]))return;var d=l.parameters[c].valueDeclaration;if(!(d&&e.isParameter(d)&&e.isIdentifier(d.name)))return;var _=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s),i.getParameterType(l,c),!1,!1));if(!e.length(_))return;return{kind:3,token:d.name,properties:_,parentDeclaration:s}}if(e.isMemberName(o)){if(e.isIdentifier(o)&&e.hasInitializer(s)&&s.initializer&&e.isObjectLiteralExpression(s.initializer)){_=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s.initializer),i.getTypeAtLocation(o),!1,!1));if(!e.length(_))return;return{kind:3,token:o,properties:_,parentDeclaration:s.initializer}}if(e.isIdentifier(o)&&e.isJsxOpeningLikeElement(o.parent)){var p=function(t,r,n){var i=t.getContextualType(n.attributes);if(void 0===i)return e.emptyArray;var a=i.getProperties();if(!e.length(a))return e.emptyArray;for(var o=new e.Set,s=0,c=n.attributes.properties;s=e.ModuleKind.ES2015&&o99)&&(s=e.textChanges.ChangeTracker.with(r,(function(r){if(e.getTsConfigObjectLiteralExpression(i)){var n=[["target",e.factory.createStringLiteral("es2017")]];o===e.ModuleKind.CommonJS&&n.push(["module",e.factory.createStringLiteral("commonjs")]),t.setJsonCompilerOptionValues(r,i,n)}})),a.push(t.createCodeFixActionWithoutFixAll("fixTargetOption",s,[e.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))),a.length?a:void 0}}})}(c||(c={})),function(e){!function(t){var r="fixPropertyAssignment",n=[e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];function i(t,r,n){t.replaceNode(r,n,e.factory.createPropertyAssignment(n.name,n.objectAssignmentInitializer))}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isShorthandPropertyAssignment)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start),s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return[t.createCodeFixAction(r,s,[e.Diagnostics.Change_0_to_1,"=",":"],r,[e.Diagnostics.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,a(t.file,t.start))}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="extendsInterfaceBecomesImplements",n=[e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingClass(n).heritageClauses,a=i[0].getFirstToken();return 94===a.kind?{extendsToken:a,heritageClauses:i}:void 0}function a(t,r,n,i){if(t.replaceNode(r,n,e.factory.createToken(117)),2===i.length&&94===i[0].token&&117===i[1].token){var a=i[1].getFirstToken(),o=a.getFullStart();t.replaceRange(r,{pos:o,end:o},e.factory.createToken(27));for(var s=r.text,c=a.end;c":">","}":"}"};function o(t,r,n,i,o){var s=n.getText()[i];if(function(t){return e.hasProperty(a,t)}(s)){var c=o?a[s]:"{".concat(e.quote(n,r,s),"}");t.replaceRangeWithText(n,{pos:i,end:i+1},c)}}}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="deleteUnmatchedParameter",n="renameUnmatchedParameter",i=[e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];function a(t,r){var n=e.getTokenAtPosition(t,r);if(n.parent&&e.isJSDocParameterTag(n.parent)&&e.isIdentifier(n.parent.name)){var i=n.parent,a=e.getHostSignatureFromJSDoc(i);if(a)return{signature:a,name:n.parent.name,jsDocParameterTag:i}}}t.registerCodeFix({fixIds:[r,n],errorCodes:i,getCodeActions:function(i){var o=[],s=a(i.sourceFile,i.span.start);if(s)return e.append(o,function(n,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag,c=e.textChanges.ChangeTracker.with(n,(function(e){return e.filterJSDocTags(n.sourceFile,o,(function(e){return e!==s}))}));return t.createCodeFixAction(r,c,[e.Diagnostics.Delete_unused_param_tag_0,a.getText(n.sourceFile)],r,e.Diagnostics.Delete_all_unused_param_tags)}(i,s)),e.append(o,function(r,i){var a=i.name,o=i.signature,s=i.jsDocParameterTag;if(!e.length(o.parameters))return;for(var c=r.sourceFile,l=e.getJSDocTags(o),u=new e.Set,d=0,_=l;d<_.length;d++){var p=_[d];e.isJSDocParameterTag(p)&&e.isIdentifier(p.name)&&u.add(p.name.escapedText)}var f=e.firstDefined(o.parameters,(function(t){return e.isIdentifier(t.name)&&!u.has(t.name.escapedText)?t.name.getText(c):void 0}));if(void 0===f)return;var m=e.factory.updateJSDocParameterTag(s,s.tagName,e.factory.createIdentifier(f),s.isBracketed,s.typeExpression,s.isNameFirst,s.comment),g=e.textChanges.ChangeTracker.with(r,(function(t){return t.replaceJSDocComment(c,o,e.map(l,(function(e){return e===s?m:e})))}));return t.createCodeFixActionWithoutFixAll(n,g,[e.Diagnostics.Rename_param_tag_name_0_to_1,a.getText(c),f])}(i,s)),o},getAllCodeActions:function(n){var o=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(n,(function(s){t.eachDiagnostic(n,i,(function(t){var r=a(t.file,t.start);r&&o.set(r.signature,e.append(o.get(r.signature),r.jsDocParameterTag))})),o.forEach((function(t,i){if(n.fixId===r){var a=new e.Set(t);s.filterJSDocTags(i.getSourceFile(),i,(function(e){return!a.has(e)}))}}))})))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixUnreferenceableDecoratorMetadata",n=[e.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=function(t,r,n){var i=e.tryCast(e.getTokenAtPosition(t,n),e.isIdentifier);if(i&&178===i.parent.kind){var a=r.getTypeChecker().getSymbolAtLocation(i);return e.find((null==a?void 0:a.declarations)||e.emptyArray,e.or(e.isImportClause,e.isImportSpecifier,e.isImportEqualsDeclaration))}}(n.sourceFile,n.program,n.span.start);if(i){var a,o=e.textChanges.ChangeTracker.with(n,(function(t){return 270===i.kind&&function(t,r,n,i){e.refactor.doChangeNamedToNamespaceOrDefault(r,i,t,n.parent)}(t,n.sourceFile,i,n.program)})),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n,i){if(265!==n.kind){var a=267===n.kind?n:n.parent.parent;if(!a.name||!a.namedBindings){var o=i.getTypeChecker();e.forEachImportClauseDeclaration(a,(function(t){if(111551&e.skipAlias(t.symbol,o).flags)return!0}))||t.insertModifierBefore(r,152,a)}}else t.insertModifierBefore(r,152,n.name)}(t,n.sourceFile,i,n.program)}));return o.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Convert_named_imports_to_namespace_import))),s.length&&(a=e.append(a,t.createCodeFixActionWithoutFixAll(r,s,e.Diagnostics.Convert_to_type_only_import))),a}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="unusedIdentifier",n="unusedIdentifier_prefix",i="unusedIdentifier_delete",a="unusedIdentifier_deleteImports",o="unusedIdentifier_infer",s=[e.Diagnostics._0_is_declared_but_its_value_is_never_read.code,e.Diagnostics._0_is_declared_but_never_used.code,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,e.Diagnostics.All_imports_in_import_declaration_are_unused.code,e.Diagnostics.All_destructured_elements_are_unused.code,e.Diagnostics.All_variables_are_unused.code,e.Diagnostics.All_type_parameters_are_unused.code];function c(t,r,n){t.replaceNode(r,n.parent,e.factory.createKeywordTypeNode(155))}function l(n,a){return t.createCodeFixAction(r,n,a,i,e.Diagnostics.Delete_all_unused_declarations)}function u(t,r,n){t.delete(r,e.Debug.checkDefined(e.cast(n.parent,e.isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"))}function d(e){return 100===e.kind||79===e.kind&&(270===e.parent.kind||267===e.parent.kind)}function _(t){return 100===t.kind?e.tryCast(t.parent,e.isImportDeclaration):void 0}function p(t,r){return e.isVariableDeclarationList(r.parent)&&e.first(r.parent.getChildren(t))===r}function f(e,t,r){e.delete(t,237===r.parent.kind?r.parent:r)}function m(t,r,n,i){r!==e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code&&(137===i.kind&&(i=e.cast(i.parent,e.isInferTypeNode).typeParameter.name),e.isIdentifier(i)&&function(e){switch(e.parent.kind){case 164:case 163:return!0;case 254:switch(e.parent.parent.parent.kind){case 244:case 243:return!0}}return!1}(i)&&(t.replaceNode(n,i,e.factory.createIdentifier("_".concat(i.text))),e.isParameter(i.parent)&&e.getJSDocParameterTags(i.parent).forEach((function(r){e.isIdentifier(r.name)&&t.replaceNode(n,r.name,e.factory.createIdentifier("_".concat(r.name.text)))}))))}function g(t,r,n,i,a,o,s,c){!function(t,r,n,i,a,o,s,c){var l=t.parent;if(e.isParameter(l))!function(t,r,n,i,a,o,s,c){void 0===c&&(c=!1);(function(t,r,n,i,a,o,s){var c=n.parent;switch(c.kind){case 169:case 171:var l=c.parameters.indexOf(n),u=e.isMethodDeclaration(c)?c.name:c,d=e.FindAllReferences.Core.getReferencedSymbolsForNode(c.pos,u,a,i,o);if(d)for(var _=0,p=d;_l,v=e.isPropertyAccessExpression(g.node.parent)&&e.isSuperKeyword(g.node.parent.expression)&&e.isCallExpression(g.node.parent.parent)&&g.node.parent.parent.arguments.length>l,b=(e.isMethodDeclaration(g.node.parent)||e.isMethodSignature(g.node.parent))&&g.node.parent!==n.parent&&g.node.parent.parameters.length>l;if(y||v||b)return!1}}return!0;case 256:return!c.name||!function(t,r,n){return!!e.FindAllReferences.Core.eachSymbolReferenceInFile(n,t,r,(function(t){return e.isIdentifier(t)&&e.isCallExpression(t.parent)&&t.parent.arguments.indexOf(t)>=0}))}(t,r,c.name)||h(c,n,s);case 213:case 214:return h(c,n,s);case 173:return!1;case 172:return!0;default:return e.Debug.failBadSyntaxKind(c)}})(i,r,n,a,o,s,c)&&(n.modifiers&&n.modifiers.length>0&&(!e.isIdentifier(n.name)||e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,i,r))?n.modifiers.forEach((function(e){return t.deleteModifier(r,e)})):!n.initializer&&y(n,i,a)&&t.delete(r,n))}(r,n,l,i,a,o,s,c);else if(!(c&&e.isIdentifier(t)&&e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,n))){var u=e.isImportClause(l)?t:e.isComputedPropertyName(l)?l.parent:l;e.Debug.assert(u!==n,"should not delete whole source file"),r.delete(n,u)}}(r,n,t,i,a,o,s,c),e.isIdentifier(r)&&e.FindAllReferences.Core.eachSymbolReferenceInFile(r,i,t,(function(r){e.isPropertyAccessExpression(r.parent)&&r.parent.name===r&&(r=r.parent),!c&&function(t){return(e.isBinaryExpression(t.parent)&&t.parent.left===t||(e.isPostfixUnaryExpression(t.parent)||e.isPrefixUnaryExpression(t.parent))&&t.parent.operand===t)&&e.isExpressionStatement(t.parent.parent)}(r)&&n.delete(t,r.parent.parent)}))}function y(t,r,n){var i=t.parent.parameters.indexOf(t);return!e.FindAllReferences.Core.someSignatureUsage(t.parent,n,r,(function(e,t){return!t||t.arguments.length>i}))}function h(t,r,n){var i=t.parameters,a=i.indexOf(r);return e.Debug.assert(-1!==a,"The parameter should already be in the list"),n?i.slice(a+1).every((function(t){return e.isIdentifier(t.name)&&!t.symbol.isReferenced})):a===i.length-1}t.registerCodeFix({errorCodes:s,getCodeActions:function(i){var s=i.errorCode,y=i.sourceFile,h=i.program,v=i.cancellationToken,b=h.getTypeChecker(),x=h.getSourceFiles(),S=e.getTokenAtPosition(y,i.span.start);if(e.isJSDocTemplateTag(S))return[l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S)})),e.Diagnostics.Remove_template_tag)];if(29===S.kind)return[l(C=e.textChanges.ChangeTracker.with(i,(function(e){return u(e,y,S)})),e.Diagnostics.Remove_type_parameters)];var D=_(S);if(D){var C=e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D)}));return[t.createCodeFixAction(r,C,[e.Diagnostics.Remove_import_from_0,e.showModuleSpecifier(D)],a,e.Diagnostics.Delete_all_unused_imports)]}if(d(S)&&(N=e.textChanges.ChangeTracker.with(i,(function(e){return g(y,S,e,b,x,h,v,!1)}))).length)return[t.createCodeFixAction(r,N,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,S.getText(y)],a,e.Diagnostics.Delete_all_unused_imports)];if(e.isObjectBindingPattern(S.parent)||e.isArrayBindingPattern(S.parent)){if(e.isParameter(S.parent.parent)){var T=S.parent.elements,E=[T.length>1?e.Diagnostics.Remove_unused_declarations_for_Colon_0:e.Diagnostics.Remove_unused_declaration_for_Colon_0,e.map(T,(function(e){return e.getText(y)})).join(", ")];return[l(e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r,n){e.forEach(n.elements,(function(e){return t.delete(r,e)}))}(t,y,S.parent)})),E)]}return[l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S.parent.parent)})),e.Diagnostics.Remove_unused_destructuring_declaration)]}if(p(y,S))return[l(e.textChanges.ChangeTracker.with(i,(function(e){return f(e,y,S.parent)})),e.Diagnostics.Remove_variable_statement)];var k=[];if(137===S.kind){C=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,y,S)}));var A=e.cast(S.parent,e.isInferTypeNode).typeParameter.name.text;k.push(t.createCodeFixAction(r,C,[e.Diagnostics.Replace_infer_0_with_unknown,A],o,e.Diagnostics.Replace_all_unused_infer_with_unknown))}else{var N;if((N=e.textChanges.ChangeTracker.with(i,(function(e){return g(y,S,e,b,x,h,v,!1)}))).length){A=e.isComputedPropertyName(S.parent)?S.parent:S;k.push(l(N,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,A.getText(y)]))}}var w=e.textChanges.ChangeTracker.with(i,(function(e){return m(e,s,y,S)}));return w.length&&k.push(t.createCodeFixAction(r,w,[e.Diagnostics.Prefix_0_with_an_underscore,S.getText(y)],n,e.Diagnostics.Prefix_all_unused_declarations_with_where_possible)),k},fixIds:[n,i,a,o],getAllCodeActions:function(r){var l=r.sourceFile,h=r.program,v=r.cancellationToken,b=h.getTypeChecker(),x=h.getSourceFiles();return t.codeFixAll(r,s,(function(t,s){var S=e.getTokenAtPosition(l,s.start);switch(r.fixId){case n:m(t,s.code,l,S);break;case a:var D=_(S);D?t.delete(l,D):d(S)&&g(l,S,t,b,x,h,v,!0);break;case i:if(137===S.kind||d(S))break;if(e.isJSDocTemplateTag(S))t.delete(l,S);else if(29===S.kind)u(t,l,S);else if(e.isObjectBindingPattern(S.parent)){if(S.parent.parent.initializer)break;e.isParameter(S.parent.parent)&&!y(S.parent.parent,b,x)||t.delete(l,S.parent.parent)}else{if(e.isArrayBindingPattern(S.parent.parent)&&S.parent.parent.parent.initializer)break;p(l,S)?f(t,l,S.parent):g(l,S,t,b,x,h,v,!0)}break;case o:137===S.kind&&c(t,l,S);break;default:e.Debug.fail(JSON.stringify(r.fixId))}}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="fixUnreachableCode",n=[e.Diagnostics.Unreachable_code_detected.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n),s=e.findAncestor(o,e.isStatement);if(s.getStart(r)!==o.getStart(r)){var c=JSON.stringify({statementKind:e.Debug.formatSyntaxKind(s.kind),tokenKind:e.Debug.formatSyntaxKind(o.kind),errorCode:a,start:n,length:i});e.Debug.fail("Token and statement should start at the same point. "+c)}var l=(e.isBlock(s.parent)?s.parent:s).parent;if(!e.isBlock(s.parent)||s===e.first(s.parent.statements))switch(l.kind){case 239:if(l.elseStatement){if(e.isBlock(s.parent))break;return void t.replaceNode(r,s,e.factory.createBlock(e.emptyArray))}case 241:case 242:return void t.delete(r,l)}if(e.isBlock(s.parent)){var u=n+i,d=e.Debug.checkDefined(function(e,t){for(var r,n=0,i=e;nJ.length)V(k,h.getSignatureFromDeclaration(y[y.length-1]),D,x,_||c(k));else e.Debug.assert(y.length===J.length,"Declarations and signatures should match count"),d(function(t,n,i,a,o,l,u,d,_){for(var p=a[0],f=a[0].minArgumentCount,m=!1,g=0,y=a;g=p.parameters.length&&(!e.signatureHasRestParameter(h)||e.signatureHasRestParameter(p))&&(p=h)}var v=p.parameters.length-(e.signatureHasRestParameter(p)?1:0),b=p.parameters.map((function(e){return e.name})),x=s(v,b,void 0,f,!1);if(m){var S=e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),b[v]||"rest",v>=f?e.factory.createToken(57):void 0,e.factory.createArrayTypeNode(e.factory.createKeywordTypeNode(155)),void 0);x.push(S)}return function(t,r,n,i,a,o,s,l){return e.factory.createMethodDeclaration(void 0,t,void 0,r,n?e.factory.createToken(57):void 0,i,a,o,l||c(s))}(u,o,l,void 0,x,function(t,n,i,a){if(e.length(t)){var o=n.getUnionType(e.map(t,n.getReturnTypeOfSignature));return n.typeToTypeNode(o,a,void 0,r(i))}}(a,t,n,i),d,_)}(h,o,n,J,x,T&&!!(1&f),D,k,_))}}function V(e,t,r,i,s){var c=a(169,o,e,t,s,i,r,T&&!!(1&f),n,u);c&&d(c)}}function a(t,n,i,a,o,s,c,l,u,d){var _=n.program,f=_.getTypeChecker(),g=e.getEmitScriptTarget(_.getCompilerOptions()),y=524545|(0===i?268435456:0),h=f.signatureToSignatureDeclaration(a,t,u,y,r(n));if(h){var v=h.typeParameters,b=h.parameters,x=h.type;if(d){if(v){var S=e.sameMap(v,(function(t){var r,n=t.constraint,i=t.default;n&&((r=p(n,g))&&(n=r.typeNode,m(d,r.symbols)));i&&((r=p(i,g))&&(i=r.typeNode,m(d,r.symbols)));return e.factory.updateTypeParameterDeclaration(t,t.modifiers,t.name,n,i)}));v!==S&&(v=e.setTextRange(e.factory.createNodeArray(S,v.hasTrailingComma),v))}var D=e.sameMap(b,(function(t){var r=p(t.type,g),n=t.type;return r&&(n=r.typeNode,m(d,r.symbols)),e.factory.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,n,t.initializer)}));if(b!==D&&(b=e.setTextRange(e.factory.createNodeArray(D,b.hasTrailingComma),b)),x){var C=p(x,g);C&&(x=C.typeNode,m(d,C.symbols))}}var T=l?e.factory.createToken(57):void 0,E=h.asteriskToken;return e.isFunctionExpression(h)?e.factory.updateFunctionExpression(h,c,h.asteriskToken,e.tryCast(s,e.isIdentifier),v,b,x,null!=o?o:h.body):e.isArrowFunction(h)?e.factory.updateArrowFunction(h,c,v,b,x,h.equalsGreaterThanToken,null!=o?o:h.body):e.isMethodDeclaration(h)?e.factory.updateMethodDeclaration(h,void 0,c,E,null!=s?s:e.factory.createIdentifier(""),T,v,b,x,o):void 0}}function o(t,r,n,i,a,o,s){var c=t.typeToTypeNode(n,i,o,s);if(c&&e.isImportTypeNode(c)){var l=p(c,a);l&&(m(r,l.symbols),c=l.typeNode)}return e.getSynthesizedDeepClone(c)}function s(t,r,n,i,a){for(var o=[],s=0;s=i?e.factory.createToken(57):void 0,a?void 0:n&&n[s]||e.factory.createKeywordTypeNode(155),void 0);o.push(c)}return o}function c(t){return l(e.Diagnostics.Method_not_implemented.message,t)}function l(t,r){return e.factory.createBlock([e.factory.createThrowStatement(e.factory.createNewExpression(e.factory.createIdentifier("Error"),void 0,[e.factory.createStringLiteral(t,0===r)]))],!0)}function u(t,r,n){var i=e.getTsConfigObjectLiteralExpression(r);if(i){var a=_(i,"compilerOptions");if(void 0!==a){var o=a.initializer;if(e.isObjectLiteralExpression(o))for(var s=0,c=n;s0)return[t.createCodeFixAction(r,a,e.Diagnostics.Convert_to_a_bigint_numeric_literal,r,e.Diagnostics.Convert_all_to_bigint_numeric_literals)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="fixAddModuleReferTypeMissingTypeof",n=[e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(100===n.kind,"This token should be an ImportKeyword"),e.Debug.assert(200===n.parent.kind,"Token parent should be an ImportType"),n.parent}function a(t,r,n){var i=e.factory.updateImportTypeNode(n,n.argument,n.qualifier,n.typeArguments,!0);t.replaceNode(r,n,i)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return[t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_typeof,r,e.Diagnostics.Add_missing_typeof)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="wrapJsxInFragment",n=[e.Diagnostics.JSX_expressions_must_have_one_parent_element.code];function i(t,r){var n=e.getTokenAtPosition(t,r).parent.parent;if((e.isBinaryExpression(n)||(n=n.parent,e.isBinaryExpression(n)))&&e.nodeIsMissing(n.operatorToken))return n}function a(t,r,n){var i=function(t){var r=[],n=t;for(;;){if(e.isBinaryExpression(n)&&e.nodeIsMissing(n.operatorToken)&&27===n.operatorToken.kind){if(r.push(n.left),e.isJsxChild(n.right))return r.push(n.right),r;if(e.isBinaryExpression(n.right)){n=n.right;continue}return}return}}(n);i&&t.replaceNode(r,n,e.factory.createJsxFragment(e.factory.createJsxOpeningFragment(),i,e.factory.createJsxJsxClosingFragment()))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return[t.createCodeFixAction(r,l,e.Diagnostics.Wrap_in_JSX_fragment,r,e.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(e.sourceFile,r.start);n&&a(t,e.sourceFile,n)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var n="fixConvertToMappedObjectType",i=[e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function a(t,r){var n=e.getTokenAtPosition(t,r),i=e.tryCast(n.parent.parent,e.isIndexSignatureDeclaration);if(i){var a=e.isInterfaceDeclaration(i.parent)?i.parent:e.tryCast(i.parent.parent,e.isTypeAliasDeclaration);if(a)return{indexSignature:i,container:a}}}function o(t,n,i){var a,o,s=i.indexSignature,c=i.container,l=(e.isInterfaceDeclaration(c)?c.members:c.type.members).filter((function(t){return!e.isIndexSignatureDeclaration(t)})),u=e.first(s.parameters),d=e.factory.createTypeParameterDeclaration(void 0,e.cast(u.name,e.isIdentifier),u.type),_=e.factory.createMappedTypeNode(e.hasEffectiveReadonlyModifier(s)?e.factory.createModifier(145):void 0,d,void 0,s.questionToken,s.type,void 0),p=e.factory.createIntersectionTypeNode(r(r(r([],e.getAllSuperTypeNodes(c),!0),[_],!1),l.length?[e.factory.createTypeLiteralNode(l)]:e.emptyArray,!0));t.replaceNode(n,c,(a=c,o=p,e.factory.createTypeAliasDeclaration(a.decorators,a.modifiers,a.name,a.typeParameters,o)))}t.registerCodeFix({errorCodes:i,getCodeActions:function(r){var i=r.sourceFile,s=r.span,c=a(i,s.start);if(c){var l=e.textChanges.ChangeTracker.with(r,(function(e){return o(e,i,c)})),u=e.idText(c.container.name);return[t.createCodeFixAction(n,l,[e.Diagnostics.Convert_0_to_mapped_object_type,u],n,[e.Diagnostics.Convert_0_to_mapped_object_type,u])]}},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(e,t){var r=a(t.file,t.start);r&&o(e,t.file,r)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="removeAccidentalCallParentheses",n=[e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=e.findAncestor(e.getTokenAtPosition(n.sourceFile,n.span.start),e.isCallExpression);if(i){var a=e.textChanges.ChangeTracker.with(n,(function(e){e.deleteRange(n.sourceFile,{pos:i.expression.end,end:i.end})}));return[t.createCodeFixActionWithoutFixAll(r,a,e.Diagnostics.Remove_parentheses)]}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="removeUnnecessaryAwait",n=[e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),(function(e){return 132===e.kind})),a=i&&e.tryCast(i.parent,e.isAwaitExpression);if(a){var o=a;if(e.isParenthesizedExpression(a.parent)){var s=e.getLeftmostExpression(a.expression,!1);if(e.isIdentifier(s)){var c=e.findPrecedingToken(a.parent.pos,r);c&&103!==c.kind&&(o=a.parent)}}t.replaceNode(r,o,a.expression)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return[t.createCodeFixAction(r,a,e.Diagnostics.Remove_unnecessary_await,r,e.Diagnostics.Remove_all_unnecessary_uses_of_await)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r=[e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],n="splitTypeOnlyImport";function i(t,r){return e.findAncestor(e.getTokenAtPosition(t,r.start),e.isImportDeclaration)}function a(t,r,n){if(r){var i=e.Debug.checkDefined(r.importClause);t.replaceNode(n.sourceFile,r,e.factory.updateImportDeclaration(r,r.decorators,r.modifiers,e.factory.updateImportClause(i,i.isTypeOnly,i.name,void 0),r.moduleSpecifier,r.assertClause)),t.insertNodeAfter(n.sourceFile,r,e.factory.createImportDeclaration(void 0,void 0,e.factory.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),r.moduleSpecifier,r.assertClause))}}t.registerCodeFix({errorCodes:r,fixIds:[n],getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.sourceFile,r.span),r)}));if(o.length)return[t.createCodeFixAction(n,o,e.Diagnostics.Split_into_two_separate_import_declarations,n,e.Diagnostics.Split_all_invalid_type_only_imports)]},getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(e.sourceFile,r),e)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixConvertConstToLet",n=[e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=n.program,s=function(t,r,n){var i,a=n.getTypeChecker().getSymbolAtLocation(e.getTokenAtPosition(t,r)),o=e.tryCast(null===(i=null==a?void 0:a.valueDeclaration)||void 0===i?void 0:i.parent,e.isVariableDeclarationList);if(void 0!==o){var s=e.findChildOfKind(o,85,t);if(void 0!==s)return e.createRange(s.pos,s.end)}}(i,a.start,o);if(void 0!==s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return function(e,t,r){e.replaceRangeWithText(t,r,"let")}(e,i,s)}));return[t.createCodeFixAction(r,c,e.Diagnostics.Convert_const_to_let,r,e.Diagnostics.Convert_const_to_let)]}},fixIds:[r]})}(c||(c={})),function(e){!function(t){var r="fixExpectedComma",n=[e.Diagnostics._0_expected.code];function i(t,r,n){var i=e.getTokenAtPosition(t,r);return 26===i.kind&&i.parent&&(e.isObjectLiteralExpression(i.parent)||e.isArrayLiteralExpression(i.parent))?{node:i}:void 0}function a(t,r,n){var i=n.node,a=e.factory.createToken(27);t.replaceNode(r,i,a)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start,n.errorCode);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,s)}));return[t.createCodeFixAction(r,c,[e.Diagnostics.Change_0_to_1,";",","],r,[e.Diagnostics.Change_0_to_1,";",","])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start,r.code);n&&a(t,e.sourceFile,n)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="addVoidToPromise",n=[e.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n.start);if(e.isIdentifier(o)&&e.isCallExpression(o.parent)&&o.parent.expression===o&&0===o.parent.arguments.length){var s=i.getTypeChecker(),c=s.getSymbolAtLocation(o),l=null==c?void 0:c.valueDeclaration;if(l&&e.isParameter(l)&&e.isNewExpression(l.parent.parent)&&!(null==a?void 0:a.has(l))){null==a||a.add(l);var u=function(t){var r;if(!e.isInJSFile(t))return t.typeArguments;if(e.isParenthesizedExpression(t.parent)){var n=null===(r=e.getJSDocTypeTag(t.parent))||void 0===r?void 0:r.typeExpression.type;if(n&&e.isTypeReferenceNode(n)&&e.isIdentifier(n.typeName)&&"Promise"===e.idText(n.typeName))return n.typeArguments}}(l.parent.parent);if(e.some(u)){var d=u[0],_=!e.isUnionTypeNode(d)&&!e.isParenthesizedTypeNode(d)&&e.isParenthesizedTypeNode(e.factory.createUnionTypeNode([d,e.factory.createKeywordTypeNode(114)]).types[0]);_&&t.insertText(r,d.pos,"("),t.insertText(r,d.end,_?") | void":" | void")}else{var p=s.getResolvedSignature(o.parent),f=null==p?void 0:p.parameters[0],m=f&&s.getTypeOfSymbolAtLocation(f,l.parent.parent);e.isInJSFile(l)?(!m||3&m.flags)&&(t.insertText(r,l.parent.parent.end,")"),t.insertText(r,e.skipTrivia(r.text,l.parent.parent.pos),"/** @type {Promise} */(")):(!m||2&m.flags)&&t.insertText(r,l.parent.parent.expression.end,"")}}}}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span,n.program)}));if(a.length>0)return[t.createCodeFixAction("addVoidToPromise",a,e.Diagnostics.Add_void_to_Promise_resolved_without_a_value,r,e.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){return i(t,n.file,n,r.program,new e.Set)}))}})}(e.codefix||(e.codefix={}))}(c||(c={})),function(e){!function(t){var r="Convert export",i={name:"Convert default export to named export",description:e.Diagnostics.Convert_default_export_to_named_export.message,kind:"refactor.rewrite.export.named"},a={name:"Convert named export to default export",description:e.Diagnostics.Convert_named_export_to_default_export.message,kind:"refactor.rewrite.export.default"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=e.getTokenAtPosition(n,a.start),s=o.parent&&1&e.getSyntacticModifierFlags(o.parent)&&r?o.parent:e.getParentNodeInSpan(o,n,a);if(!(s&&(e.isSourceFile(s.parent)||e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent))))return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_export_statement)};var c=e.isSourceFile(s.parent)?s.parent.symbol:s.parent.parent.symbol,l=e.getSyntacticModifierFlags(s)||(e.isExportAssignment(s)&&!s.isExportEquals?513:0),u=!!(512&l);if(!(1&l)||!u&&c.exports.has("default"))return{error:e.getLocaleSpecificMessage(e.Diagnostics.This_file_already_has_a_default_export)};var d=i.getTypeChecker(),_=function(t){return e.isIdentifier(t)&&d.getSymbolAtLocation(t)?void 0:{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_named_export)}};switch(s.kind){case 256:case 257:case 258:case 260:case 259:case 261:if(!(m=s).name)return;return _(m.name)||{exportNode:m,exportName:m.name,wasDefault:u,exportingModuleSymbol:c};case 237:var p=s;if(!(2&p.declarationList.flags)||1!==p.declarationList.declarations.length)return;var f=e.first(p.declarationList.declarations);if(!f.initializer)return;return e.Debug.assert(!u,"Can't have a default flag here"),_(f.name)||{exportNode:p,exportName:f.name,wasDefault:u,exportingModuleSymbol:c};case 271:var m;if((m=s).isExportEquals)return;return _(m.expression)||{exportNode:m,exportName:m.expression,wasDefault:u,exportingModuleSymbol:c};default:return}}function s(t,r){return e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}function c(t,r){return e.factory.createExportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}t.registerRefactor(r,{kinds:[i.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=c.wasDefault?i:a;return[{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.Diagnostics.Convert_default_export_to_named_export.message,actions:[n(n({},i),{notApplicableReason:c.error}),n(n({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,n){e.Debug.assert(n===i.name||n===a.name,"Unexpected action name");var l=o(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u=e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){(function(t,r,n,i){var a=r.wasDefault,o=r.exportNode,s=r.exportName;if(a)if(e.isExportAssignment(o)&&!o.isExportEquals){var l=o.expression,u=c(l.text,l.text);n.replaceNode(t,o,e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([u])))}else n.delete(t,e.Debug.checkDefined(e.findModifier(o,88),"Should find a default keyword in modifier list"));else{var d=e.Debug.checkDefined(e.findModifier(o,93),"Should find an export keyword in modifier list");switch(o.kind){case 256:case 257:case 258:n.insertNodeAfter(t,d,e.factory.createToken(88));break;case 237:var _=e.first(o.declarationList.declarations);if(!e.FindAllReferences.Core.isSymbolReferencedInFile(s,i,t)&&!_.type){n.replaceNode(t,o,e.factory.createExportDefault(e.Debug.checkDefined(_.initializer,"Initializer was previously known to be present")));break}case 260:case 259:case 261:n.deleteModifier(t,d),n.insertNodeAfter(t,o,e.factory.createExportDefault(e.factory.createIdentifier(s.text)));break;default:e.Debug.fail("Unexpected exportNode kind ".concat(o.kind))}}})(t,n,i,r.getTypeChecker()),function(t,r,n,i){var a=r.wasDefault,o=r.exportName,l=r.exportingModuleSymbol,u=t.getTypeChecker(),d=e.Debug.checkDefined(u.getSymbolAtLocation(o),"Export name should resolve to a symbol");e.FindAllReferences.Core.eachExportReference(t.getSourceFiles(),u,i,d,l,o.text,a,(function(t){var r=t.getSourceFile();a?function(t,r,n,i){var a=r.parent;switch(a.kind){case 206:n.replaceNode(t,r,e.factory.createIdentifier(i));break;case 270:case 275:var o=a;n.replaceNode(t,o,s(i,o.name.text));break;case 267:var c=a;e.Debug.assert(c.name===r,"Import clause name should match provided ref");o=s(i,r.text);var l=c.namedBindings;if(l)if(268===l.kind){n.deleteRange(t,{pos:r.getStart(t),end:l.getStart(t)});var u=e.isStringLiteral(c.parent.moduleSpecifier)?e.quotePreferenceFromString(c.parent.moduleSpecifier,t):1,d=e.makeImport(void 0,[s(i,r.text)],c.parent.moduleSpecifier,u);n.insertNodeAfter(t,c.parent,d)}else n.delete(t,r),n.insertNodeAtEndOfList(t,l.elements,o);else n.replaceNode(t,r,e.factory.createNamedImports([o]));break;case 200:var _=a;n.replaceNode(t,a,e.factory.createImportTypeNode(_.argument,e.factory.createIdentifier(i),_.typeArguments,_.isTypeOf));break;default:e.Debug.failBadSyntaxKind(a)}}(r,t,n,o.text):function(t,r,n){var i=r.parent;switch(i.kind){case 206:n.replaceNode(t,r,e.factory.createIdentifier("default"));break;case 270:var a=e.factory.createIdentifier(i.name.text);1===i.parent.elements.length?n.replaceNode(t,i.parent,a):(n.delete(t,i),n.insertNodeBefore(t,i.parent,a));break;case 275:n.replaceNode(t,i,c("default",i.name.text));break;default:e.Debug.assertNever(i,"Unexpected parent kind ".concat(i.kind))}}(r,t,n)}))}(r,n,i,a)}(r.file,r.program,l,t,r.cancellationToken)}));return{edits:u,renameFilename:void 0,renameLocation:void 0}}})}(e.refactor||(e.refactor={}))}(c||(c={})),function(e){!function(t){var r,i="Convert import",a=((r={})[0]={name:"Convert namespace import to named imports",description:e.Diagnostics.Convert_namespace_import_to_named_imports.message,kind:"refactor.rewrite.import.named"},r[2]={name:"Convert named imports to namespace import",description:e.Diagnostics.Convert_named_imports_to_namespace_import.message,kind:"refactor.rewrite.import.namespace"},r[1]={name:"Convert named imports to default import",description:e.Diagnostics.Convert_named_imports_to_default_import.message,kind:"refactor.rewrite.import.default"},r);function o(t,r){void 0===r&&(r=!0);var n=t.file,i=e.getRefactorContextSpan(t),a=e.getTokenAtPosition(n,i.start),o=r?e.findAncestor(a,e.isImportDeclaration):e.getParentNodeInSpan(a,n,i);if(!o||!e.isImportDeclaration(o))return{error:"Selection is not an import declaration."};var c=i.start+i.length,l=e.findNextToken(o,o.parent,n);if(!(l&&c>l.getStart())){var u=o.importClause;return u?u.namedBindings?268===u.namedBindings.kind?{convertTo:0,import:u.namedBindings}:s(t.program,u)?{convertTo:1,import:u.namedBindings}:{convertTo:2,import:u.namedBindings}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_namespace_import_or_named_imports)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_import_clause)}}}function s(t,r){return e.getAllowSyntheticDefaultImports(t.getCompilerOptions())&&function(e,t){var r=t.resolveExternalModuleName(e);if(!r)return!1;var n=t.resolveExternalModuleSymbol(r);return r!==n}(r.parent.moduleSpecifier,t.getTypeChecker())}function c(t){return e.isPropertyAccessExpression(t)?t.name:t.right}function l(t,r,n,i,a){void 0===a&&(a=s(r,i.parent));var o=r.getTypeChecker(),c=i.parent.parent,l=c.moduleSpecifier,d=new e.Set;i.elements.forEach((function(e){var t=o.getSymbolAtLocation(e.name);t&&d.add(t)}));var _=l&&e.isStringLiteral(l)?e.codefix.moduleSpecifierToValidIdentifier(l.text,99):"module";for(var p=i.elements.some((function(r){return!!e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(t){var r=o.resolveName(_,t,67108863,!0);return!!r&&(!d.has(r)||e.isExportSpecifier(t.parent))}))}))?e.getUniqueName(_,t):_,f=new e.Set,m=function(r){var i=(r.propertyName||r.name).text;e.FindAllReferences.Core.eachSymbolReferenceInFile(r.name,o,t,(function(a){var o=e.factory.createPropertyAccessExpression(e.factory.createIdentifier(p),i);e.isShorthandPropertyAssignment(a.parent)?n.replaceNode(t,a.parent,e.factory.createPropertyAssignment(a.text,o)):e.isExportSpecifier(a.parent)?f.add(r):n.replaceNode(t,a,o)}))},g=0,y=i.elements;g=l.pos?_.getEnd():l.getEnd()),m=o?function(e){for(;e.parent;){if(c(e)&&!c(e.parent))return e;e=e.parent}}(l):function(e,t){for(;e.parent;){if(c(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent}}(l,f),g=m&&c(m)?function(t){if(s(t))return t;if(e.isVariableStatement(t)){var r=e.getSingleVariableOfVariableStatement(t),n=null==r?void 0:r.initializer;return n&&s(n)?n:void 0}return t.expression&&s(t.expression)?t.expression:void 0}(m):void 0;if(!g)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var y=i.getTypeChecker();return e.isConditionalExpression(g)?function(t,r){var n=t.condition,i=p(t.whenTrue);if(!i||r.isNullableType(r.getTypeAtLocation(i)))return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};if((e.isPropertyAccessExpression(n)||e.isIdentifier(n))&&d(n,i.expression))return{finalExpression:i,occurrences:[n],expression:t};if(e.isBinaryExpression(n)){var a=u(i.expression,n);return a?{finalExpression:i,occurrences:a,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}}(g,y):function(t){if(55!==t.operatorToken.kind)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_logical_AND_access_chains)};var r=p(t.right);if(!r)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var n=u(r.expression,t.left);return n?{finalExpression:r,occurrences:n,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}(g)}}function u(t,r){for(var n=[];e.isBinaryExpression(r)&&55===r.operatorToken.kind;){var i=d(e.skipParentheses(t),e.skipParentheses(r.right));if(!i)break;n.push(i),t=i,r=r.left}var a=d(t,r);return a&&n.push(a),n.length>0?n:void 0}function d(t,r){if(e.isIdentifier(r)||e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r))return function(t,r){for(;(e.isCallExpression(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&_(t)!==_(r);)t=t.expression;for(;e.isPropertyAccessExpression(t)&&e.isPropertyAccessExpression(r)||e.isElementAccessExpression(t)&&e.isElementAccessExpression(r);){if(_(t)!==_(r))return!1;t=t.expression,r=r.expression}return e.isIdentifier(t)&&e.isIdentifier(r)&&t.getText()===r.getText()}(t,r)?r:void 0}function _(t){return e.isIdentifier(t)||e.isStringOrNumericLiteralLike(t)?t.getText():e.isPropertyAccessExpression(t)?_(t.name):e.isElementAccessExpression(t)?_(t.argumentExpression):void 0}function p(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)?p(t.left):(e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)||e.isCallExpression(t))&&!e.isOptionalChain(t)?t:void 0}function f(t,r,n){if(e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r)||e.isCallExpression(r)){var i=f(t,r.expression,n),a=n.length>0?n[n.length-1]:void 0,o=(null==a?void 0:a.getText())===r.expression.getText();if(o&&n.pop(),e.isCallExpression(r))return o?e.factory.createCallChain(i,e.factory.createToken(28),r.typeArguments,r.arguments):e.factory.createCallChain(i,r.questionDotToken,r.typeArguments,r.arguments);if(e.isPropertyAccessExpression(r))return o?e.factory.createPropertyAccessChain(i,e.factory.createToken(28),r.name):e.factory.createPropertyAccessChain(i,r.questionDotToken,r.name);if(e.isElementAccessExpression(r))return o?e.factory.createElementAccessChain(i,e.factory.createToken(28),r.argumentExpression):e.factory.createElementAccessChain(i,r.questionDotToken,r.argumentExpression)}return r}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(r,n){var i=l(r);return e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){var o=i.finalExpression,s=i.occurrences,c=i.expression,l=s[s.length-1],u=f(r,o,s);u&&(e.isPropertyAccessExpression(u)||e.isElementAccessExpression(u)||e.isCallExpression(u))&&(e.isBinaryExpression(c)?n.replaceNodeRange(t,l,o,u):e.isConditionalExpression(c)&&n.replaceNode(t,c,e.factory.createBinaryExpression(u,e.factory.createToken(60),c.whenFalse)))}(r.file,r.program.getTypeChecker(),t,i)})),renameFilename:void 0,renameLocation:void 0}},getAvailableActions:function(r){var s=l(r,"invoked"===r.triggerReason);return s?t.isRefactorErrorInfo(s)?r.preferences.provideRefactorNotApplicableReason?[{name:i,description:a,actions:[n(n({},o),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:i,description:a,actions:[o]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).convertToOptionalChainExpression||(t.convertToOptionalChainExpression={}))}(c||(c={})),function(e){var t;(function(r){var n="Convert overload list to single signature",i=e.Diagnostics.Convert_overload_list_to_single_signature.message,a={name:n,description:i,kind:"refactor.rewrite.function.overloadList"};function o(e){switch(e.kind){case 168:case 169:case 174:case 171:case 175:case 256:return!0}return!1}function s(t,r,n){var i=e.getTokenAtPosition(t,r),a=e.findAncestor(i,o);if(a){var s=n.getTypeChecker(),c=a.symbol;if(c){var l=c.declarations;if(!(e.length(l)<=1)&&e.every(l,(function(r){return e.getSourceFileOfNode(r)===t}))&&o(l[0])){var u=l[0].kind;if(e.every(l,(function(e){return e.kind===u}))){var d=l;if(!e.some(d,(function(t){return!!t.typeParameters||e.some(t.parameters,(function(t){return!!t.decorators||!!t.modifiers||!e.isIdentifier(t.name)}))}))){var _=e.mapDefined(d,(function(e){return s.getSignatureFromDeclaration(e)}));if(e.length(_)===e.length(l)){var p=s.getReturnTypeOfSignature(_[0]);if(e.every(_,(function(e){return s.getReturnTypeOfSignature(e)===p})))return d}}}}}}}t.registerRefactor(n,{kinds:[a.kind],getEditsForAction:function(t){var r=t.file,n=t.startPosition,i=t.program,a=s(r,n,i);if(a){var o=i.getTypeChecker(),c=a[a.length-1],l=c;switch(c.kind){case 168:l=e.factory.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,d(a),c.type);break;case 169:l=e.factory.updateMethodDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,d(a),c.type,c.body);break;case 174:l=e.factory.updateCallSignature(c,c.typeParameters,d(a),c.type);break;case 171:l=e.factory.updateConstructorDeclaration(c,c.decorators,c.modifiers,d(a),c.body);break;case 175:l=e.factory.updateConstructSignature(c,c.typeParameters,d(a),c.type);break;case 256:l=e.factory.updateFunctionDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.typeParameters,d(a),c.type,c.body);break;default:return e.Debug.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(l!==c){var u=e.textChanges.ChangeTracker.with(t,(function(e){e.replaceNodeRange(r,a[0],a[a.length-1],l)}));return{renameFilename:void 0,renameLocation:void 0,edits:u}}}function d(t){var r=t[t.length-1];return e.isFunctionLikeDeclaration(r)&&r.body&&(t=t.slice(0,t.length-1)),e.factory.createNodeArray([e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),"args",void 0,e.factory.createUnionTypeNode(e.map(t,_)))])}function _(t){var r=e.map(t.parameters,p);return e.setEmitFlags(e.factory.createTupleTypeNode(r),e.some(r,(function(t){return!!e.length(e.getSyntheticLeadingComments(t))}))?0:1)}function p(t){e.Debug.assert(e.isIdentifier(t.name));var r=e.setTextRange(e.factory.createNamedTupleMember(t.dotDotDotToken,t.name,t.questionToken,t.type||e.factory.createKeywordTypeNode(130)),t),n=t.symbol&&t.symbol.getDocumentationComment(o);if(n){var i=e.displayPartsToString(n);i.length&&e.setSyntheticLeadingComments(r,[{text:"*\n".concat(i.split("\n").map((function(e){return" * ".concat(e)})).join("\n"),"\n "),kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}])}return r}},getAvailableActions:function(t){var r=t.file,o=t.startPosition,c=t.program;return s(r,o,c)?[{name:n,description:i,actions:[a]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}))}(c||(c={})),function(e){var t;(function(r){var i,a,o,s,c="Extract Symbol",l={name:"Extract Constant",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),kind:"refactor.extract.constant"},u={name:"Extract Function",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),kind:"refactor.extract.function"};function d(r){var i=r.kind,a=p(r.file,e.getRefactorContextSpan(r),"invoked"===r.triggerReason),o=a.targetRange;if(void 0===o){if(!a.errors||0===a.errors.length||!r.preferences.provideRefactorNotApplicableReason)return e.emptyArray;var s=[];return t.refactorKindBeginsWith(u.kind,i)&&s.push({name:c,description:u.description,actions:[n(n({},u),{notApplicableReason:N(a.errors)})]}),t.refactorKindBeginsWith(l.kind,i)&&s.push({name:c,description:l.description,actions:[n(n({},l),{notApplicableReason:N(a.errors)})]}),s}var d=function(t,r){var n=g(t,r),i=n.scopes,a=n.readsAndWrites,o=a.functionErrorsPerScope,s=a.constantErrorsPerScope,c=i.map((function(t,r){var n,i,a=function(t){return e.isFunctionLikeDeclaration(t)?"inner function":e.isClassLike(t)?"method":"function"}(t),c=function(t){return e.isClassLike(t)?"readonly field":"constant"}(t),l=e.isFunctionLikeDeclaration(t)?function(t){switch(t.kind){case 171:return"constructor";case 213:case 256:return t.name?"function '".concat(t.name.text,"'"):e.ANONYMOUS;case 214:return"arrow function";case 169:return"method '".concat(t.name.getText(),"'");case 172:return"'get ".concat(t.name.getText(),"'");case 173:return"'set ".concat(t.name.getText(),"'");default:throw e.Debug.assertNever(t,"Unexpected scope kind ".concat(t.kind))}}(t):e.isClassLike(t)?function(e){return 257===e.kind?e.name?"class '".concat(e.name.text,"'"):"anonymous class declaration":e.name?"class expression '".concat(e.name.text,"'"):"anonymous class expression"}(t):function(e){return 262===e.kind?"namespace '".concat(e.parent.name.getText(),"'"):e.externalModuleIndicator?0:1}(t);return 1===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"global"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"global"])):0===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"module"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"module"])):(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[a,l]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[c,l])),0!==r||e.isClassLike(t)||(i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_enclosing_scope),[c])),{functionExtraction:{description:n,errors:o[r]},constantExtraction:{description:i,errors:s[r]}}}));return c}(o,r);if(void 0===d)return e.emptyArray;for(var _,f,m=[],y=new e.Map,h=[],v=new e.Map,b=0,x=0,S=d;x0;if(e.isBlock(t)&&!s&&0===i.size)return{body:e.factory.createBlock(t.statements,!0),returnValueProperty:void 0};var c=!1,l=e.factory.createNodeArray(e.isBlock(t)?t.statements.slice(0):[e.isStatement(t)?t:e.factory.createReturnStatement(e.skipParentheses(t))]);if(s||i.size){var u=e.visitNodes(l,_).slice();if(s&&!a&&e.isStatement(t)){var d=v(r,n);1===d.length?u.push(e.factory.createReturnStatement(d[0].name)):u.push(e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(d)))}return{body:e.factory.createBlock(u,!0),returnValueProperty:o}}return{body:e.factory.createBlock(l,!0),returnValueProperty:void 0};function _(t){if(!c&&e.isReturnStatement(t)&&s){var a=v(r,n);return t.expression&&(o||(o="__return"),a.unshift(e.factory.createPropertyAssignment(o,e.visitNode(t.expression,_)))),1===a.length?e.factory.createReturnStatement(a[0].name):e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(a))}var l=c;c=c||e.isFunctionLikeDeclaration(t)||e.isClassLike(t);var u=i.get(e.getNodeId(t).toString()),d=u?e.getSynthesizedDeepClone(u):e.visitEachChild(t,_,e.nullTransformationContext);return c=l,d}}(t,i,l,_,!!(o.facts&a.HasReturn)),I=P.body,O=P.returnValueProperty;e.suppressLeadingAndTrailingTrivia(I);var M=!!(o.facts&a.UsesThisInFunction);if(e.isClassLike(r)){var L=S?[]:[e.factory.createModifier(121)];o.facts&a.InStaticRegion&&L.push(e.factory.createModifier(124)),o.facts&a.IsAsyncFunction&&L.push(e.factory.createModifier(131)),F=e.factory.createMethodDeclaration(void 0,L.length?L:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,C,void 0,A,T,c,I)}else M&&T.unshift(e.factory.createParameterDeclaration(void 0,void 0,void 0,"this",void 0,p.typeToTypeNode(p.getTypeAtLocation(o.thisNode),r,1),void 0)),F=e.factory.createFunctionDeclaration(void 0,o.facts&a.IsAsyncFunction?[e.factory.createToken(131)]:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,C,A,T,c,I);var R=e.textChanges.ChangeTracker.fromContext(s),B=function(t,r){return e.find(function(t){if(e.isFunctionLikeDeclaration(t)){var r=t.body;if(e.isBlock(r))return r.statements}else{if(e.isModuleBlock(t)||e.isSourceFile(t))return t.statements;if(e.isClassLike(t))return t.members;e.assertType(t)}return e.emptyArray}(r),(function(r){return r.pos>=t&&e.isFunctionLikeDeclaration(r)&&!e.isConstructorDeclaration(r)}))}((b(o.range)?e.last(o.range):o.range).end,r);B?R.insertNodeBefore(s.file,B,F,!0):R.insertNodeAtEndOfScope(s.file,r,F),m.writeFixes(R);var J=[],j=function(t,r,n){var i=e.factory.createIdentifier(n);if(e.isClassLike(t)){var o=r.facts&a.InStaticRegion?e.factory.createIdentifier(t.name.text):e.factory.createThis();return e.factory.createPropertyAccessExpression(o,i)}return i}(r,o,x);M&&E.unshift(e.factory.createIdentifier("this"));var U=e.factory.createCallExpression(M?e.factory.createPropertyAccessExpression(j,"call"):j,N,E);if(o.facts&a.IsGenerator&&(U=e.factory.createYieldExpression(e.factory.createToken(41),U)),o.facts&a.IsAsyncFunction&&(U=e.factory.createAwaitExpression(U)),D(t)&&(U=e.factory.createJsxExpression(void 0,U)),i.length&&!l)if(e.Debug.assert(!O,"Expected no returnValueProperty"),e.Debug.assert(!(o.facts&a.HasReturn),"Expected RangeFacts.HasReturn flag to be unset"),1===i.length){var V=i[0];J.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(V.name),void 0,e.getSynthesizedDeepClone(V.type),U)],V.parent.flags)))}else{for(var K=[],z=[],G=i[0].parent.flags,q=!1,W=0,H=i;W0,"Found no members");for(var a=!0,o=0,s=i;ot)return n||i[0];if(a&&!e.isPropertyDeclaration(c)){if(void 0!==n)return c;a=!1}n=c}return void 0===n?e.Debug.fail():n}(t.pos,r);g.insertNodeBefore(o.file,b,h,!0),g.replaceNode(o.file,t,v)}else{var x=e.factory.createVariableDeclaration(d,void 0,p,f),C=function(t,r){for(var n;void 0!==t&&t!==r;){if(e.isVariableDeclaration(t)&&t.initializer===n&&e.isVariableDeclarationList(t.parent)&&t.parent.declarations.length>1)return t;n=t,t=t.parent}}(t,r);if(C)g.insertNodeBefore(o.file,C,x),v=e.factory.createIdentifier(d),g.replaceNode(o.file,t,v);else if(238===t.parent.kind&&r===e.findAncestor(t,m)){var T=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2));g.replaceNode(o.file,t.parent,T)}else T=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2)),b=function(t,r){var n;e.Debug.assert(!e.isClassLike(r));for(var i=t;i!==r;i=i.parent)m(i)&&(n=i);for(i=(n||t).parent;;i=i.parent){if(S(i)){for(var a=void 0,o=0,s=i.statements;ot.pos)break;a=c}return!a&&e.isCaseClause(i)?(e.Debug.assert(e.isSwitchStatement(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):e.Debug.checkDefined(a,"prevStatement failed to get set")}e.Debug.assert(i!==r,"Didn't encounter a block-like before encountering scope")}}(t,r),0===b.pos?g.insertNodeAtTopOfFile(o.file,T,!1):g.insertNodeBefore(o.file,b,T,!1),238===t.parent.kind?g.delete(o.file,t.parent):(v=e.factory.createIdentifier(d),D(t)&&(v=e.factory.createJsxExpression(void 0,v)),g.replaceNode(o.file,t,v))}var E=g.getChanges(),k=t.getSourceFile().fileName,A=e.getRenameLocation(E,k,d,!0);return{renameFilename:k,renameLocation:A,edits:E};function N(n,i){if(void 0===n)return{variableType:n,initializer:i};if(!e.isFunctionExpression(i)&&!e.isArrowFunction(i)||i.typeParameters)return{variableType:n,initializer:i};var a=l.getTypeAtLocation(t),o=e.singleOrUndefined(l.getSignaturesOfType(a,0));if(!o)return{variableType:n,initializer:i};if(o.getTypeParameters())return{variableType:n,initializer:i};for(var s=[],c=!1,u=0,d=i.parameters;u=r.start+r.length)return(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractSuper)),!0}else g|=a.UsesThis,s=n;break;case 214:e.forEachChild(n,(function t(r){if(e.isThis(r))g|=a.UsesThis,s=n;else{if(e.isClassLike(r)||e.isFunctionLike(r)&&!e.isArrowFunction(r))return!1;e.forEachChild(r,t)}}));case 257:case 256:e.isSourceFile(n.parent)&&void 0===n.parent.externalModuleIndicator&&(o||(o=[])).push(e.createDiagnosticForNode(n,i.functionWillNotBeVisibleInTheNewScope));case 226:case 213:case 169:case 171:case 172:case 173:return!1}var _=u;switch(n.kind){case 239:case 252:u=0;break;case 235:n.parent&&252===n.parent.kind&&n.parent.finallyBlock===n&&(u=4);break;case 290:case 289:u|=1;break;default:e.isIterationStatement(n,!1)&&(u|=3)}switch(n.kind){case 192:case 108:g|=a.UsesThis,s=n;break;case 250:var p=n.label;(l||(l=[])).push(p.escapedText),e.forEachChild(n,t),l.pop();break;case 246:case 245:(p=n.label)?e.contains(l,p.escapedText)||(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):u&(246===n.kind?1:2)||(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break;case 218:g|=a.IsAsyncFunction;break;case 224:g|=a.IsGenerator;break;case 247:4&u?g|=a.HasReturn:(o||(o=[])).push(e.createDiagnosticForNode(n,i.cannotExtractRangeContainingConditionalReturnStatement));break;default:e.forEachChild(n,t)}u=_}(t),g&a.UsesThis){var d=e.getThisContainer(t,!1);(256===d.kind||169===d.kind&&205===d.parent.kind||213===d.kind)&&(g|=a.UsesThisInFunction)}return o}}function f(t){return e.isStatement(t)?[t]:e.isExpressionNode(t)?e.isExpressionStatement(t.parent)?[t.parent]:t:C(t)?t:void 0}function m(t){return e.isArrowFunction(t)?e.isFunctionBody(t.body):e.isFunctionLikeDeclaration(t)||e.isSourceFile(t)||e.isModuleBlock(t)||e.isClassLike(t)}function g(t,r){var n=r.file,o=function(t){var r=b(t.range)?e.first(t.range):t.range;if(t.facts&a.UsesThis&&!(t.facts&a.UsesThisInFunction)){var n=e.getContainingClass(r);if(n){var i=e.findAncestor(r,e.isFunctionLikeDeclaration);return i?[i,n]:[n]}}for(var o=[];;)if(164===(r=r.parent).kind&&(r=e.findAncestor(r,(function(t){return e.isFunctionLikeDeclaration(t)})).parent),m(r)&&(o.push(r),305===r.kind))return o}(t),s=function(t,r){return b(t.range)?{pos:e.first(t.range).getStart(r),end:e.last(t.range).getEnd()}:t.range}(t,n),c=function(t,r,n,o,s,c){var l,u,d=new e.Map,_=[],p=[],f=[],m=[],g=[],y=new e.Map,h=[],v=b(t.range)?1===t.range.length&&e.isExpressionStatement(t.range[0])?t.range[0].expression:void 0:t.range;if(void 0===v){var x=t.range,S=e.first(x).getStart(),D=e.last(x).end;u=e.createFileDiagnostic(o,S,D-S,i.expressionExpected)}else 147456&s.getTypeAtLocation(v).flags&&(u=e.createDiagnosticForNode(v,i.uselessConstantType));for(var C=0,T=r;C0){for(var P=new e.Map,I=0,O=w;void 0!==O&&I0&&(o.usages.size>0||o.typeParameterUsages.size>0)){var s=b(t.range)?t.range[0]:t.range;m[n].push(e.createDiagnosticForNode(s,i.cannotAccessVariablesFromNestedScopes))}t.facts&a.UsesThisInFunction&&e.isClassLike(r[n])&&f[n].push(e.createDiagnosticForNode(t.thisNode,i.cannotExtractFunctionsContainingThisToMethod));var c,u=!1;if(_[n].usages.forEach((function(t){2===t.usage&&(u=!0,106500&t.symbol.flags&&t.symbol.valueDeclaration&&e.hasEffectiveModifier(t.symbol.valueDeclaration,64)&&(c=t.symbol.valueDeclaration))})),e.Debug.assert(b(t.range)||0===h.length,"No variable declarations expected if something was extracted"),u&&!b(t.range)){var d=e.createDiagnosticForNode(t.range,i.cannotWriteInExpression);f[n].push(d),m[n].push(d)}else c&&n>0?(d=e.createDiagnosticForNode(c,i.cannotExtractReadonlyPropertyInitializerOutsideConstructor),f[n].push(d),m[n].push(d)):l&&(d=e.createDiagnosticForNode(l,i.cannotExtractExportedEntity),f[n].push(d),m[n].push(d))},U=0;U=l)return g;if(A.set(g,l),y){for(var h=0,v=_;h=0)){var n=e.isIdentifier(r)?H(r):s.getSymbolAtLocation(r);if(n){var i=e.find(g,(function(e){return e.symbol===n}));if(i)if(e.isVariableDeclaration(i)){var a=i.symbol.id.toString();y.has(a)||(h.push(i),y.set(a,!0))}else l=l||i}e.forEachChild(r,W)}}function H(t){return t.parent&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?s.getShorthandAssignmentValueSymbol(t.parent):s.getSymbolAtLocation(t)}function Q(t,r,n){if(t){var i=t.getDeclarations();if(i&&i.some((function(e){return e.parent===r})))return e.factory.createIdentifier(t.name);var a=Q(t.parent,r,n);if(void 0!==a)return n?e.factory.createQualifiedName(a,e.factory.createIdentifier(t.name)):e.factory.createPropertyAccessExpression(a,t.name)}}}(t,o,s,n,r.program.getTypeChecker(),r.cancellationToken);return{scopes:o,readsAndWrites:c}}function y(e){var t,r=e.symbol;if(r&&r.declarations)for(var n=0,i=r.declarations;nn.pos}));if(-1!==a){var o=i[a];if(e.isNamedDeclaration(o)&&o.name&&e.rangeContainsRange(o.name,n))return{toMove:[i[a]],afterLast:i[a+1]};if(!(n.pos>o.getStart(r))){var s=e.findIndex(i,(function(e){return e.end>n.end}),a);if(-1===s||!(0===s||i[s].getStart(r)=1&&e.every(t,(function(t){return function(t,r){if(e.isRestParameter(t)){var n=r.getTypeAtLocation(t);if(!r.isArrayType(n)&&!r.isTupleType(n))return!1}return!t.modifiers&&!t.decorators&&e.isIdentifier(t.name)}(t,r)}))}(t.parameters,r))return!1;switch(t.kind){case 256:return g(t)&&m(t,r);case 169:if(e.isObjectLiteralExpression(t.parent)){var i=s(t.name,r);return 1===(null===(n=null==i?void 0:i.declarations)||void 0===n?void 0:n.length)&&m(t,r)}return m(t,r);case 171:return e.isClassDeclaration(t.parent)?g(t.parent)&&m(t,r):y(t.parent.parent)&&m(t,r);case 213:case 214:return y(t.parent)}return!1}(a,n)&&e.rangeContainsRange(a,i))||a.body&&e.rangeContainsRange(a.body,i)?void 0:a}function f(t){return e.isMethodSignature(t)&&(e.isInterfaceDeclaration(t.parent)||e.isTypeLiteralNode(t.parent))}function m(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function g(t){return!!t.name||!!e.findModifier(t,88)}function y(t){return e.isVariableDeclaration(t)&&e.isVarConst(t)&&e.isIdentifier(t.name)&&!t.type}function h(t){return t.length>0&&e.isThis(t[0].name)}function v(t){return h(t)&&(t=e.factory.createNodeArray(t.slice(1),t.hasTrailingComma)),t}function b(t,r){var n=v(t.parameters),i=e.isRestParameter(e.last(n)),a=i?r.slice(0,n.length-1):r,o=e.map(a,(function(t,r){var i=function(t,r){return e.isIdentifier(r)&&e.getTextOfIdentifierOrLiteral(r)===t?e.factory.createShorthandPropertyAssignment(t):e.factory.createPropertyAssignment(t,r)}(S(n[r]),t);return e.suppressLeadingAndTrailingTrivia(i.name),e.isPropertyAssignment(i)&&e.suppressLeadingAndTrailingTrivia(i.initializer),e.copyComments(t,i),i}));if(i&&r.length>=n.length){var s=r.slice(n.length-1),c=e.factory.createPropertyAssignment(S(e.last(n)),e.factory.createArrayLiteralExpression(s));o.push(c)}return e.factory.createObjectLiteralExpression(o,!1)}function x(t,r,n){var i,a,o,s=r.getTypeChecker(),c=v(t.parameters),l=e.map(c,(function(t){var r=e.factory.createBindingElement(void 0,void 0,S(t),e.isRestParameter(t)&&g(t)?e.factory.createArrayLiteralExpression():t.initializer);return e.suppressLeadingAndTrailingTrivia(r),t.initializer&&r.initializer&&e.copyComments(t.initializer,r.initializer),r})),u=e.factory.createObjectBindingPattern(l),d=(i=c,a=e.map(i,m),e.addEmitFlags(e.factory.createTypeLiteralNode(a),1));e.every(c,g)&&(o=e.factory.createObjectLiteralExpression());var _=e.factory.createParameterDeclaration(void 0,void 0,void 0,u,void 0,d,o);if(h(t.parameters)){var p=t.parameters[0],f=e.factory.createParameterDeclaration(void 0,void 0,void 0,p.name,void 0,p.type);return e.suppressLeadingAndTrailingTrivia(f.name),e.copyComments(p.name,f.name),p.type&&(e.suppressLeadingAndTrailingTrivia(f.type),e.copyComments(p.type,f.type)),e.factory.createNodeArray([f,_])}return e.factory.createNodeArray([_]);function m(t){var i=t.type;i||!t.initializer&&!e.isRestParameter(t)||(i=function(t){var i=s.getTypeAtLocation(t);return e.getTypeNodeIfAccessible(i,t,r,n)}(t));var a=e.factory.createPropertySignature(void 0,S(t),g(t)?e.factory.createToken(57):t.questionToken,i);return e.suppressLeadingAndTrailingTrivia(a),e.copyComments(t.name,a.name),t.type&&a.type&&e.copyComments(t.type,a.type),a}function g(t){if(e.isRestParameter(t)){var r=s.getTypeAtLocation(t);return!s.isTupleType(r)}return s.isOptionalParameter(t)}}function S(t){return e.getTextOfIdentifierOrLiteral(t.name)}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(t,n){e.Debug.assert(n===i,"Unexpected action name");var a=t.file,o=t.startPosition,m=t.program,g=t.cancellationToken,y=t.host,h=p(a,o,m.getTypeChecker());if(h&&g){var v=function(t,n,i){var a=function(t){switch(t.kind){case 256:return t.name?[t.name]:[e.Debug.checkDefined(e.findModifier(t,88),"Nameless function declaration should be a default export")];case 169:return[t.name];case 171:var r=e.Debug.checkDefined(e.findChildOfKind(t,134,t.getSourceFile()),"Constructor declaration should have constructor keyword");return 226===t.parent.kind?[t.parent.parent.name,r]:[r];case 214:return[t.parent.name];case 213:return t.name?[t.name,t.parent.name]:[t.parent.name];default:return e.Debug.assertNever(t,"Unexpected function declaration kind ".concat(t.kind))}}(t),o=e.isConstructorDeclaration(t)?function(t){switch(t.parent.kind){case 257:var r=t.parent;return r.name?[r.name]:[e.Debug.checkDefined(e.findModifier(r,88),"Nameless class declaration should be a default export")];case 226:var n=t.parent,i=t.parent.parent,a=n.name;return a?[a,i.name]:[i.name]}}(t):[],p=e.deduplicate(r(r([],a,!0),o,!0),e.equateValues),m=n.getTypeChecker(),g=e.flatMap(p,(function(t){return e.FindAllReferences.getReferenceEntriesForNode(-1,t,n,n.getSourceFiles(),i)})),y=h(g);return e.every(y.declarations,(function(t){return e.contains(p,t)}))||(y.valid=!1),y;function h(r){for(var n={accessExpressions:[],typeUsages:[]},i={functionCalls:[],declarations:[],classReferences:n,valid:!0},p=e.map(a,v),g=e.map(o,v),y=e.isConstructorDeclaration(t),h=e.map(a,(function(e){return s(e,m)})),b=0,x=r;b0;){var o=i.shift();e.copyTrailingComments(t[o],a,r,3,!1),n(o,a)}}}(n,r,a),s=p(0,n),c=s[0],l=s[1],u=s[2],d=s[3];if(c===n.length){var m=e.factory.createNoSubstitutionTemplateLiteral(l,u);return o(d,m),m}var g=[],y=e.factory.createTemplateHead(l,u);o(d,y);for(var h,v=function(t){var r=function(t){return e.isParenthesizedExpression(t)&&(f(t),t=t.expression),t}(n[t]);a(t,r);var i=p(t+1,n),s=i[0],c=i[1],l=i[2],u=i[3],d=(t=s-1)==n.length-1;if(e.isTemplateExpression(r)){var m=e.map(r.templateSpans,(function(t,n){f(t);var i=n===r.templateSpans.length-1,a=t.literal.text+(i?c:""),o=_(t.literal)+(i?l:"");return e.factory.createTemplateSpan(t.expression,d&&i?e.factory.createTemplateTail(a,o):e.factory.createTemplateMiddle(a,o))}));g.push.apply(g,m)}else{var y=d?e.factory.createTemplateTail(c,l):e.factory.createTemplateMiddle(c,l);o(u,y),g.push(e.factory.createTemplateSpan(r,y))}h=t},b=c;b1)return t.getUnionType(e.mapDefined(n,(function(e){return e.getReturnType()})))}var i=t.getSignatureFromDeclaration(r);if(i)return t.getReturnTypeOfSignature(i)}(a,i);if(!s)return{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_determine_function_return_type)};var c=a.typeToTypeNode(s,i,1);return c?{declaration:i,returnTypeNode:c}:void 0}}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(r){var n=s(r);if(n&&!t.isRefactorErrorInfo(n))return{renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(t){return i=r.file,a=t,o=n.declaration,s=n.returnTypeNode,c=e.findChildOfKind(o,21,i),l=e.isArrowFunction(o)&&void 0===c,void((u=l?e.first(o.parameters):c)&&(l&&(a.insertNodeBefore(i,u,e.factory.createToken(20)),a.insertNodeAfter(i,u,e.factory.createToken(21))),a.insertNodeAt(i,u.end,s,{prefix:": "})));var i,a,o,s,c,l,u}))}},getAvailableActions:function(r){var c=s(r);return c?t.isRefactorErrorInfo(c)?r.preferences.provideRefactorNotApplicableReason?[{name:i,description:a,actions:[n(n({},o),{notApplicableReason:c.error})]}]:e.emptyArray:[{name:i,description:a,actions:[o]}]:e.emptyArray}})})((t=e.refactor||(e.refactor={})).inferFunctionReturnType||(t.inferFunctionReturnType={}))}(c||(c={})),function(e){function t(t,r,n,a){var o=e.isNodeKind(t)?new i(t,r,n):79===t?new u(79,r,n):80===t?new d(80,r,n):new l(t,r,n);return o.parent=a,o.flags=50720768&a.flags,o}e.servicesVersion="0.8";var i=function(){function r(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e}return r.prototype.assertHasRealPosition=function(t){e.Debug.assert(!e.positionIsSynthesized(this.pos)&&!e.positionIsSynthesized(this.end),t||"Node must have a real position for this operation")},r.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},r.prototype.getStart=function(t,r){return this.assertHasRealPosition(),e.getTokenPosOfNode(this,t,r)},r.prototype.getFullStart=function(){return this.assertHasRealPosition(),this.pos},r.prototype.getEnd=function(){return this.assertHasRealPosition(),this.end},r.prototype.getWidth=function(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)},r.prototype.getFullWidth=function(){return this.assertHasRealPosition(),this.end-this.pos},r.prototype.getLeadingTriviaWidth=function(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos},r.prototype.getFullText=function(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)},r.prototype.getText=function(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},r.prototype.getChildCount=function(e){return this.getChildren(e).length},r.prototype.getChildAt=function(e,t){return this.getChildren(t)[e]},r.prototype.getChildren=function(r){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=function(r,n){if(!e.isNodeKind(r.kind))return e.emptyArray;var i=[];if(e.isJSDocCommentContainingNode(r))return r.forEachChild((function(e){i.push(e)})),i;e.scanner.setText((n||r.getSourceFile()).text);var o=r.pos,s=function(e){a(i,o,e.pos,r),i.push(e),o=e.end},c=function(e){a(i,o,e.pos,r),i.push(function(e,r){var n=t(348,e.pos,e.end,r);n._children=[];for(var i=e.pos,o=0,s=e;o347}));return n.kind<161?n:n.getFirstToken(t)}},r.prototype.getLastToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t),n=e.lastOrUndefined(r);if(n)return n.kind<161?n:n.getLastToken(t)},r.prototype.forEachChild=function(t,r){return e.forEachChild(this,t,r)},r}();function a(r,n,i,a){for(e.scanner.setTextPos(n);n=n.length&&(t=this.getEnd()),t||(t=n[r+1]-1);var i=this.getFullText();return"\n"===i[t]&&"\r"===i[t-1]?t-1:t},r.prototype.getNamedDeclarations=function(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations},r.prototype.computeNamedDeclarations=function(){var t=e.createMultiMap();return this.forEachChild((function i(a){switch(a.kind){case 256:case 213:case 169:case 168:var o=a,s=n(o);if(s){var c=function(e){var r=t.get(e);r||t.set(e,r=[]);return r}(s),l=e.lastOrUndefined(c);l&&o.parent===l.parent&&o.symbol===l.symbol?o.body&&!l.body&&(c[c.length-1]=o):c.push(o)}e.forEachChild(a,i);break;case 257:case 226:case 258:case 259:case 260:case 261:case 265:case 275:case 270:case 267:case 268:case 172:case 173:case 182:r(a),e.forEachChild(a,i);break;case 164:if(!e.hasSyntacticModifier(a,16476))break;case 254:case 203:var u=a;if(e.isBindingPattern(u.name)){e.forEachChild(u.name,i);break}u.initializer&&i(u.initializer);case 299:case 167:case 166:r(a);break;case 272:var d=a;d.exportClause&&(e.isNamedExports(d.exportClause)?e.forEach(d.exportClause.elements,i):i(d.exportClause.name));break;case 266:var _=a.importClause;_&&(_.name&&r(_.name),_.namedBindings&&(268===_.namedBindings.kind?r(_.namedBindings):e.forEach(_.namedBindings.elements,i)));break;case 221:0!==e.getAssignmentDeclarationKind(a)&&r(a);default:e.forEachChild(a,i)}})),t;function r(e){var r=n(e);r&&t.add(r,e)}function n(t){var r=e.getNonAssignedNameOfDeclaration(t);return r&&(e.isComputedPropertyName(r)&&e.isPropertyAccessExpression(r.expression)?r.expression.name.text:e.isPropertyName(r)?e.getNameFromPropertyName(r):void 0)}},r}(i),v=function(){function t(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r}return t.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},t}();function b(t){var r=!0;for(var n in t)if(e.hasProperty(t,n)&&!x(n)){r=!1;break}if(r)return t;var i={};for(var n in t){if(e.hasProperty(t,n))i[x(n)?n:n.charAt(0).toLowerCase()+n.substr(1)]=t[n]}return i}function x(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function S(){return{target:1,jsx:1}}e.toEditorSettings=b,e.displayPartsToString=function(t){return t?e.map(t,(function(e){return e.text})).join(""):""},e.getDefaultCompilerOptions=S,e.getSupportedCodeFixes=function(){return e.codefix.getSupportedErrorCodes()};var D=function(){function t(t,r){this.host=t,this.currentDirectory=t.getCurrentDirectory(),this.fileNameToEntry=new e.Map;var n=t.getScriptFileNames();null===e.tracing||void 0===e.tracing||e.tracing.push("session","initializeHostCache",{count:n.length});for(var i=0,a=n;i=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=t,this.hostCancellationToken.isCancellationRequested())},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"ThrottledCancellationToken"}),new e.OperationCanceledException},t}();e.ThrottledCancellationToken=w;var F=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints"],P=r(r([],F,!0),["getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getOccurrencesAtPosition","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],!1);function I(t){var r=function(t){switch(t.kind){case 10:case 14:case 8:if(162===t.parent.kind)return e.isObjectLiteralElement(t.parent.parent)?t.parent.parent:void 0;case 79:return!e.isObjectLiteralElement(t.parent)||205!==t.parent.parent.kind&&286!==t.parent.parent.kind||t.parent.name!==t?void 0:t.parent}return}(t);return r&&(e.isObjectLiteralExpression(r.parent)||e.isJsxAttributes(r.parent))?r:void 0}function O(t,r,n,i){var a=e.getNameFromPropertyName(t.name);if(!a)return e.emptyArray;if(!n.isUnion())return(o=n.getProperty(a))?[o]:e.emptyArray;var o,s=e.mapDefined(n.types,(function(n){return(e.isObjectLiteralExpression(t.parent)||e.isJsxAttributes(t.parent))&&r.isTypeInvalidDueToUnionDiscriminant(n,t.parent)?void 0:n.getProperty(a)}));if(i&&(0===s.length||s.length===n.types.length)&&(o=n.getProperty(a)))return[o];return 0===s.length?e.mapDefined(n.types,(function(e){return e.getProperty(a)})):s}e.createLanguageService=function(t,i,a){var o,s,c;void 0===i&&(i=e.createDocumentRegistry(t.useCaseSensitiveFileNames&&t.useCaseSensitiveFileNames(),t.getCurrentDirectory())),c=void 0===a?e.LanguageServiceMode.Semantic:"boolean"==typeof a?a?e.LanguageServiceMode.Syntactic:e.LanguageServiceMode.Semantic:a;var l,u,d=new C(t),_=0,p=t.getCancellationToken?new N(t.getCancellationToken()):A,f=t.getCurrentDirectory();function m(e){t.log&&t.log(e)}e.maybeSetLocalizedDiagnosticMessages(null===(s=t.getLocalizedDiagnosticMessages)||void 0===s?void 0:s.bind(t));var g=e.hostUsesCaseSensitiveFileNames(t),y=e.createGetCanonicalFileName(g),h=e.getSourceMapper({useCaseSensitiveFileNames:function(){return g},getCurrentDirectory:function(){return f},getProgram:S,fileExists:e.maybeBind(t,t.fileExists),readFile:e.maybeBind(t,t.readFile),getDocumentPositionMapper:e.maybeBind(t,t.getDocumentPositionMapper),getSourceFileLike:e.maybeBind(t,t.getSourceFileLike),log:m});function v(e){var t=l.getSourceFile(e);if(!t){var r=new Error("Could not find source file: '".concat(e,"'."));throw r.ProgramFiles=l.getSourceFiles().map((function(e){return e.fileName})),r}return t}function x(){var r,n,a;if(e.Debug.assert(c!==e.LanguageServiceMode.Syntactic),t.getProjectVersion){var o=t.getProjectVersion();if(o){if(u===o&&!(null===(r=t.hasChangedAutomaticTypeDirectiveNames)||void 0===r?void 0:r.call(t)))return;u=o}}var s=t.getTypeRootsVersion?t.getTypeRootsVersion():0;_!==s&&(m("TypeRoots version has changed; provide new program"),l=void 0,_=s);var d,v=new D(t,y),b=v.getRootFileNames(),x=t.getCompilationSettings()||{target:1,jsx:1},S=t.hasInvalidatedResolution||e.returnFalse,C=e.maybeBind(t,t.hasChangedAutomaticTypeDirectiveNames),T=null===(n=t.getProjectReferences)||void 0===n?void 0:n.call(t),E={useCaseSensitiveFileNames:g,fileExists:F,readFile:P,readDirectory:I,trace:e.maybeBind(t,t.trace),getCurrentDirectory:function(){return f},onUnRecoverableConfigFileDiagnostic:e.noop};if(!e.isProgramUptoDate(l,b,x,(function(e,r){return t.getScriptVersion(r)}),F,S,C,w,T)){var k={getSourceFile:M,getSourceFileByPath:L,getCancellationToken:function(){return p},getCanonicalFileName:y,useCaseSensitiveFileNames:function(){return g},getNewLine:function(){return e.getNewLineCharacter(x,(function(){return e.getNewLineOrDefaultFromHost(t)}))},getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:e.noop,getCurrentDirectory:function(){return f},fileExists:F,readFile:P,getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),realpath:e.maybeBind(t,t.realpath),directoryExists:function(r){return e.directoryProbablyExists(r,t)},getDirectories:function(e){return t.getDirectories?t.getDirectories(e):[]},readDirectory:I,onReleaseOldSourceFile:O,onReleaseParsedCommandLine:function(e,r,n){var i;t.getParsedCommandLine?null===(i=t.onReleaseParsedCommandLine)||void 0===i||i.call(t,e,r,n):r&&O(r.sourceFile,n)},hasInvalidatedResolution:S,hasChangedAutomaticTypeDirectiveNames:C,trace:E.trace,resolveModuleNames:e.maybeBind(t,t.resolveModuleNames),getModuleResolutionCache:e.maybeBind(t,t.getModuleResolutionCache),resolveTypeReferenceDirectives:e.maybeBind(t,t.resolveTypeReferenceDirectives),useSourceOfProjectReferenceRedirect:e.maybeBind(t,t.useSourceOfProjectReferenceRedirect),getParsedCommandLine:w};null===(a=t.setCompilerHost)||void 0===a||a.call(t,k);var A=i.getKeyForCompilationSettings(x),N={rootNames:b,options:x,host:k,oldProgram:l,projectReferences:T};return l=e.createProgram(N),v=void 0,d=void 0,h.clearCache(),void l.getTypeChecker()}function w(r){var n=e.toPath(r,f,y),i=null==d?void 0:d.get(n);if(void 0!==i)return i||void 0;var a=t.getParsedCommandLine?t.getParsedCommandLine(r):function(t){var r=M(t,100);return r?(r.path=e.toPath(t,f,y),r.resolvedPath=r.path,r.originalFileName=r.fileName,e.parseJsonSourceFileConfigFileContent(r,E,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),f),void 0,e.getNormalizedAbsolutePath(t,f))):void 0}(r);return(d||(d=new e.Map)).set(n,a||!1),a}function F(r){var n=e.toPath(r,f,y),i=v&&v.getEntryByPath(n);return i?!e.isString(i):!!t.fileExists&&t.fileExists(r)}function P(r){var n=e.toPath(r,f,y),i=v&&v.getEntryByPath(n);return i?e.isString(i)?void 0:e.getSnapshotText(i.scriptSnapshot):t.readFile&&t.readFile(r)}function I(r,n,i,a,o){return e.Debug.checkDefined(t.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,n,i,a,o)}function O(e,t){var r=i.getKeyForCompilationSettings(t);i.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind)}function M(t,r,n,i){return L(t,e.toPath(t,f,y),r,n,i)}function L(r,n,a,o,s){e.Debug.assert(void 0!==v,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");var c=v&&v.getOrCreateEntryByPath(r,n);if(c){if(!s){var u=l&&l.getSourceFileByPath(n);if(u){if(c.scriptKind===u.scriptKind)return i.updateDocumentWithKey(r,n,t,A,c.scriptSnapshot,c.version,c.scriptKind);i.releaseDocumentWithKey(u.resolvedPath,i.getKeyForCompilationSettings(l.getCompilerOptions()),u.scriptKind)}}return i.acquireDocumentWithKey(r,n,t,A,c.scriptSnapshot,c.version,c.scriptKind)}}}function S(){if(c!==e.LanguageServiceMode.Syntactic)return x(),l;e.Debug.assert(void 0===l)}function T(t,r,n){var i=e.normalizePath(t);e.Debug.assert(n.some((function(t){return e.normalizePath(t)===i}))),x();var a=e.mapDefined(n,(function(e){return l.getSourceFile(e)})),o=v(t);return e.DocumentHighlights.getDocumentHighlights(l,p,o,r,a)}function E(t,r,n,i){x();var a=n&&2===n.use?l.getSourceFiles().filter((function(e){return!l.isSourceFileDefaultLibrary(e)})):l.getSourceFiles();return e.FindAllReferences.findReferenceOrRenameEntries(l,p,a,t,r,n,i)}var k=new e.Map(e.getEntries(((o={})[18]=19,o[20]=21,o[22]=23,o[31]=29,o)));function w(r){var n;return e.Debug.assertEqual(r.type,"install package"),t.installPackage?t.installPackage({fileName:(n=r.file,e.toPath(n,f,y)),packageName:r.packageName}):Promise.reject("Host does not implement `installPackage`")}function M(e,t){return{lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function L(t,r,n){for(var i=d.getCurrentSourceFile(t),a=[],o=M(i,r),s=o.lineStarts,c=o.firstLine,l=o.lastLine,u=n||!1,_=Number.MAX_VALUE,p=new e.Map,f=new RegExp(/\S/),m=e.isInsideJsxElement(i,s[c]),g=m?"{/*":"//",y=c;y<=l;y++){var h=i.text.substring(s[y],i.getLineEndOfPosition(s[y])),v=f.exec(h);v&&(_=Math.min(_,v.index),p.set(y.toString(),v.index),h.substr(v.index,g.length)!==g&&(u=void 0===n||n))}for(y=c;y<=l;y++)if(c===l||s[y]!==r.end){var b=p.get(y.toString());void 0!==b&&(m?a.push.apply(a,R(t,{pos:s[y]+_,end:i.getLineEndOfPosition(s[y])},u,m)):u?a.push({newText:g,span:{length:0,start:s[y]+_}}):i.text.substr(s[y]+b,g.length)===g&&a.push({newText:"",span:{length:g.length,start:s[y]+b}}))}return a}function R(t,r,n,i){for(var a,o=d.getCurrentSourceFile(t),s=[],c=o.text,l=!1,u=n||!1,_=[],p=r.pos,f=void 0!==i?i:e.isInsideJsxElement(o,p),m=f?"{/*":"/*",g=f?"*/}":"*/",y=f?"\\{\\/\\*":"\\/\\*",h=f?"\\*\\/\\}":"\\*\\/";p<=r.end;){var v=c.substr(p,m.length)===m?m.length:0,b=e.isInComment(o,p+v);if(b)f&&(b.pos--,b.end++),_.push(b.pos),3===b.kind&&_.push(b.end),l=!0,p=b.end+1;else{var x=c.substring(p,r.end).search("(".concat(y,")|(").concat(h,")"));u=void 0!==n?n:u||!e.isTextWhiteSpaceLike(c,p,-1===x?r.end:p+x),p=-1===x?r.end+1:p+x+g.length}}if(u||!l){2!==(null===(a=e.isInComment(o,r.pos))||void 0===a?void 0:a.kind)&&e.insertSorted(_,r.pos,e.compareValues),e.insertSorted(_,r.end,e.compareValues);var S=_[0];c.substr(S,m.length)!==m&&s.push({newText:m,span:{length:0,start:S}});for(var D=1;D<_.length-1;D++)c.substr(_[D]-g.length,g.length)!==g&&s.push({newText:g,span:{length:0,start:_[D]}}),c.substr(_[D],m.length)!==m&&s.push({newText:m,span:{length:0,start:_[D]}});s.length%2!=0&&s.push({newText:g,span:{length:0,start:_[_.length-1]}})}else for(var C=0,T=_;C0?E-g.length:0;v=c.substr(k,g.length)===g?g.length:0;s.push({newText:"",span:{length:m.length,start:E-v}})}return s}function B(t){var r=t.openingElement,n=t.closingElement,i=t.parent;return!e.tagNamesAreEquivalent(r.tagName,n.tagName)||e.isJsxElement(i)&&e.tagNamesAreEquivalent(r.tagName,i.openingElement.tagName)&&B(i)}function J(t){var r=t.closingFragment,n=t.parent;return!!(131072&r.flags)||e.isJsxFragment(n)&&J(n)}function j(r,n,i,a,o,s){var c="number"==typeof n?[n,void 0]:[n.pos,n.end];return{file:r,startPosition:c[0],endPosition:c[1],program:S(),host:t,formatContext:e.formatting.getFormatContext(a,t),cancellationToken:p,preferences:i,triggerReason:o,kind:s}}k.forEach((function(e,t){return k.set(e.toString(),Number(t))}));var U={dispose:function(){if(l){var r=i.getKeyForCompilationSettings(l.getCompilerOptions());e.forEach(l.getSourceFiles(),(function(e){return i.releaseDocumentWithKey(e.resolvedPath,r,e.scriptKind)})),l=void 0}t=void 0},cleanupSemanticCache:function(){l=void 0},getSyntacticDiagnostics:function(e){return x(),l.getSyntacticDiagnostics(v(e),p).slice()},getSemanticDiagnostics:function(t){x();var n=v(t),i=l.getSemanticDiagnostics(n,p);if(!e.getEmitDeclarations(l.getCompilerOptions()))return i.slice();var a=l.getDeclarationDiagnostics(n,p);return r(r([],i,!0),a,!0)},getSuggestionDiagnostics:function(t){return x(),e.computeSuggestionDiagnostics(v(t),l,p)},getCompilerOptionsDiagnostics:function(){return x(),r(r([],l.getOptionsDiagnostics(p),!0),l.getGlobalDiagnostics(p),!0)},getSyntacticClassifications:function(t,r){return e.getSyntacticClassifications(p,d.getCurrentSourceFile(t),r)},getSemanticClassifications:function(t,r,n){return x(),"2020"===(n||"original")?e.classifier.v2020.getSemanticClassifications(l,p,v(t),r):e.getSemanticClassifications(l.getTypeChecker(),p,v(t),l.getClassifiableNames(),r)},getEncodedSyntacticClassifications:function(t,r){return e.getEncodedSyntacticClassifications(p,d.getCurrentSourceFile(t),r)},getEncodedSemanticClassifications:function(t,r,n){return x(),"original"===(n||"original")?e.getEncodedSemanticClassifications(l.getTypeChecker(),p,v(t),l.getClassifiableNames(),r):e.classifier.v2020.getEncodedSemanticClassifications(l,p,v(t),r)},getCompletionsAtPosition:function(r,i,a,o){void 0===a&&(a=e.emptyOptions);var s=n(n({},e.identity(a)),{includeCompletionsForModuleExports:a.includeCompletionsForModuleExports||a.includeExternalModuleExports,includeCompletionsWithInsertText:a.includeCompletionsWithInsertText||a.includeInsertTextCompletions});return x(),e.Completions.getCompletionsAtPosition(t,l,m,v(r),i,s,a.triggerCharacter,a.triggerKind,p,o&&e.formatting.getFormatContext(o,t))},getCompletionEntryDetails:function(r,n,i,a,o,s,c){return void 0===s&&(s=e.emptyOptions),x(),e.Completions.getCompletionEntryDetails(l,m,v(r),n,{name:i,source:o,data:c},t,a&&e.formatting.getFormatContext(a,t),s,p)},getCompletionEntrySymbol:function(r,n,i,a,o){return void 0===o&&(o=e.emptyOptions),x(),e.Completions.getCompletionEntrySymbol(l,m,v(r),n,{name:i,source:a},t,o)},getSignatureHelpItems:function(t,r,n){var i=(void 0===n?e.emptyOptions:n).triggerReason;x();var a=v(t);return e.SignatureHelp.getSignatureHelpItems(l,a,r,i,p)},getQuickInfoAtPosition:function(t,r){x();var n=v(t),i=e.getTouchingPropertyName(n,r);if(i!==n){var a=l.getTypeChecker(),o=function(t){if(e.isNewExpression(t.parent)&&t.pos===t.parent.pos)return t.parent.expression;if(e.isNamedTupleMember(t.parent)&&t.pos===t.parent.pos)return t.parent;if(e.isImportMeta(t.parent)&&t.parent.name===t)return t.parent;return t}(i),s=function(t,r){var n=I(t);if(n){var i=r.getContextualType(n.parent),a=i&&O(n,r,i,!1);if(a&&1===a.length)return e.first(a)}return r.getSymbolAtLocation(t)}(o,a);if(!s||a.isUnknownSymbol(s)){var c=function(t,r,n){switch(r.kind){case 79:return!e.isLabelName(r)&&!e.isTagName(r)&&!e.isConstTypeReference(r.parent);case 206:case 161:return!e.isInComment(t,n);case 108:case 192:case 106:case 197:return!0;case 231:return e.isImportMeta(r);default:return!1}}(n,o,r)?a.getTypeAtLocation(o):void 0;return c&&{kind:"",kindModifiers:"",textSpan:e.createTextSpanFromNode(o,n),displayParts:a.runWithCancellationToken(p,(function(t){return e.typeToDisplayParts(t,c,e.getContainerNode(o))})),documentation:c.symbol?c.symbol.getDocumentationComment(a):void 0,tags:c.symbol?c.symbol.getJsDocTags(a):void 0}}var u=a.runWithCancellationToken(p,(function(t){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(t,s,n,e.getContainerNode(o),o)})),d=u.symbolKind,_=u.displayParts,f=u.documentation,m=u.tags;return{kind:d,kindModifiers:e.SymbolDisplay.getSymbolModifiers(a,s),textSpan:e.createTextSpanFromNode(o,n),displayParts:_,documentation:f,tags:m}}},getDefinitionAtPosition:function(t,r,n,i){return x(),e.GoToDefinition.getDefinitionAtPosition(l,v(t),r,n,i)},getDefinitionAndBoundSpan:function(t,r){return x(),e.GoToDefinition.getDefinitionAndBoundSpan(l,v(t),r)},getImplementationAtPosition:function(t,r){return x(),e.FindAllReferences.getImplementationsAtPosition(l,p,l.getSourceFiles(),v(t),r)},getTypeDefinitionAtPosition:function(t,r){return x(),e.GoToDefinition.getTypeDefinitionAtPosition(l.getTypeChecker(),v(t),r)},getReferencesAtPosition:function(t,r){return x(),E(e.getTouchingPropertyName(v(t),r),r,{use:1},e.FindAllReferences.toReferenceEntry)},findReferences:function(t,r){return x(),e.FindAllReferences.findReferencedSymbols(l,p,l.getSourceFiles(),v(t),r)},getFileReferences:function(t){return x(),e.FindAllReferences.Core.getReferencesForFileName(t,l,l.getSourceFiles()).map(e.FindAllReferences.toReferenceEntry)},getOccurrencesAtPosition:function(t,r){return e.flatMap(T(t,r,[t]),(function(e){return e.highlightSpans.map((function(t){return n(n({fileName:e.fileName,textSpan:t.textSpan,isWriteAccess:"writtenReference"===t.kind},t.isInString&&{isInString:!0}),t.contextSpan&&{contextSpan:t.contextSpan})}))}))},getDocumentHighlights:T,getNameOrDottedNameSpan:function(t,r,n){var i=d.getCurrentSourceFile(t),a=e.getTouchingPropertyName(i,r);if(a!==i){switch(a.kind){case 206:case 161:case 10:case 95:case 110:case 104:case 106:case 108:case 192:case 79:break;default:return}for(var o=a;;)if(e.isRightSideOfPropertyAccess(o)||e.isRightSideOfQualifiedName(o))o=o.parent;else{if(!e.isNameOfModuleDeclaration(o))break;if(261!==o.parent.parent.kind||o.parent.parent.body!==o.parent)break;o=o.parent.parent.name}return e.createTextSpanFromBounds(o.getStart(),a.getEnd())}},getBreakpointStatementAtPosition:function(t,r){var n=d.getCurrentSourceFile(t);return e.BreakpointResolver.spanInSourceFileAtLocation(n,r)},getNavigateToItems:function(t,r,n,i){void 0===i&&(i=!1),x();var a=n?[v(n)]:l.getSourceFiles();return e.NavigateTo.getNavigateToItems(a,l.getTypeChecker(),p,t,r,i)},getRenameInfo:function(t,r,n){return x(),e.Rename.getRenameInfo(l,v(t),r,n)},getSmartSelectionRange:function(t,r){return e.SmartSelectionRange.getSmartSelectionRange(r,d.getCurrentSourceFile(t))},findRenameLocations:function(t,r,i,a,o){x();var s=v(t),c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(s,r));if(e.Rename.nodeIsEligibleForRename(c)){if(e.isIdentifier(c)&&(e.isJsxOpeningElement(c.parent)||e.isJsxClosingElement(c.parent))&&e.isIntrinsicJsxName(c.escapedText)){var l=c.parent.parent;return[l.openingElement,l.closingElement].map((function(t){var r=e.createTextSpanFromNode(t.tagName,s);return n({fileName:s.fileName,textSpan:r},e.FindAllReferences.toContextSpan(r,s,t.parent))}))}return E(c,r,{findInStrings:i,findInComments:a,providePrefixAndSuffixTextForRename:o,use:2},(function(t,r,n){return e.FindAllReferences.toRenameLocation(t,r,n,o||!1)}))}},getNavigationBarItems:function(t){return e.NavigationBar.getNavigationBarItems(d.getCurrentSourceFile(t),p)},getNavigationTree:function(t){return e.NavigationBar.getNavigationTree(d.getCurrentSourceFile(t),p)},getOutliningSpans:function(t){var r=d.getCurrentSourceFile(t);return e.OutliningElementsCollector.collectElements(r,p)},getTodoComments:function(t,r){x();var n=v(t);p.throwIfCancellationRequested();var i,a,o=n.text,s=[];if(r.length>0&&(a=n.fileName,!e.stringContains(a,"/node_modules/")))for(var c=function(){var t="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/\/+\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+e.map(r,(function(e){return"("+function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}(e.text)+")"})).join("|")+")";return new RegExp(t+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}(),l=void 0;l=c.exec(o);){p.throwIfCancellationRequested();e.Debug.assert(l.length===r.length+3);var u=l[1],d=l.index+u.length;if(e.isInComment(n,d)){for(var _=void 0,f=0;f=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)){var m=l[2];s.push({descriptor:_,message:m,position:d})}}}return s},getBraceMatchingAtPosition:function(t,r){var n=d.getCurrentSourceFile(t),i=e.getTouchingToken(n,r),a=i.getStart(n)===r?k.get(i.kind.toString()):void 0,o=a&&e.findChildOfKind(i.parent,a,n);return o?[e.createTextSpanFromNode(i,n),e.createTextSpanFromNode(o,n)].sort((function(e,t){return e.start-t.start})):e.emptyArray},getIndentationAtPosition:function(t,r,n){var i=e.timestamp(),a=b(n),o=d.getCurrentSourceFile(t);m("getIndentationAtPosition: getCurrentSourceFile: "+(e.timestamp()-i)),i=e.timestamp();var s=e.formatting.SmartIndenter.getIndentation(r,o,a);return m("getIndentationAtPosition: computeIndentation : "+(e.timestamp()-i)),s},getFormattingEditsForRange:function(r,n,i,a){var o=d.getCurrentSourceFile(r);return e.formatting.formatSelection(n,i,o,e.formatting.getFormatContext(b(a),t))},getFormattingEditsForDocument:function(r,n){return e.formatting.formatDocument(d.getCurrentSourceFile(r),e.formatting.getFormatContext(b(n),t))},getFormattingEditsAfterKeystroke:function(r,n,i,a){var o=d.getCurrentSourceFile(r),s=e.formatting.getFormatContext(b(a),t);if(!e.isInComment(o,n))switch(i){case"{":return e.formatting.formatOnOpeningCurly(n,o,s);case"}":return e.formatting.formatOnClosingCurly(n,o,s);case";":return e.formatting.formatOnSemicolon(n,o,s);case"\n":return e.formatting.formatOnEnter(n,o,s)}return[]},getDocCommentTemplateAtPosition:function(r,n,i){return e.JsDoc.getDocCommentTemplateAtPosition(e.getNewLineOrDefaultFromHost(t),d.getCurrentSourceFile(r),n,i)},isValidBraceCompletionAtPosition:function(t,r,n){if(60===n)return!1;var i=d.getCurrentSourceFile(t);if(e.isInString(i,r))return!1;if(e.isInsideJsxElementOrAttribute(i,r))return 123===n;if(e.isInTemplateString(i,r))return!1;switch(n){case 39:case 34:case 96:return!e.isInComment(i,r)}return!0},getJsxClosingTagAtPosition:function(t,r){var n=d.getCurrentSourceFile(t),i=e.findPrecedingToken(r,n);if(i){var a=31===i.kind&&e.isJsxOpeningElement(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxElement(i.parent)?i.parent:void 0;if(a&&B(a))return{newText:"")};var o=31===i.kind&&e.isJsxOpeningFragment(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxFragment(i.parent)?i.parent:void 0;return o&&J(o)?{newText:""}:void 0}},getSpanOfEnclosingComment:function(t,r,n){var i=d.getCurrentSourceFile(t),a=e.formatting.getRangeOfEnclosingComment(i,r);return!a||n&&3!==a.kind?void 0:e.createTextSpanFromRange(a)},getCodeFixesAtPosition:function(r,n,i,a,o,s){void 0===s&&(s=e.emptyOptions),x();var c=v(r),u=e.createTextSpanFromBounds(n,i),d=e.formatting.getFormatContext(o,t);return e.flatMap(e.deduplicate(a,e.equateValues,e.compareValues),(function(r){return p.throwIfCancellationRequested(),e.codefix.getFixes({errorCode:r,sourceFile:c,span:u,program:l,host:t,cancellationToken:p,formatContext:d,preferences:s})}))},getCombinedCodeFix:function(r,n,i,a){void 0===a&&(a=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var o=v(r.fileName),s=e.formatting.getFormatContext(i,t);return e.codefix.getAllFixes({fixId:n,sourceFile:o,program:l,host:t,cancellationToken:p,formatContext:s,preferences:a})},applyCodeActionCommand:function(t,r){var n="string"==typeof t?r:t;return e.isArray(n)?Promise.all(n.map((function(e){return w(e)}))):w(n)},organizeImports:function(r,n,i){void 0===i&&(i=e.emptyOptions),x(),e.Debug.assert("file"===r.type);var a=v(r.fileName),o=e.formatting.getFormatContext(n,t);return e.OrganizeImports.organizeImports(a,o,t,l,i,r.skipDestructiveCodeActions)},getEditsForFileRename:function(r,n,i,a){return void 0===a&&(a=e.emptyOptions),e.getEditsForFileRename(S(),r,n,t,e.formatting.getFormatContext(i,t),a,h)},getEmitOutput:function(r,n,i){x();var a=v(r),o=t.getCustomTransformers&&t.getCustomTransformers();return e.getFileEmitOutput(l,a,!!n,p,o,i)},getNonBoundSourceFile:function(e){return d.getCurrentSourceFile(e)},getProgram:S,getAutoImportProvider:function(){var e;return null===(e=t.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(t)},getApplicableRefactors:function(t,r,n,i,a){void 0===n&&(n=e.emptyOptions),x();var o=v(t);return e.refactor.getApplicableRefactors(j(o,r,n,e.emptyOptions,i,a))},getEditsForRefactor:function(t,r,n,i,a,o){void 0===o&&(o=e.emptyOptions),x();var s=v(t);return e.refactor.getEditsForRefactor(j(s,n,o,r),i,a)},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:h.toLineColumnOffset(e,t)},getSourceMapper:function(){return h},clearSourceMapperCache:function(){return h.clearCache()},prepareCallHierarchy:function(t,r){x();var n=e.CallHierarchy.resolveCallHierarchyDeclaration(l,e.getTouchingPropertyName(v(t),r));return n&&e.mapOneOrMany(n,(function(t){return e.CallHierarchy.createCallHierarchyItem(l,t)}))},provideCallHierarchyIncomingCalls:function(t,r){x();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getIncomingCalls(l,i,p):[]},provideCallHierarchyOutgoingCalls:function(t,r){x();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(l,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getOutgoingCalls(l,i):[]},toggleLineComment:L,toggleMultilineComment:R,commentSelection:function(e,t){var r=M(d.getCurrentSourceFile(e),t);return r.firstLine===r.lastLine&&t.pos!==t.end?R(e,t,!0):L(e,t,!0)},uncommentSelection:function(t,r){var n=d.getCurrentSourceFile(t),i=[],a=r.pos,o=r.end;a===o&&(o+=e.isInsideJsxElement(n,a)?2:1);for(var s=a;s<=o;s++){var c=e.isInComment(n,s);if(c){switch(c.kind){case 2:i.push.apply(i,L(t,{end:c.end,pos:c.pos+1},!1));break;case 3:i.push.apply(i,R(t,{end:c.end,pos:c.pos+1},!1))}s=c.end+1}}return i},provideInlayHints:function(r,n,i){void 0===i&&(i=e.emptyOptions),x();var a=v(r);return e.InlayHints.provideInlayHints(function(e,r,n){return{file:e,program:S(),host:t,span:r,preferences:n,cancellationToken:p}}(a,n,i))}};switch(c){case e.LanguageServiceMode.Semantic:break;case e.LanguageServiceMode.PartialSemantic:F.forEach((function(e){return U[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.PartialSemantic"))}}));break;case e.LanguageServiceMode.Syntactic:P.forEach((function(e){return U[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.Syntactic"))}}));break;default:e.Debug.assertNever(c)}return U},e.getNameTable=function(t){return t.nameTable||function(t){var r=t.nameTable=new e.Map;t.forEachChild((function t(n){if(e.isIdentifier(n)&&!e.isTagName(n)&&n.escapedText||e.isStringOrNumericLiteralLike(n)&&function(t){return e.isDeclarationName(t)||277===t.parent.kind||function(e){return e&&e.parent&&207===e.parent.kind&&e.parent.argumentExpression===e}(t)||e.isLiteralComputedPropertyDeclarationName(t)}(n)){var i=e.getEscapedTextOfIdentifierOrLiteral(n);r.set(i,void 0===r.get(i)?n.pos:-1)}else if(e.isPrivateIdentifier(n)){i=n.escapedText;r.set(i,void 0===r.get(i)?n.pos:-1)}if(e.forEachChild(n,t),e.hasJSDocNodes(n))for(var a=0,o=n.jsDoc;ai){var a=e.findPrecedingToken(n.pos,t);if(!a||t.getLineAndCharacterOfPosition(a.getEnd()).line!==i)return;n=a}if(!(16777216&n.flags))return d(n)}function o(r,n){var i=r.decorators?e.skipTrivia(t.text,r.decorators.end):r.getStart(t);return e.createTextSpanFromBounds(i,(n||r).getEnd())}function s(r,n){return o(r,e.findNextToken(n,n.parent,t))}function c(e,r){return e&&i===t.getLineAndCharacterOfPosition(e.getStart(t)).line?d(e):d(r)}function l(r){return d(e.findPrecedingToken(r.pos,t))}function u(r){return d(e.findNextToken(r,r.parent,t))}function d(r){if(r){var n=r.parent;switch(r.kind){case 237:return x(r.declarationList.declarations[0]);case 254:case 167:case 166:return x(r);case 164:return function t(r){if(e.isBindingPattern(r.name))return T(r.name);if(function(t){return!!t.initializer||void 0!==t.dotDotDotToken||e.hasSyntacticModifier(t,12)}(r))return o(r);var n=r.parent,i=n.parameters.indexOf(r);return e.Debug.assert(-1!==i),0!==i?t(n.parameters[i-1]):d(n.body)}(r);case 256:case 169:case 168:case 172:case 173:case 171:case 213:case 214:return function(e){if(e.body)return S(e)?o(e):d(e.body)}(r);case 235:if(e.isFunctionBlock(r))return h=(y=r).statements.length?y.statements[0]:y.getLastToken(),S(y.parent)?c(y.parent,h):d(h);case 262:return D(r);case 292:return D(r.block);case 238:return o(r.expression);case 247:return o(r.getChildAt(0),r.expression);case 241:return s(r,r.expression);case 240:return d(r.statement);case 253:return o(r.getChildAt(0));case 239:return s(r,r.expression);case 250:return d(r.statement);case 246:case 245:return o(r.getChildAt(0),r.label);case 242:return(g=r).initializer?C(g):g.condition?o(g.condition):g.incrementor?o(g.incrementor):void 0;case 243:return s(r,r.expression);case 244:return C(r);case 249:return s(r,r.expression);case 289:case 290:return d(r.statements[0]);case 252:return D(r.tryBlock);case 251:case 271:return o(r,r.expression);case 265:return o(r,r.moduleReference);case 266:case 272:return o(r,r.moduleSpecifier);case 261:if(1!==e.getModuleInstanceState(r))return;case 257:case 260:case 299:case 203:return o(r);case 248:return d(r.statement);case 165:return v=n.decorators,e.createTextSpanFromBounds(e.skipTrivia(t.text,v.pos),v.end);case 201:case 202:return T(r);case 258:case 259:return;case 26:case 1:return c(e.findPrecedingToken(r.pos,t));case 27:return l(r);case 18:return function(r){switch(r.parent.kind){case 260:var n=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),n.members.length?n.members[0]:n.getLastToken(t));case 257:var i=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),i.members.length?i.members[0]:i.getLastToken(t));case 263:return c(r.parent.parent,r.parent.clauses[0])}return d(r.parent)}(r);case 19:return function(t){switch(t.parent.kind){case 262:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 260:case 257:return o(t);case 235:if(e.isFunctionBlock(t.parent))return o(t);case 292:return d(e.lastOrUndefined(t.parent.statements));case 263:var r=t.parent,n=e.lastOrUndefined(r.clauses);return n?d(e.lastOrUndefined(n.statements)):void 0;case 201:var i=t.parent;return d(e.lastOrUndefined(i.elements)||i);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var a=t.parent;return o(e.lastOrUndefined(a.properties)||a)}return d(t.parent)}}(r);case 23:return function(t){if(202===t.parent.kind){var r=t.parent;return o(e.lastOrUndefined(r.elements)||r)}if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var n=t.parent;return o(e.lastOrUndefined(n.elements)||n)}return d(t.parent)}(r);case 20:return function(e){return 240===e.parent.kind||208===e.parent.kind||209===e.parent.kind?l(e):212===e.parent.kind?u(e):d(e.parent)}(r);case 21:return function(e){switch(e.parent.kind){case 213:case 256:case 214:case 169:case 168:case 172:case 173:case 171:case 241:case 240:case 242:case 244:case 208:case 209:case 212:return l(e);default:return d(e.parent)}}(r);case 58:return function(t){return e.isFunctionLike(t.parent)||296===t.parent.kind||164===t.parent.kind?l(t):d(t.parent)}(r);case 31:case 29:return function(e){return 211===e.parent.kind?u(e):d(e.parent)}(r);case 115:return function(e){return 240===e.parent.kind?s(e,e.parent.expression):d(e.parent)}(r);case 91:case 83:case 96:return u(r);case 160:return function(e){return 244===e.parent.kind?u(e):d(e.parent)}(r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(r))return E(r);if((79===r.kind||225===r.kind||296===r.kind||297===r.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return o(r);if(221===r.kind){var i=r,a=i.left,_=i.operatorToken;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(a))return E(a);if(63===_.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent))return o(r);if(27===_.kind)return d(a)}if(e.isExpressionNode(r))switch(n.kind){case 240:return l(r);case 165:return d(r.parent);case 242:case 244:return o(r);case 221:if(27===r.parent.operatorToken.kind)return o(r);break;case 214:if(r.parent.body===r)return o(r)}switch(r.parent.kind){case 296:if(r.parent.name===r&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent.parent))return d(r.parent.initializer);break;case 211:if(r.parent.type===r)return u(r.parent.type);break;case 254:case 164:var p=r.parent,f=p.initializer,m=p.type;if(f===r||m===r||e.isAssignmentOperator(r.kind))return l(r);break;case 221:if(a=r.parent.left,e.isArrayLiteralOrObjectLiteralDestructuringPattern(a)&&r!==a)return l(r);break;default:if(e.isFunctionLike(r.parent)&&r.parent.type===r)return l(r)}return d(r.parent)}}var g,y,h,v;function b(r){return e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]===r?o(e.findPrecedingToken(r.pos,t,r.parent),r):o(r)}function x(r){if(243===r.parent.parent.kind)return d(r.parent.parent);var n=r.parent;return e.isBindingPattern(r.name)?T(r.name):r.initializer||e.hasSyntacticModifier(r,1)||244===n.parent.kind?b(r):e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]!==r?d(e.findPrecedingToken(r.pos,t,r.parent)):void 0}function S(t){return e.hasSyntacticModifier(t,1)||257===t.parent.kind&&171!==t.kind}function D(r){switch(r.parent.kind){case 261:if(1!==e.getModuleInstanceState(r.parent))return;case 241:case 239:case 243:return c(r.parent,r.statements[0]);case 242:case 244:return c(e.findPrecedingToken(r.pos,t,r.parent),r.statements[0])}return d(r.statements[0])}function C(e){if(255!==e.initializer.kind)return d(e.initializer);var t=e.initializer;return t.declarations.length>0?d(t.declarations[0]):void 0}function T(t){var r=e.forEach(t.elements,(function(e){return 227!==e.kind?e:void 0}));return r?d(r):203===t.parent.kind?o(t.parent):b(t.parent)}function E(t){e.Debug.assert(202!==t.kind&&201!==t.kind);var r=204===t.kind?t.elements:t.properties,n=e.forEach(r,(function(e){return 227!==e.kind?e:void 0}));return n?d(n):o(221===t.parent.kind?t.parent:t)}}}}(c||(c={})),function(e){e.transform=function(t,r,n){var i=[];n=e.fixupCompilerOptions(n,i);var a=e.isArray(t)?t:[t],o=e.transformNodes(void 0,void 0,e.factory,n,a,r,!0);return o.diagnostics=e.concatenate(o.diagnostics,i),o}}(c||(c={}));var c,l=function(){return this}();!function(e){function t(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message)}var i=function(){function t(e){this.scriptSnapshotShim=e}return t.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},t.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},t.prototype.getChangeRange=function(t){var r=t,n=this.scriptSnapshotShim.getChangeRange(r.scriptSnapshotShim);if(null===n)return null;var i=JSON.parse(n);return e.createTextChangeRange(e.createTextSpan(i.span.start,i.span.length),i.newLength)},t.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose()},t}(),a=function(){function t(t){var r=this;this.shimHost=t,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(t,n){var i=JSON.parse(r.shimHost.getModuleResolutionsForFile(n));return e.map(t,(function(t){var r=e.getProperty(i,t);return r?{resolvedFileName:r,extension:e.extensionFromPath(r),isExternalLibraryImport:!1}:void 0}))}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return r.shimHost.directoryExists(e)}),"getTypeReferenceDirectiveResolutionsForFile"in this.shimHost&&(this.resolveTypeReferenceDirectives=function(t,n){var i=JSON.parse(r.shimHost.getTypeReferenceDirectiveResolutionsForFile(n));return e.map(t,(function(t){return e.getProperty(i,e.isString(t)?t:t.fileName.toLowerCase())}))})}return t.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e)},t.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e)},t.prototype.error=function(e){this.shimHost.error(e)},t.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},t.prototype.getTypeRootsVersion=function(){return this.shimHost.getTypeRootsVersion?this.shimHost.getTypeRootsVersion():0},t.prototype.useCaseSensitiveFileNames=function(){return!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},t.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null===e||""===e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");var t=JSON.parse(e);return t.allowNonTsExtensions=!0,t},t.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return JSON.parse(e)},t.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new i(t)},t.prototype.getScriptKind=function(e){return"getScriptKind"in this.shimHost?this.shimHost.getScriptKind(e):0},t.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},t.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null===e||""===e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},t.prototype.getCancellationToken=function(){var t=this.shimHost.getCancellationToken();return new e.ThrottledCancellationToken(t)},t.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.readFile=function(e,t){return this.shimHost.readFile(e,t)},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t}();e.LanguageServiceShimHostAdapter=a;var c=function(){function t(e){var t=this;this.shimHost=e,this.useCaseSensitiveFileNames=!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames(),"directoryExists"in this.shimHost?this.directoryExists=function(e){return t.shimHost.directoryExists(e)}:this.directoryExists=void 0,"realpath"in this.shimHost?this.realpath=function(e){return t.shimHost.realpath(e)}:this.realpath=void 0}return t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t.prototype.readFile=function(e){return this.shimHost.readFile(e)},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t}();function u(e,t,r,n){return d(e,t,!0,r,n)}function d(r,n,i,a,o){try{var s=function(t,r,n,i){var a;i&&(t.log(r),a=e.timestamp());var o=n();if(i){var s=e.timestamp();if(t.log("".concat(r," completed in ").concat(s-a," msec")),e.isString(o)){var c=o;c.length>128&&(c=c.substring(0,128)+"..."),t.log(" result.length=".concat(c.length,", result='").concat(JSON.stringify(c),"'"))}}return o}(r,n,a,o);return i?JSON.stringify({result:s}):s}catch(i){return i instanceof e.OperationCanceledException?JSON.stringify({canceled:!0}):(t(r,i),i.description=n,JSON.stringify({error:i}))}}e.CoreServicesShimHostAdapter=c;var _=function(){function e(e){this.factory=e,e.registerShim(this)}return e.prototype.dispose=function(e){this.factory.unregisterShim(this)},e}();function p(t,r){return t.map((function(t){return function(t,r){return{message:e.flattenDiagnosticMessageText(t.messageText,r),start:t.start,length:t.length,category:e.diagnosticCategoryName(t),code:t.code,reportsUnnecessary:t.reportsUnnecessary,reportsDeprecated:t.reportsDeprecated}}(t,r)}))}e.realizeDiagnostics=p;var f=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.host=r,i.languageService=n,i.logPerformance=!1,i.logger=i.host,i}return s(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.dispose=function(e){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,l&&l.CollectGarbage&&(l.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,t.prototype.dispose.call(this,e)},r.prototype.refresh=function(e){this.forwardJSONCall("refresh(".concat(e,")"),(function(){return null}))},r.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",(function(){return e.languageService.cleanupSemanticCache(),null}))},r.prototype.realizeDiagnostics=function(t){return p(t,e.getNewLineOrDefaultFromHost(this.host))},r.prototype.getSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSyntacticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSemanticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getEncodedSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return m(i.languageService.getEncodedSyntacticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getEncodedSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return m(i.languageService.getEncodedSemanticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSuggestionDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSuggestionDiagnostics('".concat(e,"')"),(function(){return t.realizeDiagnostics(t.languageService.getSuggestionDiagnostics(e))}))},r.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",(function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)}))},r.prototype.getQuickInfoAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getQuickInfoAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getQuickInfoAtPosition(e,t)}))},r.prototype.getNameOrDottedNameSpan=function(e,t,r){var n=this;return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNameOrDottedNameSpan(e,t,r)}))},r.prototype.getBreakpointStatementAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBreakpointStatementAtPosition(e,t)}))},r.prototype.getSignatureHelpItems=function(e,t,r){var n=this;return this.forwardJSONCall("getSignatureHelpItems('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSignatureHelpItems(e,t,r)}))},r.prototype.getDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAtPosition(e,t)}))},r.prototype.getDefinitionAndBoundSpan=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAndBoundSpan(e,t)}))},r.prototype.getTypeDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getTypeDefinitionAtPosition(e,t)}))},r.prototype.getImplementationAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getImplementationAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getImplementationAtPosition(e,t)}))},r.prototype.getRenameInfo=function(e,t,r){var n=this;return this.forwardJSONCall("getRenameInfo('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getRenameInfo(e,t,r)}))},r.prototype.getSmartSelectionRange=function(e,t){var r=this;return this.forwardJSONCall("getSmartSelectionRange('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getSmartSelectionRange(e,t)}))},r.prototype.findRenameLocations=function(e,t,r,n,i){var a=this;return this.forwardJSONCall("findRenameLocations('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,", ").concat(i,")"),(function(){return a.languageService.findRenameLocations(e,t,r,n,i)}))},r.prototype.getBraceMatchingAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBraceMatchingAtPosition(e,t)}))},r.prototype.isValidBraceCompletionAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.isValidBraceCompletionAtPosition(e,t,r)}))},r.prototype.getSpanOfEnclosingComment=function(e,t,r){var n=this;return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSpanOfEnclosingComment(e,t,r)}))},r.prototype.getIndentationAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getIndentationAtPosition('".concat(e,"', ").concat(t,")"),(function(){var i=JSON.parse(r);return n.languageService.getIndentationAtPosition(e,t,i)}))},r.prototype.getReferencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getReferencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getReferencesAtPosition(e,t)}))},r.prototype.findReferences=function(e,t){var r=this;return this.forwardJSONCall("findReferences('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.findReferences(e,t)}))},r.prototype.getFileReferences=function(e){var t=this;return this.forwardJSONCall("getFileReferences('".concat(e,")"),(function(){return t.languageService.getFileReferences(e)}))},r.prototype.getOccurrencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getOccurrencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getOccurrencesAtPosition(e,t)}))},r.prototype.getDocumentHighlights=function(t,r,n){var i=this;return this.forwardJSONCall("getDocumentHighlights('".concat(t,"', ").concat(r,")"),(function(){var a=i.languageService.getDocumentHighlights(t,r,JSON.parse(n)),o=e.toFileNameLowerCase(e.normalizeSlashes(t));return e.filter(a,(function(t){return e.toFileNameLowerCase(e.normalizeSlashes(t.fileName))===o}))}))},r.prototype.getCompletionsAtPosition=function(e,t,r,n){var i=this;return this.forwardJSONCall("getCompletionsAtPosition('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getCompletionsAtPosition(e,t,r,n)}))},r.prototype.getCompletionEntryDetails=function(e,t,r,n,i,a,o){var s=this;return this.forwardJSONCall("getCompletionEntryDetails('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var c=void 0===n?void 0:JSON.parse(n);return s.languageService.getCompletionEntryDetails(e,t,r,c,i,a,o)}))},r.prototype.getFormattingEditsForRange=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsForRange(e,t,r,a)}))},r.prototype.getFormattingEditsForDocument=function(e,t){var r=this;return this.forwardJSONCall("getFormattingEditsForDocument('".concat(e,"')"),(function(){var n=JSON.parse(t);return r.languageService.getFormattingEditsForDocument(e,n)}))},r.prototype.getFormattingEditsAfterKeystroke=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsAfterKeystroke(e,t,r,a)}))},r.prototype.getDocCommentTemplateAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getDocCommentTemplateAtPosition(e,t,r)}))},r.prototype.getNavigateToItems=function(e,t,r){var n=this;return this.forwardJSONCall("getNavigateToItems('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNavigateToItems(e,t,r)}))},r.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('".concat(e,"')"),(function(){return t.languageService.getNavigationBarItems(e)}))},r.prototype.getNavigationTree=function(e){var t=this;return this.forwardJSONCall("getNavigationTree('".concat(e,"')"),(function(){return t.languageService.getNavigationTree(e)}))},r.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('".concat(e,"')"),(function(){return t.languageService.getOutliningSpans(e)}))},r.prototype.getTodoComments=function(e,t){var r=this;return this.forwardJSONCall("getTodoComments('".concat(e,"')"),(function(){return r.languageService.getTodoComments(e,JSON.parse(t))}))},r.prototype.prepareCallHierarchy=function(e,t){var r=this;return this.forwardJSONCall("prepareCallHierarchy('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.prepareCallHierarchy(e,t)}))},r.prototype.provideCallHierarchyIncomingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyIncomingCalls(e,t)}))},r.prototype.provideCallHierarchyOutgoingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyOutgoingCalls(e,t)}))},r.prototype.provideInlayHints=function(e,t,r){var n=this;return this.forwardJSONCall("provideInlayHints('".concat(e,"', '").concat(JSON.stringify(t),"', ").concat(JSON.stringify(r),")"),(function(){return n.languageService.provideInlayHints(e,t,r)}))},r.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('".concat(e,"')"),(function(){var r=t.languageService.getEmitOutput(e),i=r.diagnostics,a=o(r,["diagnostics"]);return n(n({},a),{diagnostics:t.realizeDiagnostics(i)})}))},r.prototype.getEmitOutputObject=function(e){var t=this;return d(this.logger,"getEmitOutput('".concat(e,"')"),!1,(function(){return t.languageService.getEmitOutput(e)}),this.logPerformance)},r.prototype.toggleLineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleLineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleLineComment(e,t)}))},r.prototype.toggleMultilineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleMultilineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleMultilineComment(e,t)}))},r.prototype.commentSelection=function(e,t){var r=this;return this.forwardJSONCall("commentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.commentSelection(e,t)}))},r.prototype.uncommentSelection=function(e,t){var r=this;return this.forwardJSONCall("uncommentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.uncommentSelection(e,t)}))},r}(_);function m(e){return{spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var g=function(t){function r(r,n){var i=t.call(this,r)||this;return i.logger=n,i.logPerformance=!1,i.classifier=e.createClassifier(),i}return s(r,t),r.prototype.getEncodedLexicalClassifications=function(e,t,r){var n=this;return void 0===r&&(r=!1),u(this.logger,"getEncodedLexicalClassifications",(function(){return m(n.classifier.getEncodedLexicalClassifications(e,t,r))}),this.logPerformance)},r.prototype.getClassificationsForLine=function(e,t,r){void 0===r&&(r=!1);for(var n=this.classifier.getClassificationsForLine(e,t,r),i="",a=0,o=n.entries;a=1&&arguments.length<=3?e.factory.createVariableDeclaration(t,void 0,r,n):e.Debug.fail("Argument count mismatch")}),t),e.updateVariableDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.updateVariableDeclaration(t,r,n,i,a):4===arguments.length?e.factory.updateVariableDeclaration(t,r,t.exclamationToken,n,i):e.Debug.fail("Argument count mismatch")}),t),e.createImportClause=e.Debug.deprecate((function(t,r,n){return void 0===n&&(n=!1),e.factory.createImportClause(n,t,r)}),t),e.updateImportClause=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateImportClause(t,i,r,n)}),t),e.createExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return void 0===a&&(a=!1),e.factory.createExportDeclaration(t,r,a,n,i)}),t),e.updateExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateExportDeclaration(t,r,n,o,i,a,t.assertClause)}),t),e.createJSDocParamTag=e.Debug.deprecate((function(t,r,n,i){return e.factory.createJSDocParameterTag(void 0,t,r,n,!1,i?e.factory.createNodeArray([e.factory.createJSDocText(i)]):void 0)}),t),e.createComma=e.Debug.deprecate((function(t,r){return e.factory.createComma(t,r)}),t),e.createLessThan=e.Debug.deprecate((function(t,r){return e.factory.createLessThan(t,r)}),t),e.createAssignment=e.Debug.deprecate((function(t,r){return e.factory.createAssignment(t,r)}),t),e.createStrictEquality=e.Debug.deprecate((function(t,r){return e.factory.createStrictEquality(t,r)}),t),e.createStrictInequality=e.Debug.deprecate((function(t,r){return e.factory.createStrictInequality(t,r)}),t),e.createAdd=e.Debug.deprecate((function(t,r){return e.factory.createAdd(t,r)}),t),e.createSubtract=e.Debug.deprecate((function(t,r){return e.factory.createSubtract(t,r)}),t),e.createLogicalAnd=e.Debug.deprecate((function(t,r){return e.factory.createLogicalAnd(t,r)}),t),e.createLogicalOr=e.Debug.deprecate((function(t,r){return e.factory.createLogicalOr(t,r)}),t),e.createPostfixIncrement=e.Debug.deprecate((function(t){return e.factory.createPostfixIncrement(t)}),t),e.createLogicalNot=e.Debug.deprecate((function(t){return e.factory.createLogicalNot(t)}),t),e.createNode=e.Debug.deprecate((function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),e.setTextRangePosEnd(305===t?e.parseBaseNodeFactory.createBaseSourceFileNode(t):79===t?e.parseBaseNodeFactory.createBaseIdentifierNode(t):80===t?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(t):e.isNodeKind(t)?e.parseBaseNodeFactory.createBaseNode(t):e.parseBaseNodeFactory.createBaseTokenNode(t),r,n)}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate((function(t){var r=e.factory.cloneNode(t);return e.setTextRange(r,t),e.setParent(r,t.parent),r}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."}),e.isTypeAssertion=e.Debug.deprecate((function(e){return 211===e.kind}),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."}),e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate((function(t){return e.isMemberName(t)}),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."})}(c||(c={}))}(ce);class de{constructor(e,t){this.name=e,this.code=t}static getLibraryFuncs(){let e={polarDecompose2D:"(A: ti.types.matrix) => {\n let x = A[0][0] + A[1][1];\n let y = A[1][0] - A[0][1];\n let scale = 1.0 / Math.sqrt(x * x + y * y);\n let c = x * scale;\n let s = y * scale;\n let r = [\n [c, -s],\n [s, c],\n ];\n return {\n U: r,\n P: ti.matmul(ti.transpose(r), A),\n };\n}",svd2D:"(A: ti.types.matrix) => {\n let RS = ti.polarDecompose2D(A);\n let R = RS.U;\n let S = RS.P;\n let c = 0.0;\n let s = 0.0;\n let s1 = 0.0;\n let s2 = 0.0;\n if (Math.abs(S[0][1]) < 1e-5) {\n c = 1.0;\n s = 0.0;\n s1 = S[0][0];\n s2 = S[1][1];\n } else {\n let tao = 0.5 * (S[0][0] - S[1][1]);\n let w = Math.sqrt(tao * tao + S[0][1] * S[0][1]);\n let t = 0.0;\n if (tao > 0) {\n t = S[0][1] / (tao + w);\n } else {\n t = S[0][1] / (tao - w);\n }\n c = 1 / Math.sqrt(t * t + 1);\n s = -t * c;\n s1 = c ** 2 * S[0][0] - 2 * c * s * S[0][1] + s ** 2 * S[1][1];\n s2 = s ** 2 * S[0][0] + 2 * c * s * S[0][1] + c ** 2 * S[1][1];\n }\n let zeros = [\n [0.0, 0.0],\n [0.0, 0.0],\n ];\n let result = {\n U: zeros,\n E: zeros,\n V: zeros,\n };\n if (s1 < s2) {\n let tmp = s1;\n s1 = s2;\n s2 = tmp;\n result.V = [\n [-s, c],\n [-c, -s],\n ];\n } else {\n result.V = [\n [c, s],\n [-s, c],\n ];\n }\n result.U = ti.matmul(R, result.V);\n result.E = [\n [s1, 0.0],\n [0.0, s2],\n ];\n return result;\n}",svd3D:"(A: ti.types.matrix) => {\n let a00 = A[0][0];\n let a01 = A[0][1];\n let a02 = A[0][2];\n let a10 = A[1][0];\n let a11 = A[1][1];\n let a12 = A[1][2];\n let a20 = A[2][0];\n let a21 = A[2][1];\n let a22 = A[2][2];\n\n let xffffffff = -1;\n\n //@ts-ignore\n let Ti = (x: any) => ti.i32(x);\n //@ts-ignore\n let int32 = (x: any) => ti.i32(x);\n let expr_select = (c: any, x: any, y: any) => {\n let result = x;\n if (!c) {\n result = y;\n }\n return result;\n };\n let svd_bitwise_or = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) | ti.bitcast_i32(f2));\n };\n let svd_bitwise_xor = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) ^ ti.bitcast_i32(f2));\n };\n let svd_bitwise_and = (f1: number, f2: number) => {\n return ti.bitcast_f32(ti.bitcast_i32(f1) & ti.bitcast_i32(f2));\n };\n\n let Four_Gamma_Squared = 5.82842712474619;\n let Sine_Pi_Over_Eight = 0.3826834323650897;\n let Cosine_Pi_Over_Eight = 0.9238795325112867;\n\n let Sfour_gamma_squared = 0.0;\n let Ssine_pi_over_eight = 0.0;\n let Scosine_pi_over_eight = 0.0;\n let Sone_half = 0.0;\n let Sone = 0.0;\n let Stiny_number = 0.0;\n let Ssmall_number = 0.0;\n let Sa11 = 0.0;\n let Sa21 = 0.0;\n let Sa31 = 0.0;\n let Sa12 = 0.0;\n let Sa22 = 0.0;\n let Sa32 = 0.0;\n let Sa13 = 0.0;\n let Sa23 = 0.0;\n let Sa33 = 0.0;\n let Sv11 = 0.0;\n let Sv21 = 0.0;\n let Sv31 = 0.0;\n let Sv12 = 0.0;\n let Sv22 = 0.0;\n let Sv32 = 0.0;\n let Sv13 = 0.0;\n let Sv23 = 0.0;\n let Sv33 = 0.0;\n let Su11 = 0.0;\n let Su21 = 0.0;\n let Su31 = 0.0;\n let Su12 = 0.0;\n let Su22 = 0.0;\n let Su32 = 0.0;\n let Su13 = 0.0;\n let Su23 = 0.0;\n let Su33 = 0.0;\n let Sc = 0.0;\n let Ss = 0.0;\n let Sch = 0.0;\n let Ssh = 0.0;\n let Stmp1 = 0.0;\n let Stmp2 = 0.0;\n let Stmp3 = 0.0;\n let Stmp4 = 0.0;\n let Stmp5 = 0.0;\n let Sqvs = 0.0;\n let Sqvvx = 0.0;\n let Sqvvy = 0.0;\n let Sqvvz = 0.0;\n let Ss11 = 0.0;\n let Ss21 = 0.0;\n let Ss31 = 0.0;\n let Ss22 = 0.0;\n let Ss32 = 0.0;\n let Ss33 = 0.0;\n Sfour_gamma_squared = Four_Gamma_Squared;\n Ssine_pi_over_eight = Sine_Pi_Over_Eight;\n Scosine_pi_over_eight = Cosine_Pi_Over_Eight;\n Sone_half = 0.5;\n Sone = 1.0;\n Stiny_number = 1e-20;\n Ssmall_number = 1e-12;\n Sa11 = a00;\n Sa21 = a10;\n Sa31 = a20;\n Sa12 = a01;\n Sa22 = a11;\n Sa32 = a21;\n Sa13 = a02;\n Sa23 = a12;\n Sa33 = a22;\n Sqvs = 1.0;\n Sqvvx = 0.0;\n Sqvvy = 0.0;\n Sqvvz = 0.0;\n Ss11 = Sa11 * Sa11;\n Stmp1 = Sa21 * Sa21;\n Ss11 = Stmp1 + Ss11;\n Stmp1 = Sa31 * Sa31;\n Ss11 = Stmp1 + Ss11;\n Ss21 = Sa12 * Sa11;\n Stmp1 = Sa22 * Sa21;\n Ss21 = Stmp1 + Ss21;\n Stmp1 = Sa32 * Sa31;\n Ss21 = Stmp1 + Ss21;\n Ss31 = Sa13 * Sa11;\n Stmp1 = Sa23 * Sa21;\n Ss31 = Stmp1 + Ss31;\n Stmp1 = Sa33 * Sa31;\n Ss31 = Stmp1 + Ss31;\n Ss22 = Sa12 * Sa12;\n Stmp1 = Sa22 * Sa22;\n Ss22 = Stmp1 + Ss22;\n Stmp1 = Sa32 * Sa32;\n Ss22 = Stmp1 + Ss22;\n Ss32 = Sa13 * Sa12;\n Stmp1 = Sa23 * Sa22;\n Ss32 = Stmp1 + Ss32;\n Stmp1 = Sa33 * Sa32;\n Ss32 = Stmp1 + Ss32;\n Ss33 = Sa13 * Sa13;\n Stmp1 = Sa23 * Sa23;\n Ss33 = Stmp1 + Ss33;\n Stmp1 = Sa33 * Sa33;\n Ss33 = Stmp1 + Ss33;\n for (let iter of ti.range(5)) {\n Ssh = Ss21 * Sone_half;\n Stmp5 = Ss11 - Ss22;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(ti.not(ti.bitcast_i32(Stmp1)), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss33 = Ss33 * Stmp3;\n Ss31 = Ss31 * Stmp3;\n Ss32 = Ss32 * Stmp3;\n Ss33 = Ss33 * Stmp3;\n Stmp1 = Ss * Ss31;\n Stmp2 = Ss * Ss32;\n Ss31 = Sc * Ss31;\n Ss32 = Sc * Ss32;\n Ss31 = Stmp2 + Ss31;\n Ss32 = Ss32 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss22 * Stmp2;\n Stmp3 = Ss11 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss11 = Ss11 * Stmp4;\n Ss22 = Ss22 * Stmp4;\n Ss11 = Ss11 + Stmp1;\n Ss22 = Ss22 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss21 + Ss21;\n Ss21 = Ss21 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss11 = Ss11 + Stmp2;\n Ss21 = Ss21 - Stmp5;\n Ss22 = Ss22 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvz = Sqvvz + Ssh;\n Sqvs = Sqvs - Stmp3;\n Sqvvx = Sqvvx + Stmp2;\n Sqvvy = Sqvvy - Stmp1;\n Ssh = Ss32 * Sone_half;\n Stmp5 = Ss22 - Ss33;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss11 = Ss11 * Stmp3;\n Ss21 = Ss21 * Stmp3;\n Ss31 = Ss31 * Stmp3;\n Ss11 = Ss11 * Stmp3;\n Stmp1 = Ss * Ss21;\n Stmp2 = Ss * Ss31;\n Ss21 = Sc * Ss21;\n Ss31 = Sc * Ss31;\n Ss21 = Stmp2 + Ss21;\n Ss31 = Ss31 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss33 * Stmp2;\n Stmp3 = Ss22 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss22 = Ss22 * Stmp4;\n Ss33 = Ss33 * Stmp4;\n Ss22 = Ss22 + Stmp1;\n Ss33 = Ss33 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss32 + Ss32;\n Ss32 = Ss32 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss22 = Ss22 + Stmp2;\n Ss32 = Ss32 - Stmp5;\n Ss33 = Ss33 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvx = Sqvvx + Ssh;\n Sqvs = Sqvs - Stmp1;\n Sqvvy = Sqvvy + Stmp3;\n Sqvvz = Sqvvz - Stmp2;\n Ssh = Ss31 * Sone_half;\n Stmp5 = Ss33 - Ss11;\n Stmp2 = Ssh * Ssh;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 >= Stiny_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Stmp1, Ssh);\n Sch = svd_bitwise_and(Stmp1, Stmp5);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sone);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Stmp3 = Stmp1 + Stmp2;\n Stmp4 = ti.rsqrt(Stmp3);\n Ssh = Stmp4 * Ssh;\n Sch = Stmp4 * Sch;\n Stmp1 = Sfour_gamma_squared * Stmp1;\n\n Stmp1 = ti.bitcast_f32(expr_select(Stmp2 <= Stmp1, xffffffff, 0));\n\n Stmp2 = svd_bitwise_and(Ssine_pi_over_eight, Stmp1);\n\n Ssh = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Ssh);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n\n Stmp2 = svd_bitwise_and(Scosine_pi_over_eight, Stmp1);\n\n Sch = svd_bitwise_and(~ti.bitcast_i32(Stmp1), Sch);\n Sch = svd_bitwise_or(Sch, Stmp2);\n Stmp1 = Ssh * Ssh;\n Stmp2 = Sch * Sch;\n Sc = Stmp2 - Stmp1;\n Ss = Sch * Ssh;\n Ss = Ss + Ss;\n Stmp3 = Stmp1 + Stmp2;\n Ss22 = Ss22 * Stmp3;\n Ss32 = Ss32 * Stmp3;\n Ss21 = Ss21 * Stmp3;\n Ss22 = Ss22 * Stmp3;\n Stmp1 = Ss * Ss32;\n Stmp2 = Ss * Ss21;\n Ss32 = Sc * Ss32;\n Ss21 = Sc * Ss21;\n Ss32 = Stmp2 + Ss32;\n Ss21 = Ss21 - Stmp1;\n Stmp2 = Ss * Ss;\n Stmp1 = Ss11 * Stmp2;\n Stmp3 = Ss33 * Stmp2;\n Stmp4 = Sc * Sc;\n Ss33 = Ss33 * Stmp4;\n Ss11 = Ss11 * Stmp4;\n Ss33 = Ss33 + Stmp1;\n Ss11 = Ss11 + Stmp3;\n Stmp4 = Stmp4 - Stmp2;\n Stmp2 = Ss31 + Ss31;\n Ss31 = Ss31 * Stmp4;\n Stmp4 = Sc * Ss;\n Stmp2 = Stmp2 * Stmp4;\n Stmp5 = Stmp5 * Stmp4;\n Ss33 = Ss33 + Stmp2;\n Ss31 = Ss31 - Stmp5;\n Ss11 = Ss11 - Stmp2;\n Stmp1 = Ssh * Sqvvx;\n Stmp2 = Ssh * Sqvvy;\n Stmp3 = Ssh * Sqvvz;\n Ssh = Ssh * Sqvs;\n Sqvs = Sch * Sqvs;\n Sqvvx = Sch * Sqvvx;\n Sqvvy = Sch * Sqvvy;\n Sqvvz = Sch * Sqvvz;\n Sqvvy = Sqvvy + Ssh;\n Sqvs = Sqvs - Stmp2;\n Sqvvz = Sqvvz + Stmp1;\n Sqvvx = Sqvvx - Stmp3;\n }\n Stmp2 = Sqvs * Sqvs;\n Stmp1 = Sqvvx * Sqvvx;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = Sqvvy * Sqvvy;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = Sqvvz * Sqvvz;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sqvs = Sqvs * Stmp1;\n Sqvvx = Sqvvx * Stmp1;\n Sqvvy = Sqvvy * Stmp1;\n Sqvvz = Sqvvz * Stmp1;\n Stmp1 = Sqvvx * Sqvvx;\n Stmp2 = Sqvvy * Sqvvy;\n Stmp3 = Sqvvz * Sqvvz;\n Sv11 = Sqvs * Sqvs;\n Sv22 = Sv11 - Stmp1;\n Sv33 = Sv22 - Stmp2;\n Sv33 = Sv33 + Stmp3;\n Sv22 = Sv22 + Stmp2;\n Sv22 = Sv22 - Stmp3;\n Sv11 = Sv11 + Stmp1;\n Sv11 = Sv11 - Stmp2;\n Sv11 = Sv11 - Stmp3;\n Stmp1 = Sqvvx + Sqvvx;\n Stmp2 = Sqvvy + Sqvvy;\n Stmp3 = Sqvvz + Sqvvz;\n Sv32 = Sqvs * Stmp1;\n Sv13 = Sqvs * Stmp2;\n Sv21 = Sqvs * Stmp3;\n Stmp1 = Sqvvy * Stmp1;\n Stmp2 = Sqvvz * Stmp2;\n Stmp3 = Sqvvx * Stmp3;\n Sv12 = Stmp1 - Sv21;\n Sv23 = Stmp2 - Sv32;\n Sv31 = Stmp3 - Sv13;\n Sv21 = Stmp1 + Sv21;\n Sv32 = Stmp2 + Sv32;\n Sv13 = Stmp3 + Sv13;\n Stmp2 = Sa12;\n Stmp3 = Sa13;\n Sa12 = Sv12 * Sa11;\n Sa13 = Sv13 * Sa11;\n Sa11 = Sv11 * Sa11;\n Stmp1 = Sv21 * Stmp2;\n Sa11 = Sa11 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa11 = Sa11 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa12 = Sa12 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa12 = Sa12 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa13 = Sa13 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa13 = Sa13 + Stmp1;\n Stmp2 = Sa22;\n Stmp3 = Sa23;\n Sa22 = Sv12 * Sa21;\n Sa23 = Sv13 * Sa21;\n Sa21 = Sv11 * Sa21;\n Stmp1 = Sv21 * Stmp2;\n Sa21 = Sa21 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa21 = Sa21 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa22 = Sa22 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa22 = Sa22 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa23 = Sa23 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa23 = Sa23 + Stmp1;\n Stmp2 = Sa32;\n Stmp3 = Sa33;\n Sa32 = Sv12 * Sa31;\n Sa33 = Sv13 * Sa31;\n Sa31 = Sv11 * Sa31;\n Stmp1 = Sv21 * Stmp2;\n Sa31 = Sa31 + Stmp1;\n Stmp1 = Sv31 * Stmp3;\n Sa31 = Sa31 + Stmp1;\n Stmp1 = Sv22 * Stmp2;\n Sa32 = Sa32 + Stmp1;\n Stmp1 = Sv32 * Stmp3;\n Sa32 = Sa32 + Stmp1;\n Stmp1 = Sv23 * Stmp2;\n Sa33 = Sa33 + Stmp1;\n Stmp1 = Sv33 * Stmp3;\n Sa33 = Sa33 + Stmp1;\n Stmp1 = Sa11 * Sa11;\n Stmp4 = Sa21 * Sa21;\n Stmp1 = Stmp1 + Stmp4;\n Stmp4 = Sa31 * Sa31;\n Stmp1 = Stmp1 + Stmp4;\n Stmp2 = Sa12 * Sa12;\n Stmp4 = Sa22 * Sa22;\n Stmp2 = Stmp2 + Stmp4;\n Stmp4 = Sa32 * Sa32;\n Stmp2 = Stmp2 + Stmp4;\n Stmp3 = Sa13 * Sa13;\n Stmp4 = Sa23 * Sa23;\n Stmp3 = Stmp3 + Stmp4;\n Stmp4 = Sa33 * Sa33;\n Stmp3 = Stmp3 + Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp1 < Stmp2, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa11, Sa12);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa11 = svd_bitwise_xor(Sa11, Stmp5);\n Sa12 = svd_bitwise_xor(Sa12, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa21, Sa22);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa21 = svd_bitwise_xor(Sa21, Stmp5);\n Sa22 = svd_bitwise_xor(Sa22, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa31, Sa32);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa31 = svd_bitwise_xor(Sa31, Stmp5);\n Sa32 = svd_bitwise_xor(Sa32, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv11, Sv12);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv11 = svd_bitwise_xor(Sv11, Stmp5);\n Sv12 = svd_bitwise_xor(Sv12, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv21, Sv22);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv21 = svd_bitwise_xor(Sv21, Stmp5);\n Sv22 = svd_bitwise_xor(Sv22, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv31, Sv32);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv31 = svd_bitwise_xor(Sv31, Stmp5);\n Sv32 = svd_bitwise_xor(Sv32, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp1, Stmp2);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp1 = svd_bitwise_xor(Stmp1, Stmp5);\n Stmp2 = svd_bitwise_xor(Stmp2, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa12 = Sa12 * Stmp4;\n Sa22 = Sa22 * Stmp4;\n Sa32 = Sa32 * Stmp4;\n Sv12 = Sv12 * Stmp4;\n Sv22 = Sv22 * Stmp4;\n Sv32 = Sv32 * Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp1 < Stmp3, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa11, Sa13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa11 = svd_bitwise_xor(Sa11, Stmp5);\n Sa13 = svd_bitwise_xor(Sa13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa21, Sa23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa21 = svd_bitwise_xor(Sa21, Stmp5);\n Sa23 = svd_bitwise_xor(Sa23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa31, Sa33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa31 = svd_bitwise_xor(Sa31, Stmp5);\n Sa33 = svd_bitwise_xor(Sa33, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv11, Sv13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv11 = svd_bitwise_xor(Sv11, Stmp5);\n Sv13 = svd_bitwise_xor(Sv13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv21, Sv23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv21 = svd_bitwise_xor(Sv21, Stmp5);\n Sv23 = svd_bitwise_xor(Sv23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv31, Sv33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv31 = svd_bitwise_xor(Sv31, Stmp5);\n Sv33 = svd_bitwise_xor(Sv33, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp1, Stmp3);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp1 = svd_bitwise_xor(Stmp1, Stmp5);\n Stmp3 = svd_bitwise_xor(Stmp3, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa11 = Sa11 * Stmp4;\n Sa21 = Sa21 * Stmp4;\n Sa31 = Sa31 * Stmp4;\n Sv11 = Sv11 * Stmp4;\n Sv21 = Sv21 * Stmp4;\n Sv31 = Sv31 * Stmp4;\n\n Stmp4 = ti.bitcast_f32(expr_select(Stmp2 < Stmp3, xffffffff, 0));\n Stmp5 = svd_bitwise_xor(Sa12, Sa13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa12 = svd_bitwise_xor(Sa12, Stmp5);\n Sa13 = svd_bitwise_xor(Sa13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa22, Sa23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa22 = svd_bitwise_xor(Sa22, Stmp5);\n Sa23 = svd_bitwise_xor(Sa23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sa32, Sa33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sa32 = svd_bitwise_xor(Sa32, Stmp5);\n Sa33 = svd_bitwise_xor(Sa33, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv12, Sv13);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv12 = svd_bitwise_xor(Sv12, Stmp5);\n Sv13 = svd_bitwise_xor(Sv13, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv22, Sv23);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv22 = svd_bitwise_xor(Sv22, Stmp5);\n Sv23 = svd_bitwise_xor(Sv23, Stmp5);\n Stmp5 = svd_bitwise_xor(Sv32, Sv33);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Sv32 = svd_bitwise_xor(Sv32, Stmp5);\n Sv33 = svd_bitwise_xor(Sv33, Stmp5);\n Stmp5 = svd_bitwise_xor(Stmp2, Stmp3);\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp2 = svd_bitwise_xor(Stmp2, Stmp5);\n Stmp3 = svd_bitwise_xor(Stmp3, Stmp5);\n Stmp5 = -2.0;\n Stmp5 = svd_bitwise_and(Stmp5, Stmp4);\n Stmp4 = 1.0;\n Stmp4 = Stmp4 + Stmp5;\n Sa13 = Sa13 * Stmp4;\n Sa23 = Sa23 * Stmp4;\n Sa33 = Sa33 * Stmp4;\n Sv13 = Sv13 * Stmp4;\n Sv23 = Sv23 * Stmp4;\n Sv33 = Sv33 * Stmp4;\n Su11 = 1.0;\n Su21 = 0.0;\n Su31 = 0.0;\n Su12 = 0.0;\n Su22 = 1.0;\n Su32 = 0.0;\n Su13 = 0.0;\n Su23 = 0.0;\n Su33 = 1.0;\n Ssh = Sa21 * Sa21;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa21);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa11;\n Sch = Math.max(Sch, Sa11);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa11 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa11;\n Stmp2 = Ss * Sa21;\n Sa11 = Sc * Sa11;\n Sa21 = Sc * Sa21;\n Sa11 = Sa11 + Stmp2;\n Sa21 = Sa21 - Stmp1;\n Stmp1 = Ss * Sa12;\n Stmp2 = Ss * Sa22;\n Sa12 = Sc * Sa12;\n Sa22 = Sc * Sa22;\n Sa12 = Sa12 + Stmp2;\n Sa22 = Sa22 - Stmp1;\n Stmp1 = Ss * Sa13;\n Stmp2 = Ss * Sa23;\n Sa13 = Sc * Sa13;\n Sa23 = Sc * Sa23;\n Sa13 = Sa13 + Stmp2;\n Sa23 = Sa23 - Stmp1;\n Stmp1 = Ss * Su11;\n Stmp2 = Ss * Su12;\n Su11 = Sc * Su11;\n Su12 = Sc * Su12;\n Su11 = Su11 + Stmp2;\n Su12 = Su12 - Stmp1;\n Stmp1 = Ss * Su21;\n Stmp2 = Ss * Su22;\n Su21 = Sc * Su21;\n Su22 = Sc * Su22;\n Su21 = Su21 + Stmp2;\n Su22 = Su22 - Stmp1;\n Stmp1 = Ss * Su31;\n Stmp2 = Ss * Su32;\n Su31 = Sc * Su31;\n Su32 = Sc * Su32;\n Su31 = Su31 + Stmp2;\n Su32 = Su32 - Stmp1;\n Ssh = Sa31 * Sa31;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa31);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa11;\n Sch = Math.max(Sch, Sa11);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa11 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa11;\n Stmp2 = Ss * Sa31;\n Sa11 = Sc * Sa11;\n Sa31 = Sc * Sa31;\n Sa11 = Sa11 + Stmp2;\n Sa31 = Sa31 - Stmp1;\n Stmp1 = Ss * Sa12;\n Stmp2 = Ss * Sa32;\n Sa12 = Sc * Sa12;\n Sa32 = Sc * Sa32;\n Sa12 = Sa12 + Stmp2;\n Sa32 = Sa32 - Stmp1;\n Stmp1 = Ss * Sa13;\n Stmp2 = Ss * Sa33;\n Sa13 = Sc * Sa13;\n Sa33 = Sc * Sa33;\n Sa13 = Sa13 + Stmp2;\n Sa33 = Sa33 - Stmp1;\n Stmp1 = Ss * Su11;\n Stmp2 = Ss * Su13;\n Su11 = Sc * Su11;\n Su13 = Sc * Su13;\n Su11 = Su11 + Stmp2;\n Su13 = Su13 - Stmp1;\n Stmp1 = Ss * Su21;\n Stmp2 = Ss * Su23;\n Su21 = Sc * Su21;\n Su23 = Sc * Su23;\n Su21 = Su21 + Stmp2;\n Su23 = Su23 - Stmp1;\n Stmp1 = Ss * Su31;\n Stmp2 = Ss * Su33;\n Su31 = Sc * Su31;\n Su33 = Sc * Su33;\n Su31 = Su31 + Stmp2;\n Su33 = Su33 - Stmp1;\n Ssh = Sa32 * Sa32;\n\n Ssh = ti.bitcast_f32(expr_select(Ssh >= Ssmall_number, xffffffff, 0));\n Ssh = svd_bitwise_and(Ssh, Sa32);\n Stmp5 = 0.0;\n Sch = Stmp5 - Sa22;\n Sch = Math.max(Sch, Sa22);\n Sch = Math.max(Sch, Ssmall_number);\n\n Stmp5 = ti.bitcast_f32(expr_select(Sa22 >= Stmp5, xffffffff, 0));\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Stmp1 = Stmp1 * Stmp2;\n Sch = Sch + Stmp1;\n\n Stmp1 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Ssh);\n\n Stmp2 = svd_bitwise_and(~ti.bitcast_i32(Stmp5), Sch);\n Sch = svd_bitwise_and(Stmp5, Sch);\n Ssh = svd_bitwise_and(Stmp5, Ssh);\n Sch = svd_bitwise_or(Sch, Stmp1);\n Ssh = svd_bitwise_or(Ssh, Stmp2);\n Stmp1 = Sch * Sch;\n Stmp2 = Ssh * Ssh;\n Stmp2 = Stmp1 + Stmp2;\n Stmp1 = ti.rsqrt(Stmp2);\n Stmp4 = Stmp1 * Sone_half;\n Stmp3 = Stmp1 * Stmp4;\n Stmp3 = Stmp1 * Stmp3;\n Stmp3 = Stmp2 * Stmp3;\n Stmp1 = Stmp1 + Stmp4;\n Stmp1 = Stmp1 - Stmp3;\n Sch = Sch * Stmp1;\n Ssh = Ssh * Stmp1;\n Sc = Sch * Sch;\n Ss = Ssh * Ssh;\n Sc = Sc - Ss;\n Ss = Ssh * Sch;\n Ss = Ss + Ss;\n Stmp1 = Ss * Sa21;\n Stmp2 = Ss * Sa31;\n Sa21 = Sc * Sa21;\n Sa31 = Sc * Sa31;\n Sa21 = Sa21 + Stmp2;\n Sa31 = Sa31 - Stmp1;\n Stmp1 = Ss * Sa22;\n Stmp2 = Ss * Sa32;\n Sa22 = Sc * Sa22;\n Sa32 = Sc * Sa32;\n Sa22 = Sa22 + Stmp2;\n Sa32 = Sa32 - Stmp1;\n Stmp1 = Ss * Sa23;\n Stmp2 = Ss * Sa33;\n Sa23 = Sc * Sa23;\n Sa33 = Sc * Sa33;\n Sa23 = Sa23 + Stmp2;\n Sa33 = Sa33 - Stmp1;\n Stmp1 = Ss * Su12;\n Stmp2 = Ss * Su13;\n Su12 = Sc * Su12;\n Su13 = Sc * Su13;\n Su12 = Su12 + Stmp2;\n Su13 = Su13 - Stmp1;\n Stmp1 = Ss * Su22;\n Stmp2 = Ss * Su23;\n Su22 = Sc * Su22;\n Su23 = Sc * Su23;\n Su22 = Su22 + Stmp2;\n Su23 = Su23 - Stmp1;\n Stmp1 = Ss * Su32;\n Stmp2 = Ss * Su33;\n Su32 = Sc * Su32;\n Su33 = Sc * Su33;\n Su32 = Su32 + Stmp2;\n Su33 = Su33 - Stmp1;\n\n return {\n U: [\n [Su11, Su12, Su13],\n [Su21, Su22, Su23],\n [Su31, Su32, Su33],\n ],\n V: [\n [Sv11, Sv12, Sv13],\n [Sv21, Sv22, Sv23],\n [Sv31, Sv32, Sv33],\n ],\n E: [\n [Sa11, 0.0, 0.0],\n [0.0, Sa22, 0.0],\n [0.0, 0.0, Sa33],\n ],\n };\n}",lookAt:"(eye: ti.types.vector, center: ti.types.vector, up: ti.types.vector) => {\n let z = ti.normalized(eye - center);\n let x = ti.normalized(ti.cross(up, z));\n let y = ti.normalized(ti.cross(z, x));\n let result = [x.concat([-ti.dot(x, eye)]), y.concat([-ti.dot(y, eye)]), z.concat([-ti.dot(z, eye)]), [0, 0, 0, 1]];\n return result;\n}",perspective:"(fovy: number, aspect: number, zNear: number, zFar: number) => {\n let rad = (fovy * Math.PI) / 180.0;\n let tanHalfFovy = Math.tan(rad / 2.0);\n\n let zero4 = [0.0, 0.0, 0.0, 0.0];\n let result = [zero4, zero4, zero4, zero4];\n\n result[0][0] = 1.0 / (aspect * tanHalfFovy);\n result[1][1] = 1.0 / tanHalfFovy;\n result[2][2] = zFar / (zNear - zFar);\n result[3][2] = -1.0;\n result[2][3] = (zFar * zNear) / (zNear - zFar);\n return result;\n}",ortho:"(left: number, right: number, bottom: number, top: number, zNear: number, zFar: number) => {\n let zero4 = [0.0, 0.0, 0.0, 0.0];\n let result = [zero4, zero4, zero4, zero4];\n result[0][0] = 2.0 / (right - left);\n result[1][1] = 2.0 / (top - bottom);\n result[2][2] = -1.0 / (zFar - zNear);\n result[0][3] = -(right + left) / (right - left);\n result[1][3] = -(top + bottom) / (top - bottom);\n result[2][3] = (-zNear * 2.0) / (zFar - zNear);\n result[3][3] = 1.0;\n return result;\n}",inverse:"(m: ti.types.matrix) => {\n let det =\n m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) -\n m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) +\n m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\n\n let invdet = 1 / det;\n\n let minv = [\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0],\n ];\n minv[0][0] = (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * invdet;\n minv[0][1] = (m[0][2] * m[2][1] - m[0][1] * m[2][2]) * invdet;\n minv[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) * invdet;\n minv[1][0] = (m[1][2] * m[2][0] - m[1][0] * m[2][2]) * invdet;\n minv[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) * invdet;\n minv[1][2] = (m[1][0] * m[0][2] - m[0][0] * m[1][2]) * invdet;\n minv[2][0] = (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * invdet;\n minv[2][1] = (m[2][0] * m[0][1] - m[0][0] * m[2][1]) * invdet;\n minv[2][2] = (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * invdet;\n return minv;\n}",rotateAxisAngle:"(axis: ti.types.vector, angle: number) => {\n let a = angle;\n let c = Math.cos(a);\n let s = Math.sin(a);\n let temp: ti.types.vector = (1.0 - c) * axis;\n\n let m = [\n [1.0, 0.0, 0.0, 0.0],\n [0.0, 1.0, 0.0, 0.0],\n [0.0, 0.0, 1.0, 0.0],\n [0.0, 0.0, 0.0, 1.0],\n ];\n m[0][0] = c + temp[0] * axis[0];\n m[1][0] = temp[0] * axis[1] + s * axis[2];\n m[2][0] = temp[0] * axis[2] - s * axis[1];\n\n m[0][1] = temp[1] * axis[0] - s * axis[2];\n m[1][1] = c + temp[1] * axis[1];\n m[2][1] = temp[1] * axis[2] + s * axis[0];\n\n m[0][2] = temp[2] * axis[0] + s * axis[1];\n m[1][2] = temp[2] * axis[1] - s * axis[0];\n m[2][2] = c + temp[2] * axis[2];\n return m;\n}",translate:"(t: ti.types.vector) => {\n return [\n [1.0, 0.0, 0.0, t[0]],\n [0.0, 1.0, 0.0, t[1]],\n [0.0, 0.0, 1.0, t[2]],\n [0.0, 0.0, 0.0, 1.0],\n ];\n}",scale:"(t: ti.types.vector) => {\n return [\n [t[0], 0.0, 0.0, 0.0],\n [0.0, t[1], 0.0, 0.0],\n [0.0, 0.0, t[2], 0.0],\n [0.0, 0.0, 0.0, 1.0],\n ];\n}"},t=new Map;for(let r in e)t.set(r,new de(r,e[r].toString()));return t}}class _e{constructor(e,t=[],r=[]){this.stmts=t,this.compileTimeConstants=r,this.hostSideValue=void 0,this.type_=e}getType(){return this.type_}isCompileTimeConstant(){return null!==this.compileTimeConstants&&this.compileTimeConstants.length===this.stmts.length}}class pe{static makeScalar(e,t){return new _e(new u(t),[e],[])}static makeConstantScalar(e,t,r){return new _e(new u(r),[t],[e])}static getVectorComponents(e){let r,n;if(c(h.isValueOrPointerOfCategory(e.getType(),t.Vector)),e.getType().getCategory()===t.Pointer){let t=e.getType();r=h.getPrimitiveType(t.getValueType()),n=new u(r),n=new p(n,t.getIsGlobal())}else r=h.getPrimitiveType(e.getType()),n=new u(r);let i=[];for(let t=0;t0);for(let r of e)c(h.isValueOrPointerOfCategory(r.getType(),t.Scalar));if(e[0].getType().getCategory()===t.Pointer){let t=e[0].getType(),i=h.getPrimitiveType(t.getValueType());for(let t of e){let e=t.getType();c(h.getPrimitiveType(e.getValueType())===i)}r=new d(i,n),r=new p(r,t.getIsGlobal())}else{let t=h.getPrimitiveType(e[0].getType());for(let r of e)c(h.getPrimitiveType(r.getType())===t);r=new d(t,n)}let i=new _e(r,[],[]),a=!0;for(let t of e)a&&(a=t.isCompileTimeConstant());for(let t of e)i.stmts.push(t.stmts[0]),a&&i.compileTimeConstants.push(t.compileTimeConstants[0]);return i}static makeMatrixFromVectorsAsRows(e){let r,n=e.length;c(n>0);for(let r of e)c(h.isValueOrPointerOfCategory(r.getType(),t.Vector));if(e[0].getType().getCategory()===t.Pointer){let t=e[0].getType(),i=h.getPrimitiveType(t.getValueType());for(let t of e){let e=t.getType();c(h.getPrimitiveType(e.getValueType())===i)}let a=t.getValueType().getNumRows();for(let t of e){c(t.getType().getValueType().getNumRows()===a)}r=new _(i,n,a),r=new p(r,t.getIsGlobal())}else{let t=h.getPrimitiveType(e[0].getType());for(let r of e)c(h.getPrimitiveType(r.getType())===t);let i=e[0].getType().getNumRows();for(let t of e)c(t.getType().getNumRows()===i);r=new _(t,n,i)}let i=new _e(r,[],[]),a=!0;for(let t of e)a&&(a=t.isCompileTimeConstant());for(let t of e)for(let e=0;ee+t)),new mt("add",r,!0,!0,me.add,((e,t)=>e+t)),new mt("-",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("sub",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("*",r,!0,!0,me.mul,((e,t)=>e-t)),new mt("mul",r,!0,!0,me.sub,((e,t)=>e-t)),new mt("**",r,!0,!0,me.pow,((e,t)=>Math.pow(e,t))),new mt("%",r,!0,!0,me.mod,((e,t)=>e%t)),new mt("<",r,!0,!0,me.cmp_lt,((e,t)=>Number(e",r,!0,!0,me.cmp_gt,((e,t)=>Number(e>t))),new mt(">=",r,!0,!0,me.cmp_ge,((e,t)=>Number(e>=t))),new mt("==",r,!0,!0,me.cmp_eq,((e,t)=>Number(e===t))),new mt("!=",r,!0,!0,me.cmp_ne,((e,t)=>Number(e!==t))),new mt("===",r,!0,!0,me.cmp_eq,((e,t)=>Number(e===t))),new mt("!==",r,!0,!0,me.cmp_ne,((e,t)=>Number(e!==t))),new mt("&",r,!0,!0,me.bit_and,((e,t)=>e&t)),new mt("&&",r,!1,!1,me.bit_and,((e,t)=>e&t)),new mt("|",r,!0,!0,me.bit_or,((e,t)=>e&t)),new mt("||",r,!1,!1,me.bit_or,((e,t)=>e&t)),new mt("^",r,!0,!0,me.bit_xor,((e,t)=>e&t)),new mt("/",r,!0,!0,me.truediv,((e,t)=>e/t)),new mt("div",r,!0,!0,me.truediv,((e,t)=>e/t)),new mt("<<",r,!1,!1,me.bit_shl),new mt(">>>",r,!1,!1,me.bit_shr),new mt("max",r,!0,!0,me.max,((e,t)=>Math.max(e,t))),new mt("min",r,!0,!0,me.min,((e,t)=>Math.min(e,t))),new mt("pow",r,!0,!0,me.pow,((e,t)=>Math.pow(e,t))),new mt("atan2",r,!0,!0,me.atan2,((e,t)=>Math.atan2(e,t))),new ft("sin",r,ge.sin),new ft("cos",r,ge.cos),new ft("asin",r,ge.asin),new ft("acos",r,ge.acos),new ft("tan",r,ge.tan),new ft("tanh",r,ge.tanh),new ft("exp",r,ge.exp),new ft("log",r,ge.log),new ft("neg",r,ge.neg,(e=>-e)),new ft("not",r,ge.bit_not),new ft("logical_not",r,ge.logic_not),new ft("abs",r,ge.abs),new ft("floor",r,ge.floor),new ft("sgn",r,ge.sgn),new ft("sqrt",r,ge.sqrt),new ft("rsqrt",r,ge.rsqrt),new ft("i32",r,ge.cast_i32_value,(e=>Math.floor(e))),new ft("f32",r,ge.cast_f32_value,(e=>e)),new ft("bitcast_f32",r,ge.cast_f32_bits,(e=>e)),new ft("bitcast_i32",r,ge.cast_i32_bits,(e=>e)),new pt("random",new u(e.f32),(()=>new _e(new u(e.f32),[r.create_rand(e.f32)],[])))];for(let e of i)n.set(e.name,e);let a=new gt("=",2,(r=>{if(2!==r.length)return v.createError("what??");if(r[0].getType().getCategory()!==t.Pointer)return v.createError("expecting left hand side of assignment to be an lvalue");let n=r[0].getType(),i=r[1].getType();if(h.isTensorType(n.getValueType())&&h.isTensorType(i)){let r=h.getPrimitiveType(n.getValueType()),a=h.getPrimitiveType(i);return r===e.i32&&a===e.f32?v.createError("storing f32 into a i32 local variable."):h.tensorTypeShapeMatch(n.getValueType(),i)||i.getCategory()===t.Scalar?v.createNoError():v.createError("Shape mismatch in assignment")}return n.getValueType().getCategory()===t.Struct&&i.getCategory()===t.Struct?(n.getValueType().equals(i)||v.createError("struct type mismatch"),v.createNoError()):v.createError("invalid assignment")}),(i=>{let a=i[0].getType(),o=i[1].getType(),l=(e,t)=>{switch(e.getKind()){case fe.GlobalPtrStmt:return r.create_global_store(e,t);case fe.GlobalTemporaryStmt:return r.create_global_temporary_store(e,t);case fe.AllocaStmt:return r.create_local_store(e,t);default:s("assignment failed: not a pointer",i)}};if(h.isTensorType(a.getValueType())&&h.isTensorType(i[1].getType())){let r=h.getPrimitiveType(a.getValueType()),u=h.getPrimitiveType(o);if(r===e.f32&&u===e.i32&&(i[1]=n.get("f32").apply([i[1]])),h.tensorTypeShapeMatch(a.getValueType(),o)){c(i[0].stmts.length===i[1].stmts.length,"[Compiler bug]","Expecting stmts.length to match");for(let e=0;e1===e.length&&e[0].getType().getCategory()===t.Pointer?v.createNoError():v.createError("expecting pointer type")),(e=>{let t=e[0].getType().getValueType(),n=new _e(t,[]);for(let t=0;t{if(2!==e.length)return v.createError("expecting 2 values being");let r=e[0],n=e[1],i=r.getType(),a=n.getType();if(!h.isTensorType(i)||!h.isTensorType(a))return v.createError("Only scalar/vector/matrix types can be grouped together");let o=i.getCategory(),s=a.getCategory();if(o===t.Scalar&&s===t.Scalar)return v.createNoError();if(o===t.Vector&&s===t.Scalar)return v.createNoError();if(o===t.Vector&&s===t.Vector){let e=a;return i.getNumRows()!==e.getNumRows()?v.createError("vectors with different number of rows cannot be grouped together"):v.createNoError()}if(o===t.Matrix&&s===t.Vector){let e=a;return i.getNumCols()!==e.getNumRows()?v.createError("cannot append to a matrix a vector whose number of rows don't match"):v.createNoError()}return v.createError("invalid grouping")}),(r=>{let i=r[0],a=r[1],o=i.getType(),s=a.getType(),c=h.getPrimitiveType(o),l=h.getPrimitiveType(s);(c===e.f32||l===e.f32)&&(i=n.get("f32").apply([i]),a=n.get("f32").apply([a]));let u=o.getCategory(),d=s.getCategory();return u===t.Scalar&&d===t.Scalar?pe.makeVectorFromScalars([i,a]):u===t.Vector&&d===t.Scalar?pe.addScalarToVector(i,a):u===t.Vector&&d===t.Vector?pe.makeMatrixFromVectorsAsRows([i,a]):u===t.Matrix&&d===t.Vector?pe.addRowVectorToMatrix(i,a):i})),d=new gt("concat",2,(e=>{if(2!==e.length)return v.createError("can only concat among two values");let r=e[0],n=e[1],i=r.getType(),a=n.getType(),o=i.getCategory(),s=a.getCategory();if(o===t.Vector&&s===t.Vector)return v.createNoError();if(o===t.Matrix&&s===t.Matrix){let e=a;return i.getNumCols()!==e.getNumCols()?v.createError("cannot concat matrices with different amount of columns"):v.createNoError()}return v.createError("cannot only concat two vectors or two matrices")}),(r=>{let i=r[0],a=r[1],o=i.getType(),s=a.getType(),c=o.getCategory(),l=s.getCategory(),u=h.getPrimitiveType(o),d=h.getPrimitiveType(s);return(u===e.f32||d===e.f32)&&(i=n.get("f32").apply([i]),a=n.get("f32").apply([a])),c===t.Vector&&l===t.Vector?pe.concatVectors(i,a):c===t.Matrix&&l===t.Matrix?pe.concatMatrices(i,a):i})),_=new gt("len",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(t=>{let n=t[0].getType().getNumRows();return pe.makeConstantScalar(n,r.get_int32(n),e.i32)})),p=new gt("length",1,(e=>_.checkType(e)),(e=>_.apply(e))),f=new gt("sum",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(t=>{let i=pe.makeConstantScalar(0,r.get_float32(0),e.f32),a=pe.getVectorComponents(t[0]);for(let e of a)i=n.get("+").apply([i,e]);return i})),g=new gt("normSqr",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=n.get("*").apply([e[0],e[0]]);return f.apply([t])})),y=new gt("norm",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=g.apply(e);return n.get("sqrt").apply([t])})),b=new gt("normalized",1,(e=>1===e.length&&e[0].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vector")),(e=>{let t=y.apply(e);return n.get("/").apply([e[0],t])})),x=new gt("dot",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector&&e[0].getType().getNumRows()===e[1].getType().getNumRows()?v.createNoError():v.createError("expecting vectors of the same size ")),(e=>{let t=n.get("*").apply([e[0],e[1]]);return f.apply([t])})),S=new gt("cross",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector&&3===e[0].getType().getNumRows()&&3===e[1].getType().getNumRows()?v.createNoError():v.createError("expecting 3D vectors")),(e=>{let t=pe.getVectorComponents(e[0]),r=pe.getVectorComponents(e[1]),i=n.get("-").apply([n.get("*").apply([t[1],r[2]]),n.get("*").apply([t[2],r[1]])]),a=n.get("-").apply([n.get("*").apply([t[2],r[0]]),n.get("*").apply([t[0],r[2]])]),o=n.get("-").apply([n.get("*").apply([t[0],r[1]]),n.get("*").apply([t[1],r[0]])]);return pe.makeVectorFromScalars([i,a,o])})),D=new gt("outerProduct",2,(e=>2===e.length&&e[0].getType().getCategory()===t.Vector&&e[1].getType().getCategory()===t.Vector?v.createNoError():v.createError("expecting vectors")),(e=>{let t=pe.getVectorComponents(e[0]),r=pe.getVectorComponents(e[1]),i=t.length,a=r.length,o=[];for(let e=0;e{let r=e[0].getType(),n=e[1].getType();if(r.getCategory()!==t.Matrix)return v.createError("LHS of the matrix multiplication must be a matrix");let i=r;if(n.getCategory()===t.Matrix){let e=n;return i.getNumCols()===e.getNumRows()?v.createNoError():v.createError(`size mismatch during matrix-matrix multiplication: LHS num cols = ${i.getNumCols()}, but RHS num rows = ${e.getNumRows()}`)}if(n.getCategory()===t.Vector){let e=n;return i.getNumCols()===e.getNumRows()?v.createNoError():v.createError(`size mismatch during matrix-vector multiplication: LHS num cols = ${i.getNumCols()}, but RHS num rows = ${e.getNumRows()}`)}return v.createError("RHS of the matrix multiplication must be a matrix or a vector")}),(e=>{let r=e[0].getType(),n=e[1].getType(),i=r,a=pe.getMatrixRowVectors(e[0]);if(n.getCategory()===t.Matrix){let t=n,r=i.getNumRows(),o=t.getNumCols(),s=[],c=pe.getMatrixColVectors(e[1]);for(let e=0;e1===e.length&&e[0].getType().getCategory()===t.Matrix?v.createNoError():v.createError("expecting matrix")),(e=>pe.transposeMatrix(e[0]))),E=new gt("static",1,(e=>1!==e.length?v.createError("static(...) requires exactly 1 argument"):e[0].isCompileTimeConstant()?v.createNoError():v.createError("static(...) requires a compile-time constant argument")),(e=>e[0].getType().getCategory()===t.HostObjectReference?pe.makeHostObjectReference(e[0].hostSideValue,!0):e[0])),k=new gt("Static",1,(e=>E.checkType(e)),(e=>E.apply(e))),A=new gt("mergeStructs",2,(e=>{if(2!==e.length)return v.createError("ti.mergeStructs(...) requires 2 structs to be merged");if(e[0].getType().getCategory()!==t.Struct||e[1].getType().getCategory()!==t.Struct)return v.createError("arguments to ti.mergeStructs(...) must be structs");let r=e[0].getType(),n=e[1].getType();for(let e of r.getPropertyNames())for(let t of n.getPropertyNames())if(e===t)return v.createError("structs to be named cannot have overlapping property names");return v.createNoError()}),(e=>{let t=e[0].getType(),r=e[1].getType(),n=t.getPropertyNames(),i=r.getPropertyNames(),a=n.concat(i),o=pe.getStructMembers(e[0]),s=pe.getStructMembers(e[1]),c=new Map;for(let e of n)c.set(e,o.get(e));for(let e of i)c.set(e,s.get(e));return pe.makeStruct(a,c)})),N=new gt("slice",3,(e=>{if(e.length<2||e.length>3)return v.createError("unsupported overload of slice()");let r=e[0].getType();for(let t=1;t{let r=e[0],n=r.getType();if(n.getCategory()===t.Vector){let t=e[1].compileTimeConstants[0],n=r.stmts.length;3===e.length&&(n=e[2].compileTimeConstants[0]);let i=pe.getVectorComponents(r);return i=i.slice(t,n),pe.makeVectorFromScalars(i)}{let t=n,i=e[1].compileTimeConstants,a=[t.getNumRows(),t.getNumCols()];3===e.length&&(a=e[2].compileTimeConstants),1===i.length&&i.push(t.getNumCols()),1===a.length&&a.push(t.getNumCols());let o=a[0]-i[0];a[1],i[1];let s=pe.getMatrixComponents(r);s=s.slice(i[0],a[0]);for(let e=0;et.startsWith(e))),t=t.map((t=>t.substr(e.length+1).split("/")[0])),t}}class bt{constructor(){this.fs=new vt}getSourceFile(e,t,r){let n=null;if(this.fs.fileExists(e)&&(n=this.fs.readFile(e)),null!=n)return ce.exports.createSourceFile(e,this.fs.readFile(e),t)}getDefaultLibFileName(e){return"typescript.js"}writeFile(e,t){this.fs.writeFile(e,t,!0)}getCurrentDirectory(){return"."}getDirectories(e){throw new Error("Method not implemented.")}getCanonicalFileName(e){return e}useCaseSensitiveFileNames(){return!0}getNewLine(){return"\n"}fileExists(e){return o(`fileExists(${e})`),this.fs.fileExists(e)}readFile(e){return o(`readFile(${e})`),this.fs.readFile(e)}}class xt{constructor(){this.typeChecker=null,this.tsProgram=null,this.functionNode=null,this.parent=null,this.argNames=[],this.argNodes=[]}static makeFromCode(e){let t=new xt,r=new bt,n="temp.ts";r.writeFile(n,e);let i={allowNonTsExtensions:!0,target:ce.exports.ScriptTarget.Latest,allowJs:!0,strict:!1,noImplicitUseStrict:!0,alwaysStrict:!1,strictFunctionTypes:!1,checkJs:!0};t.tsProgram=ce.exports.createProgram([n],i,r),t.errorTsDiagnostics(t.tsProgram.getSyntacticDiagnostics()),t.typeChecker=t.tsProgram.getTypeChecker();let a=t.tsProgram.getSourceFiles();t.assertNode(a[0],1===a.length,"Expecting exactly 1 source file, got ",a.length);let o=a[0].statements;return t.assertNode(a[0],1===o.length,"Expecting exactly 1 statement in ti.kernel (A single function or arrow function)"),t.registerFunctionNode(o[0]),t}static makeFromParsedNode(e,t){let r=new xt;return t.parent=t,r.typeChecker=t.typeChecker,r.tsProgram=t.tsProgram,r.registerFunctionNode(e),r}registerFunctionNode(e){if(e.kind===ce.exports.SyntaxKind.FunctionDeclaration){let t=e;t.name&&-1!==t.name.getText().indexOf("$")&&this.errorNode(e,"function name cannot have $ in it"),this.functionNode=e,this.registerArguments(e.parameters)}else if(e.kind===ce.exports.SyntaxKind.ExpressionStatement&&e.expression.kind===ce.exports.SyntaxKind.ArrowFunction){let t=e.expression;this.functionNode=t,this.registerArguments(t.parameters)}else e.kind===ce.exports.SyntaxKind.ArrowFunction?(this.functionNode=e,this.registerArguments(e.parameters)):this.errorNode(e,"Expecting a function or an arrow function in kernel/function")}registerArguments(e){for(let t of e)this.argNames.push(t.name.getText()),this.argNodes.push(t)}hasNodeSymbol(e){return void 0!==this.typeChecker.getSymbolAtLocation(e)}getNodeSymbol(e){return this.assertNode(e,this.hasNodeSymbol(e),"symbol not found for "+e.getText()),this.typeChecker.getSymbolAtLocation(e)}getSourceCodeAt(e,t){let r=this.tsProgram.getSourceFiles()[0],n=r.getLineAndCharacterOfPosition(e).line,i=r.getLineAndCharacterOfPosition(t).line,a=r.getLineStarts()[n],o=r.getLineStarts()[i+1];return r.getText().slice(a,o)}errorTsDiagnostics(e){let t="";for(let r of e)if(r.category===ce.exports.DiagnosticCategory.Error){let e=r.start,n=r.start+r.length,i=this.getSourceCodeAt(e,n);t+=`\n Syntax Error: ${r.messageText} \n at: \n ${i}\n `}""!==t&&s("Kernel/function code cannot be parsed as Javascript: \n"+t)}getNodeSourceCode(e){let t=e.getStart(),r=e.getEnd();return this.getSourceCodeAt(t,r)}errorNode(e,...t){let r=this.getNodeSourceCode(e),n="Error: ";for(let e of t)n+=String(e);n+=`\nat:\n ${r} `,s(n)}assertNode(e,t,...r){t||this.errorNode(e,...r)}}class St{static createField(e,t,r=!1){r&&ne.getCurrentProgram().materializeCurrentTree();let n=ne.getCurrentProgram().partialTree.addNaiveDenseField(e,t);return r&&(n.snodeTree.fragmentShaderWritable=!0,ne.getCurrentProgram().materializeCurrentTree()),n}}class Dt{constructor(){this.module=new dt,this.guards=[new Ct(this,this.module.block)]}get_int32(t){return this.pushNewStmt(new Te(t,e.i32,this.getNewId()))}get_float32(t){return this.pushNewStmt(new Te(t,e.f32,this.getNewId()))}create_range_for(e,t){return this.pushNewStmt(new Ee(e,t,new ut,this.getNewId()))}get_loop_index(e){return this.pushNewStmt(new ke(e,this.getNewId()))}create_global_ptr(e,t,r){return this.pushNewStmt(new Fe(e,t,r,this.getNewId()))}create_global_load(e){return this.pushNewStmt(new Pe(e,this.getNewId()))}create_global_store(e,t){return this.pushNewStmt(new Ie(e,t,this.getNewId()))}create_global_temporary(e,t){return this.pushNewStmt(new Oe(e,t,this.getNewId()))}create_global_temporary_load(e){return this.pushNewStmt(new Me(e,this.getNewId()))}create_global_temporary_store(e,t){return this.pushNewStmt(new Le(e,t,this.getNewId()))}create_local_var(e){return this.pushNewStmt(new Ae(e,this.getNewId()))}create_local_load(e){return this.pushNewStmt(new Ne(e,this.getNewId()))}create_local_store(e,t){return this.pushNewStmt(new we(e,t,this.getNewId()))}create_binary_op(e,t,r){return this.pushNewStmt(new Je(e,t,r,this.getNewId()))}create_unary_op(e,t){return this.pushNewStmt(new Ue(e,t,this.getNewId()))}create_atomic_op(e,t,r){return this.pushNewStmt(new Qe(e,t,r,this.getNewId()))}create_atomic_load(e){return this.pushNewStmt(new Xe(e,this.getNewId()))}create_atomic_store(e,t){return this.pushNewStmt(new $e(e,t,this.getNewId()))}create_while_true(){return this.pushNewStmt(new Ve(new ut,this.getNewId()))}create_if(e){return this.pushNewStmt(new Ke(e,new ut,new ut,this.getNewId()))}create_break(){return this.pushNewStmt(new ze(this.getNewId()))}create_continue(){return this.pushNewStmt(new Ge(this.getNewId()))}create_arg_load(e,t){return this.pushNewStmt(new qe(e,t,this.getNewId()))}create_rand(e){return this.pushNewStmt(new We(e,this.getNewId()))}create_return(e){return this.pushNewStmt(new He([e],this.getNewId()))}create_return_vec(e){return this.pushNewStmt(new He(e,this.getNewId()))}create_vertex_input(e,t){return this.pushNewStmt(new et(t,e,this.getNewId()))}create_vertex_output(e,t){return this.pushNewStmt(new tt(t,e,this.getNewId()))}create_position_output(e){return this.pushNewStmt(new nt(e,he.Position,void 0,this.getNewId()))}create_fragment_input(e,t){return this.pushNewStmt(new rt(t,e,this.getNewId()))}create_color_output(e,t){return this.pushNewStmt(new nt(t,he.Color,e,this.getNewId()))}create_vertex_for(){return this.pushNewStmt(new Ye(new ut,this.getNewId()))}create_fragment_for(){return this.pushNewStmt(new Ze(new ut,this.getNewId()))}create_discard(){return this.pushNewStmt(new st(this.getNewId()))}create_depth_output(e){return this.pushNewStmt(new nt([e],he.FragDepth,void 0,this.getNewId()))}create_texture_sample(e,t){return this.pushNewStmt(new ct(e,xe.Sample,t,[],this.getNewId()))}create_texture_sample_lod(e,t,r){return this.pushNewStmt(new ct(e,xe.SampleLod,t,[r],this.getNewId()))}create_texture_sample_compare(e,t,r){return this.pushNewStmt(new ct(e,xe.SampleCompare,t,[r],this.getNewId()))}create_texture_load(e,t){return this.pushNewStmt(new ct(e,xe.Load,t,[],this.getNewId()))}create_texture_store(e,t,r){return this.pushNewStmt(new ct(e,xe.Store,t,r,this.getNewId()))}create_composite_extract(e,t){return this.pushNewStmt(new lt(e,t,this.getNewId()))}create_vertex_index_input(){return this.pushNewStmt(new at(ve.VertexIndex,this.getNewId()))}create_instance_index_input(){return this.pushNewStmt(new at(ve.InstanceIndex,this.getNewId()))}create_frag_coord_input(){return this.pushNewStmt(new at(ve.FragCoord,this.getNewId()))}create_dpdx(e){return this.pushNewStmt(new ot(be.x,e,this.getNewId()))}create_dpdy(e){return this.pushNewStmt(new ot(be.y,e,this.getNewId()))}get_range_loop_guard(e){return this.addGuard(e.body)}get_while_loop_guard(e){return this.addGuard(e.body)}get_vertex_loop_guard(e){return this.addGuard(e.body)}get_fragment_loop_guard(e){return this.addGuard(e.body)}get_if_guard(e,t){return t?this.addGuard(e.trueBranch):this.addGuard(e.falseBranch)}getNewId(){return this.module.getNewId()}pushNewStmt(e){return this.guards.at(-1).block.stmts.push(e),e}addGuard(e){let t=new Ct(this,e);return this.guards.push(t),t}}class Ct{constructor(e,t){this.parent=e,this.block=t}delete(){this.parent.guards.pop()}}class Tt{visitModule(e){this.visitBlock(e.block)}visitBlock(e){for(let t of e.stmts)this.visit(t)}visit(e){switch(e.getKind()){case fe.ConstStmt:this.visitConstStmt(e);break;case fe.RangeForStmt:this.visitRangeForStmt(e);break;case fe.LoopIndexStmt:this.visitLoopIndexStmt(e);break;case fe.AllocaStmt:this.visitAllocaStmt(e);break;case fe.LocalLoadStmt:this.visitLocalLoadStmt(e);break;case fe.LocalStoreStmt:this.visitLocalStoreStmt(e);break;case fe.GlobalPtrStmt:this.visitGlobalPtrStmt(e);break;case fe.GlobalLoadStmt:this.visitGlobalLoadStmt(e);break;case fe.GlobalStoreStmt:this.visitGlobalStoreStmt(e);break;case fe.GlobalTemporaryStmt:this.visitGlobalTemporaryStmt(e);break;case fe.GlobalTemporaryLoadStmt:this.visitGlobalTemporaryLoadStmt(e);break;case fe.GlobalTemporaryStoreStmt:this.visitGlobalTemporaryStoreStmt(e);break;case fe.BinaryOpStmt:this.visitBinaryOpStmt(e);break;case fe.UnaryOpStmt:this.visitUnaryOpStmt(e);break;case fe.WhileStmt:this.visitWhileStmt(e);break;case fe.IfStmt:this.visitIfStmt(e);break;case fe.WhileControlStmt:this.visitWhileControlStmt(e);break;case fe.ContinueStmt:this.visitContinueStmt(e);break;case fe.ArgLoadStmt:this.visitArgLoadStmt(e);break;case fe.RandStmt:this.visitRandStmt(e);break;case fe.ReturnStmt:this.visitReturnStmt(e);break;case fe.AtomicOpStmt:this.visitAtomicOpStmt(e);break;case fe.AtomicLoadStmt:this.visitAtomicLoadStmt(e);break;case fe.AtomicStoreStmt:this.visitAtomicStoreStmt(e);break;case fe.VertexForStmt:this.visitVertexForStmt(e);break;case fe.FragmentForStmt:this.visitFragmentForStmt(e);break;case fe.VertexInputStmt:this.visitVertexInputStmt(e);break;case fe.VertexOutputStmt:this.visitVertexOutputStmt(e);break;case fe.FragmentInputStmt:this.visitFragmentInputStmt(e);break;case fe.BuiltInOutputStmt:this.visitBuiltInOutputStmt(e);break;case fe.BuiltInInputStmt:this.visitBuiltInInputStmt(e);break;case fe.FragmentDerivativeStmt:this.visitFragmentDerivativeStmt(e);break;case fe.DiscardStmt:this.visitDiscardStmt(e);break;case fe.TextureFunctionStmt:this.visitTextureFunctionStmt(e);break;case fe.CompositeExtractStmt:this.visitCompositeExtractStmt(e);break;default:s("unrecognized stmt: ",e)}}visitConstStmt(e){}visitRangeForStmt(e){this.visitBlock(e.body)}visitLoopIndexStmt(e){}visitAllocaStmt(e){}visitLocalLoadStmt(e){}visitLocalStoreStmt(e){}visitGlobalPtrStmt(e){}visitGlobalLoadStmt(e){}visitGlobalStoreStmt(e){}visitGlobalTemporaryStmt(e){}visitGlobalTemporaryLoadStmt(e){}visitGlobalTemporaryStoreStmt(e){}visitBinaryOpStmt(e){}visitUnaryOpStmt(e){}visitWhileStmt(e){this.visitBlock(e.body)}visitIfStmt(e){this.visitBlock(e.trueBranch),this.visitBlock(e.falseBranch)}visitWhileControlStmt(e){}visitContinueStmt(e){}visitArgLoadStmt(e){}visitRandStmt(e){}visitReturnStmt(e){}visitAtomicOpStmt(e){}visitAtomicLoadStmt(e){}visitAtomicStoreStmt(e){}visitVertexForStmt(e){this.visitBlock(e.body)}visitFragmentForStmt(e){this.visitBlock(e.body)}visitVertexInputStmt(e){}visitVertexOutputStmt(e){}visitFragmentInputStmt(e){}visitBuiltInOutputStmt(e){}visitBuiltInInputStmt(e){}visitFragmentDerivativeStmt(e){}visitDiscardStmt(e){}visitTextureFunctionStmt(e){}visitCompositeExtractStmt(e){}}class Et extends Tt{visitModule(e){for(let t of e.block.stmts)this.visit(t)}visitBlock(e){}visitRangeForStmt(e){e.isParallelFor=!e.strictlySerialize}}class kt extends Tt{constructor(){super(...arguments),this.guards=[],this.module=new dt}transform(e){this.module=e,this.visitBlock(e.block)}pushNewStmt(e){return this.guards.at(-1).block.stmts.push(e),e}addGuard(e){let t=new Ct(this,e);return this.guards.push(t),t}visitBlock(e){let t=new ut,r=this.addGuard(t);for(let t of e.stmts)this.visit(t);r.delete(),e.stmts=t.stmts}visitConstStmt(e){this.pushNewStmt(e)}visitRangeForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitLoopIndexStmt(e){this.pushNewStmt(e)}visitAllocaStmt(e){this.pushNewStmt(e)}visitLocalLoadStmt(e){this.pushNewStmt(e)}visitLocalStoreStmt(e){this.pushNewStmt(e)}visitGlobalPtrStmt(e){this.pushNewStmt(e)}visitGlobalLoadStmt(e){this.pushNewStmt(e)}visitGlobalStoreStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryLoadStmt(e){this.pushNewStmt(e)}visitGlobalTemporaryStoreStmt(e){this.pushNewStmt(e)}visitBinaryOpStmt(e){this.pushNewStmt(e)}visitUnaryOpStmt(e){this.pushNewStmt(e)}visitWhileStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitIfStmt(e){this.pushNewStmt(e),this.visitBlock(e.trueBranch),this.visitBlock(e.falseBranch)}visitWhileControlStmt(e){this.pushNewStmt(e)}visitContinueStmt(e){this.pushNewStmt(e)}visitArgLoadStmt(e){this.pushNewStmt(e)}visitRandStmt(e){this.pushNewStmt(e)}visitReturnStmt(e){this.pushNewStmt(e)}visitAtomicOpStmt(e){this.pushNewStmt(e)}visitAtomicLoadStmt(e){this.pushNewStmt(e)}visitAtomicStoreStmt(e){this.pushNewStmt(e)}visitVertexForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitFragmentForStmt(e){this.pushNewStmt(e),this.visitBlock(e.body)}visitVertexInputStmt(e){this.pushNewStmt(e)}visitVertexOutputStmt(e){this.pushNewStmt(e)}visitFragmentInputStmt(e){this.pushNewStmt(e)}visitBuiltInOutputStmt(e){this.pushNewStmt(e)}visitBuiltInInputStmt(e){this.pushNewStmt(e)}visitFragmentDerivativeStmt(e){this.pushNewStmt(e)}visitDiscardStmt(e){this.pushNewStmt(e)}visitTextureFunctionStmt(e){this.pushNewStmt(e)}visitCompositeExtractStmt(e){this.pushNewStmt(e)}}class At extends kt{constructor(){super(...arguments),this.replaceMap=new Map}markReplace(e,t){this.replaceMap.set(e,t)}pushNewStmt(e){for(let t=0;t{switch(e){case ye.add:return me.add;case ye.sub:return me.sub;case ye.max:return me.max;case ye.min:return me.min;case ye.bit_and:return me.bit_and;case ye.bit_or:return me.bit_or;case ye.bit_xor:return me.bit_xor}})(e.op),a=this.pushNewStmt(new Je(r,n,i,this.module.getNewId()));this.replacer.markReplace(e,a),this.pushNewStmt(new we(t,a,this.module.getNewId()))}visitAtomicLoadStmt(e){if(e.getPointer().getKind()!==fe.AllocaStmt)return void this.pushNewStmt(e);let t=e.getPointer(),r=this.pushNewStmt(new Ne(t,this.module.getNewId()));this.replacer.markReplace(e,r)}visitAtomicStoreStmt(e){if(e.getPointer().getKind()!==fe.AllocaStmt)return void this.pushNewStmt(e);let t=e.getPointer(),r=e.getValue();this.pushNewStmt(new $e(t,r,this.module.getNewId()))}transform(e){super.transform(e),this.replacer.transform(e)}}!function(e){e[e.Serial=0]="Serial",e[e.Compute=1]="Compute",e[e.Vertex=2]="Vertex",e[e.Fragment=3]="Fragment"}(Se||(Se={}));class Mt extends dt{constructor(e){super(),this.type=e}}class Lt extends Mt{constructor(){super(Se.Serial)}}class Rt extends Mt{constructor(e,t){super(Se.Compute),this.rangeArg=e,this.hasConstRange=t}}class Bt extends Mt{constructor(){super(Se.Vertex)}}class Jt extends Mt{constructor(){super(Se.Fragment)}}class jt extends kt{constructor(){super(...arguments),this.offloadedModules=[],this.currentOffloadType=Se.Serial}transform(e){this.resetTransformerState(new Lt);for(let t of e.block.stmts)this.visit(t)}resetTransformerState(e){this.guards=[],this.module=e,this.addGuard(e.block),this.offloadedModules.push(e),this.currentOffloadType=e.type}visitRangeForStmt(e){if(e.isParallelFor){let t=0,r=!1,n=e.getRange();n.getKind()===fe.ConstStmt?(r=!0,t=n.val):n.getKind()===fe.GlobalTemporaryLoadStmt?(r=!1,t=n.getPointer().offset):s("InternalError: range of be const or global temp load");let i=new Rt(t,r);this.resetTransformerState(i);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}else super.visitRangeForStmt(e)}visitVertexForStmt(e){let t=new Bt;this.resetTransformerState(t);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}visitFragmentForStmt(e){let t=new Jt;this.resetTransformerState(t);for(let t of e.body.stmts)this.visit(t);this.resetTransformerState(new Lt)}}class Ut extends Tt{constructor(){super(),this.isTrivial=!0}visitGlobalTemporaryStoreStmt(e){this.isTrivial=!1}visitGlobalStoreStmt(e){this.isTrivial=!1}visitAtomicOpStmt(e){this.isTrivial=!1}visitAtomicStoreStmt(e){this.isTrivial=!1}visitReturnStmt(e){this.isTrivial=!1}}class Vt{constructor(){this.parts=[]}write(...e){for(let t of e)this.parts.push(t.toString())}getString(){return this.parts.join("")}empty(){return 0===this.parts.length}}class Kt{constructor(){this.bindings=[]}has(e){for(let t of this.bindings)if(t.info.equals(e))return!0;return!1}add(e,t){let r=new A(e,t);this.bindings.push(r)}get(e){for(let t of this.bindings)if(t.info.equals(e))return t.binding}size(){return this.bindings.length}}class zt extends Tt{constructor(e,t,r,n,i){super(),this.runtime=e,this.offload=t,this.argBytes=r,this.retBytes=n,this.previousStageBindings=i,this.globalDecls=new Vt,this.stageInStructBegin=new Vt,this.stageInStructBody=new Vt,this.stageInStructEnd=new Vt,this.stageOutStructBegin=new Vt,this.stageOutStructBody=new Vt,this.stageOutStructEnd=new Vt,this.funtionSignature=new Vt,this.functionBodyPrologue=new Vt,this.body=new Vt,this.functionBodyEpilogue=new Vt,this.functionEnd=new Vt,this.stageInMembers=new Set,this.stageOutMembers=new Set,this.stageOutBuiltinMembers=new Set,this.bodyIndentCount=1,this.nextInternalTemp=0,this.resourceBindings=new Kt,this.randInitiated=!1}visitConstStmt(t){let r=t.getReturnType(),n=t.val;switch(this.emitLet(t.getName(),this.getPrimitiveTypeName(r)),r){case e.f32:{let e=n.toPrecision(8);e.includes(".")||e.includes("e")||e.includes("E")||(e+=".f"),this.body.write(e);break}case e.i32:c(Number.isInteger(n),"expecting integer"),this.body.write(n.toString());break;default:s("unrecognized return type ",t)}this.body.write(";\n")}visitRandStmt(t){switch(this.initRand(),this.emitLet(t.getName(),this.getPrimitiveTypeName(t.getReturnType())),t.getReturnType()){case e.i32:this.body.write("rand_i32(gid3.x);\n");break;case e.f32:this.body.write("rand_f32(gid3.x);\n");break;default:s("unrecognized primitive type")}}visitUnaryOpStmt(t){let r=t.getOperand().getName(),n=t.getOperand().getReturnType(),i=t.getReturnType(),a=this.getPrimitiveTypeName(i),o=(t=>{switch(t){case ge.neg:return`(-(${r}))`;case ge.sqrt:return`sqrt(f32(${r}))`;case ge.round:return`round(f32(${r}))`;case ge.floor:return`floor(f32(${r}))`;case ge.ceil:return`ceil(f32(${r}))`;case ge.cast_i32_value:return`i32(${r})`;case ge.cast_f32_value:return`f32(${r})`;case ge.cast_i32_bits:return`bitcast(${r})`;case ge.cast_f32_bits:return`bitcast(${r})`;case ge.abs:return`abs(${r})`;case ge.sgn:return`sign(${r})`;case ge.sin:return`sin(f32(${r}))`;case ge.asin:return`asin(f32(${r}))`;case ge.cos:return`cos(f32(${r}))`;case ge.acos:return`acos(f32(${r}))`;case ge.tan:return`tan(f32(${r}))`;case ge.tanh:return`tanh(f32(${r}))`;case ge.inv:case ge.rcp:return`1.f / f32(${r})`;case ge.exp:return`exp(f32(${r}))`;case ge.log:return`log(f32(${r}))`;case ge.rsqrt:return`inverseSqrt(f32(${r}))`;case ge.logic_not:{let t="0";switch(n){case e.f32:t="0.f";break;case e.i32:t="0";break;default:s("unexpected prim type")}return`i32(${r} == ${t})`}case ge.bit_not:return`(~(${r}))`;default:return s("unhandled unary op ",t),"error"}})(t.op);this.emitLet(t.getName(),a),this.body.write(`${i}(${o});\n`)}visitBinaryOpStmt(t){let r=t.getLeft().getName(),n=t.getRight().getName(),i=t.op,a=t.getReturnType(),o=(()=>{switch(i){case me.mul:return`(${r} * ${n})`;case me.add:return`(${r} + ${n})`;case me.sub:return`(${r} - ${n})`;case me.truediv:return`(f32(${r}) / f32(${n}))`;case me.floordiv:return`i32(${r} / ${n})`;case me.mod:return`(${r} % ${n})`;case me.max:return`max(${r}, ${n})`;case me.min:return`min(${r}, ${n})`;case me.bit_and:return`(${r} & ${n})`;case me.bit_or:return`(${r} | ${n})`;case me.bit_xor:return`(${r} ^ ${n})`;case me.bit_shl:return`(${r} << u32(${n}))`;case me.bit_shr:return`(u32(${r}) >> u32(${n}))`;case me.bit_sar:return`(${r} >> u32(${n}))`;case me.cmp_lt:return`(${r} < ${n})`;case me.cmp_le:return`(${r} <= ${n})`;case me.cmp_gt:return`(${r} > ${n})`;case me.cmp_ge:return`(${r} >= ${n})`;case me.cmp_eq:return`(${r} == ${n})`;case me.cmp_ne:return`(${r} != ${n})`;case me.atan2:return`atan2(f32(${r}), f32(${n}))`;case me.logical_or:return`(${r} | ${n})`;case me.logical_and:return`(${r} & ${n})`;case me.pow:switch(a){case e.i32:return`round(pow(f32(${r}), f32(${n})))`;case e.f32:return`pow(f32(${r}), f32(${n}))`;default:return s("unrecgnized prim type"),"error"}}})(),c=this.getPrimitiveTypeName(a);this.emitLet(t.getName(),c),this.body.write(`${c}(${o});\n`)}visitRangeForStmt(e){this.emitVar(e.getName(),"i32"),this.body.write("0;\n"),this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.body.write(this.getIndentation(),`if (${e.getName()} >= ${e.getRange().getName()}) { break; }\n`),this.visitBlock(e.body),this.body.write(this.getIndentation(),`continuing { ${e.getName()} = ${e.getName()} + 1; }\n`),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitIfStmt(e){this.body.write(this.getIndentation(),`if (bool(${e.getCondition().getName()})) {\n`),this.indent(),this.visitBlock(e.trueBranch),this.dedent(),this.body.write(this.getIndentation(),"}\n"),this.body.write(this.getIndentation(),"else {\n"),this.indent(),this.visitBlock(e.falseBranch),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitWhileControlStmt(e){this.body.write(this.getIndentation(),"break;\n")}visitContinueStmt(e){this.body.write(this.getIndentation(),"continue;\n")}visitWhileStmt(e){this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.visitBlock(e.body),this.dedent(),this.body.write(this.getIndentation(),"}\n")}visitVertexInputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getReturnType()),i=`in_${r}_${n}`;this.ensureStageInStruct();let a=t.getReturnType()==e.i32;this.addStageInMember(i,n,r,a),this.emitLet(t.getName(),n),this.body.write(`stage_input.${i};\n`)}visitFragmentInputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getReturnType()),i=`in_${r}_${n}`;this.ensureStageInStruct();let a=t.getReturnType()==e.i32;this.addStageInMember(i,n,r,a),this.emitLet(t.getName(),n),this.body.write(`stage_input.${i};\n`)}visitVertexOutputStmt(t){let r=t.location,n=this.getPrimitiveTypeName(t.getValue().getReturnType()),i=`out_${r}_${n}`;this.ensureStageOutStruct();let a=t.getValue().getReturnType()==e.i32;this.addStageOutMember(i,n,r,a),this.body.write(this.getIndentation(),`stage_output.${i} = ${t.getValue().getName()};\n`)}visitBuiltInOutputStmt(e){this.ensureStageOutStruct();let t=e.getValues().length,r=e.getValues()[0].getReturnType(),n=this.getScalarOrVectorTypeName(r,t),i=this.getScalarOrVectorExpr(e.getValues(),n),a="";switch(e.builtinKind){case he.Color:{let t=e.location;a=`color_${t}`,this.addStageOutMember(a,n,t,!1);break}case he.Position:a="position",this.addStageOutBuiltinMember(a,n,"position");break;case he.FragDepth:a="frag_depth",this.addStageOutBuiltinMember(a,n,"frag_depth");break;default:s("unrecognized builtin kind")}this.body.write(this.getIndentation(),`stage_output.${a} = ${i};\n`)}visitBuiltInInputStmt(e){let t=it(e.builtinKind),r=function(e){switch(e){case ve.VertexIndex:case ve.InstanceIndex:return 1;case ve.FragCoord:return 4}}(e.builtinKind),n=this.getScalarOrVectorTypeName(t,r);switch(this.emitLet(e.getName(),n),this.body.write(`${n}(`),e.builtinKind){case ve.VertexIndex:this.body.write("vertex_index");break;case ve.InstanceIndex:this.body.write("instance_index");break;case ve.FragCoord:this.body.write("frag_coord");break;default:s("unrecognized builtin kind")}this.body.write(");\n")}visitFragmentDerivativeStmt(e){let t=this.getPrimitiveTypeName(e.getReturnType());switch(this.emitLet(e.getName(),t),e.direction){case be.x:this.body.write("dpdxFine");break;case be.y:this.body.write("dpdyFine");break;default:s("unrecognized direction")}this.body.write(`(${e.getValue().getName()});\n`)}visitDiscardStmt(e){this.body.write(this.getIndentation(),"discard;\n")}visitTextureFunctionStmt(t){let r=t.texture,n=r instanceof C,a=new k(i.Texture,r.textureId),o=!1,l=n?1:4;switch(t.func){case xe.Sample:case xe.SampleLod:o=!0;break;case xe.SampleCompare:o=!0,l=1;break;case xe.Load:o=!1;break;case xe.Store:o=!1,a.resourceType=i.StorageTexture;break;default:s("unrecognized texture func")}let u=this.getTextureName(a),d=this.getScalarOrVectorTypeName(e.f32,l),_="";if(o){let e=new k(i.Sampler,r.textureId);_=this.getSamplerName(e)}let p=b(r.getTextureDimensionality());c(p===t.getCoordinates().length,"component count mismatch",t);let f=t.getCoordinates()[0].getReturnType(),m=this.getScalarOrVectorTypeName(f,p),g=this.getScalarOrVectorExpr(t.getCoordinates(),m);switch(t.func){case xe.Sample:this.emitLet(t.getName(),d),this.body.write(`textureSample(${u}, ${_}, ${g});\n`);break;case xe.SampleLod:c(1===t.getAdditionalOperands().length,"expecting 1 lod value"),this.emitLet(t.getName(),d),this.body.write(`textureSampleLevel(${u}, ${_}, ${g}, ${t.getAdditionalOperands()[0].getName()});\n`);break;case xe.SampleCompare:c(1===t.getAdditionalOperands().length,"expecting 1 depth ref value"),this.emitLet(t.getName(),d),this.body.write(`textureSampleCompare(${u}, ${_}, ${g}, ${t.getAdditionalOperands()[0].getName()});\n`);break;case xe.Load:this.emitLet(t.getName(),d),this.body.write(`textureLoad(${u}, ${g}, 0);\n`);break;case xe.Store:{let e=t.getAdditionalOperands()[0].getReturnType(),r=this.getScalarOrVectorTypeName(e,t.getAdditionalOperands().length),n=this.getScalarOrVectorExpr(t.getAdditionalOperands(),r);this.body.write(this.getIndentation(),`textureStore(${u}, ${g}, ${n});\n`);break}default:s("unrecognized texture func")}}visitCompositeExtractStmt(e){let t=this.getPrimitiveTypeName(e.getReturnType());switch(this.emitLet(e.getName(),t),this.body.write(e.getComposite().getName()),e.elementIndex){case 0:this.body.write(".x");break;case 1:this.body.write(".y");break;case 2:this.body.write(".z");break;case 3:this.body.write(".w");break;default:s("unsupported composite extract index: ",e.elementIndex)}this.body.write(";\n")}visitArgLoadStmt(e){let t=e.argId,r=e.getReturnType(),n=this.getPrimitiveTypeName(r),a=this.getBufferMemberName(new k(i.Args));this.emitLet(e.getName(),n),this.body.write(`bitcast<${n}>(${a}[${t}]);\n`)}visitReturnStmt(t){(this.isVertexFor()||this.isFragmentFor())&&s("Return cannot be used in a vertex-for or a fragment-for");let r=t.getValues();for(let t=0;t(${r[t].getName()});\n`);break;case e.i32:this.body.write(`${r[t].getName()};\n`);break;default:s("unrecognized prim type")}}}visitAllocaStmt(e){let t=e.allocatedType;this.body.write(this.getIndentation(),`var ${e.getName()} : ${this.getPrimitiveTypeName(t)};\n`)}visitLocalLoadStmt(e){let t=e.getReturnType();this.emitLet(e.getName(),t),this.body.write(e.getPointer().getName(),";\n")}visitLocalStoreStmt(e){this.body.write(this.getIndentation(),`${e.getPointer().getName()} = ${e.getValue().getName()};\n`)}visitGlobalPtrStmt(e){let t=e.field,r=e.getIndices();c(r.length===t.dimensions.length,"global ptr dimension mismatch");let n="",i=1;for(let e=t.dimensions.length-1;e>=0;--e)n+=`${i} * ${r[e].getName()}`,e>0&&(n+=" + "),i*=t.dimensions[e];let a=`${t.offsetBytes/4} + ${t.elementType.getPrimitivesList().length} * (${n}) + ${e.offsetInElement}`;this.emitLet(e.getName(),this.getPointerIntTypeName()),this.body.write(a,";\n")}visitGlobalTemporaryStmt(e){this.emitLet(e.getName(),this.getPointerIntTypeName()),this.body.write(e.offset,";\n")}emitGlobalLoadExpr(e,t=!1){let r,n=e.getPointer();if(n.getKind()===fe.GlobalPtrStmt){n=n;let e=t?i.RootAtomic:i.Root;r=new k(e,n.field.snodeTree.treeId),this.runtime.materializedTrees[n.field.snodeTree.treeId].fragmentShaderWritable&&s("A vertex shader cannot read from a field marked as `fragmentShaderWritable`")}else{let e=t?i.GlobalTmpsAtomic:i.GlobalTmps;r=new k(e)}let a=this.getBufferMemberName(r),o=e.getReturnType(),c=this.getPrimitiveTypeName(o);this.emitLet(e.getName(),o),t?this.body.write(`bitcast<${c}>(atomicLoad(&(${a}[${n.getName()}])));\n`):this.body.write(`bitcast<${c}>(${a}[${n.getName()}]);\n`)}emitGlobalStore(e,t=!1){let r,n=e.getPointer();if(n.getKind()===fe.GlobalPtrStmt){n=n;let e=t?i.RootAtomic:i.Root;r=new k(e,n.field.snodeTree.treeId)}else{let e=t?i.GlobalTmpsAtomic:i.GlobalTmps;r=new k(e)}let a=this.getBufferMemberName(r);this.assertBufferWritable(r);let o=`bitcast<${this.getRawDataTypeName()}>(${e.getValue().getName()})`;t?this.body.write(this.getIndentation(),`atomicStore(&(${a}[${n.getName()}]), ${o});\n`):this.body.write(this.getIndentation(),`${a}[${n.getName()}] = ${o};\n`)}visitGlobalLoadStmt(e){this.emitGlobalLoadExpr(e,!1)}visitGlobalStoreStmt(e){this.emitGlobalStore(e,!1)}visitGlobalTemporaryLoadStmt(e){this.emitGlobalLoadExpr(e,!1)}visitGlobalTemporaryStoreStmt(e){this.emitGlobalStore(e,!1)}visitAtomicOpStmt(t){let r,n=Re(t.getDestination()),a=this.getPrimitiveTypeName(n),o=t.getDestination();o.getKind()===fe.GlobalPtrStmt?(o=o,r=new k(i.RootAtomic,o.field.snodeTree.treeId)):r=new k(i.GlobalTmpsAtomic),this.assertBufferWritable(r);let c=this.getBufferMemberName(r),l=this.getTemp("atomic_op_result");this.body.write(this.getIndentation(),`var ${l} : ${a};\n`);let u=`&(${c}[${t.getDestination().getName()}])`;switch(n){case e.i32:{let e="";switch(t.op){case ye.add:e="atomicAdd";break;case ye.sub:e="atomicSub";break;case ye.max:e="atomicMax";break;case ye.min:e="atomicMin";break;case ye.bit_and:e="atomicAnd";break;case ye.bit_or:e="atomicOr";break;case ye.bit_xor:e="atomicXor";break;default:s("atomic op not supported")}this.body.write(`${l} = ${e}(${u}, ${t.getOperand().getName()});\n`);break}case e.f32:{this.body.write(this.getIndentation(),"loop { \n"),this.indent();let e=this.getTemp("old_val");this.emitLet(e,"f32"),this.body.write(`bitcast(atomicLoad(${u}));\n`);let r="";switch(t.op){case ye.add:r=`${e} + ${t.getOperand().getName()}`;break;case ye.sub:r=`${e} - ${t.getOperand().getName()}`;break;case ye.max:r=`max(${e}, ${t.getOperand().getName()})`;break;case ye.min:r=`min(${e}, ${t.getOperand().getName()})`;break;default:s("atomic op not supported for f32")}let n=this.getTemp("new_val");this.emitLet(n,"f32"),this.body.write(`${r};\n`),this.body.write(this.getIndentation(),`if(atomicCompareExchangeWeak(${u}, bitcast(${e}), bitcast(${n})).exchanged){\n`),this.indent(),this.body.write(this.getIndentation(),`${l} = ${e};\n`),this.body.write(this.getIndentation(),"break;\n"),this.dedent(),this.body.write(this.getIndentation(),"}\n"),this.dedent(),this.body.write(this.getIndentation(),"}\n");break}default:s("unrecognized prim type")}this.emitLet(t.getName(),a),this.body.write(`${l};\n`)}visitAtomicLoadStmt(e){this.emitGlobalLoadExpr(e,!0)}visitAtomicStoreStmt(e){this.emitGlobalStore(e,!0)}visitLoopIndexStmt(e){e.getLoop().isParallelFor?(this.emitLet(e.getName(),"i32"),this.body.write("ii;\n")):(this.emitLet(e.getName(),"i32"),this.body.write(`${e.getLoop().getName()};\n`))}visitFragmentForStmt(e){s("FragmentForStmt should have been offloaded")}visitVertexForStmt(e){s("VertexForStmt should have been offloaded")}generateSerialKernel(){return this.startComputeFunction(1),this.visitBlock(this.offload.block),new N(this.assembleShader(),1,1,this.resourceBindings.bindings)}generateRangeForKernel(){let e=128,t=512,r=this.offload,n="";if(r.hasConstRange)n=`${r.rangeArg}`,t=B(r.rangeArg,e);else{let e=new k(i.GlobalTmps);n=`${this.getBufferMemberName(e)}[${r.rangeArg}]`}this.startComputeFunction(e);let a=this.getTemp("end");this.emitLet(a,"i32"),this.body.write(`${n};\n`);let o=this.getTemp("total_invocs");return this.emitLet(o,"i32"),this.body.write("128 * i32(n_workgroups.x);\n"),this.emitVar("ii","i32"),this.body.write("i32(gid3.x);\n"),this.body.write(this.getIndentation(),"loop {\n"),this.indent(),this.body.write(this.getIndentation(),`if(ii >= ${a}) { break; }\n`),this.visitBlock(this.offload.block),this.body.write(this.getIndentation(),`continuing { ii = ii + ${o}; }\n`),this.dedent(),this.body.write(this.getIndentation(),"}\n"),new N(this.assembleShader(),e,t,this.resourceBindings.bindings)}generateVertexForKernel(){return this.visitBlock(this.offload.block),this.startGraphicsFunction(),new w(this.assembleShader(),this.resourceBindings.bindings)}generateFragmentForKernel(){return this.visitBlock(this.offload.block),this.startGraphicsFunction(),new F(this.assembleShader(),this.resourceBindings.bindings)}generate(){switch(this.offload.type){case Se.Serial:return this.generateSerialKernel();case Se.Compute:return this.generateRangeForKernel();case Se.Vertex:return this.generateVertexForKernel();case Se.Fragment:return this.generateFragmentForKernel()}}emitLet(e,t){this.body.write(this.getIndentation(),`let ${e} : ${t} = `)}emitVar(e,t){this.body.write(this.getIndentation(),`var ${e} : ${t} = `)}getPointerIntTypeName(){return"i32"}getPrimitiveTypeName(t){switch(t){case e.f32:return"f32";case e.i32:return"i32";default:return s("unsupported primitive type ",t),"error"}}getScalarOrVectorTypeName(e,t){let r=this.getPrimitiveTypeName(e),n=r;return t>1&&(n=`vec${t}<${r}>`),n}getScalarOrVectorExpr(e,t){let r=e[0].getName();if(e.length>1){r=`${t}(${e[0].getName()}`;for(let t=1;t, \n @builtin(num_workgroups) n_workgroups : vec3) \n{ \n`;this.funtionSignature.write(t),this.functionEnd.write("}\n")}startGraphicsFunction(){c(this.funtionSignature.empty(),"already has a signature");let e="",t="",r="",n="";this.isVertexFor()?(e="vertex",t="@builtin(vertex_index) vertex_index : u32, @builtin(instance_index) instance_index : u32"):this.isFragmentFor()?(e="fragment",t="@builtin(position) frag_coord : vec4"):s("emit_graphics_function called, but we're not in vert/frag for"),this.stageInStructBegin.empty()||(r=", stage_input: StageInput"),this.stageOutStructBegin.empty()||(n="-> StageOutput");let i=`\n@${e}\nfn main(${t} ${r}) ${n}\n{\n`;this.funtionSignature.write(i),this.functionEnd.write("\n}\n")}ensureStageInStruct(){this.stageInStructBegin.parts.length>0||(this.stageInStructBegin.write("struct StageInput {\n"),this.stageInStructEnd.write("};\n"))}ensureStageOutStruct(){this.stageOutStructBegin.parts.length>0||(this.stageOutStructBegin.write("struct StageOutput {\n"),this.stageOutStructEnd.write("};\n"),this.functionBodyPrologue.write(" var stage_output: StageOutput;\n"),this.functionBodyEpilogue.write(" return stage_output;\n"))}addStageInMember(e,t,r,n){this.stageInMembers.has(e)||(this.stageInStructBody.write(` @location(${r}) `),n&&this.stageInStructBody.write("@interpolate(flat) "),this.stageInStructBody.write(`${e} : ${t},\n`),this.stageInMembers.add(e))}addStageOutMember(e,t,r,n){this.stageOutMembers.has(e)||(this.stageOutStructBody.write(` @location(${r}) `),n&&this.stageOutStructBody.write("@interpolate(flat) "),this.stageOutStructBody.write(`${e} : ${t},\n`),this.stageOutMembers.add(e))}addStageOutBuiltinMember(e,t,r){this.stageOutBuiltinMembers.has(e)||(this.stageOutStructBody.write(` @builtin(${r}) ${e} : ${t},\n`),this.stageOutMembers.add(e))}indent(){this.bodyIndentCount++}dedent(){this.bodyIndentCount--}getIndentation(){return" ".repeat(this.bodyIndentCount)}getTemp(e=""){return`_internal_temp_${this.nextInternalTemp++}_${e}`}isVertexFor(){return this.offload.type===Se.Vertex}isFragmentFor(){return this.offload.type===Se.Fragment}getRawDataTypeName(){return"i32"}getAtomicRawDataTypeName(){return`atomic<${this.getRawDataTypeName()}>`}getRawDataTypeSize(){return 4}getElementCount(e){switch(e.resourceType){case i.Root:return B(this.runtime.materializedTrees[e.resourceID].size,this.getRawDataTypeSize());case i.RootAtomic:return B(this.runtime.materializedTrees[e.resourceID].size,4);case i.GlobalTmps:case i.GlobalTmpsAtomic:return B(65536,this.getRawDataTypeSize());case i.RandStates:return 65536;case i.Args:return B(this.argBytes,this.getRawDataTypeSize());case i.Rets:return B(this.retBytes,this.getRawDataTypeSize());default:return s("not a buffer"),-1}}getBufferName(e){let t,r="";t=this.resourceBindings.has(e)?this.resourceBindings.get(e):this.previousStageBindings.length+this.resourceBindings.size();let n=this.getRawDataTypeName();switch(e.resourceType){case i.Root:r=`root_buffer_binding_${t}`;break;case i.RootAtomic:r=`root_buffer_atomic_binding_${t}`,n=this.getAtomicRawDataTypeName();break;case i.GlobalTmps:r="global_tmps_";break;case i.GlobalTmpsAtomic:r="global_tmps_atomic_",n=this.getAtomicRawDataTypeName();break;case i.RandStates:r="rand_states_",n="RandState";break;case i.Args:r="args_";break;case i.Rets:r="rets_";break;default:s("not a buffer")}if(!this.resourceBindings.has(e)){this.resourceBindings.add(e,t);let i=this.getElementCount(e);this.declareNewBuffer(e,r,t,n,i)}return r}isBufferWritable(e){if(this.isVertexFor())return!1;if(this.isFragmentFor()){for(let t of this.previousStageBindings)if(t.info.equals(e))return!1;if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){if(!this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable)return!1}}return!0}assertBufferWritable(e){if(this.isVertexFor()&&(e.resourceType===i.GlobalTmps||e.resourceType===i.GlobalTmpsAtomic?s("a vertex shader is not allowed to write to global temporary variables"):e.resourceType===i.Root||e.resourceType===i.RootAtomic?s("a vertex shader is not allowed to write to fields"):s("[Internal Error] Unexpected resource type")),this.isFragmentFor()){for(let t of this.previousStageBindings)if(t.info.equals(e))if(e.resourceType===i.GlobalTmps||e.resourceType===i.GlobalTmpsAtomic)s("a fragment shader is not allowed to write to global temporary variables, if the corresponding vertex shader reads any global temporary variable");else if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable?s("[Internal Error] the vertex shader shouldn't have been able to read from the field which is marked as `fragmentShaderWritable`"):s("[Internal Error] a fragment shader can only write to a field if it is marked as `fragmentShaderWritable`")}else s("[Internal Error] Unexpected resource type");if(e.resourceType===i.Root||e.resourceType===i.RootAtomic){this.runtime.materializedTrees[e.resourceID].fragmentShaderWritable||s("[Internal Error] a fragment shader can only write to a field if it is marked as `fragmentShaderWritable`")}}}declareNewBuffer(e,t,r,n,i){let a="storage, read_write";this.isBufferWritable(e)||(a="storage, read");let o=`\nstruct ${t}_type {\n member: array<${n}, ${i}>,\n};\n@group(0) @binding(${r})\nvar<${a}> ${t}: ${t}_type; \n`;this.globalDecls.write(o)}getBufferMemberName(e){return this.getBufferName(e)+".member"}getTextureName(t){let n;t.resourceType!==i.Texture&&t.resourceType!==i.StorageTexture&&s("not a texture"),n=this.resourceBindings.has(t)?this.resourceBindings.get(t):this.previousStageBindings.length+this.resourceBindings.size();let a,o=t.resourceType===i.StorageTexture,l=this.runtime.textures[t.resourceID];a=o?`texture_binding_${n}`:`storage_texture_binding_${n}`;let u=this.getPrimitiveTypeName(e.f32),d="",_=l instanceof C;switch(c(!(_&&o),"cannot have depth storeage texture"),l.getTextureDimensionality()){case r.Dim2d:d=_?1===l.sampleCount?"texture_depth_2d":"texture_depth_multisampled_2d":o?"texture_storage_2d":"texture_2d";break;case r.Dim3d:_?s("depth 3d texture not supported"):d=o?"texture_storage_3d":"texture_3d";break;case r.DimCube:_?s("depth cube texture not supported"):o?s("storage cube texture not supported"):d="texture_3d";break;default:s("unrecognized dimensionality")}if(!this.resourceBindings.has(t)){this.resourceBindings.add(t,n);let e="";e=o?`<${l.getGPUTextureFormat()}, write>`:_?"":`<${u}>`,this.declareNewTexture(t,a,d,e,n)}return a}declareNewTexture(e,t,r,n,i){let a=`\n@group(0) @binding(${i})\nvar ${t}: ${r}${n};\n `;this.globalDecls.write(a)}getSamplerName(e){let t;e.resourceType!==i.Sampler&&s("not a sampler"),t=this.resourceBindings.has(e)?this.resourceBindings.get(e):this.previousStageBindings.length+this.resourceBindings.size();let r=`sampler_binding_${t}`,n="sampler";return this.runtime.textures[e.resourceID]instanceof C&&(n="sampler_comparison"),this.resourceBindings.has(e)||(this.resourceBindings.add(e,t),this.declareNewSampler(e,r,n,t)),r}declareNewSampler(e,t,r,n){let i=`\n@group(0) @binding(${n})\nvar ${t}: ${r};\n `;this.globalDecls.write(i)}initRand(){if(this.randInitiated)return;this.globalDecls.write("\nstruct RandState{\n x: u32,\n y: u32,\n z: u32,\n w: u32,\n};\n");let e=this.getBufferMemberName(new k(i.RandStates)),t=`\nfn rand_u32(id: u32) -> u32 {\n var state : RandState = ${e}[id];\n if(state.x == 0u && state.y == 0u && state.z == 0u && state.w == 0u){\n state.x = 123456789u * id * 1000000007u;\n state.y = 362436069u;\n state.z = 521288629u;\n state.w = 88675123u;\n }\n let t : u32 = state.x ^ (state.x << 11u);\n state.x = state.y;\n state.y = state.z;\n state.z = state.w;\n state.w = (state.w ^ (state.w >> 19u)) ^ (t ^ (t >> 8u)); \n let result : u32 = state.w * 1000000007u;\n ${e}[id] = state;\n return result;\n}\n\nfn rand_f32(id:u32) -> f32 {\n let u32_res : u32 = rand_u32(id);\n return f32(u32_res) * (1.0f / 4294967296.0f);\n}\n\nfn rand_i32(id:u32) -> i32 {\n let u32_res : u32 = rand_u32(id);\n return i32(u32_res);\n}\n`;this.globalDecls.write(t),this.randInitiated=!0}}function Gt(e){return`%${e.id}`}function qt(t){switch(t){case e.i32:return"i32";case e.f32:return"f32";default:return s("unrecognized type"),"error-type"}}class Wt extends Tt{constructor(){super(...arguments),this.sb=new Vt,this.indentation=0}visitConstStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = const ${e.val}`)}visitRangeForStmt(e){this.write(`${Gt(e)} = for range(${Gt(e)}) {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitLoopIndexStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = loop index of ${Gt(e.getLoop())}`)}visitAllocaStmt(e){this.write(`${Gt(e)} = alloca ${qt(e.allocatedType)}`)}visitLocalLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = local load ${Gt(e.getPointer())}`)}visitLocalStoreStmt(e){this.write(`local store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitGlobalPtrStmt(e){let t="["+e.getIndices().map(Gt).join(", ")+"]";this.write(`${Gt(e)} = global pointer, indices ${t}`)}visitGlobalLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = global load ${Gt(e.getPointer())}`)}visitGlobalStoreStmt(e){this.write(`global store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitGlobalTemporaryStmt(e){this.write(`${Gt(e)} = gtemp ${e.offset} : ${qt(e.type)}`)}visitGlobalTemporaryLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = gtemp load ${Gt(e.getPointer())}`)}visitGlobalTemporaryStoreStmt(e){this.write(`gtemp store ${Gt(e.getPointer())} <- ${Gt(e.getValue())}`)}visitBinaryOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = binary op ${(()=>{switch(e.op){case me.mul:return"mul";case me.add:return"add";case me.sub:return"sub";case me.truediv:return"truediv";case me.floordiv:return"floordiv";case me.mod:return"mod";case me.max:return"max";case me.min:return"min";case me.bit_and:return"bit_and";case me.bit_or:return"bit_or";case me.bit_xor:return"bit_xor";case me.bit_shl:return"bit_shl";case me.bit_shr:return"bit_shr";case me.bit_sar:return"bit_sar";case me.cmp_lt:return"cmp_lt";case me.cmp_le:return"cmp_le";case me.cmp_gt:return"cmp_gt";case me.cmp_ge:return"cmp_ge";case me.cmp_eq:return"cmp_eq";case me.cmp_ne:return"cmp_ne";case me.atan2:return"atan2";case me.pow:return"pow";case me.logical_or:return"logical_or";case me.logical_and:return"logical_and"}})()} ${Gt(e.getLeft())} ${Gt(e.getRight())}`)}visitUnaryOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = unary op ${(()=>{switch(e.op){case ge.neg:return"neg";case ge.sqrt:return"sqrt";case ge.round:return"round";case ge.floor:return"floor";case ge.ceil:return"ceil";case ge.cast_i32_value:return"cast_i32_value";case ge.cast_f32_value:return"cast_f32_value";case ge.cast_i32_bits:return"cast_i32_bits";case ge.cast_f32_bits:return"cast_f32_bits";case ge.abs:return"abs";case ge.sgn:return"sgn";case ge.sin:return"sin";case ge.asin:return"asin";case ge.cos:return"cos";case ge.acos:return"acos";case ge.tan:return"tan";case ge.tanh:return"tanh";case ge.inv:return"inv";case ge.rcp:return"rcp";case ge.exp:return"exp";case ge.log:return"log";case ge.rsqrt:return"rsqrt";case ge.bit_not:return"bit_not";case ge.logic_not:return"logic_not"}})()} ${Gt(e.getOperand())}`)}visitWhileStmt(e){this.write(`${Gt(e)} = while true {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitIfStmt(e){this.write(`${Gt(e)} = if(${Gt(e.getCondition())}){`),this.indent(),this.visitBlock(e.trueBranch),this.dedent(),this.write("}"),this.write("else {"),this.indent(),this.visitBlock(e.falseBranch),this.dedent(),this.write("}")}visitWhileControlStmt(e){this.write("break;")}visitContinueStmt(e){this.write("continue;")}visitArgLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = arg load ${e.argId}`)}visitRandStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = random`)}visitReturnStmt(e){let t="["+e.getValues().map(Gt).join(", ")+"]";this.write(`return ${t}`)}visitAtomicOpStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic op ${(()=>{switch(e.op){case ye.add:return"add";case ye.sub:return"sub";case ye.max:return"max";case ye.min:return"min";case ye.bit_and:return"bit_and";case ye.bit_or:return"bit_or";case ye.bit_xor:return"bit_xor"}})()}, dest ${Gt(e.getDestination())}, operand ${Gt(e.getOperand())}`)}visitAtomicLoadStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic load, ptr ${Gt(e.getPointer())}`)}visitAtomicStoreStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = atomic store, ptr ${Gt(e.getPointer())}, val ${Gt(e.getValue())}`)}visitVertexForStmt(e){this.write(`${Gt(e)} = vertex for {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitFragmentForStmt(e){this.write(`${Gt(e)} = fragment for {`),this.indent(),this.visitBlock(e.body),this.dedent(),this.write("}")}visitVertexInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = vertex input ${e.location}`)}visitVertexOutputStmt(e){this.write(`vertex output location=${e.location} ${e.getValue()}`)}visitFragmentInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = fragment input ${e.location}`)}visitBuiltInOutputStmt(e){let t="["+e.getValues().map(Gt).join(", ")+"]";this.write(`built-in output ${(()=>{switch(e.builtinKind){case he.Color:return"color";case he.FragDepth:return"FragDepth";case he.Position:return"position"}})()} location=${e.location} ${t}`)}visitBuiltInInputStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = built-in input ${(()=>{switch(e.builtinKind){case ve.InstanceIndex:return"instance index";case ve.VertexIndex:return"vert index"}})()}`)}visitFragmentDerivativeStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = d(${e.getValue()})d${(()=>{switch(e.direction){case be.x:return"x";case be.y:return"y"}})()}`)}visitDiscardStmt(e){this.write("discard;")}visitTextureFunctionStmt(e){let t="["+e.getCoordinates().map(Gt).join(", ")+"]",r="["+e.getAdditionalOperands().map(Gt).join(", ")+"]";this.write(`${Gt(e)} = texture ${(()=>{switch(e.func){case xe.Load:return"load";case xe.Store:return"store";case xe.Sample:return"sample";case xe.SampleLod:return"sample-lod"}})()} ${t} ${r}`)}visitCompositeExtractStmt(e){this.write(`${Gt(e)} : ${qt(e.getReturnType())} = composite extract ${e.elementIndex} ${e.getComposite()}`)}indent(){this.indentation+=1}dedent(){this.indentation-=1}write(...e){this.sb.write(" ".repeat(this.indentation),...e,"\n")}}function Ht(e){let t=new Wt;return t.visitModule(e),t.sb.getString()}class Qt extends kt{visitBinaryOpStmt(t){let r=t.getLeft(),n=t.getRight();r.getReturnType()!==n.getReturnType()?(r.getReturnType()===e.i32?(r=this.pushNewStmt(new Ue(r,ge.cast_f32_value,this.module.getNewId())),t.setLeft(r)):n.getReturnType()===e.i32&&(n=this.pushNewStmt(new Ue(n,ge.cast_f32_value,this.module.getNewId())),t.setRight(n)),this.pushNewStmt(t)):super.visitBinaryOpStmt(t)}}class Xt extends kt{constructor(){super(...arguments),this.idBound=0}transform(e){super.transform(e),e.idBound=this.idBound}pushNewStmt(e){return e.id=this.getNewId(),super.pushNewStmt(e)}getNewId(){return this.idBound++}}function $t(e){(new Xt).transform(e)}class Yt extends Tt{constructor(){super(),this.usefulInstructions=new Set}visit(e){let t=e.getKind();[fe.GlobalStoreStmt,fe.LocalStoreStmt,fe.GlobalTemporaryStoreStmt,fe.ReturnStmt,fe.AtomicOpStmt,fe.AtomicLoadStmt,fe.AtomicStoreStmt,fe.IfStmt,fe.WhileStmt,fe.RangeForStmt,fe.FragmentForStmt,fe.VertexForStmt,fe.WhileControlStmt,fe.ContinueStmt,fe.DiscardStmt,fe.VertexOutputStmt,fe.BuiltInOutputStmt,fe.TextureFunctionStmt].includes(t)&&this.usefulInstructions.add(e),super.visit(e)}visitModule(e){super.visitModule(e);let t=this.usefulInstructions;this.usefulInstructions=new Set,t.forEach((e=>{this.recursiveMarkUseful(e)}))}recursiveMarkUseful(e){if(!this.usefulInstructions.has(e)){this.usefulInstructions.add(e);for(let t of e.operands)this.recursiveMarkUseful(t)}}}class Zt extends kt{constructor(e){super(),this.usefulInstructions=e}visit(e){this.usefulInstructions.has(e)&&super.visit(e)}}class er extends Tt{constructor(){super(),this.atomicTrees=new Set,this.atomicGtemps=!1}maybeMarkAtomics(e){if(e.getKind()==fe.GlobalPtrStmt){let t=e.field.snodeTree.treeId;this.atomicTrees.add(t)}else e.getKind()==fe.GlobalTemporaryStmt&&(this.atomicGtemps=!0)}visitAtomicOpStmt(e){let t=e.getDestination();this.maybeMarkAtomics(t)}visitAtomicLoadStmt(e){let t=e.getPointer();this.maybeMarkAtomics(t)}visitAtomicStoreStmt(e){let t=e.getPointer();this.maybeMarkAtomics(t)}}class tr extends kt{constructor(e,t){super(),this.replacer=new At,this.atomicTrees=e,this.atomicGtemps=t}visitGlobalLoadStmt(e){let t=e.getPointer();if(this.atomicTrees.has(t.field.snodeTree.treeId)){let r=this.pushNewStmt(new Xe(t,this.module.getNewId()));this.replacer.markReplace(e,r)}else this.pushNewStmt(e)}visitGlobalStoreStmt(e){let t=e.getPointer();this.atomicTrees.has(t.field.snodeTree.treeId)?this.pushNewStmt(new $e(t,e.getValue(),this.module.getNewId())):this.pushNewStmt(e)}visitGlobalTemporaryLoadStmt(e){let t=e.getPointer();if(this.atomicGtemps){let r=this.pushNewStmt(new Xe(t,this.module.getNewId()));this.replacer.markReplace(e,r)}else this.pushNewStmt(e)}visitGlobalTemporaryStoreStmt(e){let t=e.getPointer();this.atomicGtemps?this.pushNewStmt(new $e(t,e.getValue(),this.module.getNewId())):this.pushNewStmt(e)}transform(e){super.transform(e),this.replacer.transform(e)}}!function(e){e[e.For=0]="For",e[e.While=1]="While",e[e.VertexFor=2]="VertexFor",e[e.FragmentFor=3]="FragmentFor"}(De||(De={}));class rr extends class{extractVisitorResult(e){return c(void 0!==e,"Result is undefined"),e}dispatchVisit(e){switch(e.kind){case ce.exports.SyntaxKind.VariableDeclaration:return this.visitVariableDeclaration(e);case ce.exports.SyntaxKind.VariableDeclarationList:return this.visitVariableDeclarationList(e);case ce.exports.SyntaxKind.FunctionDeclaration:return this.visitFunctionDeclaration(e);case ce.exports.SyntaxKind.ArrowFunction:return this.visitArrowFunction(e);case ce.exports.SyntaxKind.VariableStatement:return this.visitVariableStatement(e);case ce.exports.SyntaxKind.Identifier:return this.visitIdentifier(e);case ce.exports.SyntaxKind.ForOfStatement:case ce.exports.SyntaxKind.ForStatement:return this.visitForOfStatement(e);case ce.exports.SyntaxKind.ForInStatement:return this.visitForInStatement(e);case ce.exports.SyntaxKind.IfStatement:return this.visitIfStatement(e);case ce.exports.SyntaxKind.WhileStatement:return this.visitWhileStatement(e);case ce.exports.SyntaxKind.BreakStatement:return this.visitBreakStatement(e);case ce.exports.SyntaxKind.ContinueStatement:return this.visitContinueStatement(e);case ce.exports.SyntaxKind.ReturnStatement:return this.visitReturnStatement(e);case ce.exports.SyntaxKind.Block:return this.visitBlock(e);case ce.exports.SyntaxKind.NumericLiteral:return this.visitNumericLiteral(e);case ce.exports.SyntaxKind.ExpressionStatement:return this.visitExpressionStatement(e);case ce.exports.SyntaxKind.BinaryExpression:return this.visitBinaryExpression(e);case ce.exports.SyntaxKind.PrefixUnaryExpression:return this.visitPrefixUnaryExpression(e);case ce.exports.SyntaxKind.CallExpression:return this.visitCallExpression(e);case ce.exports.SyntaxKind.PropertyAccessExpression:return this.visitPropertyAccessExpression(e);case ce.exports.SyntaxKind.ElementAccessExpression:return this.visitElementAccessExpression(e);case ce.exports.SyntaxKind.ParenthesizedExpression:return this.visitParenthesizedExpression(e);case ce.exports.SyntaxKind.ArrayLiteralExpression:return this.visitArrayLiteralExpression(e);case ce.exports.SyntaxKind.ObjectLiteralExpression:return this.visitObjectLiteralExpression(e);case ce.exports.SyntaxKind.NonNullExpression:return this.visitNonNullExpression(e);case ce.exports.SyntaxKind.AsExpression:return this.visitAsExpression(e);case ce.exports.SyntaxKind.ThisKeyword:return this.visitThisKeyword();case ce.exports.SyntaxKind.TrueKeyword:return this.visitTrueKeyword();case ce.exports.SyntaxKind.FalseKeyword:return this.visitFalseKeyword();default:return this.visitUnknown(e)}}visitEachChild(e,t=null){let r=[];if(e.forEachChild((e=>{let t=this.dispatchVisit(e);r.push(t)})),t)return t(r)}visitUnknown(e){return this.visitEachChild(e)}visitNumericLiteral(e){return this.visitEachChild(e)}visitIdentifier(e){return this.visitEachChild(e)}visitVariableDeclaration(e){return this.visitEachChild(e)}visitVariableStatement(e){return this.visitEachChild(e)}visitFunctionDeclaration(e){return this.visitEachChild(e)}visitArrowFunction(e){return this.visitEachChild(e)}visitVariableDeclarationList(e){return this.visitEachChild(e)}visitForOfStatement(e){return this.visitEachChild(e)}visitForInStatement(e){return this.visitEachChild(e)}visitForStatement(e){return this.visitEachChild(e)}visitIfStatement(e){return this.visitEachChild(e)}visitWhileStatement(e){return this.visitEachChild(e)}visitBreakStatement(e){return this.visitEachChild(e)}visitContinueStatement(e){return this.visitEachChild(e)}visitReturnStatement(e){return this.visitEachChild(e)}visitBlock(e){return this.visitEachChild(e)}visitExpressionStatement(e){return this.visitEachChild(e)}visitBinaryExpression(e){return this.visitEachChild(e)}visitPrefixUnaryExpression(e){return this.visitEachChild(e)}visitCallExpression(e){return this.visitEachChild(e)}visitPropertyAccessExpression(e){return this.visitEachChild(e)}visitElementAccessExpression(e){return this.visitEachChild(e)}visitParenthesizedExpression(e){return this.visitEachChild(e)}visitArrayLiteralExpression(e){return this.visitEachChild(e)}visitObjectLiteralExpression(e){return this.visitEachChild(e)}visitNonNullExpression(e){return this.visitEachChild(e)}visitAsExpression(e){return this.visitEachChild(e)}visitThisKeyword(){}visitTrueKeyword(){}visitFalseKeyword(){}}{constructor(e,t,r){super(),this.irBuilder=e,this.builtinOps=t,this.atomicOps=r,this.kernelScope=new re,this.templatedValues=new re,this.symbolTable=new Map,this.parsedFunction=null,this.returnValue=null,this.loopStack=[],this.branchDepth=0,this.lastVisitedNode=null,this.startedVertex=!1,this.finishedVertex=!1,this.startedFragment=!1,this.renderPipelineParams=[],this.currentRenderPipelineParams=null,this.renderPassParams=null}buildIR(e,t,r){this.kernelScope=t,this.templatedValues=r,this.parsedFunction=e;let n=this.parsedFunction.functionNode;if(n.kind===ce.exports.SyntaxKind.FunctionDeclaration){let e=n;this.registerArguments(e.parameters),this.visitInputFunctionBody(e.body)}else if(n.kind===ce.exports.SyntaxKind.ArrowFunction){let e=n;this.registerArguments(e.parameters);let t=e.body;if(t.kind===ce.exports.SyntaxKind.Block)this.visitInputFunctionBody(t);else{let t=ce.exports.factory.createReturnStatement(e.body);this.visitReturnStatement(t)}}}visitInputFunctionBody(e){this.visitEachChild(e)}dispatchVisit(e){return this.returnValue&&this.errorNode(e,"If there is a `return`, it must be the final statement of the function"),this.finishedVertex&&!this.startedFragment&&(this.isFragmentFor(e)||this.errorNode(e,"No statements allowed between the vertex shader and the fragment shader")),this.lastVisitedNode=e,super.dispatchVisit(e)}extractVisitorResult(e){return this.assertNode(null,void 0!==e,"VistorResult is undefined"),super.extractVisitorResult(e)}extractValueOrError(e,t,...r){return e.isError&&this.errorNode(t,e.errorMessage,...r),e.result}registerArguments(e){this.errorNode(e[0],"[Compiler bug] should call overriden function")}hasNodeSymbol(e){return this.parsedFunction.hasNodeSymbol(e)}getNodeSymbol(e){return this.parsedFunction.getNodeSymbol(e)}getNodeBaseSymbol(e){for(;;){if(this.hasNodeSymbol(e)){if(e.kind===ce.exports.SyntaxKind.ThisKeyword)return;return this.getNodeSymbol(e)}if(e.kind===ce.exports.SyntaxKind.PropertyAccessExpression){e=e.expression}else if(e.kind===ce.exports.SyntaxKind.ElementAccessExpression){e=e.expression}else{if(e.kind!==ce.exports.SyntaxKind.CallExpression)return;e=e.expression}}}tryEvalInKernelScopeOrTemplateArgs(e){let t=e.getText(),r=this.getNodeBaseSymbol(e);if(void 0!==r){let e=!1;for(let t of this.parsedFunction.argNodes)if(this.getNodeSymbol(t.name)===r){e=!0;break}if(!e)return;if(!this.templatedValues.canEvaluate(t))return;return this.templatedValues.tryEvaluate(t)}return this.kernelScope.tryEvaluate(t)}canEvalInKernelScopeOrTemplateArgs(e){return void 0!==this.tryEvalInKernelScopeOrTemplateArgs(e)}errorNode(e,...t){null!==e?this.parsedFunction.errorNode(e,...t):null!==this.lastVisitedNode?this.errorNode(this.lastVisitedNode,...t):s(...t)}assertNode(e,t,...r){t||this.errorNode(e,...r)}derefIfPointer(e){return e.getType().getCategory()!==t.Pointer?e:this.builtinOps.get("load").apply([e])}createLocalVarCopy(e){let t=e.getType(),r=t.getPrimitivesList(),n=new _e(new p(t,!1));for(let t=0;t2**32-1&&this.errorNode(t,`${t.getText()} cannot be expressed as a 32-bit integer`),r>2**31-1&&(r-=2**32),pe.makeConstantScalar(r,this.irBuilder.get_int32(r),e.i32))}visitPrefixUnaryExpression(e){let t=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.operand))),r=null;switch(e.operator){case ce.exports.SyntaxKind.PlusToken:return t;case ce.exports.SyntaxKind.MinusToken:r=this.builtinOps.get("neg");break;case ce.exports.SyntaxKind.ExclamationToken:r=this.builtinOps.get("logical_not");break;case ce.exports.SyntaxKind.TildeToken:r=this.builtinOps.get("not");break;default:this.errorNode(e,"unsupported prefix unary operator:"+e.getText())}let n=r.checkType([t]);return n.hasError&&this.errorNode(e,"type error in unary operator:"+e.getText()+" "+n.msg),r.apply([t])}visitBinaryExpression(e){let r=this.extractVisitorResult(this.dispatchVisit(e.left)),n=this.extractVisitorResult(this.dispatchVisit(e.right)),i=r.getType(),a=this.derefIfPointer(n),o=e.operatorToken,s=o.getText();if(o.kind===ce.exports.SyntaxKind.EqualsToken){i.getCategory()!=t.Pointer&&this.errorNode(e,"Left hand side of assignment must be an l-value. ",i.getCategory());let n=i;this.isInVertexFor()&&n.getIsGlobal()&&this.errorNode(e,"vertex shaders are not allowed to write to global temporary variables or global fields.");let o=this.builtinOps.get("="),s=o.checkType([r,a]);return s.hasError&&this.errorNode(e,"Assignment type error: "+s.msg),void o.apply([r,a])}let c=new Map;if(c.set(ce.exports.SyntaxKind.PlusEqualsToken,this.atomicOps.get("atomicAdd")),c.set(ce.exports.SyntaxKind.MinusEqualsToken,this.atomicOps.get("atomicSub")),c.set(ce.exports.SyntaxKind.AmpersandEqualsToken,this.atomicOps.get("atomicAnd")),c.set(ce.exports.SyntaxKind.BarEqualsToken,this.atomicOps.get("atomicOr")),c.set(ce.exports.SyntaxKind.CaretEqualsToken,this.atomicOps.get("atomicXor")),c.has(o.kind)){let t=c.get(o.kind),n=t.checkType([r,a]);return n.hasError&&this.errorNode(e,"Atomic type error: "+n.msg),t.apply([r,a])}let l=this.derefIfPointer(r),u=new Map;if(u.set(ce.exports.SyntaxKind.AsteriskEqualsToken,this.builtinOps.get("*")),u.set(ce.exports.SyntaxKind.SlashEqualsToken,this.builtinOps.get("/")),u.has(o.kind)){let t=u.get(o.kind),n=t.checkType([l,a]);n.hasError&&this.errorNode(e,"self assignment type error: "+n.msg);let i=t.apply([l,a]),s=this.builtinOps.get("=");return n=s.checkType([r,i]),n.hasError&&this.errorNode(e,"self assignment type error: "+n.msg),s.apply([r,i]),i}if(l.getType().getCategory()===t.HostObjectReference&&a.getType().getCategory()===t.HostObjectReference)try{let e=Function("x","y",`return x ${s} y;`)(l.hostSideValue,a.hostSideValue);return this.getValueFromAnyHostValue(e)}catch(t){this.errorNode(e,"can not evaluate "+e.getText())}let d=this.builtinOps;if(d.has(s)){let t=d.get(s),r=t.checkType([l,a]);return r.hasError&&this.errorNode(e,`Binary op ${s} type error: `+r.msg),t.apply([l,a])}if(o.kind===ce.exports.SyntaxKind.CommaToken)return this.comma(l,a);this.errorNode(e,"unsupported binary operator:"+s)}visitArrayLiteralExpression(e){let r=e.elements;this.assertNode(e,r.length>0,"cannot have empty arrays");let n=[];for(let e of r)n.push(this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e))));if(1===n.length){let r=n[0].getType().getCategory();if(r===t.Scalar)return pe.makeVectorFromScalars(n);if(r===t.Vector)return pe.makeMatrixFromVectorsAsRows(n);this.errorNode(e,"array expression can only be used to represent vectors and matrices")}let i=n[0];for(let e=1;e{this.assertNode(e,e.arguments.length===t,r+" requires "+t.toString()+" args")},i=[];for(let t of e.arguments){let e=this.extractVisitorResult(this.dispatchVisit(t));i.push(e)}let a=null,o=()=>{if(null!==a)return a;a=[];for(let e of i)if(e.getType().getCategory()===t.Pointer)a.push(e);else if(e.getType().getCategory()===t.Function||e.getType().getCategory()===t.HostObjectReference)a.push(e);else{let t=this.createLocalVarCopy(e);a.push(t)}return a},s=null,c=()=>{if(null!==s)return s;s=[];for(let r=0;r1){let r=!0,n=[];for(let t of i){if(!e.has(t)){r=!1;break}n.push(e.get(t))}if(r){let e=[];for(let r of n)e.push(t[r]);return pe.makeVectorFromScalars(e)}}}else if(h.isValueOrPointerOfCategory(a.getType(),t.Struct)){let e=pe.getStructMembers(a);if(e.has(i))return e.get(i)}else if(a.getType().getCategory()===t.HostObjectReference){let e=a.hostSideValue;if("object"==typeof e&&e&&i in e)return this.getValueFromAnyHostValue(e[i])}this.errorNode(r,`invalid property access: ${r.getText()}`)}getValueFromAnyHostValue(r){let n=(r,i)=>{if(i>1024)return"The object is too big to be evaluated in kernel scope (or it might has a circular reference structure).";if("number"==typeof r)return r%1==0?pe.makeConstantScalar(r,this.irBuilder.get_int32(r),e.i32):pe.makeConstantScalar(r,this.irBuilder.get_float32(r),e.f32);if("boolean"==typeof r)return r?pe.makeConstantScalar(1,this.irBuilder.get_int32(1),e.i32):pe.makeConstantScalar(0,this.irBuilder.get_int32(0),e.i32);if("function"==typeof r){if(0!==i)return"calling member functions are not supported";let e=xt.makeFromCode(r.toString()),t=new _e(new g);return t.hostSideValue=e,t}if("string"==typeof r){if(0!==i)return" member functions / strings are not supported";let e=xt.makeFromCode(r),t=new _e(new g);return t.hostSideValue=e,t}if(G(r)){let e=n(r[0],i+1);if("string"==typeof e)return e;if(1===r.length)return e.getType().getCategory()===t.Scalar?pe.makeVectorFromScalars([e]):e.getType().getCategory()===t.Vector?pe.makeMatrixFromVectorsAsRows([e]):"can only use arrays of scalars or vectors";for(let t=1;t0&&this.loopStack[this.loopStack.length-1]===De.While,"break can only be used in a while loop"),this.irBuilder.create_break()}visitContinueStatement(e){this.assertNode(e,this.loopStack.length>0&&(this.loopStack[this.loopStack.length-1]===De.For||this.loopStack[this.loopStack.length-1]===De.While),"continue must be used inside a non-static loop"),this.loopStack[this.loopStack.length-1]!==De.VertexFor&&this.loopStack[this.loopStack.length-1]!==De.FragmentFor||this.errorNode(e,"continue cannot be used for Vertex-For or Fragment-For"),this.irBuilder.create_continue()}visitWhileStatement(e){let r=this.irBuilder.create_while_true(),n=this.irBuilder.get_while_loop_guard(r),i=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression)));this.assertNode(e,i.getType().getCategory()===t.Scalar,"condition of while statement must be scalar");let a=this.irBuilder.create_unary_op(i.stmts[0],ge.logic_not),o=this.irBuilder.create_if(a),s=this.irBuilder.get_if_guard(o,!0);this.irBuilder.create_break(),s.delete(),this.loopStack.push(De.While),this.dispatchVisit(e.statement),this.loopStack.pop(),n.delete()}shouldStrictlySerialize(){return!1}visitRangeFor(r,n,i,a){this.assertNode(null,1===n.length,"Expecting exactly 1 argument in range()"),this.assertNode(null,1===r.length,"Expecting exactly 1 loop index in range()");let o=n[0],s=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(o)));if(s=this.castTo(s,e.i32),this.assertNode(null,s.getType().getCategory()===t.Scalar,"range must be scalar"),a){this.assertNode(null,s.isCompileTimeConstant(),"for static range loops, the range must be a compile time constant");let t=s.compileTimeConstants[0];for(let n=0;n0,"ndrange() arg list cannot be empty");let s=[];for(let r of n){let n=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(r)));n=this.castTo(n,e.i32),this.assertNode(null,n.getType().getCategory()===t.Scalar,"each arg to ndrange() must be a scalar"),s.push(n)}if(a){let t=1;for(let e of s)this.assertNode(null,e.isCompileTimeConstant(),"for static ndrange loops, each range must be a compile time constant"),t*=e.compileTimeConstants[0];for(let n=0;n=0;--e){let t=s[e].compileTimeConstants[0],r=c%t,n=this.irBuilder.get_int32(r);a.stmts.push(n),a.compileTimeConstants.push(r),c=(c-r)/t}this.symbolTable.set(r[0],a),this.dispatchVisit(i)}}else{let t=s[0].stmts[0];for(let e=1;e=0;--e){let t=s[e].stmts[0],r=this.irBuilder.create_binary_op(_,t,me.mod);u.stmts=[r].concat(u.stmts),_=this.irBuilder.create_binary_op(_,t,me.floordiv)}this.symbolTable.set(r[0],u),this.loopStack.push(De.For),this.dispatchVisit(i),this.loopStack.pop(),a.delete()}}isAtTopLevel(){return 0===this.loopStack.length&&0===this.branchDepth}isInVertexFor(){return this.startedVertex&&!this.finishedVertex}isInFragmentFor(){return this.startedFragment}isInVertexOrFragmentFor(){return this.isInVertexFor()||this.isInFragmentFor()}isFragmentFor(e){if(e.kind!==ce.exports.SyntaxKind.ForOfStatement)return!1;let t=e;if(t.expression.kind!==ce.exports.SyntaxKind.CallExpression)return!1;let r=t.expression.expression.getText();return this.isBuiltinFunctionWithName(r,"inputFragments")}visitVertexFor(r,n,i){this.isAtTopLevel()||this.errorNode(null,"Vertex-For must be top-level"),this.finishedVertex&&this.errorNode(null,"cannot start a new render pipeline when the previous one hasn't been finioshed"),this.assertNode(null,1===r.length,"Expecting exactly 1 vertex declaration"),this.assertNode(null,null===this.currentRenderPipelineParams,"[Compiler bug]"),this.currentRenderPipelineParams=new P(new w,new F),this.ensureRenderPassParams(),0===n.length&&this.errorNode(null,"Expecting vertex buffer and optionally index buffer");let a=n.map((e=>this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e)))));if(a.length>=1){this.assertNode(null,a[0].getType().getCategory()===t.HostObjectReference&&a[0].hostSideValue instanceof W,`the vertex buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let e=a[0].hostSideValue;this.assertNode(null,1===e.dimensions.length,"the vertex buffer must be a 1D field "),this.currentRenderPipelineParams.vertexBuffer=e}if(a.length>=2){this.assertNode(null,a[1].getType().getCategory()===t.HostObjectReference&&a[1].hostSideValue instanceof W,`the index buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let r=a[1].hostSideValue;this.assertNode(null,1===r.dimensions.length,"the index buffer must be a 1D field"),this.assertNode(null,h.getPrimitiveType(r.elementType)===e.i32&&(r.elementType.getCategory()===t.Scalar||r.elementType.getCategory()===t.Vector&&3==r.elementType.getNumRows()),"the index buffer must container i32 scalars or 3D i32 vectors"),this.currentRenderPipelineParams.indexBuffer=r}if(n.length>=3){this.assertNode(null,a[2].getType().getCategory()===t.HostObjectReference&&a[2].hostSideValue instanceof W,`the indirect buffer ${n[0].getText()} must be an instance of taichi field that's visible in kernel scope`);let e=a[2].getType(),r=a[2].hostSideValue;this.assertNode(null,1===r.dimensions.length,"the indirect buffer must be a 1D field "),e.markedAsStatic?this.currentRenderPipelineParams.indirectBuffer=r.toInt32Array():this.currentRenderPipelineParams.indirectBuffer=r}if(n.length>=4)if(this.assertNode(null,a[3].getType().getCategory()===t.Scalar&&h.getPrimitiveType(a[3].getType())==e.i32,"the indirect count must be a i32 scalar"),a[3].isCompileTimeConstant())this.currentRenderPipelineParams.indirectCount=a[3].compileTimeConstants[0];else{this.currentRenderPipelineParams.indirectCount=St.createField(new u(e.i32),[1]),ne.getCurrentProgram().materializeCurrentTree();let t=this.irBuilder.create_global_ptr(this.currentRenderPipelineParams.indirectCount,[this.irBuilder.get_int32(0)],0);this.irBuilder.create_global_store(t,a[3].stmts[0])}n.length>=5&&this.errorNode(null,"Expecting up to 4 arguments (vertex buffer, index buffer, indirect buffer, indirect count) in inputVertices");let o=this.irBuilder.create_vertex_for(),s=this.irBuilder.get_vertex_loop_guard(o);this.loopStack.push(De.VertexFor);let c=this.currentRenderPipelineParams.vertexBuffer.elementType,l=new _e(c,[]),d=c.getPrimitivesList();for(let e=0;e0||this.loopStack.length>0)&&this.errorNode(e,"return cannot be used inside a loop/branch"),e.expression?this.returnValue=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression))):this.returnValue=new _e(new m)}visitVertexFor(e,t,r){this.errorNode(null,"Vertex-For not allowed in non-kernel functions")}visitFragmentFor(e,t,r){this.errorNode(null,"Fragment-For not allowed in non-kernel functions")}shouldStrictlySerialize(){return!0}}class ir extends rr{constructor(){let e=new Dt;super(e,ht.getBuiltinOps(e),ht.getAtomicOps(e)),this.kernelArgTypes=[],this.argTypesMap=new Map,this.templateArgumentValues=null}compileKernel(e,t,r,n=null){this.argTypesMap=r,this.templateArgumentValues=n;let i=new re;if(null!==n)for(let e of n.keys())i.addStored(e,n.get(e));this.buildIR(e,t,i);let a=ne.getCurrentProgram().options.printIR,o=this.irBuilder.module;a&&console.log("initial IR\n",Ht(o)),function(e){let t=new Qt;t.transform(e)}(o),a&&console.log("fixed op types \n",Ht(o)),function(e){(new Et).visitModule(e)}(o),a&&console.log("identified parallel loops\n",Ht(o)),function(e){let t=new Yt;t.visitModule(e);let r=t.usefulInstructions;new Zt(r).transform(e)}(o),a&&console.log("DIEed\n",Ht(o)),function(e){let t=0,r=new Nt(t);r.visitModule(e);let n=r.gtempsAllocation;new wt(n).transform(e),t+=n.size;let i=new Ft(t);i.visitModule(e),n=i.gtempsAllocation,new Pt(n).transform(e),t+=n.size,new It(t).transform(e)}(o),a&&console.log("global temps\n",Ht(o)),function(e){(new Ot).transform(e)}(o),a&&console.log("demoted atomics\n",Ht(o)),function(e){let t=new er;t.visitModule(e),new tr(t.atomicTrees,t.atomicGtemps).transform(e)}(o),a&&console.log("promoted load stores to atomics\n",Ht(o));let c=function(e){let t=new jt;t.transform(e);let r=t.offloadedModules,n=[];for(let e of r){if(e.type!==Se.Serial){n.push(e);continue}let t=new Ut;t.visitModule(e),t.isTrivial||n.push(e)}return n}(o);a&&console.log("offloaded\n");for(let e of c)$t(e),a&&console.log(Ht(e));let l=0;for(let e of this.kernelArgTypes)l+=4*e.getPrimitivesList().length;let u=0,d=new m;null!==this.returnValue&&(d=this.returnValue.getType(),u=4*d.getPrimitivesList().length);let _=[],p=0;for(let e=0;e0||this.loopStack.length>0)&&this.errorNode(e,"return cannot be used inside a loop/branch"),e.expression?(this.returnValue=this.derefIfPointer(this.extractVisitorResult(this.dispatchVisit(e.expression))),this.irBuilder.create_return_vec(this.returnValue.stmts.slice())):(this.returnValue=new _e(new m),this.irBuilder.create_return_vec(this.returnValue.stmts))}checkGraphicsShaderBindings(e){for(let t of e)t.info.resourceType===i.RandStates?s("vertex and fragment shaders are not allowed to use randoms"):t.info.resourceType===i.Rets&&s("[Compiler Bug] vertex and fragment shaders are not allowed to have return values")}}class ar{}class or{constructor(){this.instances=[]}findInstance(e){for(let t of this.instances){let r=!0,n=t[0];for(let t of n.keys())e.has(t)&&e.get(t)===n.get(t)||(r=!1);if(r)return t[1]}return null}}class sr{static kernel(t,r,n){let i={};n=n.toString(),r&&(i=r);let a=new Map,o=new Set;for(let t in i){let r=i[t];r===e.f32||r===e.i32?(r=new u(r),a.set(t,r)):r instanceof l?a.set(t,r):r instanceof ar?o.add(t):s("Invalid argument type annotations")}let d=n.toString(),_=ne.getCurrentProgram(),p=xt.makeFromCode(d),f=p.argNames;sr.templateKernelCache.has(d)||sr.templateKernelCache.set(d,new or);let m=sr.templateKernelCache.get(d);if(0===o.size){_.materializeCurrentTree();let e=(new ir).compileKernel(p,t,a),r=_.runtime.createKernel(e);return async(...e)=>await _.runtime.launchKernel(r,...e)}{let e=async(...e)=>{c(e.length===f.length,`Kernel requires ${f.length} arguments, but ${e.length} is provided`);let r=new Map,n=[];for(let t=0;tyr(new d(t,e),r,n)},vr={field:(e,t,r,n,i=!1)=>yr(new _(r,e,t),n,i)},br={field:(e,t,r=!1)=>yr(new f(e),t,r)};function xr(){ne.getCurrentProgram().materializeCurrentTree()}let Sr=(e,t,r=1,n={})=>new S(e,t,r,n),Dr=(e,t=1)=>new D(e,t),Cr=(e,t=1)=>new C(e,t);class Tr{constructor(e){this.htmlCanvas=e,this.VBO=hr.field(2,gr,[4]),this.IBO=yr(mr,[6]),this.renderTarget=Dr(e),this.VBO.fromArray([[-1,-1],[1,-1],[-1,1],[1,1]]),this.IBO.fromArray([0,1,2,1,3,2]),this.renderFieldKernel=_r(this,{image:ur()},"(image: any) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n //@ts-ignore\n let texelIndex = ti.i32(coord * (image.dimensions - 1));\n let color = image[texelIndex].rgb;\n ti.outputColor(this.renderTarget, color.concat([1.0]));\n }\n }"),this.renderTextureKernel=_r(this,{image:ur()},"(image: TextureBase) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n let color = ti.textureSample(image, coord);\n color[3] = 1.0;\n ti.outputColor(this.renderTarget, color);\n }\n }"),this.renderDepthTextureKernel=_r(this,{image:ur()},"(image: DepthTexture) => {\n ti.clearColor(this.renderTarget, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.VBO, this.IBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord = (f + 1) / 2.0;\n //@ts-ignore\n let texelIndex = ti.i32(coord * (image.dimensions - 1));\n let depth = ti.textureLoad(image, texelIndex);\n let color = [depth, depth, depth, 1.0];\n ti.outputColor(this.renderTarget, color);\n }\n }")}async render(e){e instanceof W?await this.renderFieldKernel(e):e instanceof C?await this.renderDepthTextureKernel(e):await this.renderTextureKernel(e)}}class Er{constructor(e){this.htmlCanvas=e,this.setImageObj=new Tr(e)}async setImage(e){await this.setImageObj.render(e)}}class kr{constructor(){this.begin=Date.now()}time(){return Date.now()-this.begin}static getDefaultTimer(){return this.defaultTimer}}kr.defaultTimer=new kr;let Ar=()=>{s("This function is only implemented in taichi kernel scope!")};function Nr(e){let t=[];for(let r=0;rr(e,t)));if("number"==typeof e&&Array.isArray(t))return t.map((t=>r(e,t)));if(Array.isArray(e)&&Array.isArray(t)){c(e.length===t.length,"vector size mismatch");let n=[];for(let i=0;i-e))}function Mr(e,t){return Ir(e,t,((e,t)=>e+t))}function Lr(e,t){return Ir(e,t,((e,t)=>e-t))}function Rr(e,t){return Ir(e,t,((e,t)=>e*t))}function Br(e,t){return Ir(e,t,((e,t)=>e/t))}function Jr(e){let t=0;for(let r of e)t+=r*r;return t}function jr(e){return Math.sqrt(Jr(e))}function Ur(e){return Br(e,jr(e))}function Vr(e,t){c(e.length===t.length,"vector size mismatch");let r=0;for(let n=0;n{this.ensureAttrib(e)}))}setAttribValue(e,t){switch(e){case En.Position:this.position=t;break;case En.Normal:this.normal=t;break;case En.Tangent:this.tangent=t;break;case En.TexCoords0:this.texCoords0=t;break;case En.TexCoords1:this.texCoords1=t;break;case En.Color:this.color=t;break;case En.Joints:this.joints=t;break;case En.Weights:this.weights=t;break;default:s("setAttribValue called on None or All")}}ensureAttrib(e){let t=Nn(e),r=Array(t).fill(0);this.setAttribValue(e,r)}ensureAttribs(e){e.foreach((e=>this.ensureAttrib(e)))}}class Fn{constructor(e){this.matrix=[],this.reset(),e&&(this.matrix=e)}reset(){this.matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]}mul(e){let t=new Fn;return t.matrix=zr(this.matrix,e.matrix),t}static getKernelType(){return Bc({matrix:Rc(gr,4,4)})}}class Pn{constructor(){this.parent=-1,this.children=[],this.localTransform=new Fn,this.globalTransform=new Fn,this.mesh=-1}static getKernelType(){return Bc({globalTransform:Fn.getKernelType()})}}!function(e){e[e.Point=1]="Point",e[e.Spot=2]="Spot",e[e.Directional=3]="Directional"}(kn||(kn={}));class In{constructor(e,t,r,n,i=[0,0,0],a=[0,0,0],o=0,s=Math.PI/4,c=!1,l){this.type=e,this.brightness=t,this.color=r,this.influenceRadius=n,this.position=i,this.direction=a,this.innerConeAngle=o,this.outerConeAngle=s,this.castsShadow=c,this.shadow=l}static getKernelType(){return Bc({type:mr,brightness:gr,color:Lc(gr,3),influenceRadius:gr,position:Lc(gr,3),direction:Lc(gr,3),innerConeAngle:gr,outerConeAngle:gr,castsShadow:mr})}}function On(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const Mn=Boolean("object"!=typeof process||"[object process]"!==String(process)||process.browser),Ln="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);Ln&&parseFloat(Ln[1]);function Rn(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const Bn={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document},Jn=Bn.global||Bn.self||Bn.window||{},jn="object"!=typeof process||"[object process]"!==String(process)||process.browser,Un="function"==typeof importScripts,Vn="undefined"!=typeof window&&void 0!==window.orientation,Kn="undefined"!=typeof process&&process.version&&/v([0-9]*)/.exec(process.version);function zn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Kn&&parseFloat(Kn[1]);class Gn{constructor(e,t){zn(this,"name",void 0),zn(this,"workerThread",void 0),zn(this,"isRunning",void 0),zn(this,"result",void 0),zn(this,"_resolve",void 0),zn(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Rn(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Rn(this.isRunning),this.isRunning=!1,this._reject(e)}}const qn=new Map;function Wn(e){Rn(e.source&&!e.url||!e.source&&e.url);let t=qn.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Hn((t=e,"try {\n importScripts('".concat(t,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var t}(e.url),qn.set(e.url,t)),e.source&&(t=Hn(e.source),qn.set(e.source,t))),Rn(t),t}function Hn(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Qn(e,t=!0,r){const n=r||new Set;if(e){if(Xn(e))n.add(e);else if(Xn(e.buffer))n.add(e.buffer);else if(ArrayBuffer.isView(e));else if(t&&"object"==typeof e)for(const r in e)Qn(e[r],t,n)}else;return void 0===r?Array.from(n):[]}function Xn(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}const $n=()=>{};class Yn{static isSupported(){return"undefined"!=typeof Worker}constructor(e){zn(this,"name",void 0),zn(this,"source",void 0),zn(this,"url",void 0),zn(this,"terminated",!1),zn(this,"worker",void 0),zn(this,"onMessage",void 0),zn(this,"onError",void 0),zn(this,"_loadableURL","");const{name:t,source:r,url:n}=e;Rn(r||n),this.name=t,this.source=r,this.url=n,this.onMessage=$n,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=$n,this.onError=$n,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||Qn(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=Wn({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class Zn{constructor(e){zn(this,"name","unnamed"),zn(this,"source",void 0),zn(this,"url",void 0),zn(this,"maxConcurrency",1),zn(this,"maxMobileConcurrency",1),zn(this,"onDebug",(()=>{})),zn(this,"reuseWorkers",!0),zn(this,"props",{}),zn(this,"jobQueue",[]),zn(this,"idleQueue",[]),zn(this,"count",0),zn(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach((e=>e.destroy())),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,r)=>e.done(r)),r=((e,t)=>e.error(t))){const n=new Promise((n=>(this.jobQueue.push({name:e,onMessage:t,onError:r,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const r=new Gn(t.name,e);e.onMessage=e=>t.onMessage(r,e.type,e.payload),e.onError=e=>t.onError(r,e),t.onStart(r);try{await r.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{},reuseWorkers:!0};class ri{static isSupported(){return Yn.isSupported()}static getWorkerFarm(e={}){return ri._workerFarm=ri._workerFarm||new ri({}),ri._workerFarm.setProps(e),ri._workerFarm}constructor(e){zn(this,"props",void 0),zn(this,"workerPools",new Map),this.props={...ei},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:r,url:n}=e;let i=this.workerPools.get(t);return i||(i=new Zn({name:t,source:r,url:n}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}zn(ri,"_workerFarm",void 0);const ni={};async function ii(e,t=null,r={}){return t&&(e=function(e,t,r){if(e.startsWith("http"))return e;const n=r.modules||{};if(n[e])return n[e];if(!jn)return"modules/".concat(t,"/dist/libs/").concat(e);if(r.CDN)return Rn(r.CDN.startsWith("http")),"".concat(r.CDN,"/").concat(t,"@").concat("3.1.8","/dist/libs/").concat(e);if(Un)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,r)),ni[e]=ni[e]||async function(e){if(e.endsWith("wasm")){const t=await fetch(e);return await t.arrayBuffer()}if(!jn)try{return le&&void 0}catch{return null}if(Un)return importScripts(e);const t=await fetch(e);return function(e,t){if(!jn)return;if(Un)return eval.call(Jn,e),null;const r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch(t){r.text=e}return document.body.appendChild(r),null}(await t.text(),e)}(e),await ni[e]}async function ai(e,t,r,n,i){const a=e.id,o=function(e,t={}){const r=t[e.id]||{},n="".concat(e.id,"-worker.js");let i=r.workerUrl;if(i||"compression"!==e.id||(i=t.workerUrl),"test"===t._workerType&&(i="modules/".concat(e.module,"/dist/").concat(n)),!i){let t=e.version;"latest"===t&&(t="latest");const r=t?"@".concat(t):"";i="https://unpkg.com/@loaders.gl/".concat(e.module).concat(r,"/dist/").concat(n)}return Rn(i),i}(e,r),s=ri.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r));const c=await s.startJob("process-on-worker",oi.bind(null,i));c.postMessage("process",{input:t,options:r});const l=await c.result;return await l.result}async function oi(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:i,input:a,options:o}=n;try{const r=await e(a,o);t.postMessage("done",{id:i,result:r})}catch(e){const r=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:r})}break;default:console.warn("parse-with-worker unknown message ".concat(r))}}function si(e,t,r){if(e.byteLength<=t+r)return"";const n=new DataView(e);let i="";for(let e=0;e=0),On(t>0),e+(t-1)&~(t-1)}function pi(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{const t=e.byteOffset,r=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,t,r)}return t.set(n,r),r+_i(n.byteLength,4)}async function fi(e){const t=[];for await(const r of e)t.push(r);return function(...e){const t=e.map((e=>e instanceof ArrayBuffer?new Uint8Array(e):e)),r=t.reduce(((e,t)=>e+t.byteLength),0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n.buffer}(...t)}const mi={};const gi=e=>"function"==typeof e,yi=e=>null!==e&&"object"==typeof e,hi=e=>yi(e)&&e.constructor==={}.constructor,vi=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,bi=e=>"undefined"!=typeof Blob&&e instanceof Blob,xi=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||yi(e)&&gi(e.tee)&&gi(e.cancel)&&gi(e.getReader))(e)||(e=>yi(e)&&gi(e.read)&&gi(e.pipe)&&(e=>"boolean"==typeof e)(e.readable))(e),Si=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Di=/^([-\w.]+\/[-\w.+]+)/;function Ci(e){const t=Di.exec(e);return t?t[1]:e}function Ti(e){const t=Si.exec(e);return t?t[1]:""}const Ei=/\?.*/;function ki(e){if(vi(e)){const t=Ai(e.url||"");return{url:t,type:Ci(e.headers.get("content-type")||"")||Ti(t)}}return bi(e)?{url:Ai(e.name||""),type:e.type||""}:"string"==typeof e?{url:Ai(e),type:Ti(e)}:{url:"",type:""}}function Ai(e){return e.replace(Ei,"")}async function Ni(e){if(vi(e))return e;const t={},r=function(e){return vi(e)?e.headers["content-length"]||-1:bi(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);r>=0&&(t["content-length"]=String(r));const{url:n,type:i}=ki(e);i&&(t["content-type"]=i);const a=await async function(e){const t=5;if("string"==typeof e)return"data:,".concat(e.slice(0,t));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise((e=>{const r=new FileReader;r.onload=t=>{var r;return e(null==t||null===(r=t.target)||void 0===r?void 0:r.result)},r.readAsDataURL(t)}))}if(e instanceof ArrayBuffer){const r=function(e){let t="";const r=new Uint8Array(e);for(let e=0;e=0)}()}const Pi={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:"undefined"!=typeof global&&global,document:"undefined"!=typeof document&&document,process:"object"==typeof process&&process},Ii=Pi.window||Pi.self||Pi.global,Oi=Pi.process||{},Mi="undefined"!=typeof __VERSION__?__VERSION__:"untranspiled source";Fi();class Li{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";zn(this,"storage",void 0),zn(this,"id",void 0),zn(this,"config",{}),this.storage=function(e){try{const t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch(e){return null}}(r),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function Ri(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));const a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}let Bi;function Ji(e){return"string"==typeof e?Bi[e.toUpperCase()]||Bi.WHITE:e}function ji(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ui(){let e;var t,r;if(Fi&&"performance"in Ii)e=null==Ii||null===(t=Ii.performance)||void 0===t||null===(r=t.now)||void 0===r?void 0:r.call(t);else if("hrtime"in Oi){var n;const t=null==Oi||null===(n=Oi.hrtime)||void 0===n?void 0:n.call(Oi);e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}!function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(Bi||(Bi={}));const Vi={debug:Fi&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ki={enabled:!0,level:0};function zi(){}const Gi={},qi={once:!0};class Wi{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};zn(this,"id",void 0),zn(this,"VERSION",Mi),zn(this,"_startTs",Ui()),zn(this,"_deltaTs",Ui()),zn(this,"_storage",void 0),zn(this,"userData",{}),zn(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new Li("__probe-".concat(this.id,"__"),Ki),this.userData={},this.timeStamp("".concat(this.id," started")),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r);for(const r of n)"function"==typeof e[r]&&(t.find((e=>r===e))||(e[r]=e[r].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ui()-this._startTs).toPrecision(10))}getDelta(){return Number((Ui()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){ji(e,t)}warn(e){return this._getLogFunction(0,e,Vi.warn,arguments,qi)}error(e){return this._getLogFunction(0,e,Vi.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,Vi.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Vi.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i{const t=Ri(e,r,n);console.log(...t)},e.src=t,zi}const i=t.nodeName||"";if("img"===i.toLowerCase())return console.log(...Ri(t,r,n)),zi;if("canvas"===i.toLowerCase()){const e=new Image;return e.onload=()=>console.log(...Ri(e,r,n)),e.src=t.toDataURL(),zi}return zi}({image:n,message:i,scale:a}):function(e){let{image:t,message:r="",scale:n=1}=e,i=null;try{i=module.require("asciify-image")}catch(e){}if(i)return()=>i(t,{fit:"box",width:"".concat(Math.round(80*n),"%")}).then((e=>console.log(e)));return zi}({image:n,message:i,scale:a}):zi}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||zi)}group(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=Qi({logLevel:e,message:t,opts:r}),{collapsed:i}=r;return n.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(e,t,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||zi)}withGroup(e,t,r){this.group(e,t)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Hi(e)}_getLogFunction(e,t,r,n,i){if(this._shouldLog(e)){i=Qi({logLevel:e,message:t,args:n,opts:i}),ji(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Ui();const a=i.tag||i.message;if(i.once){if(Gi[a])return zi;Gi[a]=Ui()}return t=function(e,t,r){if("string"==typeof t){const o=r.time?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),n=t,i=r.color,a=r.background,Fi||"string"!=typeof n||(i&&(i=Ji(i),n="[".concat(i,"m").concat(n,"")),a&&(i=Ji(a),n="[".concat(a+10,"m").concat(n,""))),t=n}var n,i,a;return t}(this.id,i.message,i),r.bind(console,t,...i.args)}return zi}}function Hi(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ji(Number.isFinite(t)&&t>=0),t}function Qi(e){const{logLevel:t,message:r}=e;e.logLevel=Hi(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":void 0!==r&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const i=typeof e.message;return ji("string"===i||"object"===i),Object.assign(e,{args:n},e.opts)}function Xi(e){for(const t in e)for(const r in e[t])return r||"untitled";return"empty"}zn(Wi,"VERSION",Mi);const $i=new Wi({id:"loaders.gl"});class Yi{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const Zi={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){zn(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ea={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function ta(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state=e._state||{},e._state}const ra=()=>{const e=ta();return e.globalOptions=e.globalOptions||{...Zi},e.globalOptions};function na(e,t,r,n){return r=r||[],function(e,t){aa(e,null,Zi,ea,t);for(const r of t){const n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};aa(n,r.id,i,a,t)}}(e,r=Array.isArray(r)?r:[r]),function(e,t,r){const n={...e.options||{}};(function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)})(n,r),null===n.log&&(n.log=new Yi);return sa(n,ra()),sa(n,t),n}(t,e,n)}function ia(e,t){const r=ra(),n=e||r;return"function"==typeof n.fetch?n.fetch:yi(n.fetch)?e=>wi(e,n):null!=t&&t.fetch?null==t?void 0:t.fetch:wi}function aa(e,t,r,n,i){const a=t||"Top level",o=t?"".concat(t,"."):"";for(const s in e){const c=!t&&yi(e[s]),l="baseUri"===s&&!t,u="workerUrl"===s&&t;if(!(s in r)&&!l&&!u)if(s in n)$i.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!c){const e=oa(s,i);$i.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(e))()}}}function oa(e,t){const r=e.toLowerCase();let n="";for(const i of t)for(const t in i.options){if(e===t)return"Did you mean '".concat(i.id,".").concat(t,"'?");const a=t.toLowerCase();(r.startsWith(a)||a.startsWith(r))&&(n=n||"Did you mean '".concat(i.id,".").concat(t,"'?"))}return n}function sa(e,t){for(const r in t)if(r in t){const n=t[r];hi(n)&&hi(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function ca(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function la(e){var t,r;let n;return On(e,"null loader"),On(ca(e),"invalid loader"),Array.isArray(e)&&(n=e[1],e=e[0],e={...e,options:{...e.options,...n}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(r=e)&&void 0!==r&&r.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}function ua(){return(()=>{const e=ta();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry})()}const da=new Wi({id:"loaders.gl"}),_a=/\.([^.]+)$/;function pa(e,t=[],r,n){if(!fa(e))return null;if(t&&!Array.isArray(t))return la(t);let i=[];t&&(i=i.concat(t)),null!=r&&r.ignoreRegisteredLoaders||i.push(...ua()),function(e){for(const t of e)la(t)}(i);const a=function(e,t,r,n){const{url:i,type:a}=ki(e),o=i||(null==n?void 0:n.url);let s=null,c="";null!=r&&r.mimeType&&(s=ga(t,null==r?void 0:r.mimeType),c="match forced by supplied MIME type ".concat(null==r?void 0:r.mimeType));var l;s=s||function(e,t){const r=t&&_a.exec(t),n=r&&r[1];return n?function(e,t){t=t.toLowerCase();for(const r of e)for(const e of r.extensions)if(e.toLowerCase()===t)return r;return null}(e,n):null}(t,o),c=c||(s?"matched url ".concat(o):""),s=s||ga(t,a),c=c||(s?"matched MIME type ".concat(a):""),s=s||function(e,t){if(!t)return null;for(const r of e)if("string"==typeof t){if(ya(t,r))return r}else if(ArrayBuffer.isView(t)){if(ha(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer){if(ha(t,0,r))return r}return null}(t,e),c=c||(s?"matched initial data ".concat(va(e)):""),s=s||ga(t,null==r?void 0:r.fallbackMimeType),c=c||(s?"matched fallback MIME type ".concat(a):""),c&&da.log(1,"selectLoader selected ".concat(null===(l=s)||void 0===l?void 0:l.name,": ").concat(c,"."));return s}(e,i,r,n);if(!(a||null!=r&&r.nothrow))throw new Error(ma(e));return a}function fa(e){return!(e instanceof Response&&204===e.status)}function ma(e){const{url:t,type:r}=ki(e);let n="No valid loader found (";n+=t?"".concat(function(e){const t=e&&e.lastIndexOf("/");return t>=0?e.substr(t+1):""}(t),", "):"no url provided, ",n+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");const i=e?va(e):"";return n+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",n+=")",n}function ga(e,t){for(const r of e){if(r.mimeTypes&&r.mimeTypes.includes(t))return r;if(t==="application/x.".concat(r.id))return r}return null}function ya(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some((t=>e.startsWith(t)))}function ha(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some((n=>function(e,t,r,n){if(n instanceof ArrayBuffer)return function(e,t,r){if(r=r||e.byteLength,e.byteLength60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}(r),t.binary?await r.arrayBuffer():await r.text()}if(xi(e)&&(e=Da(e,r)),(i=e)&&"function"==typeof i[Symbol.iterator]||(e=>e&&"function"==typeof e[Symbol.asyncIterator])(e))return fi(e);var i;throw new Error(Ca)}async function Ea(e,t,r,n){Rn(!n||"object"==typeof n),!t||Array.isArray(t)||ca(t)||(n=void 0,r=t,t=void 0),e=await e,r=r||{};const{url:i}=ki(e),a=function(e,t){if(!t&&e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...e]:e}return r&&r.length?r:null}(t,n),o=await async function(e,t=[],r,n){if(!fa(e))return null;let i=pa(e,t,{...r,nothrow:!0},n);if(i)return i;if(bi(e)&&(i=pa(e=await e.slice(0,10).arrayBuffer(),t,r,n)),!(i||null!=r&&r.nothrow))throw new Error(ma(e));return i}(e,a,r);return o?(n=function(e,t,r=null){if(r)return r;const n={fetch:ia(t,e),...e};return Array.isArray(n.loaders)||(n.loaders=null),n}({url:i,parse:Ea,loaders:a},r=na(r,o,a,i),n),await async function(e,t,r,n){if(function(e,t="3.1.8"){Rn(e,"no worker provided");const r=e.version}(e),t=await Ta(t,e,r),e.parseTextSync&&"string"==typeof t)return r.dataType="text",e.parseTextSync(t,r,n,e);if(function(e,t){return!!ri.isSupported()&&e.worker&&(null==t?void 0:t.worker)}(e,r))return await ai(e,t,r,0,Ea);if(e.parseText&&"string"==typeof t)return await e.parseText(t,r,n,e);if(e.parse)return await e.parse(t,r,n,e);throw Rn(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(o,e,r,n)):null}const ka="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.wasm"),Aa="https://unpkg.com/@loaders.gl/textures@".concat("3.1.8","/dist/libs/basis_encoder.js");let Na,wa;async function Fa(e){const t=e.modules||{};return t.basis?t.basis:(Na=Na||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await ii("basis_transcoder.js","textures",e),await ii("basis_transcoder.wasm","textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e(r).then((e=>{const{BasisFile:r,initializeBasis:n}=e;n(),t({BasisFile:r})}))}))}(t,r)}(e),await Na)}async function Pa(e){const t=e.modules||{};return t.basisEncoder?t.basisEncoder:(wa=wa||async function(e){let t=null,r=null;return[t,r]=await Promise.all([await ii(Aa,"textures",e),await ii(ka,"textures",e)]),t=t||globalThis.BASIS,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e(r).then((e=>{const{BasisFile:r,KTX2File:n,initializeBasis:i,BasisEncoder:a}=e;i(),t({BasisFile:r,KTX2File:n,BasisEncoder:a})}))}))}(t,r)}(e),await wa)}const Ia=33776,Oa=33779,Ma=35840,La=35842,Ra=36196,Ba=37808,Ja=["","WEBKIT_","MOZ_"],ja={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let Ua=null;function Va(e){if(!Ua){e=e||function(){try{return document.createElement("canvas").getContext("webgl")}catch(e){return null}}()||void 0,Ua=new Set;for(const t of Ja)for(const r in ja)if(e&&e.getExtension("".concat(t).concat(r))){const e=ja[r];Ua.add(e)}}return Ua}var Ka,za,Ga,qa,Wa,Ha,Qa,Xa,$a;($a=Ka||(Ka={}))[$a.NONE=0]="NONE",$a[$a.BASISLZ=1]="BASISLZ",$a[$a.ZSTD=2]="ZSTD",$a[$a.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(za||(za={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Ga||(Ga={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(qa||(qa={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Wa||(Wa={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(Ha||(Ha={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(Qa||(Qa={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Xa||(Xa={}));const Ya=[171,75,84,88,32,50,48,187,13,10,26,10];const Za={etc1:{basisFormat:0,compressed:!0,format:Ra},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ia},bc3:{basisFormat:3,compressed:!0,format:Oa},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ma},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:La},"astc-4x4":{basisFormat:10,compressed:!0,format:Ba},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function eo(e,t,r){const n=new e(new Uint8Array(t));try{if(!n.startTranscoding())return null;const e=n.getNumImages(),t=[];for(let i=0;i{try{r.onload=()=>t(r),r.onerror=t=>n(new Error("Could not load image ".concat(e,": ").concat(t)))}catch(e){n(e)}}))}(a||n,t)}finally{a&&i.revokeObjectURL(a)}}const vo={};let bo=!0;async function xo(e,t,r){let n;if(go(r)){n=await ho(e,t,r)}else n=yo(e,r);const i=t&&t.imagebitmap;return await async function(e,t=null){!function(e){for(const t in e||vo)return!1;return!0}(t)&&bo||(t=null);if(t)try{return await createImageBitmap(e,t)}catch(e){console.warn(e),bo=!1}return await createImageBitmap(e)}(n,i)}function So(e){const t=Do(e);return function(e){const t=Do(e);if(!(t.byteLength>=24&&2303741511===t.getUint32(0,false)))return null;return{mimeType:"image/png",width:t.getUint32(16,false),height:t.getUint32(20,false)}}(t)||function(e){const t=Do(e);if(!(t.byteLength>=3&&65496===t.getUint16(0,false)&&255===t.getUint8(2)))return null;const{tableMarkers:r,sofMarkers:n}=function(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);const t=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:e,sofMarkers:t}}();let i=2;for(;i+9=10&&1195984440===t.getUint32(0,false)))return null;return{mimeType:"image/gif",width:t.getUint16(6,true),height:t.getUint16(8,true)}}(t)||function(e){const t=Do(e);if(!(t.byteLength>=14&&16973===t.getUint16(0,false)&&t.getUint32(2,true)===t.byteLength))return null;return{mimeType:"image/bmp",width:t.getUint32(18,true),height:t.getUint32(22,true)}}(t)}function Do(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}const Co={id:"image",module:"images",name:"Images",version:"3.1.8",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(e,t,r){const n=((t=t||{}).image||{}).type||"auto",{url:i}=r||{};let a;switch(function(e){switch(e){case"auto":case"data":return function(){if(lo)return"imagebitmap";if(co)return"image";if(_o)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(e){switch(e){case"auto":return lo||co||_o;case"imagebitmap":return lo;case"image":return co;case"data":return _o;default:throw new Error("@loaders.gl/images: image ".concat(e," not supported in this environment"))}}(e),e}}(n)){case"imagebitmap":a=await xo(e,t,i);break;case"image":a=await ho(e,t,i);break;case"data":a=await async function(e,t){const{mimeType:r}=So(e)||{},n=globalThis._parseImageNode;return On(n),await n(e,r)}(e);break;default:On(!1)}return"data"===n&&(a=function(e){switch(po(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}(a)),a},tests:[e=>Boolean(So(new DataView(e)))],options:{image:{type:"auto",decode:!0}}},To=["image/png","image/jpeg","image/gif"],Eo={};function ko(e){return void 0===Eo[e]&&(Eo[e]=function(e){switch(e){case"image/webp":return function(){if(!Mn)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Mn;default:if(!Mn){const{_parseImageNode:t}=globalThis;return Boolean(t)&&To.includes(e)}return!0}}(e)),Eo[e]}function Ao(e,t){if(!e)throw new Error(t||"assert failed: gltf")}function No(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;const r=t.baseUri||t.uri;if(!r)throw new Error("'baseUri' must be provided to resolve relative url ".concat(e));return r.substr(0,r.lastIndexOf("/")+1)+e}const wo=["SCALAR","VEC2","VEC3","VEC4"],Fo=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Po=new Map(Fo),Io={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Oo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Mo={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Lo(e){return wo[e-1]||wo[0]}function Ro(e){const t=Po.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Bo(e,t){const r=Mo[e.componentType],n=Io[e.type],i=Oo[e.componentType],a=e.count*n,o=e.count*n*i;return Ao(o>=0&&o<=t.byteLength),{ArrayType:r,length:a,byteLength:o}}const Jo={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class jo{constructor(e){zn(this,"gltf",void 0),zn(this,"sourceBuffers",void 0),zn(this,"byteLength",void 0),this.gltf=e||{json:{...Jo},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}getExtension(e){const t=this.getUsedExtensions().find((t=>t===e)),r=this.json.extensions||{};return t?r[e]||!0:null}getRequiredExtension(e){const t=this.getRequiredExtensions().find((t=>t===e));return t?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];if(!r)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(t,"]"));return r}getTypedArrayForBufferView(e){const t=(e=this.getBufferView(e)).buffer,r=this.gltf.buffers[t];Ao(r);const n=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,n,e.byteLength)}getTypedArrayForAccessor(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,{ArrayType:n,length:i}=Bo(e,t);return new n(r,t.byteOffset+e.byteOffset,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const t=this.getBufferView(e.bufferView),r=this.getBuffer(t.buffer).data,n=t.byteOffset||0;return new Uint8Array(r,n,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,r){return e.extensions=e.extensions||{},e.extensions[t]=r,this.registerUsedExtension(t),this}setObjectExtension(e,t,r){(e.extensions||{})[t]=r}removeObjectExtension(e,t){const r=e.extensions||{},n=r[t];return delete r[t],n}addExtension(e,t={}){return Ao(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ao(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((t=>t===e))||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((t=>t===e))||this.json.extensionsRequired.push(e)}removeExtension(e){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e]}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){const{meshIndex:t,matrix:r}=e;this.json.nodes=this.json.nodes||[];const n={mesh:t};return r&&(n.matrix=r),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(e){const{attributes:t,indices:r,material:n,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(r){const e=this._addIndices(r);a.primitives[0].indices=e}return Number.isFinite(n)&&(a.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){const t={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(t),this.json.meshes.length-1}addImage(e,t){const r=So(e),n=t||(null==r?void 0:r.mimeType),i={bufferView:this.addBufferView(e),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e){const t=e.byteLength;Ao(Number.isFinite(t)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const r={buffer:0,byteOffset:this.byteLength,byteLength:t};return this.byteLength+=_i(t,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(r),this.json.bufferViews.length-1}addAccessor(e,t){const r={bufferView:e,type:Lo(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){const r=this.addBufferView(e);let n={min:t.min,max:t.max};n.min&&n.max||(n=this._getAccessorMinMax(e,t.size));const i={size:t.size,componentType:Ro(e),count:Math.round(e.length/t.size),min:n.min,max:n.max};return this.addAccessor(r,Object.assign(i,t))}addTexture(e){const{imageIndex:t}=e,r={source:t};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){var e,t;this.gltf.buffers=[];const r=this.byteLength,n=new ArrayBuffer(r),i=new Uint8Array(n);let a=0;for(const e of this.sourceBuffers||[])a=pi(e,i,a);null!==(e=this.json)&&void 0!==e&&null!==(t=e.buffers)&&void 0!==t&&t[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(e,t){let r=!0;for(;r;){const n=e.indexOf(t);n>-1?e.splice(n,1):r=!1}}_addAttributes(e={}){const t={};for(const r in e){const n=e[r],i=this._getGltfAttributeName(r),a=this.addBinaryBuffer(n.value,n);t[i]=a}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){const r={min:null,max:null};if(e.length96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}let r=0;for(let n=0;nt[e.name]));return new ts(r,this.metadata)}selectAt(...e){const t=e.map((e=>this.fields[e])).filter(Boolean);return new ts(t,this.metadata)}assign(e){let t,r=this.metadata;if(e instanceof ts){const n=e;t=n.fields,r=rs(rs(new Map,this.metadata),n.metadata)}else t=e;const n=Object.create(null);for(const e of this.fields)n[e.name]=e;for(const e of t)n[e.name]=e;const i=Object.values(n);return new ts(i,r)}}function rs(e,t){return new Map([...e||new Map,...t||new Map])}class ns{constructor(e,t,r=!1,n=new Map){zn(this,"name",void 0),zn(this,"type",void 0),zn(this,"nullable",void 0),zn(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=r,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new ns(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let is,as,os,ss;!function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth"}(is||(is={}));class cs{static isNull(e){return e&&e.typeId===is.Null}static isInt(e){return e&&e.typeId===is.Int}static isFloat(e){return e&&e.typeId===is.Float}static isBinary(e){return e&&e.typeId===is.Binary}static isUtf8(e){return e&&e.typeId===is.Utf8}static isBool(e){return e&&e.typeId===is.Bool}static isDecimal(e){return e&&e.typeId===is.Decimal}static isDate(e){return e&&e.typeId===is.Date}static isTime(e){return e&&e.typeId===is.Time}static isTimestamp(e){return e&&e.typeId===is.Timestamp}static isInterval(e){return e&&e.typeId===is.Interval}static isList(e){return e&&e.typeId===is.List}static isStruct(e){return e&&e.typeId===is.Struct}static isUnion(e){return e&&e.typeId===is.Union}static isFixedSizeBinary(e){return e&&e.typeId===is.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===is.FixedSizeList}static isMap(e){return e&&e.typeId===is.Map}static isDictionary(e){return e&&e.typeId===is.Dictionary}get typeId(){return is.NONE}compareTo(e){return this===e}}as=Symbol.toStringTag;class ls extends cs{constructor(e,t){super(),zn(this,"isSigned",void 0),zn(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return is.Int}get[as](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class us extends ls{constructor(){super(!0,8)}}class ds extends ls{constructor(){super(!0,16)}}class _s extends ls{constructor(){super(!0,32)}}class ps extends ls{constructor(){super(!1,8)}}class fs extends ls{constructor(){super(!1,16)}}class ms extends ls{constructor(){super(!1,32)}}const gs=32,ys=64;os=Symbol.toStringTag;class hs extends cs{constructor(e){super(),zn(this,"precision",void 0),this.precision=e}get typeId(){return is.Float}get[os](){return"Float"}toString(){return"Float".concat(this.precision)}}class vs extends hs{constructor(){super(gs)}}class bs extends hs{constructor(){super(ys)}}ss=Symbol.toStringTag;class xs extends cs{constructor(e,t){super(),zn(this,"listSize",void 0),zn(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return is.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[ss](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}function Ss(e,t,r){const n=function(e){switch(e.constructor){case Int8Array:return new us;case Uint8Array:return new ps;case Int16Array:return new ds;case Uint16Array:return new fs;case Int32Array:return new _s;case Uint32Array:return new ms;case Float32Array:return new vs;case Float64Array:return new bs;default:throw new Error("array type not supported")}}(t.value),i=r||function(e){const t=new Map;"byteOffset"in e&&t.set("byteOffset",e.byteOffset.toString(10));"byteStride"in e&&t.set("byteStride",e.byteStride.toString(10));"normalized"in e&&t.set("normalized",e.normalized.toString());return t}(t);return new ns(e,new xs(t.size,new ns("value",n)),!1,i)}function Ds(e,t,r){return Ss(e,t,r?Cs(r.metadata):void 0)}function Cs(e){const t=new Map;for(const r in e)t.set("".concat(r,".string"),JSON.stringify(e[r]));return t}const Ts={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Es={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class ks{constructor(e){zn(this,"draco",void 0),zn(this,"decoder",void 0),zn(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(t);const n=this.decoder.GetEncodedGeometryType(r),i=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let e;switch(n){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,i);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!i.ptr){const t="DRACO decompression failed: ".concat(e.error_msg());throw new Error(t)}const a=this._getDracoLoaderData(i,n,t),o=this._getMeshData(i,a,t),s=function(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0;const s=e.POSITION?e.POSITION.value:[],c=s&&s.length;for(let e=0;ei?c:i,a=l>a?l:a,o=u>o?u:o}return[[t,r,n],[i,a,o]]}(o.attributes),c=function(e,t,r){const n=Cs(t.metadata),i=[],a=function(e){const t={};for(const r in e){const n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const t in e){const r=Ds(t,e[t],a[t]);i.push(r)}if(r){const e=Ds("indices",r);i.push(e)}return new ts(i,n)}(o.attributes,a,o.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:s},...o,schema:c}}finally{this.draco.destroy(r),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,r){const n=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,r);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:n,attributes:i}}_getDracoAttributes(e,t){const r={};for(let n=0;nthis.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits(),range:t.range(),min_values:new Float32Array([1,2,3]).map((e=>t.min_value(e)))}}finally{this.draco.destroy(t)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:r=[]}=t,n=e.attribute_type();if(r.map((e=>this.decoder[e])).includes(n)){const t=new this.draco.AttributeQuantizationTransform;try{if(t.InitFromAttribute(e))return{quantization_bits:t.quantization_bits()}}finally{this.draco.destroy(t)}}return null}}const As="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),Ns="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),ws="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");let Fs;async function Ps(e){const t=e.modules||{};return Fs=t.draco3d?Fs||t.draco3d.createDecoderModule({}).then((e=>({draco:e}))):Fs||async function(e){let t,r;if("js"===(e.draco&&e.draco.decoderType))t=await ii(As,"draco",e);else[t,r]=await Promise.all([await ii(Ns,"draco",e),await ii(ws,"draco",e)]);return t=t||globalThis.DracoDecoderModule,await function(e,t){const r={};t&&(r.wasmBinary=t);return new Promise((t=>{e({...r,onModuleLoaded:e=>t({draco:e})})}))}(t,r)}(e),await Fs}const Is={...es,parse:async function(e,t){const{draco:r}=await Ps(t),n=new ks(r);try{return n.parseSync(e,null==t?void 0:t.draco)}finally{n.destroy()}}};function Os(e){const{buffer:t,size:r,count:n}=function(e){let t=e,r=1,n=0;e&&e.value&&(t=e.value,r=e.size||1);t&&(ArrayBuffer.isView(t)||(t=function(e,t,r=!1){if(!e)return null;if(Array.isArray(e))return new t(e);if(r&&!(e instanceof t))return new t(e);return e}(t,Float32Array)),n=t.length/r);return{buffer:t,size:r,count:n}}(e);return{value:t,size:r,byteOffset:0,count:n,type:Lo(r),componentType:Ro(t)}}async function Ms(e,t,r,n){const i=e.getObjectExtension(t,"KHR_draco_mesh_compression");if(!i)return;const a=e.getTypedArrayForBufferView(i.bufferView),o=di(a.buffer,a.byteOffset),{parse:s}=n,c={...r};delete c["3d-tiles"];const l=await s(o,Is,c,n),u=function(e){const t={};for(const r in e){const n=e[r];if("indices"!==r){const e=Os(n);t[r]=e}}return t}(l.attributes);for(const[r,n]of Object.entries(u))if(r in t.attributes){const i=t.attributes[r],a=e.getAccessor(i);null!=a&&a.min&&null!=a&&a.max&&(n.min=a.min,n.max=a.max)}t.attributes=u,l.indices&&(t.indices=Os(l.indices)),function(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(t)}function Ls(e,t,r=4,n,i){var a;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const o=n.DracoWriter.encodeSync({attributes:e}),s=null==i||null===(a=i.parseSync)||void 0===a?void 0:a.call(i,{attributes:e}),c=n._addFauxAttributes(s.attributes);return{primitives:[{attributes:c,mode:r,extensions:{KHR_draco_mesh_compression:{bufferView:n.addBufferView(o),attributes:c}}}]}}function*Rs(e){for(const t of e.json.meshes||[])for(const e of t.primitives)yield e}var Bs=Object.freeze({__proto__:null,name:"KHR_draco_mesh_compression",preprocess:function(e,t,r){const n=new jo(e);for(const e of Rs(n))n.getObjectExtension(e,"KHR_draco_mesh_compression")},decode:async function(e,t,r){var n;if(null==t||null===(n=t.gltf)||void 0===n||!n.decompressMeshes)return;const i=new jo(e),a=[];for(const e of Rs(i))i.getObjectExtension(e,"KHR_draco_mesh_compression")&&a.push(Ms(i,e,t,r));await Promise.all(a),i.removeExtension("KHR_draco_mesh_compression")},encode:function(e,t={}){const r=new jo(e);for(const e of r.json.meshes||[])Ls(e),r.addRequiredExtension("KHR_draco_mesh_compression")}});var Js=Object.freeze({__proto__:null,name:"KHR_lights_punctual",decode:async function(e){const t=new jo(e),{json:r}=t,n=t.getExtension("KHR_lights_punctual");n&&(t.json.lights=n.lights,t.removeExtension("KHR_lights_punctual"));for(const e of r.nodes||[]){const r=t.getObjectExtension(e,"KHR_lights_punctual");r&&(e.light=r.light),t.removeObjectExtension(e,"KHR_lights_punctual")}},encode:async function(e){const t=new jo(e),{json:r}=t;if(r.lights){const e=t.addExtension("KHR_lights_punctual");Ao(!e.lights),e.lights=r.lights,delete r.lights}if(t.json.lights){for(const e of t.json.lights){const r=e.node;t.addObjectExtension(r,"KHR_lights_punctual",e)}delete t.json.lights}}});function js(e,t){const r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach((t=>{e.uniforms[t].value&&!(t in r)&&(r[t]=e.uniforms[t].value)})),Object.keys(r).forEach((e=>{"object"==typeof r[e]&&void 0!==r[e].index&&(r[e].texture=t.getTexture(r[e].index))})),r}const Us=[$o,Yo,Zo,Bs,Js,Object.freeze({__proto__:null,name:"KHR_materials_unlit",decode:async function(e){const t=new jo(e),{json:r}=t;t.removeExtension("KHR_materials_unlit");for(const e of r.materials||[]){e.extensions&&e.extensions.KHR_materials_unlit&&(e.unlit=!0),t.removeObjectExtension(e,"KHR_materials_unlit")}},encode:function(e){const t=new jo(e),{json:r}=t;if(t.materials)for(const e of r.materials||[])e.unlit&&(delete e.unlit,t.addObjectExtension(e,"KHR_materials_unlit",{}),t.addExtension("KHR_materials_unlit"))}}),Object.freeze({__proto__:null,name:"KHR_techniques_webgl",decode:async function(e){const t=new jo(e),{json:r}=t,n=t.getExtension("KHR_techniques_webgl");if(n){const e=function(e,t){const{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach((e=>{if(!Number.isFinite(e.bufferView))throw new Error("KHR_techniques_webgl: no shader code");e.code=a.decode(t.getTypedArrayForBufferView(e.bufferView))})),r.forEach((e=>{e.fragmentShader=n[e.fragmentShader],e.vertexShader=n[e.vertexShader]})),i.forEach((e=>{e.program=r[e.program]})),i}(n,t);for(const n of r.materials||[]){const r=t.getObjectExtension(n,"KHR_techniques_webgl");r&&(n.technique=Object.assign({},r,e[r.technique]),n.technique.values=js(n.technique,t)),t.removeObjectExtension(n,"KHR_techniques_webgl")}t.removeExtension("KHR_techniques_webgl")}},encode:async function(e,t){}})];function Vs(e,t){var r;const n=(null==t||null===(r=t.gltf)||void 0===r?void 0:r.excludeExtensions)||{};return!(e in n&&!n[e])}const Ks={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},zs={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class Gs{constructor(){zn(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),zn(this,"json",void 0)}normalize(e,t){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(r.asset.version))}if(!t.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),function(e){const t=new jo(e),{json:r}=t;for(const e of r.images||[]){const r=t.getObjectExtension(e,"KHR_binary_glTF");r&&Object.assign(e,r),t.removeObjectExtension(e,"KHR_binary_glTF")}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension("KHR_binary_glTF")}(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const t in Ks)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){const r=e[t];if(r&&!Array.isArray(r)){e[t]=[];for(const n in r){const i=r[n];i.id=i.id||n;const a=e[t].length;e[t].push(i),this.idToIndexMap[t][n]=a}}}_convertObjectIdsToArrayIndices(e){for(const t in Ks)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const t of e.textures)this._convertTextureIds(t);for(const t of e.meshes)this._convertMeshIds(t);for(const t of e.nodes)this._convertNodeIds(t);for(const t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const t of e.primitives){const{attributes:e,indices:r,material:n}=t;for(const t in e)e[t]=this._convertIdToIndex(e[t],"accessor");r&&(t.indices=this._convertIdToIndex(r,"accessor")),n&&(t.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map((e=>this._convertIdToIndex(e,"node")))),e.meshes&&(e.meshes=e.meshes.map((e=>this._convertIdToIndex(e,"mesh"))))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map((e=>this._convertIdToIndex(e,"node"))))}_convertIdsToIndices(e,t){e[t]||(console.warn("gltf v1: json doesn't contain attribute ".concat(t)),e[t]=[]);for(const r of e[t])for(const e in r){const t=r[e],n=this._convertIdToIndex(t,e);r[e]=n}}_convertIdToIndex(e,t){const r=zs[t];if(r in this.idToIndexMap){const n=this.idToIndexMap[r][e];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(t," with id ").concat(e));return n}return e}_updateObjects(e){for(const e of this.json.buffers)delete e.type}_updateMaterial(e){for(const t of e.materials){t.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=t.values&&t.values.tex,n=e.textures.findIndex((e=>e.id===r));-1!==n&&(t.pbrMetallicRoughness.baseColorTexture={index:n})}}}const qs={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ws={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Hs=10240,Qs=10241,Xs=10242,$s=10243,Ys=10497,Zs={magFilter:Hs,minFilter:Qs,wrapS:Xs,wrapT:$s},ec={[Hs]:9729,[Qs]:9986,[Xs]:Ys,[$s]:Ys};class tc{constructor(){zn(this,"baseUri",""),zn(this,"json",{}),zn(this,"buffers",[]),zn(this,"images",[])}postProcess(e,t={}){const{json:r,buffers:n=[],images:i=[],baseUri:a=""}=e;return Ao(r),this.baseUri=a,this.json=r,this.buffers=n,this.images=i,this._resolveTree(this.json,t),this.json}_resolveTree(e,t={}){e.bufferViews&&(e.bufferViews=e.bufferViews.map(((e,t)=>this._resolveBufferView(e,t)))),e.images&&(e.images=e.images.map(((e,t)=>this._resolveImage(e,t)))),e.samplers&&(e.samplers=e.samplers.map(((e,t)=>this._resolveSampler(e,t)))),e.textures&&(e.textures=e.textures.map(((e,t)=>this._resolveTexture(e,t)))),e.accessors&&(e.accessors=e.accessors.map(((e,t)=>this._resolveAccessor(e,t)))),e.materials&&(e.materials=e.materials.map(((e,t)=>this._resolveMaterial(e,t)))),e.meshes&&(e.meshes=e.meshes.map(((e,t)=>this._resolveMesh(e,t)))),e.nodes&&(e.nodes=e.nodes.map(((e,t)=>this._resolveNode(e,t)))),e.skins&&(e.skins=e.skins.map(((e,t)=>this._resolveSkin(e,t)))),e.scenes&&(e.scenes=e.scenes.map(((e,t)=>this._resolveScene(e,t)))),void 0!==e.scene&&(e.scene=e.scenes[this.json.scene])}getScene(e){return this._get("scenes",e)}getNode(e){return this._get("nodes",e)}getSkin(e){return this._get("skins",e)}getMesh(e){return this._get("meshes",e)}getMaterial(e){return this._get("materials",e)}getAccessor(e){return this._get("accessors",e)}getCamera(e){return null}getTexture(e){return this._get("textures",e)}getSampler(e){return this._get("samplers",e)}getImage(e){return this._get("images",e)}getBufferView(e){return this._get("bufferViews",e)}getBuffer(e){return this._get("buffers",e)}_get(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];return r||console.warn("glTF file error: Could not find ".concat(e,"[").concat(t,"]")),r}_resolveScene(e,t){return e.id=e.id||"scene-".concat(t),e.nodes=(e.nodes||[]).map((e=>this.getNode(e))),e}_resolveNode(e,t){return e.id=e.id||"node-".concat(t),e.children&&(e.children=e.children.map((e=>this.getNode(e)))),void 0!==e.mesh?e.mesh=this.getMesh(e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce(((e,t)=>{const r=this.getMesh(t);return e.id=r.id,e.primitives=e.primitives.concat(r.primitives),e}),{primitives:[]})),void 0!==e.camera&&(e.camera=this.getCamera(e.camera)),void 0!==e.skin&&(e.skin=this.getSkin(e.skin)),e}_resolveSkin(e,t){return e.id=e.id||"skin-".concat(t),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}_resolveMesh(e,t){return e.id=e.id||"mesh-".concat(t),e.primitives&&(e.primitives=e.primitives.map((e=>{const t=(e={...e}).attributes;e.attributes={};for(const r in t)e.attributes[r]=this.getAccessor(t[r]);return void 0!==e.indices&&(e.indices=this.getAccessor(e.indices)),void 0!==e.material&&(e.material=this.getMaterial(e.material)),e}))),e}_resolveMaterial(e,t){if(e.id=e.id||"material-".concat(t),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture={...e.occlustionTexture},e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture={...e.emmisiveTexture},e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.getTexture(t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.getTexture(t.metallicRoughnessTexture.index))}return e}_resolveAccessor(e,t){var r,n;if(e.id=e.id||"accessor-".concat(t),void 0!==e.bufferView&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=(r=e.componentType,Ws[r]),e.components=(n=e.type,qs[n]),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:r,byteLength:n}=Bo(e,e.bufferView),i=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+t.byteOffset;let a=t.arrayBuffer.slice(i,i+n);e.bufferView.byteStride&&(a=this._getValueFromInterleavedBuffer(t,i,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new r(a)}return e}_getValueFromInterleavedBuffer(e,t,r,n,i){const a=new Uint8Array(i*n);for(let o=0;o20);const n=t.getUint32(r+0,nc),i=t.getUint32(r+4,nc);return r+=8,On(0===i),ac(e,t,r,n),r+=n,r+=oc(e,t,r,e.header.byteLength)}(e,i,r);case 2:return function(e,t,r,n){return On(e.header.byteLength>20),function(e,t,r,n){for(;r+8<=e.header.byteLength;){const i=t.getUint32(r+0,nc),a=t.getUint32(r+4,nc);switch(r+=8,a){case 1313821514:ac(e,t,r,i);break;case 5130562:oc(e,t,r,i);break;case 0:n.strict||ac(e,t,r,i);break;case 1:n.strict||oc(e,t,r,i)}r+=_i(i,4)}}(e,t,r,n),r+e.header.byteLength}(e,i,r,{});default:throw new Error("Invalid GLB version ".concat(e.version,". Only supports v1 and v2."))}}function ac(e,t,r,n){const i=new Uint8Array(t.buffer,r,n),a=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(a),_i(n,4)}function oc(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),_i(n,4)}async function sc(e,t,r=0,n,i){var a,o,s,c;!function(e,t,r,n){n.uri&&(e.baseUri=n.uri);if(t instanceof ArrayBuffer&&!function(e,t=0,r={}){const n=new DataView(e),{magic:i=rc}=r,a=n.getUint32(t,!1);return a===i||a===rc}(t,r,n)){t=(new TextDecoder).decode(t)}if("string"==typeof t)e.json=ci(t);else if(t instanceof ArrayBuffer){const i={};r=ic(i,t,r,n.glb),Ao("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),e._glb=i,e.json=i.json}else Ao(!1,"GLTF: must be ArrayBuffer or string");const i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){const{binChunks:t}=e._glb;e.buffers[0]={arrayBuffer:t[0].arrayBuffer,byteOffset:t[0].byteOffset,byteLength:t[0].byteLength}}const a=e.json.images||[];e.images=new Array(a.length).fill({})}(e,t,r,n),function(e,t={}){(new Gs).normalize(e,t)}(e,{normalize:null==n||null===(a=n.gltf)||void 0===a?void 0:a.normalize}),function(e,t={},r){const n=Us.filter((e=>Vs(e.name,t)));for(const a of n){var i;null===(i=a.preprocess)||void 0===i||i.call(a,e,t,r)}}(e,n,i);const l=[];if(null!=n&&null!==(o=n.gltf)&&void 0!==o&&o.loadBuffers&&e.json.buffers&&await async function(e,t,r){const n=e.json.buffers||[];for(let o=0;oVs(e.name,t)));for(const a of n){var i;await(null===(i=a.decode)||void 0===i?void 0:i.call(a,e,t,r))}}(e,n,i);return l.push(u),await Promise.all(l),null!=n&&null!==(c=n.gltf)&&void 0!==c&&c.postProcess?function(e,t){return(new tc).postProcess(e,t)}(e,n):e}async function cc(e,t,r,n,i){const{fetch:a,parse:o}=i;let s;if(t.uri){const e=No(t.uri,n),r=await a(e);s=await r.arrayBuffer()}if(Number.isFinite(t.bufferView)){const r=function(e,t,r){const n=e.bufferViews[r];Ao(n);const i=t[n.buffer];Ao(i);const a=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,n.byteLength)}(e.json,e.buffers,t.bufferView);s=di(r.buffer,r.byteOffset,r.byteLength)}Ao(s,"glTF image has no data");let c=await o(s,[Co,oo],{mimeType:t.mimeType,basis:n.basis||{format:ao()}},i);c&&c[0]&&(c={compressed:!0,mipmaps:!1,width:c[0].width,height:c[0].height,data:c}),e.images=e.images||[],e.images[r]=c}const lc={name:"glTF",id:"gltf",module:"gltf",version:"3.1.8",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(e,t={},r){(t={...lc.options,...t}).gltf={...lc.options.gltf,...t.gltf};const{byteOffset:n=0}=t;return await sc({},e,n,t,r)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const uc={name:"GLB",id:"glb",module:"gltf",version:"3.1.8",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,parse:async function(e,t){return dc(e,t)},parseSync:dc,options:{glb:{strict:!1}}};function dc(e,t){const{byteOffset:r=0}=t||{},n={};return ic(n,e,r,null==t?void 0:t.glb),n}class _c{constructor(e,t,r){this.firstIndex=e,this.indexCount=t,this.materialID=r}}class pc{constructor(e=[]){this.primitives=e}}class fc{static async loadFromURL(e){let t=new Cc,r=function(e,t){return e.slice(-t.length)===t}(e,".glb");const n=await async function(e,t,r,n){Array.isArray(t)||ca(t)||(r=t,t=void 0);const i=ia(r);let a=e;return"string"==typeof e&&(a=await i(e)),bi(e)&&(a=await i(e)),await Ea(a,t,r)}(e,r?uc:lc,{gltf:{loadBuffers:!0,loadImages:!0}});console.log(n);let i,a=[];if(r){for(let e of n.binChunks)a.push(new mc(e.arrayBuffer.slice(e.byteOffset)));i=n.json}else i=n;let o=[];for(let e of i.bufferViews)r?o.push(gc.fromBuffer(a[e.buffer],e.byteOffset,e.byteLength,e.byteStride)):o.push(gc.fromData(e.data,e.byteOffset,e.byteLength,e.byteStride));let l=[];for(let e of i.accessors){let t=xc(e.bufferView);l.push(new hc(o[t],e.byteOffset,e.count,e.componentType,e.type,e.max,e.min))}let u=[];if(void 0!==i.images)for(let e of i.images)if(void 0!==e.bufferView){let t=o[xc(e.bufferView)],r=new Blob([t.data],{type:e.mimeType}),n=window.URL||window.webkitURL,i=n.createObjectURL(r),a=new Image;a.src=i,await a.decode(),n.revokeObjectURL(i);let s=await createImageBitmap(a);u.push(s)}else u.push(e.image);let d=[];if(void 0!==i.textures)for(let e of i.textures)d.push(new Dc(xc(e.source)));for(let e=0;e{let r=Nn(e),n=Lc(gr,r);switch(e){case En.Position:t.position=n;break;case En.Normal:t.normal=n;break;case En.Tangent:t.tangent=n;break;case En.TexCoords0:t.texCoords0=n;break;case En.TexCoords1:t.texCoords1=n;break;case En.Color:t.color=n;break;case En.Joints:t.joints=Lc(mr,r);break;case En.Weights:t.weights=n;break;default:s("vert attr is None or All")}})),Bc(t)}(this.vertexAttribSet),this.vertices.length);await e.fromArray(this.vertices);let t=yr(mr,this.indices.length);await t.fromArray(this.indices);let r=yr(new Tn(0).getInfoKernelType(),this.materials.length),n=this.materials.map((e=>e.getInfo()));await r.fromArray(n);let i,a=yr(Pn.getKernelType(),this.nodes.length);return await a.fromArray(this.nodes),this.lights.length>0&&(i=yr(In.getKernelType(),this.lights.length),await i.fromArray(this.lights)),{vertexBuffer:e,indexBuffer:t,materialInfoBuffer:r,nodesBuffer:a,lightsInfoBuffer:i}}init(){this.computeGlobalTransforms()}computeGlobalTransforms(){let e=(t,r)=>{let n=this.nodes[t];n.globalTransform=r.mul(n.localTransform);for(let t of n.children)e(t,n.globalTransform)};e(this.rootNode,new Fn)}async add(e,t=new Fn){let r=this.nodes.length;this.nodes=this.nodes.concat(e.nodes);let n=this.vertices.length;this.vertices=this.vertices.concat(e.vertices);let i=this.indices.length;for(let t=0;te+r)),-1!==t.mesh&&(t.mesh+=o);for(let t of e.materials)t.materialID+=a;for(let t of e.meshes)for(let e of t.primitives)e.firstIndex+=i,e.materialID+=a;return this.init(),s}async addGLTF(e,t=new Fn){let r=await fc.loadFromURL(e);return await this.add(r,t)}}class Tc{constructor(e){this.materialIndex=e}static getKernelType(){return Bc({materialIndex:mr})}}class Ec{constructor(e,t,r=[0,1,0],n=45,i=.1,a=1e3){this.position=e,this.direction=t,this.up=r,this.fov=n,this.near=i,this.far=a,this.view=[],this.projection=[],this.viewProjection=[]}computeMatrices(e){this.view=_n(this.position,Mr(this.position,this.direction),this.up),this.projection=pn(this.fov,e,this.near,this.far),this.viewProjection=zr(this.projection,this.view)}static getKernelType(){return Bc({position:Lc(gr,3),direction:Lc(gr,3),up:Lc(gr,3),fov:gr,near:gr,far:gr,view:Rc(gr,4,4),projection:Rc(gr,4,4),viewProjection:Rc(gr,4,4)})}track(e,t=2,r=2,n=.01){let i=!1,a=0,o=0;e.onmousedown=t=>{i=!0,a=t.offsetX/e.width,o=t.offsetY/e.height},e.onmouseup=e=>{i=!1},e.onmousemove=n=>{if(i){let i=n.offsetX/e.width,s=n.offsetY/e.height,c=i-a,l=s-o,[u,d]=(e=>{e=Ur(e);let t,r=Math.asin(e[1]),n=-e[0]/Math.cos(r),i=-e[2]/Math.cos(r);return Math.abs(n)<1e-6?t=0:(t=Math.acos(i),n<0&&(t=-t)),[t,r]})(Ur(this.direction));u+=c*t,d+=l*r;let _=Math.PI/2*.99;d>_&&(d=_),d<-_&&(d=-_),this.direction=((e,t)=>{let r=[0,0,0];return r[0]=-Math.sin(e)*Math.cos(t),r[1]=Math.sin(t),r[2]=-Math.cos(e)*Math.cos(t),r})(u,d),a=i,o=s}},e.onwheel=e=>{this.position=Mr(this.position,Rr(this.direction,-e.deltaY*n))}}}class kc{constructor(e=0,t=0,r=0,n=0,i=0){this.indexCount=e,this.instanceCount=t,this.firstIndex=r,this.baseVertex=n,this.firstInstance=i}static getKernelType(){return Bc({indexCount:mr,instanceCount:mr,firstIndex:mr,baseVertex:mr,firstInstance:mr})}}class Ac{constructor(e=0,t=0){this.nodeIndex=e,this.materialIndex=t}static getKernelType(){return Bc({nodeIndex:mr,materialIndex:mr})}}class Nc{static beginsWith(e,t){return e.trim().split(" ").filter((e=>0!==e.length))[0]===t}static tailWords(e){return e.trim().split(" ").filter((e=>0!==e.length)).splice(1)}static lastWord(e){let t=this.tailWords(e);return t[t.length-1]}static expandToVecN(e,t){let r=[];for(let n=0;nparseFloat(e))),t)}}class wc{static async loadFromURL(e){let t=await fetch(e),r=await t.text(),n=[],i=e.split("/"),a=i.slice(0,i.length-1).join("/")+"/",o=r.split("\n"),s=null;for(let e=0;e0;){if(p(l)128){if(c=(255&d[0])-128,0==c||c>s-o)throw new Error("Bad scanline data");for(;c-- >0;)u[o++]=d[1]}else{if(c=255&d[0],0==c||c>s-o)throw new Error("Bad scanline data");if(u[o++]=d[1],--c>0){if(f(u,o,c) {\n for (let I of ti.ndrange(imgField.dimensions[0], imgField.dimensions[1])) {\n let x = I.y;\n let y = imgField.dimensions[0] - I.x;\n ti.textureStore(imgTexture, [x, y], imgField[I]);\n }\n }")),this.imgFieldToTexture}static async loadFromURL(e){let t=await fetch(e),r=await t.arrayBuffer(),n=Fc(new Uint8Array(r)),i=n.shape[0],a=n.shape[1],o=Array.from(n.data),s=hr.field(4,gr,[a,i]);await s.fromArray1D(o);let c=Sr(4,[i,a]);return this.getImgFieldToTextureKernel()(s,c),new Pc(c,n.exposure)}}Ic.imgFieldToTexture=void 0;class Oc{constructor(e,t,r=[1024,1024],n=1){this.physicalSize=e,this.maxDistance=t,this.shadowMapResolution=r,this.strength=n,this.view=[],this.projection=[],this.viewProjection=[]}static createIblShadowInfo(e,t,r,n,i=[1024,1024],a=1){let o=new Oc(r,n,i,a);o.view=_n(e,Mr(e,t),[0,1,0]);let s=r;return o.projection=fn(-.5*s[0],.5*s[0],-.5*s[1],.5*s[0],0,n),o.viewProjection=zr(o.projection,o.view),o}}var Mc=Object.freeze({__proto__:null,MaterialAttribute:Cn,Material:Tn,Scene:Cc,Renderer:class{constructor(e,t){this.scene=e,this.htmlCanvas=t,this.batchInfos=[],this.batchesDrawInfos=[],this.batchesDrawInstanceInfos=[],this.batchesDrawInfoBuffers=[],this.batchesDrawInstanceInfoBuffers=[],this.lightShadowMaps=[],this.iblShadowMaps=[],this.geometryOnlyDrawInfos=[],this.geometryOnlyDrawInstanceInfos=[],this.engine=Mc,this.uvToDir=()=>{},this.dirToUV=()=>{},this.tonemap=()=>{},this.characteristic=()=>{},this.ggxDistribution=()=>{},this.getNormal=()=>{},this.getLightBrightnessAndDir=()=>{},this.lerp=()=>{},this.linearTosRGB=()=>{},this.sRGBToLinear=()=>{},this.fresnel=()=>{},this.evalSpecularBRDF=()=>{},this.evalDiffuseBRDF=()=>{},this.evalMetalBRDF=()=>{},this.evalDielectricBRDF=()=>{},this.evalBRDF=()=>{},this.evalShadow=()=>{},this.evalIBL=()=>{},this.hammersley2d=()=>{},this.generateTBN=()=>{},this.cosineSampleHemisphere=()=>{},this.cosineSampleHemispherePdf=()=>{},this.zPrePassKernel=()=>{},this.gPrePassKernel=()=>{},this.shadowKernel=()=>{},this.renderKernel=()=>{},this.ssaoKernel=()=>{},this.ssaoBlurKernel=()=>{},this.combineKernel=()=>{},this.presentKernel=()=>{},this.depthPrePassTexture=Cr([t.width,t.height],1),this.depthTexture=Cr([t.width,t.height],4),this.gNormalTexture=Sr(4,[t.width,t.height],4),this.gPositionTexture=Sr(4,[t.width,t.height],4),this.directLightingTexture=Sr(4,[t.width,t.height],4),this.environmentLightingTexture=Sr(4,[t.width,t.height],4),this.renderResultTexture=Sr(4,[t.width,t.height],4),this.ssaoTexture=Sr(4,[t.width,t.height],4),this.ssaoBlurredTexture=Sr(4,[t.width,t.height],1),this.canvasTexture=Dr(t,4),this.quadVBO=yr(Lc(gr,2),4),this.quadIBO=yr(mr,6),this.ssaoSamples=yr(Lc(gr,3),[32,5,5])}async init(){this.sceneData=await this.scene.getKernelData();for(let e of this.scene.lights)if(e.castsShadow){c(e.type===kn.Directional,"only directional lights can be shadow casters"),c(void 0!==e.shadow,"expexcting shadow info"),this.lightShadowMaps.push(Cr(e.shadow.shadowMapResolution,1)),e.shadow.view=_n(e.position,Mr(e.position,e.direction),[0,1,0]);let t=e.shadow.physicalSize;e.shadow.projection=fn(-.5*t[0],.5*t[0],-.5*t[1],.5*t[0],0,e.shadow.maxDistance),e.shadow.viewProjection=zr(e.shadow.projection,e.shadow.view)}for(let e of this.scene.iblShadows)this.iblShadowMaps.push(Cr(e.shadowMapResolution,1));await this.quadVBO.fromArray([[-1,-1],[1,-1],[-1,1],[1,1]]),await this.quadIBO.fromArray([0,1,2,1,3,2]),await this.computeDrawBatches(),await this.initHelperFuncs(),await this.initIBL(),await this.initSSAO(),await this.initKernels()}async initHelperFuncs(){this.uvToDir="(uv: ti.types.vector): ti.types.vector => {\n let y = Math.cos((1.0 - uv[1]) * Math.PI);\n let phi = ((uv[0] - 0.5) * Math.PI) / 0.5;\n let absZOverX = Math.abs(Math.tan(phi));\n let xSquared = (1.0 - y * y) / (1.0 + absZOverX * absZOverX);\n let x = Math.sqrt(xSquared);\n let z = x * absZOverX;\n if (Math.abs(phi) >= Math.PI * 0.5) {\n x = -x;\n }\n if (phi < 0) {\n z = -z;\n }\n return [x, y, z];\n }",this.dirToUV="(dir: ti.types.vector): ti.types.vector => {\n return [0.5 + (0.5 * Math.atan2(dir[2], dir[0])) / Math.PI, 1.0 - Math.acos(dir[1]) / Math.PI];\n }",this.tonemap="(color: ti.types.vector, exposure: number) => {\n let A = 2.51;\n let B = 0.03;\n let C = 2.43;\n let D = 0.59;\n let E = 0.14;\n //@ts-ignore\n let temp = color * exposure;\n temp = (temp * (A * temp + B)) / (temp * (C * temp + D) + E);\n return Math.max(0.0, Math.min(1.0, temp));\n }",this.characteristic="(x: number) => {\n let result = 1;\n if (x < 0) {\n result = 0;\n }\n return result;\n }",this.ggxDistribution="(NdotH: number, alpha: number) => {\n let numerator = alpha * alpha * this.characteristic(NdotH);\n let temp = NdotH * NdotH * (alpha * alpha - 1) + 1;\n let denominator = Math.PI * temp * temp;\n return numerator / denominator;\n }",this.getLightBrightnessAndDir="(light: any, fragPos: ti.types.vector) => {\n let brightness: ti.types.vector = [0.0, 0.0, 0.0];\n let lightDir: ti.types.vector = [0.0, 0.0, 0.0];\n if (light.type === this.engine.LightType.Point || light.type === this.engine.LightType.Spot) {\n let fragToLight = light.position - fragPos;\n let distance = ti.norm(fragToLight);\n let attenuation = 1.0 / Math.max(distance * distance, 0.01 * 0.01);\n let window = (1 - (distance / light.influenceRadius) ** 2) ** 4;\n //@ts-ignore\n brightness = light.brightness * attenuation * window;\n if (light.type === this.engine.LightType.Spot) {\n let cosAngle = ti.dot(-ti.normalized(fragToLight), light.direction);\n let spotScale =\n 1.0 / Math.max(Math.cos(light.innerConeAngle) - Math.cos(light.outerConeAngle), 1e-4);\n let spotOffset = -Math.cos(light.outerConeAngle) * spotScale;\n let t = cosAngle * spotScale + spotOffset;\n t = Math.max(0.0, Math.min(1.0, t));\n //@ts-ignore\n brightness = brightness * t * t;\n }\n lightDir = ti.normalized(fragToLight);\n } else if (light.type === this.engine.LightType.Directional) {\n brightness = light.brightness;\n lightDir = -light.direction;\n }\n return {\n brightness,\n lightDir,\n };\n }",this.lerp="(x: ti.types.vector | number, y: ti.types.vector | number, s: number): ti.types.vector | number => {\n return x * (1.0 - s) + y * s;\n }",this.linearTosRGB="(x: ti.types.vector | number): ti.types.vector | number => {\n return Math.pow(x, 1.0 / 2.2);\n }",this.sRGBToLinear="(x: ti.types.vector | number): ti.types.vector | number => {\n return Math.pow(x, 2.2);\n }",this.fresnel="(F0: ti.types.vector | number, directions: any) => {\n return F0 + (1.0 - F0) * (1.0 - Math.abs(directions.HdotV)) ** 5;\n }",this.evalSpecularBRDF="(alpha: number, Fr: ti.types.vector | number, directions: any) => {\n let D = this.ggxDistribution(directions.NdotH, alpha);\n let NdotL = Math.abs(directions.NdotL);\n let NdotV = Math.abs(directions.NdotV);\n let G2_Over_4_NdotL_NdotV = 0.5 / this.lerp(2 * NdotL * NdotV, NdotL + NdotV, alpha);\n return (\n G2_Over_4_NdotL_NdotV *\n D *\n Fr *\n this.characteristic(directions.HdotL) *\n this.characteristic(directions.HdotV)\n );\n }",this.evalDiffuseBRDF="(albedo: any, directions: any) => {\n return (\n albedo * (1.0 / Math.PI) * this.characteristic(directions.NdotL) * this.characteristic(directions.NdotV)\n );\n }",this.evalMetalBRDF="(alpha: number, baseColor: ti.types.vector, directions: any) => {\n let F0 = baseColor;\n let Fr = this.fresnel(F0, directions);\n return this.evalSpecularBRDF(alpha, Fr, directions);\n }",this.evalDielectricBRDF="(alpha: number, baseColor: ti.types.vector, directions: any) => {\n let dielectricF0: ti.types.vector = [0.04, 0.04, 0.04];\n let Fr = this.fresnel(dielectricF0, directions);\n let specular = this.evalSpecularBRDF(alpha, Fr, directions);\n let diffuse = this.evalDiffuseBRDF(baseColor, directions);\n return diffuse * (1 - Fr) + specular;\n }",this.evalBRDF="(material: any, normal: ti.types.vector, lightDir: ti.types.vector, viewDir: ti.types.vector) => {\n let halfDir = ti.normalized(viewDir + lightDir);\n let directions = {\n normal: normal,\n lightDir: lightDir,\n viewDir: viewDir,\n halfDir: halfDir,\n NdotH: ti.dot(normal, halfDir),\n NdotV: ti.dot(normal, viewDir),\n NdotL: ti.dot(normal, lightDir),\n HdotV: ti.dot(halfDir, viewDir),\n HdotL: ti.dot(halfDir, lightDir),\n };\n let alpha = material.roughness * material.roughness;\n let metallicBRDF = this.evalMetalBRDF(alpha, material.baseColor.rgb, directions);\n let dielectricBRDF = this.evalDielectricBRDF(alpha, material.baseColor.rgb, directions);\n return material.metallic * metallicBRDF + (1.0 - material.metallic) * dielectricBRDF;\n }",this.evalShadow="(pos: ti.types.vector, shadowMap: DepthTexture, shadowInfo: ShadowInfo) => {\n let vp = shadowInfo.viewProjection;\n let clipSpacePos = ti.matmul(vp, pos.concat([1.0]));\n let depth = clipSpacePos.z / clipSpacePos.w;\n let coords: ti.types.vector = (clipSpacePos.xy / clipSpacePos.w) * 0.5 + 0.5;\n coords.y = 1.0 - coords.y;\n let visibility = ti.textureSampleCompare(shadowMap, coords, depth - 0.001);\n let contribution = 1.0 - (1.0 - visibility) * shadowInfo.strength;\n return contribution;\n }",this.evalIBL="(material: any, normal: ti.types.vector, viewDir: ti.types.vector, pos: ti.types.vector) => {\n let dielectricF0: ti.types.vector = [0.04, 0.04, 0.04];\n let result: ti.types.vector = [0.0, 0.0, 0.0];\n if (ti.Static(this.scene.ibl !== undefined)) {\n let diffuseColor = (1.0 - material.metallic) * (1.0 - dielectricF0) * material.baseColor.rgb;\n let normalUV = this.dirToUV(normal);\n let diffuseLight = ti.textureSample(this.iblLambertianFiltered!, normalUV).rgb;\n let diffuse = diffuseColor * diffuseLight;\n\n let specularColor =\n (1.0 - material.metallic) * dielectricF0 + material.metallic * material.baseColor.rgb;\n let reflection = ti.normalized(2.0 * normal * ti.dot(normal, viewDir) - viewDir);\n let reflectionUV = this.dirToUV(reflection);\n let specularLight = ti.textureSample(\n this.iblGGXFiltered!,\n reflectionUV.concat([material.roughness])\n ).rgb;\n let NdotV = ti.dot(normal, viewDir);\n let scaleBias = ti.textureSample(this.LUT!, [NdotV, material.roughness]).rg;\n let specular = specularLight * (specularColor * scaleBias[0] + scaleBias[1]);\n\n result = specular + diffuse;\n for (let i of ti.Static(ti.range(this.scene.iblShadows.length))) {\n let contribution = this.evalShadow(pos, this.iblShadowMaps[i], this.scene.iblShadows[i]);\n result *= contribution;\n }\n result = result * this.scene.iblIntensity;\n }\n return result;\n }",this.getNormal="(\n normal: ti.types.vector,\n normalMap: ti.types.vector,\n texCoords: ti.types.vector,\n position: ti.types.vector\n ) => {\n let uvDx: ti.types.vector = ti.dpdx(texCoords.concat([0.0]));\n let uvDy: ti.types.vector = ti.dpdy(texCoords.concat([0.0]));\n let posDx: ti.types.vector = ti.dpdx(position);\n let posDy: ti.types.vector = ti.dpdy(position);\n let denom = uvDx[0] * uvDy[1] - uvDy[0] * uvDx[1];\n let temp = (uvDy[1] * posDx - uvDx[1] * posDy) / denom;\n let tangent = temp - normal * ti.dot(normal, temp);\n let tangentNorm = ti.norm(tangent);\n let bitangent = ti.cross(normal, tangent);\n let bitangentNorm = ti.norm(bitangent);\n let mat = ti.transpose([tangent / tangentNorm, bitangent / bitangentNorm, normal]);\n let normalMapValue = ti.normalized(normalMap * 2.0 - 1.0);\n let result = ti.normalized(ti.matmul(mat, normalMapValue));\n if (denom === 0.0 || tangentNorm === 0.0 || bitangentNorm === 0.0) {\n result = normal;\n }\n return result;\n }",this.hammersley2d="(i: number, N: number) => {\n let radicalInverseVdC = (bits: number) => {\n bits = (bits << 16) | (bits >>> 16);\n bits = ((bits & 0x55555555) << 1) | ((bits & 0xaaaaaaaa) >>> 1);\n bits = ((bits & 0x33333333) << 2) | ((bits & 0xcccccccc) >>> 2);\n bits = ((bits & 0x0f0f0f0f) << 4) | ((bits & 0xf0f0f0f0) >>> 4);\n bits = ((bits & 0x00ff00ff) << 8) | ((bits & 0xff00ff00) >>> 8);\n //@ts-ignore\n let result = f32(bits) * 2.3283064365386963e-10;\n if (bits < 0) {\n //@ts-ignore\n result = 1.0 + f32(bits) * 2.3283064365386963e-10;\n }\n return result;\n };\n //@ts-ignore\n return [f32(i) / N, radicalInverseVdC(i32(i))];\n }",this.generateTBN="(normal: ti.types.vector) => {\n let bitangent = [0.0, 1.0, 0.0];\n\n let NdotUp = ti.dot(normal, [0.0, 1.0, 0.0]);\n let epsilon = 0.0000001;\n if (1.0 - Math.abs(NdotUp) <= epsilon) {\n // Sampling +Y or -Y, so we need a more robust bitangent.\n if (NdotUp > 0.0) {\n bitangent = [0.0, 0.0, 1.0];\n } else {\n bitangent = [0.0, 0.0, -1.0];\n }\n }\n\n let tangent = ti.normalized(ti.cross(bitangent, normal));\n bitangent = ti.cross(normal, tangent);\n\n return ti.transpose([tangent, bitangent, normal]);\n }",this.cosineSampleHemisphere="(randomSource: ti.types.vector) => {\n let concentricSampleDisk = (randomSource: ti.types.vector) => {\n let result: ti.types.vector = [0.0, 0.0];\n let uOffset: ti.types.vector = 2.0 * randomSource - 1.0;\n if (uOffset.x !== 0 || uOffset.y !== 0) {\n let theta = 0.0;\n let r = 0.0;\n if (Math.abs(uOffset.x) > Math.abs(uOffset.y)) {\n r = uOffset.x;\n theta = (Math.PI / 4.0) * (uOffset.y / uOffset.x);\n } else {\n r = uOffset.y;\n theta = Math.PI / 2.0 - (Math.PI / 4.0) * (uOffset.x / uOffset.y);\n }\n //@ts-ignore\n result = r * [Math.cos(theta), Math.sin(theta)];\n }\n return result;\n };\n let d = concentricSampleDisk(randomSource);\n let z = Math.sqrt(Math.max(0.0, 1 - d.x * d.x - d.y * d.y));\n return [d.x, d.y, z];\n }",this.cosineSampleHemispherePdf="(sampled: ti.types.vector) => {\n let cosTheta = sampled.z;\n return cosTheta / Math.PI;\n }"}async initKernels(){this.zPrePassKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthPrePassTexture);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n //no-op\n }\n }"),this.gPrePassKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.gNormalTexture, [0.0, 0.0, 0.0, 0.0]);\n ti.clearColor(this.gPositionTexture, [0.0, 0.0, 0.0, 0.0]);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let normal = ti.normalized(f.normal);\n ti.outputColor(this.gNormalTexture, normal.concat([1.0]));\n ti.outputColor(this.gPositionTexture, f.position.concat([1.0]));\n }\n }"),this.renderKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.directLightingTexture, [0, 0, 0, 1]);\n ti.clearColor(this.environmentLightingTexture, [0, 0, 0, 1]);\n\n for (let batchID of ti.Static(ti.range(this.batchesDrawInfoBuffers.length))) {\n let getMaterial = (fragment: any, materialID: number) => {\n //@ts-ignore\n let materialInfo = this.sceneData.materialInfoBuffer[materialID];\n let material = {\n baseColor: materialInfo.baseColor.value,\n metallic: materialInfo.metallicRoughness.value[0],\n roughness: materialInfo.metallicRoughness.value[1],\n emissive: materialInfo.emissive.value,\n normalMap: materialInfo.normalMap.value,\n };\n if (ti.Static(this.batchInfos[batchID].materialIndex != -1)) {\n let texCoords = fragment.texCoords0;\n let materialRef = this.scene.materials[this.batchInfos[batchID].materialIndex];\n if (ti.Static(materialRef.baseColor.texture !== undefined)) {\n if (ti.Static(materialRef.baseColor.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledBaseColor = ti.textureSample(materialRef.baseColor.texture!, texCoords);\n sampledBaseColor.rgb = this.sRGBToLinear(sampledBaseColor.rgb);\n material.baseColor *= sampledBaseColor;\n }\n if (ti.Static(materialRef.metallicRoughness.texture !== undefined)) {\n if (ti.Static(materialRef.metallicRoughness.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let metallicRoughness = ti.textureSample(materialRef.metallicRoughness.texture!, texCoords);\n material.metallic *= metallicRoughness.b;\n material.roughness *= metallicRoughness.g;\n }\n if (ti.Static(materialRef.emissive.texture !== undefined)) {\n if (ti.Static(materialRef.emissive.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledEmissive = ti.textureSample(materialRef.emissive.texture!, texCoords).rgb;\n sampledEmissive = this.sRGBToLinear(sampledEmissive);\n material.emissive *= sampledEmissive;\n }\n if (ti.Static(materialRef.normalMap.texture !== undefined)) {\n if (ti.Static(materialRef.normalMap.texcoordsSet === 1)) {\n texCoords = fragment.texCoords1;\n }\n let sampledNormal = ti.textureSample(materialRef.normalMap.texture!, texCoords).rgb;\n material.normalMap = sampledNormal;\n }\n }\n return material;\n };\n\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.batchesDrawInfoBuffers[batchID]),\n ti.Static(this.batchesDrawInfoBuffers[batchID].dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.batchesDrawInstanceInfoBuffers[batchID][instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n let materialIndex = instanceInfo.materialIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = camera.viewProjection.matmul(v.position.concat([1.0]));\n ti.outputPosition(pos);\n let vertexOutput = ti.mergeStructs(v, { materialIndex: materialIndex });\n ti.outputVertex(vertexOutput);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let materialID = f.materialIndex;\n let material = getMaterial(f, materialID);\n let normal = f.normal.normalized();\n normal = this.getNormal(normal, material.normalMap, f.texCoords0, f.position);\n let viewDir = ti.normalized(camera.position - f.position);\n\n let directLighting: ti.types.vector = [0.0, 0.0, 0.0];\n directLighting += material.emissive;\n\n let evalLight = (light: any) => {\n let brightnessAndDir = this.getLightBrightnessAndDir(light, f.position);\n let brdf = this.evalBRDF(material, normal, brightnessAndDir.lightDir, viewDir);\n return brightnessAndDir.brightness * brdf;\n };\n\n if (ti.Static(this.scene.lights.length > 0)) {\n for (let i of ti.range(this.scene.lights.length)) {\n //@ts-ignore\n let light = this.sceneData.lightsInfoBuffer[i];\n if (!light.castsShadow) {\n directLighting += evalLight(light);\n }\n }\n for (let i of ti.Static(ti.range(this.scene.lights.length))) {\n if (ti.Static(this.scene.lights[i].castsShadow)) {\n directLighting +=\n evalLight(this.scene.lights[i]) *\n this.evalShadow(f.position, this.lightShadowMaps[i]!, this.scene.lights[i].shadow!);\n }\n }\n }\n\n let environmentLighting: ti.types.vector = this.evalIBL(material, normal, viewDir, f.position);\n directLighting += environmentLighting;\n\n ti.outputColor(this.directLightingTexture, directLighting.concat([1.0]));\n ti.outputColor(this.environmentLightingTexture, environmentLighting.concat([1.0]));\n }\n }\n if (ti.Static(this.scene.ibl !== undefined)) {\n for (let v of ti.inputVertices(this.skyboxVBO!, this.skyboxIBO!)) {\n let pos = camera.viewProjection.matmul((v + camera.position).concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (1.0 > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy))) {\n ti.discard();\n }\n let dir = f.normalized();\n let uv = this.dirToUV(dir);\n let color = ti.textureSample(this.iblGGXFiltered!, uv.concat([this.scene.iblBackgroundBlur]));\n //color *= this.scene.iblIntensity\n color.rgb = this.tonemap(color.rgb, this.scene.ibl!.exposure);\n color[3] = 1.0;\n ti.outputColor(this.directLightingTexture, color);\n ti.outputColor(this.environmentLightingTexture, [0.0, 0.0, 0.0, 0.0]);\n ti.outputDepth(1.0);\n }\n }\n }"),this.ssaoKernel=_r(this,{camera:Ec.getKernelType()},"(camera: any) => {\n ti.useDepth(this.depthTexture);\n ti.clearColor(this.ssaoTexture, [0, 0, 0, 1]);\n\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n v.normal = ti.transpose(ti.inverse(modelMatrix.slice([0, 0], [3, 3]))).matmul(v.normal);\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(camera.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let fragCoord = ti.getFragCoord();\n //@ts-ignore\n if (fragCoord.z > ti.textureLoad(this.depthPrePassTexture, ti.i32(fragCoord.xy)) + 0.001) {\n ti.discard();\n }\n let normal = f.normal.normalized();\n let TBN = this.generateTBN(normal);\n\n let clipSpacePos = ti.matmul(camera.viewProjection, f.position.concat([1.0]));\n let screenSpaceCoords: ti.types.vector = (clipSpacePos.xy / clipSpacePos.w) * 0.5 + 0.5;\n //@ts-ignore\n let texelIndex = ti.i32(\n [screenSpaceCoords.x, 1.0 - screenSpaceCoords.y] *\n ([this.htmlCanvas.width, this.htmlCanvas.height] - 1)\n );\n let indexInBlock: ti.types.vector = [\n texelIndex.x % this.ssaoSamples.dimensions[1],\n texelIndex.y % this.ssaoSamples.dimensions[2],\n ];\n //@ts-ignore\n let numSamples = this.ssaoSamples.dimensions[0];\n let sampleRadius = ti.norm(camera.position - f.position) * 0.05;\n\n let sumVisibility = 0.0;\n\n for (let i of ti.range(numSamples)) {\n //@ts-ignore\n let ssaoSample = this.ssaoSamples[[i, indexInBlock.x, indexInBlock.y]];\n let deltaPos = ti.matmul(TBN, ssaoSample) * sampleRadius;\n let sampledPoint = deltaPos + f.position;\n let sampledPointClipSpace = ti.matmul(camera.viewProjection, sampledPoint.concat([1.0]));\n //@ts-ignore\n let sampledPointDepth = sampledPointClipSpace.z / sampledPointClipSpace.w;\n let sampledPointScreenSpace: ti.types.vector =\n (sampledPointClipSpace.xy / sampledPointClipSpace.w) * 0.5 + 0.5;\n let texCoords = [sampledPointScreenSpace.x, 1.0 - sampledPointScreenSpace.y];\n\n let vis = 1.0;\n //@ts-ignore\n if (\n sampledPointDepth >=\n ti.textureLoad(\n this.depthPrePassTexture,\n ti.i32(texCoords * (this.depthPrePassTexture.dimensions - 1))\n )\n ) {\n vis = 0.0;\n }\n sumVisibility += vis; // should multiply by cosTheta here (see games 202 lecture), but this is cancelled by dividing the PDF\n }\n let meanVisibility = sumVisibility / numSamples;\n ti.outputColor(this.ssaoTexture, [0.0, 0.0, 0.0, meanVisibility]);\n //ti.outputColor(this.ssaoTexture, [1 - result.w, 1-result.w, 1-result.w, 1.0])\n }\n }"),this.ssaoBlurKernel=_r(this,"() => {\n for (let I of ti.ndrange(this.ssaoTexture.dimensions[0], this.ssaoTexture.dimensions[1])) {\n let ssaoSum: ti.types.vector = [0.0, 0.0, 0.0, 0.0];\n for (let delta of ti.ndrange(5, 5)) {\n let J: ti.types.vector = I + delta - 1;\n //@ts-ignore\n J = Math.max(0, Math.min(this.ssaoTexture.dimensions - 1, J));\n let ssao = ti.textureLoad(this.ssaoTexture, J);\n ssaoSum += ssao;\n }\n ti.textureStore(this.ssaoBlurredTexture, I, ssaoSum / 25.0);\n }\n }"),this.shadowKernel=_r(this,{shadowMap:ur(),shadowInfo:ur()},"(shadowMap: DepthTexture, shadowInfo: ShadowInfo) => {\n ti.useDepth(shadowMap);\n for (let v of ti.inputVertices(\n this.sceneData!.vertexBuffer,\n this.sceneData!.indexBuffer,\n ti.Static(this.geometryOnlyDrawInfoBuffer),\n ti.Static(this.geometryOnlyDrawInfoBuffer!.dimensions[0])\n )) {\n let instanceIndex = ti.getInstanceIndex();\n //@ts-ignore\n let instanceInfo = this.geometryOnlyDrawInstanceInfoBuffer[instanceIndex];\n let nodeIndex = instanceInfo.nodeIndex;\n //@ts-ignore\n let modelMatrix = this.sceneData.nodesBuffer[nodeIndex].globalTransform.matrix;\n\n v.position = modelMatrix.matmul(v.position.concat([1.0])).xyz;\n let pos = ti.matmul(shadowInfo.viewProjection, v.position.concat([1.0]));\n ti.outputPosition(pos);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n //no-op\n }\n }"),this.combineKernel=_r(this,{},"() => {\n ti.clearColor(this.renderResultTexture, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.quadVBO, this.quadIBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord: ti.types.vector = (f + 1) / 2.0;\n coord[1] = 1 - coord[1];\n\n let directLighting = ti.textureSample(this.directLightingTexture, coord).rgb;\n let environmentLighting = ti.textureSample(this.environmentLightingTexture, coord).rgb;\n let ssao = ti.textureSample(this.ssaoBlurredTexture, coord);\n let occlusion = ssao[3];\n let color: ti.types.vector = directLighting - environmentLighting * (1.0 - occlusion);\n color = this.linearTosRGB(this.tonemap(color, 1.0));\n //color = [occlusion, occlusion, occlusion]\n ti.outputColor(this.renderResultTexture, color.concat([1.0]));\n }\n }"),this.presentKernel=_r(this,{presentedTexture:ur()},"(presentedTexture: Texture) => {\n ti.clearColor(this.canvasTexture, [0.0, 0.0, 0.0, 1]);\n for (let v of ti.inputVertices(this.quadVBO, this.quadIBO)) {\n ti.outputPosition([v.x, v.y, 0.0, 1.0]);\n ti.outputVertex(v);\n }\n for (let f of ti.inputFragments()) {\n let coord: ti.types.vector = (f + 1) / 2.0;\n coord[1] = 1 - coord[1];\n\n let color = ti.textureSample(presentedTexture, coord);\n color[3] = 1.0;\n ti.outputColor(this.canvasTexture, color);\n }\n }")}async initSSAO(){let e=_r(this,"() => {\n let numSamples = this.ssaoSamples.dimensions[0];\n let blockSizeX = this.ssaoSamples.dimensions[1];\n let blockSizeY = this.ssaoSamples.dimensions[2];\n for (let I of ti.ndrange(numSamples, blockSizeX, blockSizeY)) {\n let sampleId = I[0];\n let randomSource = this.hammersley2d(sampleId, numSamples);\n let sample = this.cosineSampleHemisphere(randomSource);\n let length = Math.random();\n length = this.lerp(0.1, 1.0, length);\n sample *= length;\n //@ts-ignore\n this.ssaoSamples[I] = sample;\n }\n }");await e()}async initIBL(){if(this.scene.ibl){this.iblLambertianFiltered=Sr(4,this.scene.ibl.texture.dimensions),this.iblGGXFiltered=Sr(4,this.scene.ibl.texture.dimensions.concat([16]),1,{wrapModeW:n.ClampToEdge}),this.LUT=Sr(4,[512,512],1,{wrapModeU:n.ClampToEdge,wrapModeV:n.ClampToEdge}),this.skyboxVBO=yr(Lc(gr,3),8),this.skyboxIBO=yr(mr,36),await this.skyboxVBO.fromArray([[-1,-1,-1],[-1,-1,1],[-1,1,-1],[-1,1,1],[1,-1,-1],[1,-1,1],[1,1,-1],[1,1,1]]),await this.skyboxIBO.fromArray([0,1,2,1,3,2,4,5,6,5,7,6,0,2,4,2,6,4,1,3,5,3,7,5,0,1,4,1,5,4,2,3,6,3,7,6]);let e=_r(this,"() => {\n let kSampleCount = 1024;\n\n let computeLod = (pdf: number) => {\n return (\n (0.5 *\n Math.log(\n (6.0 *\n this.scene.ibl!.texture.dimensions[0] *\n this.scene.ibl!.texture.dimensions[0]) /\n (kSampleCount * pdf)\n )) /\n Math.log(2.0)\n );\n };\n\n let getLambertianImportanceSample = (normal: ti.types.vector, xi: ti.types.vector) => {\n let localSpaceDirection = this.cosineSampleHemisphere(xi);\n let pdf = this.cosineSampleHemispherePdf(localSpaceDirection);\n let TBN = this.generateTBN(normal);\n let direction = ti.matmul(TBN, localSpaceDirection);\n return {\n pdf: pdf,\n direction: direction,\n };\n };\n\n let filterLambertian = (normal: ti.types.vector) => {\n let color: any = [0.0, 0.0, 0.0];\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getLambertianImportanceSample(normal, xi);\n let halfDir = importanceSample.direction;\n let pdf = importanceSample.pdf;\n let lod = computeLod(pdf);\n let halfDirCoords = this.dirToUV(halfDir);\n let sampled = ti.textureSampleLod(this.scene.ibl!.texture, halfDirCoords, lod);\n //@ts-ignore\n color += sampled.rgb / kSampleCount;\n }\n return color;\n };\n\n for (let I of ti.ndrange(\n this.iblLambertianFiltered!.dimensions[0],\n this.iblLambertianFiltered!.dimensions[1]\n )) {\n //@ts-ignore\n let uv = I / (this.iblLambertianFiltered.dimensions - [1.0, 1.0]);\n let dir = this.uvToDir(uv);\n let filtered = filterLambertian(dir);\n ti.textureStore(this.iblLambertianFiltered!, I, filtered.concat([1.0]));\n }\n\n let saturate = (v: any) => {\n return Math.max(0.0, Math.min(1.0, v));\n };\n\n let getGGXImportanceSample = (normal: ti.types.vector, roughness: number, xi: ti.types.vector) => {\n let alpha = roughness * roughness;\n let cosTheta = saturate(Math.sqrt((1.0 - xi[1]) / (1.0 + (alpha * alpha - 1.0) * xi[1])));\n let sinTheta = Math.sqrt(1.0 - cosTheta * cosTheta);\n let phi = 2.0 * Math.PI * xi[0];\n\n let pdf = this.ggxDistribution(cosTheta, alpha) / 4.0;\n let localSpaceDirection = [sinTheta * Math.cos(phi), sinTheta * Math.sin(phi), cosTheta];\n let TBN = this.generateTBN(normal);\n let direction = ti.matmul(TBN, localSpaceDirection);\n return {\n pdf: pdf,\n direction: direction,\n };\n };\n\n let filterGGX = (normal: ti.types.vector, roughness: number) => {\n let color = [0.0, 0.0, 0.0];\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getGGXImportanceSample(normal, roughness, xi);\n let halfDir = importanceSample.direction;\n let pdf = importanceSample.pdf;\n let lod = computeLod(pdf);\n if (roughness == 0.0) {\n lod = 0.0;\n }\n let halfDirCoords = this.dirToUV(halfDir);\n let sampled = ti.textureSampleLod(this.scene.ibl!.texture, halfDirCoords, lod);\n //@ts-ignore\n color += sampled.rgb / kSampleCount;\n }\n return color;\n };\n\n for (let I of ti.ndrange(this.iblGGXFiltered!.dimensions[0], this.iblGGXFiltered!.dimensions[1])) {\n let numLevels = this.iblGGXFiltered!.dimensions[2];\n for (let level of ti.range(numLevels)) {\n let roughness = level / (numLevels - 1);\n //@ts-ignore\n let uv = I / (this.iblGGXFiltered.dimensions.slice(0, 2) - [1.0, 1.0]);\n let dir = this.uvToDir(uv);\n let filtered = filterGGX(dir, roughness);\n ti.textureStore(this.iblGGXFiltered!, I.concat([level]), filtered.concat([1.0]));\n }\n }\n\n let computeLUT = (NdotV: number, roughness: number): ti.types.vector => {\n let V: any = [Math.sqrt(1.0 - NdotV * NdotV), 0.0, NdotV];\n let N = [0.0, 0.0, 1.0];\n\n let A = 0.0;\n let B = 0.0;\n let C = 0.0;\n\n for (let i of ti.range(kSampleCount)) {\n let xi = this.hammersley2d(i, kSampleCount);\n let importanceSample = getGGXImportanceSample(N, roughness, xi);\n let H: any = importanceSample.direction;\n // float pdf = importanceSample.w;\n //@ts-ignore\n let L = ti.normalized(2.0 * H * ti.dot(H, V) - V);\n\n let NdotL = saturate(L[2]);\n let NdotH = saturate(H[2]);\n let VdotH = saturate(ti.dot(V, H));\n\n if (NdotL > 0.0) {\n let a2 = Math.pow(roughness, 4.0);\n let GGXV = NdotL * Math.sqrt(NdotV * NdotV * (1.0 - a2) + a2);\n let GGXL = NdotV * Math.sqrt(NdotL * NdotL * (1.0 - a2) + a2);\n let V_pdf = ((0.5 / (GGXV + GGXL)) * VdotH * NdotL) / NdotH;\n let Fc = Math.pow(1.0 - VdotH, 5.0);\n A += (1.0 - Fc) * V_pdf;\n B += Fc * V_pdf;\n C += 0.0;\n }\n }\n //@ts-ignore\n return [4.0 * A, 4.0 * B, 4.0 * 2.0 * Math.PI * C] / kSampleCount;\n };\n\n for (let I of ti.ndrange(this.LUT!.dimensions[0], this.LUT!.dimensions[1])) {\n //@ts-ignore\n let uv: ti.types.vector = I / (this.LUT.dimensions - [1.0, 1.0]);\n let texel = computeLUT(uv[0], uv[1]);\n ti.textureStore(this.LUT!, I, texel.concat([1.0]));\n }\n }",void 0);await e()}}async computeDrawBatches(){this.batchesDrawInfos=[],this.batchesDrawInstanceInfos=[];let e=[],t=[];for(let r=0;r=0){let n=this.scene.meshes[t.mesh];for(let t of n.primitives)if(t.materialID===r){let n=new kc(t.indexCount,1,t.firstIndex,0,-1);i.push(n);let o=new Ac(e,r);a.push(o)}}}n.hasTexture()?(this.batchesDrawInfos.push(i),this.batchesDrawInstanceInfos.push(a),this.batchInfos.push(new Tc(r))):(e=e.concat(i),t=t.concat(a))}e.length>0&&t.length>0&&(this.batchesDrawInfos.push(e),this.batchesDrawInstanceInfos.push(t),this.batchInfos.push(new Tc(-1)));for(let e of this.batchesDrawInfos)for(let t=0;t=0){let r=this.scene.meshes[t.mesh];for(let t of r.primitives){let r=this.geometryOnlyDrawInstanceInfos.length,n=new kc(t.indexCount,1,t.firstIndex,0,r);this.geometryOnlyDrawInfos.push(n);let i=new Ac(e,t.materialID);this.geometryOnlyDrawInstanceInfos.push(i)}}}this.geometryOnlyDrawInfoBuffer=yr(kc.getKernelType(),this.geometryOnlyDrawInfos.length),await this.geometryOnlyDrawInfoBuffer.fromArray(this.geometryOnlyDrawInfos),this.geometryOnlyDrawInstanceInfoBuffer=yr(Ac.getKernelType(),this.geometryOnlyDrawInstanceInfos.length),await this.geometryOnlyDrawInstanceInfoBuffer.fromArray(this.geometryOnlyDrawInstanceInfos)}async render(e){let t=this.htmlCanvas.width/this.htmlCanvas.height;e.computeMatrices(t);for(let e=0;eparseInt(e)-1)),o=a[0];e[r]=o,a.length>=2&&0!==i[1].length&&(n.vertices[o].texCoords0=s[a[1]]),3===a.length&&(n.vertices[o].normal=c[a[2]])}n.indices.push(e[0]),n.indices.push(e[1]),n.indices.push(e[2]),l.indexCount+=3,4===e.length&&(n.indices.push(e[0]),n.indices.push(e[2]),n.indices.push(e[3]),l.indexCount+=3)}}l&&u.push(l);let d=new Pn;n.rootNode=0,n.nodes=[d];for(let e of u){let t=new pc([e]),r=n.meshes.length;n.meshes.push(t);let i=new Pn,a=n.nodes.length;i.mesh=r,i.parent=0,d.children.push(a),n.nodes.push(i)}return n.init(),n}static getNewVertex(e,t){let r=new wn(t);return r.position=e,r}},MtlLoader:wc,GltfLoader:fc,HdrTexture:Pc,HdrLoader:Ic,get LightType(){return kn},LightInfo:In,PointLightInfo:class extends In{constructor(e,t,r,n,i=!1,a){super(kn.Point,e,t,r,n,[0,0,0],0,0,i,a)}},SpotLightInfo:class extends In{constructor(e,t,r,n,i,a=0,o=Math.PI/4,s=!1,c){super(kn.Spot,e,t,r,n,i,a,o,s,c),this.innerConeAngle=a,this.outerConeAngle=o}},DirectionalLightInfo:class extends In{constructor(e,t,r,n=!1,i=[0,0,0],a){super(kn.Directional,e,t,0,i,r,0,0,n,a)}},DrawInfo:kc,BatchInfo:Tc,InstanceInfo:Ac,Transform:Fn,ShadowInfo:Oc});function Lc(e,t){return new d(e,t)}function Rc(e,t,r){return new _(e,t,r)}function Bc(e){return new f(e)}var Jc=Object.freeze({__proto__:null,vector:Lc,matrix:Rc,struct:Bc});function jc(e,t,r=1e-6){if("number"==typeof t)return c("number"==typeof e,"expecting number"),!(isNaN(e)!=isNaN(t)||Math.abs(e-t)>r)||(s(`Mismatch: expecting ${t}, but received ${e}`),!1);if(Array.isArray(t)){c(Array.isArray(e),"expecting array"),c(e.length===t.length,"length mismatch ",e.length,t.length);for(let n=0;n {\n //@ts-ignore\n for (let i of range(2)) {\n for (let j of range(2)) {\n m[[i, j]][[0, 0]] = i * 1000 + j * 100;\n m[[i, j]][[0, 1]] = i * 1000 + j * 100 + 1;\n m[[i, j]][[1, 0]] = i * 1000 + j * 100 + 10;\n m[[i, j]][[1, 1]] = i * 1000 + j * 100 + 11;\n }\n }\n v[0] = m[[1, 1]][1];\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,10,11,100,101,110,111,1e3,1001,1010,1011,1100,1101,1110,1111])&&jc(n,[1110,1111])}()),e&&(e=await async function(){console.log("testVectorLocalVar"),await ie();let e=hr.field(2,mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j + 10000];\n f[[i, j]] = v;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testMatrixLocalVar"),await ie();let e=vr.field(2,2,mr,[2,2]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(2)) {\n for (let j of range(2)) {\n let m = [\n [i * 1000 + j * 100, i * 1000 + j * 100 + 1],\n [i * 1000 + j * 100 + 10, i * 1000 + j * 100 + 11],\n ];\n f[[i, j]] = m;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,10,11,100,101,110,111,1e3,1001,1010,1011,1100,1101,1110,1111])}()),e&&(e=await async function(){console.log("testMultipleSNodeTree"),await ie();let e=yr(mr,[7]);cr({f1:e}),dr("function k1() {\n //@ts-ignore\n for (let i of range(7)) {\n f1[i] = i;\n }\n }")();let t=yr(mr,[7]);cr({f1:e,f2:t}),dr("function k2() {\n //@ts-ignore\n for (let i of range(7)) {\n f2[i] = f1[i] + 1;\n }\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2,3,4,5,6])&&jc(n,[1,2,3,4,5,6,7])}()),e&&(e=await async function(){console.log("testNdrange"),await ie();let e=yr(mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let I of ndrange(3, 3)) {\n let i = I[0];\n let j = I[1];\n f[[i, j]] = i * 10 + j;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,10,11,12,20,21,22])}()),e&&(e=await async function(){console.log("testVectorArithmetic"),await ie();let e=hr.field(2,mr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j] + [0, 10000];\n v = v * 2;\n f[[i, j]] = i32(v / 2);\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testFloat"),await ie();let e=hr.field(2,gr,[3,3]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(3)) {\n for (let j of range(3)) {\n let v = [i * 10 + j, i * 10 + j] + [0, 10000];\n v = v * 2;\n f[[i, j]] = v / 2;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1e4,1,10001,2,10002,10,10010,11,10011,12,10012,20,10020,21,10021,22,10022])}()),e&&(e=await async function(){console.log("testSerial"),await ie();let e=hr.field(2,gr,[1]);cr({f:e}),dr("function k() {\n let v = [1.5, 4.5];\n v = v * 2;\n f[0] = v;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[3,9])}()),e&&(e=await async function(){console.log("testMath"),await ie();let e=yr(gr,[9]);cr({f:e}),dr("function k() {\n let x = max(0.5, 0.75);\n f[0] = x;\n\n let c = sin(x);\n let s = cos(x);\n f[1] = c * c + s * s;\n\n f[2] = log(4) / log(2);\n\n f[3] = 3;\n f[4] = f[3] += 3; // += is considered atomic, so the value returned is the old value\n\n f[5] = 5;\n f[6] = f[5] *= 5; // += is not atomic, so the value returned is the new value\n\n let temp = 6.0;\n f[7] = temp /= 2;\n f[8] = temp;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[.75,1,2,6,3,25,25,3,3])}()),e&&(e=await async function(){console.log("testKernelScope"),await ie();let e=[313,326],t=[[313,533],[326,799]],r=yr(gr,[1]),n=hr.field(2,gr,[1]),i=vr.field(2,2,gr,[1]);cr({a:2533,b:e,c:t,f:r,v:n,m:i}),dr("function k() {\n f[0] = (a * 2) / 2;\n v[0] = (b * 3) / 3;\n m[0] = c + 4 - 4;\n }")();let a=await r.toArray1D(),o=await n.toArray1D(),s=await i.toArray1D();return console.log(a,o,s),jc(a,[2533])&&jc(o,e)&&jc(s,t[0].concat(t[1]))}()),e&&(e=await async function(){console.log("testIf"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(10)) {\n if (i < 3 || i >= 8) {\n f[i] = i;\n } else {\n f[i] = 0;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,0,0,0,0,0,8,9])}()),e&&(e=await async function(){console.log("testWhile"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 5) {\n f[i] = i;\n i = i + 1;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,4,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testBreak"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 5) {\n f[i] = i;\n i = i + 1;\n if (i > 3) {\n break;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,0,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testContinue"),await ie();let e=yr(mr,[10]),t=yr(mr,[10]),r=yr(mr,[10]);cr({f1:e,f2:t,f3:r}),dr("function k() {\n //@ts-ignore\n let i = 0;\n while (i < 10) {\n if (i < 5) {\n i = i + 1;\n continue;\n }\n f1[i] = i;\n i = i + 1;\n }\n for (let j of ti.range(10)) {\n if (j < 5) {\n continue;\n }\n f2[j] = 2 * j;\n }\n for (let k of ti.range(1)) {\n for (let j of ti.range(10)) {\n if (j < 5) {\n continue;\n }\n f3[j] = 2 * j;\n }\n }\n }")();let n=await e.toArray1D(),i=await t.toArray1D(),a=await r.toArray1D();return console.log(n,i,a),jc(n,[0,0,0,0,0,5,6,7,8,9])&&jc(i,[0,0,0,0,0,10,12,14,16,18])&&jc(a,[0,0,0,0,0,10,12,14,16,18])}()),e&&(e=await async function(){console.log("testUnary"),await ie();let e=yr(mr,[10]);cr({f:e}),dr("function k() {\n //@ts-ignore\n for (let i of range(10)) {\n if (!(i >= 5)) {\n f[i] = -i;\n }\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,-1,-2,-3,-4,0,0,0,0,0])}()),e&&(e=await async function(){console.log("testArrowFunctionKernel"),await ie();let e=yr(gr,[10]);cr({f:e}),dr("() => {\n for (let i of range(10)) {\n f[i] = i + i;\n }\n for (let i of range(10)) {\n f[i] = f[i] + i;\n }\n for (let i of range(10)) {\n f[i + 1 - 1] = f[i - 1 + 1] / 3;\n }\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[0,1,2,3,4,5,6,7,8,9])}()),e&&(e=await async function(){console.log("testArgs"),await ie();let e=yr(gr,[10]);cr({f:e}),dr("(x) => {\n //@ts-ignore\n for (let i of range(10)) {\n f[i] = i + x;\n }\n }")(3);let t=await e.toArray1D();return console.log(t),jc(t,[3,4,5,6,7,8,9,10,11,12])}()),e&&(e=await async function(){console.log("testFunc"),await ie();let e=yr(mr,[10]),t=hr.field(2,mr,[10]),r=hr.field(2,mr,[10]),n=hr.field(2,mr,[10]),i=hr.field(2,mr,[10]);cr({f1:e,f2:t,f3:r,f4:n,f5:i,returnOne:()=>1,identity:e=>e,plusOne:e=>1+e,getMirrorVec:e=>[e,-e],modify:"(x, i) => { x = x + i }",modifyUseless:(e,t)=>e}),dr("() => {\n //@ts-ignore\n for (let i of range(10)) {\n f1[i] = plusOne(i);\n f2[i] = plusOne([i, i]);\n f3[i] = getMirrorVec(i);\n modify(f4[i], [i, i]);\n f5[i] = modifyUseless(i, 123);\n }\n }")();let a=await e.toArray1D(),o=await t.toArray1D(),s=await r.toArray1D(),c=await n.toArray1D();return console.log(a,o,s,c),jc(a,[1,2,3,4,5,6,7,8,9,10])&&jc(o,[1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10])&&jc(s,[0,0,1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,8,-8,9,-9])&&jc(c,[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9])}()),e&&(e=await async function(){console.log("testVectorComponent"),await ie();let e=hr.field(2,gr,1);cr({f:e,res:[2,4]});let t=dr("() => {\n //@ts-ignore\n for (let i of range(1)) {\n f[i] = [i + 1, i + 1];\n }\n }"),r=dr("() => {\n //@ts-ignore\n for (let i of range(1)) {\n let x = f[i] * [2, 3] + [0.5, 0.0];\n x[0] = x[0] * res[0];\n x[1] = x[1] * res[1];\n let ix = i32(x);\n f[i] = x;\n }\n }");t(),r();let n=await e.toArray1D();return console.log(n),jc(n,[5,12])}()),e&&(e=await async function(){console.log("testPropertyFunc"),await ie();let e=yr(gr,[13]);cr({f:e,dot_f:(e,t)=>e.dot(t)}),dr("() => {\n //@ts-ignore\n let x = [3.0, 4.0];\n f[0] = x.norm();\n f[1] = x.normSqr();\n f[2] = x.length();\n f[3] = x.sum();\n\n f[4] = [3.0, 4.0].norm();\n f[5] = [3.0, 4.0].normSqr();\n f[6] = [3.0, 4.0].length();\n f[7] = [3.0, 4.0].sum();\n\n let y = [1.0, 2.0];\n f[8] = dot(x, y);\n f[9] = x.dot(y);\n f[10] = dot_f(x, y);\n\n f[11] = [3.0, 4.0].normalized().x;\n f[12] = [3.0, 4.0].normalized().y;\n }")();let t=await e.toArray1D();return console.log(t),jc(t,[5,25,2,7,5,25,2,7,11,11,11,.6,.8])}()),e&&(e=await async function(){console.log("testSwizzle"),await ie();let e=yr(gr,[10]),t=hr.field(4,gr,[2]);cr({f:e,v:t}),dr("() => {\n //@ts-ignore\n let v0 = [0.0, 1.0, 2.0, 3.0];\n let v1 = v0.xyzw;\n f[0] = v1.x;\n f[1] = v1.y;\n f[2] = v1.z;\n f[3] = v1.w;\n\n let v2 = [0.0, 1.0, 2.0, 3.0].bgra;\n f[4] = v2.r;\n f[5] = v2.g;\n f[6] = v2.b;\n f[7] = v2.a;\n\n let v3 = [0.0, 1.0].uv;\n f[8] = v3.v;\n f[9] = v3.u;\n\n let v4 = [0.0, 0.0, 0.0, 0.0];\n v4.x = 1;\n v4.y = 2;\n v4.z = 3;\n v4.w = 4;\n v[0] = v4;\n\n let v5 = [0.0, 0.0, 0.0, 0.0];\n v5.wzyx = [1, 2, 3, 4].wzwz;\n v[1] = v5;\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2,3,2,1,0,3,1,0])&&jc(n,[1,2,3,4,3,4,3,4])}()),e&&(e=await async function(){console.log("testRandom"),await ie();let e=1e4,t=yr(gr,[e]);cr({f:t,N:e}),dr("() => {\n for (let i of range(N)) {\n f[i] = random();\n }\n }")();let r=await t.toArray1D(),n=0,i=0;for(let e of r)n+=e,i+=e*e;let a=n/e,o=i/e;return console.log(a,o),console.log(r),jc([a],[.5],.01)&&jc([o],[1/3],.01)}()),e&&(e=await async function(){console.log("testAtomic"),await ie();let e=100,t=100,r=1e5,n=yr(gr,[1]),i=yr(gr,[1]),a=yr(gr,[1]),o=yr(mr,[1]),s=yr(mr,[t]),c=yr(mr,[1]);cr({f1:n,f2:i,f3:a,i1:o,i2:s,i3:c,n1:e,n2:t,n3:r});let l=dr("() => {\n for (let i of range(n1)) {\n f1[0] += i;\n atomicAdd(i1[0], i);\n }\n for (let i of range(n2)) {\n let my_index = (f2[0] += 1);\n i2[i] = i32(my_index);\n }\n for (let i of range(n3)) {\n atomicAdd(f3[0], 1);\n i3[0] += 1;\n }\n }");await l();let u=await n.toArray1D(),d=await i.toArray1D(),_=await a.toArray1D(),p=await o.toArray1D(),f=await s.toArray1D(),m=await c.toArray1D();console.log(u),console.log(d),console.log(_),console.log(p),console.log(f),console.log(m);let g=!0;g&&(g=jc(u,[4950])),g&&(g=jc(p,[4950])),g&&(g=jc(_,[r])),g&&(g=jc(m,[r])),g&&(g=jc(d,[t])),f.sort((function(e,t){return e-t}));for(let e=0;e {\n let s = 0.0;\n for (let i of range(100)) {\n s += i;\n }\n return s;\n }"),h=await y(),v=0;for(let e of Nr(100))v+=e;return g&&(g=jc(h,v)),console.log(h),g}()),e&&(e=await async function(){console.log("testMatrixOps"),await ie();let e=vr.field(2,2,gr,[4]),t=hr.field(2,gr,[1]);cr({f:e,v:t}),dr("() => {\n //@ts-ignore\n let m1 = [\n [1, 2],\n [3, 4],\n ];\n let m2 = [\n [5, 6],\n [7, 8],\n ];\n let m3 = m1.matmul(m2);\n f[0] = m3;\n f[1] = m2.transpose();\n f[2] = m1.transpose().transpose();\n f[3] = [1, 2].outerProduct([3, 4]);\n let v1 = [9, 10];\n let v2 = m1.matmul(v1);\n v[0] = v2;\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[19,22,43,50,5,7,6,8,1,2,3,4,3,4,6,8])&&jc(n,[29,67])}()),e&&(e=await async function(){console.log("testLibraryFuncs"),await ti.init();let e=ti.Matrix.field(2,2,ti.f32,[5]),t=ti.Matrix.field(3,3,ti.f32,[3]);ti.addToKernelScope({f2:e,f3:t}),ti.kernel("() => {\n //@ts-ignore\n let m2 = [\n [1.0, 2.0],\n [3.0, 4.0],\n ];\n let polar2DResult = ti.polarDecompose2D(m2);\n let svd2DResult = ti.svd2D(m2);\n f2[0] = polar2DResult.U;\n f2[1] = polar2DResult.P;\n f2[2] = svd2DResult.U;\n f2[3] = svd2DResult.E;\n f2[4] = svd2DResult.V;\n\n let m3 = [\n [1.0, 2.0, 3.0],\n [4.0, 5.0, 6.0],\n [7.0, 8.0, 9.0],\n ];\n let svd3DResult = ti.svd3D(m3);\n f3[0] = svd3DResult.U;\n f3[1] = svd3DResult.E;\n f3[2] = svd3DResult.V;\n }")();let r=await e.toArray1D();console.log(r);let n=await t.toArray();return console.log(n),jc(r,[.9805807,-.19611613,.19611613,.9805807,1.5689291,2.745626,2.7456257,3.5300906,-.40455358,.9145143,-.9145143,-.40455358,5.4649857,0,0,-.36596619,-.57604844,.81741556,-.81741556,-.57604844])&&jc(n,[[[-.214837,-.887231,-.408248],[-.520588,-.249644,.816496],[-.826337,.387943,-.408248]],[[16.8481,0,0],[0,1.06837,0],[0,0,-4.86675e-8]],[[-.479671,.776689,.408253],[-.572368,.0756911,-.816496],[-.665064,-.62532,.408245]]],1e-4)}()),e&&(e=await async function(){console.log("testStaticLoopUnroll"),await ti.init();let e=ti.Vector.field(3,ti.i32,[1]),t=ti.Matrix.field(3,3,ti.i32,[2]);ti.addToKernelScope({v:e,m:t}),ti.kernel("() => {\n //@ts-ignore\n for (let _ of range(1)) {\n for (let i of ti.static(ti.range(3))) {\n v[0][i] = i;\n }\n for (let i of ti.static(ti.range(3))) {\n for (let j of ti.static(ti.range(3))) {\n m[0][[i, j]] = i * 10 + j;\n }\n }\n for (let I of ti.static(ti.ndrange(3, 3))) {\n m[1][[I[0], I[1]]] = I[0] * 10 + I[1];\n }\n }\n }")();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[0,1,2])&&jc(n,[0,1,2,10,11,12,20,21,22,0,1,2,10,11,12,20,21,22])}()),e&&(e=await async function(){console.log("testBroadcast"),await ie();let e=vr.field(2,2,mr,[1]),t=hr.field(2,mr,[1]);cr({m:e,v:t}),dr((()=>{e[0]=1,t[0]=1+[2,3]}))();let r=await e.toArray1D(),n=await t.toArray1D();return console.log(r,n),jc(r,[1,1,1,1])&&jc(n,[3,4])}()),e&&(e=await async function(){console.log("testTypes"),await ie();let e=Lc(mr,3),t=yr(Rc(gr,2,2),[1]),r=yr(e,[1]);cr({m:t,v:r}),dr("() => {\n v[0] = [0, 1, 2];\n m[0] = [\n [0, 1],\n [2, 3],\n ];\n }")();let n=await t.toArray1D(),i=await r.toArray1D();return console.log(n,i),jc(n,[0,1,2,3])&&jc(i,[0,1,2])}()),e&&(e=await async function(){console.log("testToArray"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]);cr({s1:e,s2:t,s3:r,v1:n,v2:i,v3:a,m1:o,m2:s}),dr("() => {\n for (let i of range(2)) {\n s1[i] = i;\n v1[i] = [2 * i, 2 * i + 1];\n m1[i] = [\n [4 * i, 4 * i + 1],\n [4 * i + 2, 4 * i + 3],\n ];\n for (let j of range(2)) {\n let index = i * 2 + j;\n s2[[i, j]] = index;\n v2[[i, j]] = [index * 2, index * 2 + 1];\n m2[[i, j]] = [\n [4 * index, 4 * index + 1],\n [4 * index + 2, 4 * index + 3],\n ];\n for (let k of range(2)) {\n let index = i * 4 + j * 2 + k;\n s3[[i, j, k]] = index;\n v3[[i, j, k]] = [index * 2, index * 2 + 1];\n }\n }\n }\n }")();let c=await e.toArray(),l=await t.toArray(),u=await r.toArray(),d=await n.toArray(),_=await i.toArray(),p=await a.toArray(),f=await o.toArray(),m=await s.toArray();return console.log(c,l,u,d,_,p,f,m),jc(c,[0,1])&&jc(l,[[0,1],[2,3]])&&jc(u,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(d,[[0,1],[2,3]])&&jc(_,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(p,[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]])&&jc(f,[[[0,1],[2,3]],[[4,5],[6,7]]])&&jc(m,[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]])}()),e&&(e=await async function(){console.log("testFieldAccessor"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]);cr({s1:e,s2:t,s3:r,v1:n,v2:i,v3:a,m1:o,m2:s}),dr("() => {\n for (let i of range(2)) {\n s1[i] = i;\n v1[i] = [2 * i, 2 * i + 1];\n m1[i] = [\n [4 * i, 4 * i + 1],\n [4 * i + 2, 4 * i + 3],\n ];\n for (let j of range(2)) {\n let index = i * 2 + j;\n s2[[i, j]] = index;\n v2[[i, j]] = [index * 2, index * 2 + 1];\n m2[[i, j]] = [\n [4 * index, 4 * index + 1],\n [4 * index + 2, 4 * index + 3],\n ];\n for (let k of range(2)) {\n let index = i * 4 + j * 2 + k;\n s3[[i, j, k]] = index;\n v3[[i, j, k]] = [index * 2, index * 2 + 1];\n }\n }\n }\n }")();let c=!0;return console.log(await e.get([1])),console.log(await t.get([1,1])),console.log(await r.get([1,0,1])),console.log(await n.get([1])),console.log(await i.get([1,0])),console.log(await a.get([1,1,0])),console.log(await o.get([0])),console.log(await s.get([1,1])),c&&(c=jc(await e.get([1]),1)&&jc(await t.get([1,1]),3)&&jc(await r.get([1,0,1]),5)&&jc(await n.get([1]),[2,3])&&jc(await i.get([1,0]),[4,5])&&jc(await a.get([1,1,0]),[12,13])&&jc(await o.get([0]),[[0,1],[2,3]])&&jc(await s.get([1,1]),[[12,13],[14,15]])),await e.set([0],123),c&&(c=jc(await e.get([0]),123)),await t.set([0,1],456.333),c&&(c=jc(await t.get([0,1]),456.333,1e-5)),await r.set([0,1,0],789),c&&(c=jc(await r.get([0,1,0]),789)),await n.set([1],[123,456]),c&&(c=jc(await n.get([1]),[123,456])),await i.set([1,0],[456.789,789.456]),c&&(c=jc(await i.get([1,0]),[456.789,789.456],1e-5)),await a.set([1,1,1],[10,11]),c&&(c=jc(await a.get([1,1,1]),[10,11])),await o.set([1],[[1,23],[4,56]]),c&&(c=jc(await o.get([1]),[[1,23],[4,56]])),await s.set([1,1],[[45,6],[78,9]]),c&&(c=jc(await s.get([1,1]),[[45,6],[78,9]])),c}()),e&&(e=await async function(){console.log("testFromArray"),await ie();let e=yr(gr,[2]),t=yr(gr,[2,2]),r=yr(gr,[2,2,2]),n=hr.field(2,gr,[2]),i=hr.field(2,gr,[2,2]),a=hr.field(2,gr,[2,2,2]),o=vr.field(2,2,mr,[2]),s=vr.field(2,2,mr,[2,2]),c=[0,1],l=[[0,1],[2,3]],u=[[[0,1],[2,3]],[[4,5],[6,7]]],d=[[0,1],[2,3]],_=[[[0,1],[2,3]],[[4,5],[6,7]]],p=[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]],f=[[[0,1],[2,3]],[[4,5],[6,7]]],m=[[[[0,1],[2,3]],[[4,5],[6,7]]],[[[8,9],[10,11]],[[12,13],[14,15]]]];await e.fromArray(c),await t.fromArray(l),await r.fromArray(u),await n.fromArray(d),await i.fromArray(_),await a.fromArray(p),await o.fromArray(f),await s.fromArray(m);let g=!0;g&&(g=jc(await e.toArray(),c)&&jc(await t.toArray(),l)&&jc(await r.toArray(),u)&&jc(await n.toArray(),d)&&jc(await i.toArray(),_)&&jc(await a.toArray(),p)&&jc(await o.toArray(),f)&&jc(await s.toArray(),m));let y=c.map((e=>Math.random())),h=l.flat(1).map((e=>Math.random())),v=u.flat(2).map((e=>Math.random())),b=d.flat(1).map((e=>Math.random())),x=_.flat(2).map((e=>Math.random())),S=p.flat(3).map((e=>Math.random())),D=f.flat(2).map((e=>Math.floor(100*Math.random()))),C=m.flat(3).map((e=>Math.floor(100*Math.random())));return await e.fromArray1D(y),await t.fromArray1D(h),await r.fromArray1D(v),await n.fromArray1D(b),await i.fromArray1D(x),await a.fromArray1D(S),await o.fromArray1D(D),await s.fromArray1D(C),g&&(g=jc(await e.toArray1D(),y)&&jc(await t.toArray1D(),h)&&jc(await r.toArray1D(),v)&&jc(await n.toArray1D(),b)&&jc(await i.toArray1D(),x)&&jc(await a.toArray1D(),S)&&jc(await o.toArray1D(),D)&&jc(await s.toArray1D(),C)),g}()),e&&(e=await async function(){console.log("testStruct"),await ie();let e=Bc({f:gr,f3:Lc(gr,3),i4:Lc(mr,4)}),t=Bc({i:mr,s1:e}),r=yr(e,[4]),n=yr(t,[2]);cr({f1:r,f2:n});let i=!0;dr("() => {\n f1[0] = {\n f: 0.1,\n f3: [0.2, 0.3, 0.4],\n i4: [1, 2, 3, 4],\n };\n f1[1].f = 0.5;\n f1[1].f3 = [0.6, 0.6, 0.6];\n f1[1].f3.yz = [0.7, 0.8];\n f1[1].i4 = [5, 6, 7, 8];\n\n let s1Temp1 = f1[0];\n f1[2] = s1Temp1;\n\n let s1Temp2 = {\n f: 0.5,\n f3: [0.6, 0.7, 0.8],\n i4: [5, 6, 7, 8],\n };\n f1[3] = s1Temp2;\n\n f2[0] = {\n i: 0,\n s1: f1[0],\n };\n let s2Temp1 = {\n i: 1,\n s1: f2[0].s1,\n };\n s2Temp1.s1 = {\n f: 0.5,\n f3: [0.6, 0.7, 0.8],\n i4: [5, 6, 7, 8],\n };\n f2[1] = s2Temp1;\n }")();let a=await r.toArray(),o=await n.toArray();console.log(a,o),i&&(i=jc(a,[{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]},{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]},{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]},{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]}])),i&&(i=jc(o,[{i:0,s1:{f:.1,f3:[.2,.3,.4],i4:[1,2,3,4]}},{i:1,s1:{f:.5,f3:[.6,.7,.8],i4:[5,6,7,8]}}]));let s={f:.6,f3:[.7,.8,.9],i4:[9,0,1,2]};await r.set([0],s),i&&(i=jc(await r.get([0]),s));let c={i:123,s1:s};return await n.set([0],c),i&&(i=jc(await n.get([0]),c)),i}()),e&&(e=await async function(){console.log("testRets"),await ie();let e=[2,3],t=[[4,5]],r={s:6.6,v:[7.7,8.8]},n={s:9,v:[10,11],ss:r};cr({scalar:1,vector:e,matrix:t,struct:r,nestedStruct:n});let i=dr("() => {\n return scalar;\n }"),a=dr("() => {\n return vector;\n }"),o=dr("() => {\n return matrix;\n }"),s=dr("() => {\n return struct;\n }"),c=dr("() => {\n return nestedStruct;\n }"),l=await i(),u=await a(),d=await o(),_=await s(),p=await c();return console.log(l,u,d,_,p),jc(1,l)&&jc(e,u)&&jc(t,d)&&jc(r,_)&&jc(n,p)}()),e&&(e=await async function(){console.log("testArgAnnotation"),await ie();let e=12345,t=[1.1,2.2],r=[[1.1,2.2],[3.3,4.4]],n={i:e,f:1.1,v:t,m:r},i=mr,a=gr,o=Lc(gr,2),s=Rc(gr,2,2),c=Bc({i:i,f:a,v:o,m:s}),l=yr(i,[1]),u=yr(a,[1]),d=yr(o,[1]),_=yr(s,[1]),p=yr(c,[1]);return cr({iField:l,fField:u,vField:d,mField:_,oField:p}),dr({i:i,f:a,v:o,m:s,o:c},"(i, f, v, m, o) => {\n iField[0] = i;\n fField[0] = f;\n vField[0] = v;\n mField[0] = m;\n oField[0] = o;\n }")(e,1.1,t,r,n),console.log(await l.get([0])),console.log(await u.get([0])),console.log(await d.get([0])),console.log(await _.get([0])),console.log(await p.get([0])),jc(await l.get([0]),e)&&jc(await u.get([0]),1.1)&&jc(await d.get([0]),t)&&jc(await _.get([0]),r)&&jc(await p.get([0]),n)}()),e&&(e=await async function(){console.log("testTemplateArgs"),await ie();let e=12345,t=1.1,r=[1.1,2.2],n=[[1.1,2.2],[3.3,4.4]],i={i:e,f:t,v:r,m:n},a=mr,o=gr,s=Lc(gr,2),c=Rc(gr,2,2),l=Bc({i:a,f:o,v:s,m:c}),u=yr(a,[1]),d=yr(o,[1]),_=yr(s,[1]),p=yr(c,[1]),f=yr(l,[1]),m=dr({i:ur(),f:ur(),v:ur(),m:ur(),o:ur(),iField:ur(),fField:ur(),mField:ur(),vField:ur(),oField:ur()},"(i, f, v, m, o, iField, fField, vField, mField, oField) => {\n iField[0] = i;\n fField[0] = f;\n vField[0] = v;\n mField[0] = m;\n oField[0] = o;\n }");await m(e,t,r,n,i,u,d,_,p,f),console.log(await u.get([0])),console.log(await d.get([0])),console.log(await _.get([0])),console.log(await p.get([0])),console.log(await f.get([0]));let g=jc(await u.get([0]),e)&&jc(await d.get([0]),t)&&jc(await _.get([0]),r)&&jc(await p.get([0]),n)&&jc(await f.get([0]),i),y=yr(a,[1]);return await m(54321,t,r,n,i,y,d,_,p,f),console.log(await y.get([0])),g&&(g=jc(await y.get([0]),54321)),g}()),e&&(e=await async function(){console.log("testLambda"),await ie();let e=yr(gr,[6]);cr({f:e,globalFunc:()=>4}),dr("() => {\n let f0 = () => {\n return 0;\n };\n function f1() {\n return 1;\n }\n let f2 = (x) => {\n return x * 2;\n };\n let f3 = () => {\n f[3] = 3;\n };\n let one = 1;\n let f5 = () => {\n return one + f2(f2(one));\n };\n f[0] = f0();\n f[1] = f1();\n f[2] = f2(1);\n f3();\n f[4] = globalFunc();\n f[5] = f5();\n }")();let t=await e.toArray();return console.log(t),jc(t,[0,1,2,3,4,5])}()),e&&(e=await async function(){console.log("testHostObjectReference"),await ti.init();let e=[{valueWanted:123,field:ti.field(ti.f32,1)},{valueWanted:456,field:void 0},{valueWanted:789,field:ti.field(ti.f32,1)}];ti.addToKernelScope({data:e}),ti.kernel("() => {\n for (let i of ti.static(range(3))) {\n if (ti.static(data[i].field !== undefined)) {\n data[i].field[0] = data[i].valueWanted;\n }\n }\n }")();let t=!0;for(let r=0;r<3;++r)void 0!==e[r].field&&(console.log(await e[r].field.toArray(),e[r].valueWanted),t&&(t=jc(await e[r].field.get([0]),e[r].valueWanted)));return t}()),e&&(e=await async function(){console.log("testStaticIf"),await ti.init();let e=ti.field(ti.i32,6),t={x:456,y:567,z:[e,e]};ti.addToKernelScope({f:e,data0:[123],data1:t}),ti.kernel("() => {\n if (ti.static(1)) {\n f[0] = 1;\n } else {\n a.b().c().d();\n }\n\n if (ti.static(data0[0] === data0[0])) {\n f[1] = 1;\n } else {\n a.b().c().d();\n }\n\n if (ti.static(data1 === undefined)) {\n a.b().c().d();\n } else {\n f[2] = 1;\n }\n\n if (ti.static(data1.x > data1.y)) {\n a.b().c().d();\n } else {\n f[3] = 1;\n }\n\n if (ti.static(data1.z[1] === undefined)) {\n a.b().c().d();\n } else {\n f[4] = 1;\n }\n\n if (ti.static(data1.z[2] === undefined)) {\n f[5] = 1;\n } else {\n a.b().c().d();\n }\n }")();let r=await e.toArray();return console.log(r),jc(r,[1,1,1,1,1,1])}()),e&&(e=await async function(){console.log("testClassKernel"),await ie();let e=new class{constructor(){this.x=3,this.f=yr(gr,[1]),this.k=_r(this,"() => {\n this.f[0] = this.x;\n return this.x;\n }"),this.tk=_r(this,{f:ur(),x:gr},"(f, x) => {\n f[0] = x;\n return x;\n }")}},t=!0,r=await e.k(),n=await e.f.toArray();console.log(r,n),t&&(t=jc(r,3)),t&&(t=jc(n,[3]));let i=yr(gr,[1]),a=await e.tk(i,5),o=await i.toArray();return console.log(a,o),t&&(t=jc(a,5)),t&&(t=jc(o,[5])),t}()),e?console.log("All tests passed"):s("TESTS FAILED")}globalThis.ti=a;export{Er as Canvas,T as CubeTexture,vr as Matrix,Dn as Static,br as Struct,S as Texture,kr as Timer,hr as Vector,n as WrapMode,Mr as add,cr as addToKernelScope,bn as bitcast_f32,vn as bitcast_i32,Dr as canvasTexture,_r as classKernel,Xr as clearColor,lr as clearKernelScope,Kr as cross,Cr as depthTexture,en as discard,Br as div,Vr as dot,un as dpdx,dn as dpdy,Mc as engine,gr as f32,yr as field,pr as func,ln as getFragCoord,cn as getInstanceIndex,sn as getVertexIndex,mr as i32,ie as init,Pr as inputFragments,Fr as inputVertices,qr as inverse,dr as kernel,_n as lookAt,xr as materializeFields,zr as matmul,hn as mergeStructs,Rr as mul,wr as ndrange,Or as neg,jr as norm,Jr as normSqr,Ur as normalized,xn as not,fn as ortho,Yr as outputColor,Zr as outputDepth,Qr as outputPosition,Hr as outputVertex,pn as perspective,Wr as polarDecompose2D,Nr as range,mn as rotateAxisAngle,Sn as rsqrt,Uc as runAllTests,yn as scale,Lr as sub,fr as sync,ur as template,Sr as texture,an as textureLoad,tn as textureSample,nn as textureSampleCompare,rn as textureSampleLod,on as textureStore,gn as translate,Gr as transpose,Jc as types,$r as useDepth}; diff --git a/src/visualization/plotSolutionScript.js b/src/visualization/plotSolutionScript.js index b3a22d7..06370ba 100644 --- a/src/visualization/plotSolutionScript.js +++ b/src/visualization/plotSolutionScript.js @@ -8,6 +8,9 @@ // |_| | |_ // // Website: https://feascript.com/ \__| // +const math = window.math; +const Plotly = window.Plotly; + /** * Function to create plots of the solution vector * @param {*} solutionVector - The computed solution vector diff --git a/src/workers/webgpuComputeWorker.js b/src/workers/webgpuComputeWorker.js new file mode 100644 index 0000000..06f354f --- /dev/null +++ b/src/workers/webgpuComputeWorker.js @@ -0,0 +1,188 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +import * as Comlink from "../vendor/comlink.mjs"; +import * as ti from "../vendor/taichi.esm.js"; +import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; + +class WebGPUComputeWorker { + constructor() { + this.computeEngine = null; + this.initialized = false; + } + + async initialize() { + if (!this.initialized) { + await ti.init(); + this.initialized = true; + } + if (!this.computeEngine) { + this.computeEngine = new WebGPUComputeEngine(); + // Don't initialize again, already done + } + } + + async vecAdd(a, b) { + await this.initialize(); + return this.computeEngine.vecAdd(a, b); + } + + async matVecMul(A, x) { + await this.initialize(); + return this.computeEngine.matVecMul(A, x); + } + + async matMatMul(A, B) { + await this.initialize(); + return this.computeEngine.matMatMul(A, B); + } + + async transpose(A) { + await this.initialize(); + return this.computeEngine.transpose(A); + } + + async diagonal(A) { + await this.initialize(); + return this.computeEngine.diagonal(A); + } + + async sparseMatVecMul(sparseMatrix, x) { + await this.initialize(); + return this.computeEngine.sparseMatVecMul(sparseMatrix, x); + } + + async dotProduct(a, b) { + await this.initialize(); + const n = a.length; + const aField = ti.field(ti.f32, [n]); + const bField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(a); + bField.fromArray(b); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, bField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * bField[i]); + } + })(n); + + const result = await resultField.toArray(); + return result[0]; + } + + async norm(vector) { + await this.initialize(); + const n = vector.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [1]); + + aField.fromArray(vector); + resultField.fromArray([0]); + + ti.addToKernelScope({aField, resultField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(resultField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel(() => { + resultField[0] = ti.sqrt(resultField[0]); + })(); + + const result = await resultField.toArray(); + return result[0]; + } + + async normalize(vector) { + await this.initialize(); + const n = vector.length; + const aField = ti.field(ti.f32, [n]); + const resultField = ti.field(ti.f32, [n]); + const tempField = ti.field(ti.f32, [1]); + + aField.fromArray(vector); + tempField.fromArray([0]); + + ti.addToKernelScope({aField, resultField, tempField}); + + ti.kernel((n) => { + for (let i of ti.ndrange(n)) { + ti.atomicAdd(tempField[0], aField[i] * aField[i]); + } + })(n); + + ti.kernel((n) => { + const normVal = ti.sqrt(tempField[0]); + for (let i of ti.ndrange(n)) { + resultField[i] = aField[i] / normVal; + } + })(n); + + const result = await resultField.toArray(); + return result; + } + + async copy(data) { + await this.initialize(); + return this.computeEngine.copy(data); + } + + async fill(data, value) { + await this.initialize(); + return this.computeEngine.fill(data, value); + } + + async scale(data, scalar) { + await this.initialize(); + return this.computeEngine.scale(data, scalar); + } + + async residual(A, x, b) { + await this.initialize(); + return this.computeEngine.residual(A, x, b); + } + + async preconditioner(A, r, type = 'jacobi', omega = 1.0) { + await this.initialize(); + return this.computeEngine.preconditioner(A, r, type, omega); + } + + async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + await this.initialize(); + return this.computeEngine.conjugateGradient(A, b, x0, tol, maxIter, preconditionerType); + } + + async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { + await this.initialize(); + try { + return await this.computeEngine.jacobiSolve(A, b, x0, maxIter, tol); + } catch (e) { + console.error('Error in jacobiSolve:', e); + throw new Error('Jacobi solve failed: ' + e.message); + } + } + + async destroy() { + if (this.computeEngine) { + this.computeEngine.destroy(); + this.computeEngine = null; + } + this.initialized = false; + } +} + +Comlink.expose(new WebGPUComputeWorker()); \ No newline at end of file diff --git a/src/workers/webgpuJacobiWorker.js b/src/workers/webgpuJacobiWorker.js new file mode 100644 index 0000000..aceb1dc --- /dev/null +++ b/src/workers/webgpuJacobiWorker.js @@ -0,0 +1,109 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +import * as Comlink from "../vendor/comlink.mjs"; +import * as ti from '../vendor/taichi.esm.js'; + +class WebGPUJacobiWorker { + constructor() { + this.initialized = false; + } + + async initialize() { + if (this.initialized) return; + + await ti.init(); + this.initialized = true; + } + + async jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) { + await this.initialize(); + + const n = A.length; + let x = [...x0]; + let xNew = new Array(n).fill(0); + + let iterationsCompleted = 0; + let hasConverged = false; + + // Main iteration loop + for (let iteration = 0; iteration < maxIterations; iteration++) { + // Perform Jacobi update using Taichi + const matrixField = ti.field(ti.f32, [n * n]); + const bField = ti.field(ti.f32, [n]); + const xField = ti.field(ti.f32, [n]); + const xNewField = ti.field(ti.f32, [n]); + + // Flatten the matrix for Taichi + const flatA = A.flat(); + matrixField.fromArray(flatA); + bField.fromArray(b); + xField.fromArray(x); + + ti.addToKernelScope({matrixField, bField, xField, xNewField}); + + ti.kernel((n) => { + for (let i = 0; i < n; i++) { + let sum = 0.0; + for (let j = 0; j < n; j++) { + if (j !== i) { + sum += matrixField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + } + } + let diagonal = matrixField[ti.i32(i) * ti.i32(n) + ti.i32(i)]; + xNewField[i] = (bField[i] - sum) / diagonal; + } + })(n); + + xNew = await xNewField.toArray(); + + // Check convergence by computing max difference + const diffField = ti.field(ti.f32, [n]); + diffField.fromArray(xNew.map((val, i) => val - x[i])); + + ti.addToKernelScope({diffField, absDiffField}); + + ti.kernel((n) => { + for (let i = 0; i < n; i++) { + absDiffField[i] = ti.abs(diffField[i]); + } + })(n); + + const absDiffData = await absDiffField.toArray(); + + // Find maximum absolute difference + let maxDiff = 0; + for (let i = 0; i < n; i++) { + if (absDiffData[i] > maxDiff) maxDiff = absDiffData[i]; + } + + if (maxDiff < tolerance) { + hasConverged = true; + iterationsCompleted = iteration + 1; + break; + } + + // Swap for next iteration + x = [...xNew]; + + if (iteration === maxIterations - 1) { + iterationsCompleted = maxIterations; + } + } + + return { + solution: xNew, + iterations: iterationsCompleted, + converged: hasConverged, + }; + } +} + +Comlink.expose(new WebGPUJacobiWorker()); \ No newline at end of file diff --git a/testWebGPU.html b/testWebGPU.html new file mode 100644 index 0000000..d0ea066 --- /dev/null +++ b/testWebGPU.html @@ -0,0 +1,651 @@ + + + + + + WebGPU Compute Engine Test + + + +

WebGPU Compute Engine Test

+

This page tests the basic functionality of the WebGPU compute engine.

+ +
+

Vector Addition Test

+ +
+
+ +
+

Matrix-Vector Multiplication Test

+ +
+
+ +
+

Dot Product Test

+ +
+
+ +
+

Vector Norm Test

+ +
+
+ +
+

Vector Normalization Test

+ +
+
+ +
+

Matrix-Matrix Multiplication Test

+ +
+
+ +
+

Matrix Transpose Test

+ +
+
+ +
+

Matrix Diagonal Test

+ +
+
+ +
+

Sparse Matrix-Vector Multiplication Test

+ +
+
+ +
+

Copy Test

+ +
+
+ +
+

Fill Test

+ +
+
+ +
+

Scale Test

+ +
+
+ +
+

Conjugate Gradient Solver Test

+ +
+
+ +
+

Cleanup

+ +
+
+ + + + \ No newline at end of file From d8e9e3bdb8d568c45369e80d9577cf220688654c Mon Sep 17 00:00:00 2001 From: sridhar <2019309038@student.annauniv.edu> Date: Tue, 21 Oct 2025 10:43:32 +0000 Subject: [PATCH 07/12] Refactor heat conduction example and improve Jacobi solver - Updated mesh configuration in HeatConduction2DFinCG.html to reduce the number of elements for better performance. - Enhanced FEAScript.js to prepare the mesh and extract node coordinates before matrix assembly. - Modified jacobiMethodScript.js documentation to clarify return object structure. - Rewrote jacobiSolverScript.js to implement a CPU synchronous version of the Jacobi method, removing the WebGPU dependency. - Adjusted convergence check in webgpuJacobiWorker.js to use absolute differences. - Removed testWebGPU.html as it is no longer needed. --- dist/feascript.esm.js.map | 2 +- .../HeatConduction2DFinCG.html | 4 +- src/FEAScript.js | 15 +- src/methods/jacobiMethodScript.js | 2 +- src/methods/jacobiSolverScript.js | 52 +- src/workers/webgpuJacobiWorker.js | 2 +- testWebGPU.html | 651 ------------------ 7 files changed, 50 insertions(+), 678 deletions(-) delete mode 100644 testWebGPU.html diff --git a/dist/feascript.esm.js.map b/dist/feascript.esm.js.map index bfc4285..16e0e11 100644 --- a/dist/feascript.esm.js.map +++ b/dist/feascript.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"feascript.esm.js","sources":["../src/methods/euclideanNormScript.js","../src/utilities/loggingScript.js","../src/methods/linearSystemSolverScript.js","../src/methods/jacobiSolverScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/methods/numericalIntegrationScript.js","../src/mesh/meshUtilsScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/solvers/heatConductionScript.js","../src/solvers/genericBoundaryConditionsScript.js","../src/solvers/frontPropagationScript.js","../src/methods/frontalSolverScript.js","../src/methods/newtonRaphsonScript.js","../src/FEAScript.js","../src/solvers/generalFormPDEScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/vendor/comlink.mjs","../src/workers/workerScript.js","../src/index.js"],"sourcesContent":["// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to calculate the Euclidean norm of a vector\n * @param {array} vector - The input vector\n * @returns {number} The Euclidean norm of the vector\n */\nexport function euclideanNorm(vector) {\n let norm = 0;\n for (let i = 0; i < vector.length; i++) {\n norm += vector[i] * vector[i];\n }\n norm = Math.sqrt(norm);\n return norm;\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Global logging level\nlet currentLogLevel = \"basic\";\n\n/**\n * Function to set the logging system level\n * @param {string} level - Logging level (basic, debug)\n */\nexport function logSystem(level) {\n if (level !== \"basic\" && level !== \"debug\") {\n console.log(\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\n \"color: #FFC107; font-weight: bold;\"\n ); // Yellow for warnings\n currentLogLevel = \"basic\";\n } else {\n currentLogLevel = level;\n basicLog(`Log level set to: ${level}`);\n }\n}\n\n/**\n * Function to log debug messages - only logs if level is 'debug'\n * @param {string} message - Message to log\n */\nexport function debugLog(message) {\n if (currentLogLevel === \"debug\") {\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\");\n }\n}\n\n/**\n * Function to log basic information - always logs\n * @param {string} message - Message to log\n */\nexport function basicLog(message) {\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\");\n}\n\n/**\n * Function to log error messages\n * @param {string} message - Message to log\n */\nexport function errorLog(message) {\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\");\n}\n\n/**\n * Function to log warning messages\n * @param {string} message - Message to log\n */\nexport function warnLog(message) {\n console.log(\"%c[WARN] \" + message, \"color: #FF9800; font-weight: bold;\");\n}\n\n/**\n * Function to handle version information and fetch the latest update date and release from GitHub\n */\nexport async function printVersionInformation() {\n basicLog(\"Fetching latest FEAScript version information...\");\n try {\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\n const commitData = await commitResponse.json();\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\n return latestCommitDate;\n } catch (error) {\n errorLog(\"Failed to fetch version information: \" + error);\n return \"Version information unavailable\";\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { jacobiSolver } from \"./jacobiSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to solve a system of linear equations using different solver methods\n * @param {string} solverMethod - The solver method to use (\"lusolve\" or \"jacobi\")\n * @param {Array} jacobianMatrix - The coefficient matrix\n * @param {Array} residualVector - The right-hand side vector\n * @param {object} [options] - Additional options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - converged: Boolean indicating whether the method converged (for iterative methods)\n * - iterations: Number of iterations performed (for iterative methods)\n */\nexport function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n\n let solutionVector = [];\n let converged = true;\n let iterations = 0;\n\n // Solve the linear system based on the specified solver method\n basicLog(`Solving system using ${solverMethod}...`);\n console.time(\"systemSolving\");\n\n if (solverMethod === \"lusolve\") {\n // Use LU decomposition method\n const jacobianMatrixSparse = math.sparse(jacobianMatrix);\n const luFactorization = math.slu(jacobianMatrixSparse, 1, 1); // order=1, threshold=1 for pivoting\n let solutionMatrix = math.lusolve(luFactorization, residualVector);\n solutionVector = math.squeeze(solutionMatrix).valueOf();\n //solutionVector = math.lusolve(jacobianMatrix, residualVector); // In the case of a dense matrix\n } else if (solverMethod === \"jacobi\") {\n // Use Jacobi method\n const initialGuess = new Array(residualVector.length).fill(0);\n const jacobiSolverResult = jacobiSolver(jacobianMatrix, residualVector, initialGuess, {\n maxIterations,\n tolerance,\n });\n\n // Log convergence information\n if (jacobiSolverResult.converged) {\n debugLog(`Jacobi method converged in ${jacobiSolverResult.iterations} iterations`);\n } else {\n errorLog(`Jacobi method did not converge after ${jacobiSolverResult.iterations} iterations`);\n }\n\n solutionVector = jacobiSolverResult.solutionVector;\n converged = jacobiSolverResult.converged;\n iterations = jacobiSolverResult.iterations;\n } else {\n errorLog(`Unknown solver method: ${solverMethod}`);\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n return { solutionVector, converged, iterations };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to solve a system of linear equations using the Jacobi iterative method\n * @param {array} jacobianMatrix - The coefficient matrix (must be square)\n * @param {array} residualVector - The right-hand side vector\n * @param {array} initialGuess - Initial guess for solution vector\n * @param {object} [options] - Options for the solver\n * @param {number} [options.maxIterations=1000] - Maximum number of iterations\n * @param {number} [options.tolerance=1e-6] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\nexport function jacobiSolver(jacobianMatrix, residualVector, initialGuess, options = {}) {\n const { maxIterations = 1000, tolerance = 1e-6 } = options;\n const n = jacobianMatrix.length; // Size of the square matrix\n let x = [...initialGuess]; // Current solution (starts with initial guess)\n let xNew = new Array(n); // Next iteration's solution\n\n for (let iteration = 0; iteration < maxIterations; iteration++) {\n // Perform one iteration\n for (let i = 0; i < n; i++) {\n let sum = 0;\n // Calculate sum of jacobianMatrix[i][j] * x[j] for j ≠ i\n for (let j = 0; j < n; j++) {\n if (j !== i) {\n sum += jacobianMatrix[i][j] * x[j];\n }\n }\n // Update xNew[i] using the Jacobi formula\n xNew[i] = (residualVector[i] - sum) / jacobianMatrix[i][i];\n }\n\n // Check convergence\n let maxDiff = 0;\n for (let i = 0; i < n; i++) {\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\n }\n\n // Update x for next iteration\n x = [...xNew];\n\n // Successfully converged if maxDiff is less than tolerance\n if (maxDiff < tolerance) {\n return {\n solutionVector: x,\n iterations: iteration + 1,\n converged: true,\n };\n }\n }\n\n // maxIterations were reached without convergence\n return {\n solutionVector: x,\n iterations: maxIterations,\n converged: false,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle basis functions and their derivatives based on element configuration\n */\nexport class BasisFunctions {\n /**\n * Constructor to initialize the BasisFunctions class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to calculate basis functions and their derivatives based on the dimension and order\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\n * @returns {object} An object containing:\n * - basisFunction: Array of evaluated basis functions\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\n */\n getBasisFunctions(ksi, eta = null) {\n let basisFunction = [];\n let basisFunctionDerivKsi = [];\n let basisFunctionDerivEta = [];\n\n if (this.meshDimension === \"1D\") {\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 1D elements\n basisFunction[0] = 1 - ksi;\n basisFunction[1] = ksi;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -1;\n basisFunctionDerivKsi[1] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 1D elements\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\n basisFunction[2] = -ksi + 2 * ksi ** 2;\n\n // Derivatives of basis functions with respect to ksi\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\n }\n } else if (this.meshDimension === \"2D\") {\n if (eta === null) {\n errorLog(\"Eta coordinate is required for 2D elements\");\n return;\n }\n\n if (this.elementOrder === \"linear\") {\n // Linear basis functions for 2D elements\n function l1(c) {\n return 1 - c;\n }\n function l2(c) {\n return c;\n }\n function dl1() {\n return -1;\n }\n function dl2() {\n return 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l2(ksi) * l1(eta);\n basisFunction[3] = l2(ksi) * l2(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\n } else if (this.elementOrder === \"quadratic\") {\n // Quadratic basis functions for 2D elements\n function l1(c) {\n return 2 * c ** 2 - 3 * c + 1;\n }\n function l2(c) {\n return -4 * c ** 2 + 4 * c;\n }\n function l3(c) {\n return 2 * c ** 2 - c;\n }\n function dl1(c) {\n return 4 * c - 3;\n }\n function dl2(c) {\n return -8 * c + 4;\n }\n function dl3(c) {\n return 4 * c - 1;\n }\n\n // Evaluate basis functions at (ksi, eta)\n basisFunction[0] = l1(ksi) * l1(eta);\n basisFunction[1] = l1(ksi) * l2(eta);\n basisFunction[2] = l1(ksi) * l3(eta);\n basisFunction[3] = l2(ksi) * l1(eta);\n basisFunction[4] = l2(ksi) * l2(eta);\n basisFunction[5] = l2(ksi) * l3(eta);\n basisFunction[6] = l3(ksi) * l1(eta);\n basisFunction[7] = l3(ksi) * l2(eta);\n basisFunction[8] = l3(ksi) * l3(eta);\n\n // Derivatives with respect to ksi\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\n\n // Derivatives with respect to eta\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\n }\n }\n\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Basic structure for the mesh\n */\nexport class Mesh {\n /**\n * Constructor to initialize the Mesh class\n * @param {object} config - Configuration object for the mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n meshDimension = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n this.numElementsX = numElementsX;\n this.numElementsY = numElementsY;\n this.maxX = maxX;\n this.maxY = maxY;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n this.parsedMesh = parsedMesh;\n\n this.boundaryElementsProcessed = false;\n\n if (this.parsedMesh) {\n basicLog(\"Using pre-parsed mesh from gmshReader data for mesh generation.\");\n this.parseMeshFromGmsh();\n }\n }\n\n /**\n * Method to parse the mesh from the GMSH format to the FEAScript format\n */\n parseMeshFromGmsh() {\n if (!this.parsedMesh.nodalNumbering) {\n errorLog(\"No valid nodal numbering found in the parsed mesh.\");\n }\n\n if (\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\n !Array.isArray(this.parsedMesh.nodalNumbering)\n ) {\n // Store the nodal numbering structure before converting\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\n\n debugLog(\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Check if it has quadElements or triangleElements structure from gmshReader\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\n const mappedNodalNumbering = [];\n\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\n const gmshNodes = quadElements[elemIdx];\n const feaScriptNodes = new Array(gmshNodes.length);\n\n // Check for element type based on number of nodes\n if (gmshNodes.length === 4) {\n // Simple mapping for linear quad elements (4 nodes)\n // GMSH: FEAScript:\n // 3 --- 2 1 --- 3\n // | | --> | |\n // 0 --- 1 0 --- 2\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\n } else if (gmshNodes.length === 9) {\n // Mapping for quadratic quad elements (9 nodes)\n // GMSH: FEAScript:\n // 3--6--2 2--5--8\n // | | | |\n // 7 8 5 --> 1 4 7\n // | | | |\n // 0--4--1 0--3--6\n\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\n }\n\n mappedNodalNumbering.push(feaScriptNodes);\n }\n\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\n } else if (this.parsedMesh.elementTypes[2]) {\n errorLog(\"Element type is neither triangle nor quad; mapping for this type is not implemented yet.\");\n }\n\n debugLog(\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\n JSON.stringify(this.parsedMesh.nodalNumbering)\n );\n\n // Process boundary elements if they exist and if physical property mapping exists\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\n // Check if boundary elements need to be processed\n if (\n Array.isArray(this.parsedMesh.boundaryElements) &&\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n // Create a new array without the empty first element\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n\n // If boundary node pairs exist but boundary elements haven't been processed\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\n // Reset boundary elements array\n this.parsedMesh.boundaryElements = [];\n\n // Process each physical property from the Gmsh file\n this.parsedMesh.physicalPropMap.forEach((prop) => {\n // Only process 1D physical entities (boundary lines)\n if (prop.dimension === 1) {\n // Get all node pairs for this boundary\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\n\n if (boundaryNodePairs.length > 0) {\n // Initialize array for this boundary tag\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\n this.parsedMesh.boundaryElements[prop.tag] = [];\n }\n\n // For each boundary line segment (defined by a pair of nodes)\n boundaryNodePairs.forEach((nodesPair) => {\n const node1 = nodesPair[0]; // First node in the pair\n const node2 = nodesPair[1]; // Second node in the pair\n\n debugLog(\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\n prop.name || \"unnamed\"\n })`\n );\n\n // Search through all elements to find which one contains both nodes\n let foundElement = false;\n\n // Loop through all elements in the mesh\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\n\n // For linear quadrilateral linear elements (4 nodes)\n if (elemNodes.length === 4) {\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript linear quadrilateral numbering:\n // 1 --- 3\n // | |\n // 0 --- 2\n\n if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0)\n ) {\n side = 0; // Bottom side\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0)\n ) {\n side = 1; // Left side\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 1 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 1)\n ) {\n side = 2; // Top side\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 2)\n ) {\n side = 3; // Right side\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n } else if (elemNodes.length === 9) {\n // For quadratic quadrilateral elements (9 nodes)\n // Check if both boundary nodes are in this element\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\n // Find which side of the element these nodes form\n let side;\n\n const node1Index = elemNodes.indexOf(node1);\n const node2Index = elemNodes.indexOf(node2);\n\n debugLog(\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\n \", \"\n )}]`\n );\n debugLog(\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\n );\n\n // Based on FEAScript quadratic quadrilateral numbering:\n // 2--5--8\n // | |\n // 1 4 7\n // | |\n // 0--3--6\n\n // TODO: Transform into dictionaries for better readability\n if (\n (node1Index === 0 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 3) ||\n (node1Index === 3 && node2Index === 0) ||\n (node1Index === 3 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 3)\n ) {\n side = 0; // Bottom side (nodes 0, 3, 6)\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 0 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 0) ||\n (node1Index === 0 && node2Index === 1) ||\n (node1Index === 1 && node2Index === 0) ||\n (node1Index === 1 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 1)\n ) {\n side = 1; // Left side (nodes 0, 1, 2)\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 2 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 2) ||\n (node1Index === 2 && node2Index === 5) ||\n (node1Index === 5 && node2Index === 2) ||\n (node1Index === 5 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 5)\n ) {\n side = 2; // Top side (nodes 2, 5, 8)\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\n } else if (\n (node1Index === 6 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 6) ||\n (node1Index === 6 && node2Index === 7) ||\n (node1Index === 7 && node2Index === 6) ||\n (node1Index === 7 && node2Index === 8) ||\n (node1Index === 8 && node2Index === 7)\n ) {\n side = 3; // Right side (nodes 6, 7, 8)\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\n }\n\n // Add the element and side to the boundary elements array\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\n debugLog(\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\n );\n foundElement = true;\n break;\n }\n }\n }\n\n if (!foundElement) {\n errorLog(\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\n );\n }\n });\n }\n }\n });\n\n // Mark as processed\n this.boundaryElementsProcessed = true;\n\n // Fix boundary elements array - remove undefined entries\n if (\n this.parsedMesh.boundaryElements.length > 0 &&\n this.parsedMesh.boundaryElements[0] === undefined\n ) {\n const fixedBoundaryElements = [];\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\n if (this.parsedMesh.boundaryElements[i]) {\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\n }\n }\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\n }\n }\n }\n }\n\n return this.parsedMesh;\n }\n}\n\nexport class Mesh1D extends Mesh {\n /**\n * Constructor to initialize the 1D mesh\n * @param {object} config - Configuration object for the 1D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({ numElementsX = null, maxX = null, elementOrder = \"linear\", parsedMesh = null }) {\n super({\n numElementsX,\n maxX,\n numElementsY: 1,\n maxY: 0,\n meshDimension: \"1D\",\n elementOrder,\n parsedMesh,\n });\n\n if (this.numElementsX === null || this.maxX === null) {\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n const xStart = 0;\n let totalNodesX, deltaX;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n\n nodesXCoordinates[0] = xStart;\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\n }\n }\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate1DNodalNumbering(this.numElementsX, totalNodesX, this.elementOrder);\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\n return {\n nodesXCoordinates,\n totalNodesX,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate1DNodalNumbering(numElementsX, totalNodesX, elementOrder) {\n // TODO: The totalNodesX is not used in the original function. Verify if\n // there is a multiple calculation on the totalNodes.\n\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear 1D elements with the following nodes representation:\n *\n * 1 --- 2\n *\n */\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic 1D elements with the following nodes representation:\n *\n * 1--2--3\n *\n */\n let columnCounter = 0;\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\n nop[elementIndex] = [];\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\n }\n columnCounter += 1;\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 1D domains (line segments):\n * 0 - Left node of reference element (maps to physical left endpoint)\n * 1 - Right node of reference element (maps to physical right endpoint)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 2; // For 1D, we only have two sides (left and right)\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // Left boundary (element 0, side 0)\n boundaryElements[0].push([0, 0]);\n\n // Right boundary (last element, side 1)\n boundaryElements[1].push([this.numElementsX - 1, 1]);\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n\nexport class Mesh2D extends Mesh {\n /**\n * Constructor to initialize the 2D mesh\n * @param {object} config - Configuration object for the 2D mesh\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\n * @param {number} [config.numElementsY] - Number of elements along the y-axis (required for geometry-based mesh)\n * @param {number} [config.maxY] - Maximum y-coordinate of the mesh (required for geometry-based mesh)\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\n */\n constructor({\n numElementsX = null,\n maxX = null,\n numElementsY = null,\n maxY = null,\n elementOrder = \"linear\",\n parsedMesh = null,\n }) {\n super({\n numElementsX,\n maxX,\n numElementsY,\n maxY,\n meshDimension: \"2D\",\n elementOrder,\n parsedMesh,\n });\n\n // Validate geometry parameters (when not using a parsed mesh)\n if (\n !parsedMesh &&\n (this.numElementsX === null || this.maxX === null || this.numElementsY === null || this.maxY === null)\n ) {\n errorLog(\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\n );\n }\n }\n\n generateMesh() {\n let nodesXCoordinates = [];\n let nodesYCoordinates = [];\n const xStart = 0;\n const yStart = 0;\n let totalNodesX, totalNodesY, deltaX, deltaY;\n\n if (this.elementOrder === \"linear\") {\n totalNodesX = this.numElementsX + 1;\n totalNodesY = this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n totalNodesX = 2 * this.numElementsX + 1;\n totalNodesY = 2 * this.numElementsY + 1;\n deltaX = (this.maxX - xStart) / this.numElementsX;\n deltaY = (this.maxY - yStart) / this.numElementsY;\n\n nodesXCoordinates[0] = xStart;\n nodesYCoordinates[0] = yStart;\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\n }\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\n const nnode = nodeIndexX * totalNodesY;\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\n }\n }\n }\n\n // Generate nodal numbering (NOP) array\n const nodalNumbering = this.generate2DNodalNumbering(\n this.numElementsX,\n this.numElementsY,\n totalNodesY,\n this.elementOrder\n );\n\n // Find boundary elements\n const boundaryElements = this.findBoundaryElements();\n\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\n\n // Return statement\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nodalNumbering,\n boundaryElements,\n };\n }\n\n /**\n * Function to generate the nodal numbering (NOP) array for a structured mesh\n * This array represents the connectivity between elements and their corresponding nodes\n * @param {number} numElementsX - Number of elements along the x-axis\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\n * @param {number} totalNodesX - Total number of nodes along the x-axis\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\n */\n generate2DNodalNumbering(numElementsX, numElementsY, totalNodesY, elementOrder) {\n let elementIndex = 0;\n let nop = [];\n\n if (elementOrder === \"linear\") {\n /**\n * Linear rectangular elements with the following nodes representation:\n *\n * 1 --- 3\n * | |\n * 0 --- 2\n *\n */\n let rowCounter = 0;\n let columnCounter = 2;\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\n rowCounter += 1;\n nop[elementIndex] = [];\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\n nop[elementIndex][1] = elementIndex + columnCounter;\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\n if (rowCounter === numElementsY) {\n columnCounter += 1;\n rowCounter = 0;\n }\n }\n } else if (elementOrder === \"quadratic\") {\n /**\n * Quadratic rectangular elements with the following nodes representation:\n *\n * 2--5--8\n * | |\n * 1 4 7\n * | |\n * 0--3--6\n *\n */\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\n nop[elementIndex] = [];\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\n let nodeIndex2 = 3 * nodeIndex1 - 2;\n nop[elementIndex][nodeIndex2 - 1] =\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\n }\n elementIndex = elementIndex + 1;\n }\n }\n }\n\n return nop;\n }\n\n /**\n * Function to find the elements that belong to each boundary of a domain\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\n * of the reference element is in contact with the physical boundary:\n *\n * For 2D domains (rectangular):\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\n * 1 - Left side of reference element (maps to physical left boundary)\n * 2 - Top side of reference element (maps to physical top boundary)\n * 3 - Right side of reference element (maps to physical right boundary)\n */\n findBoundaryElements() {\n const boundaryElements = [];\n const maxSides = 4; // For 2D, we have four sides (left, right, bottom, top)\n\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\n boundaryElements.push([]);\n }\n\n // TODO: Why to loop through all elements? Is it not better to loop over only the\n // elements that are on the boundary? eg: [0, this.numElementsX - 1] on x and\n // [0, this.numElementsY - 1] on y\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\n\n // Bottom boundary\n if (elementIndexY === 0) {\n boundaryElements[0].push([elementIndex, 0]);\n }\n\n // Left boundary\n if (elementIndexX === 0) {\n boundaryElements[1].push([elementIndex, 1]);\n }\n\n // Top boundary\n if (elementIndexY === this.numElementsY - 1) {\n boundaryElements[2].push([elementIndex, 2]);\n }\n\n // Right boundary\n if (elementIndexX === this.numElementsX - 1) {\n boundaryElements[3].push([elementIndex, 3]);\n }\n }\n }\n\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\n this.boundaryElementsProcessed = true;\n return boundaryElements;\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Class to handle numerical integration using Gauss quadrature\n */\nexport class NumericalIntegration {\n /**\n * Constructor to initialize the NumericalIntegration class\n * @param {string} meshDimension - The dimension of the mesh\n * @param {string} elementOrder - The order of elements\n */\n constructor({ meshDimension, elementOrder }) {\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to return Gauss points and weights based on element configuration\n * @returns {object} An object containing:\n * - gaussPoints: Array of Gauss points\n * - gaussWeights: Array of Gauss weights\n */\n getGaussPointsAndWeights() {\n let gaussPoints = []; // Gauss points\n let gaussWeights = []; // Gauss weights\n\n if (this.elementOrder === \"linear\") {\n // For linear elements, use 1-point Gauss quadrature\n gaussPoints[0] = 0.5;\n gaussWeights[0] = 1;\n } else if (this.elementOrder === \"quadratic\") {\n // For quadratic elements, use 3-point Gauss quadrature\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\n gaussPoints[1] = 0.5;\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\n gaussWeights[0] = 5 / 18;\n gaussWeights[1] = 8 / 18;\n gaussWeights[2] = 5 / 18;\n }\n\n return { gaussPoints, gaussWeights };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nimport { BasisFunctions } from \"./basisFunctionsScript.js\";\nimport { Mesh1D, Mesh2D } from \"./meshGenerationScript.js\";\nimport { NumericalIntegration } from \"../methods/numericalIntegrationScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to prepare the mesh for finite element analysis\n * @param {object} meshConfig - Object containing computational mesh details\n * @returns {object} An object containing all mesh-related data\n */\nexport function prepareMesh(meshConfig) {\n const { meshDimension, numElementsX, numElementsY, maxX, maxY, elementOrder, parsedMesh } = meshConfig;\n\n // Create a new instance of the Mesh class\n let mesh;\n if (meshDimension === \"1D\") {\n mesh = new Mesh1D({ numElementsX, maxX, elementOrder, parsedMesh });\n } else if (meshDimension === \"2D\") {\n mesh = new Mesh2D({ numElementsX, maxX, numElementsY, maxY, elementOrder, parsedMesh });\n } else {\n errorLog(\"Mesh dimension must be either '1D' or '2D'.\");\n }\n\n // Use the parsed mesh in case it was already passed with Gmsh format\n const nodesCoordinatesAndNumbering = mesh.boundaryElementsProcessed ? mesh.parsedMesh : mesh.generateMesh();\n\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\n\n // Check the mesh type\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\n\n // Calculate totalElements and totalNodes based on mesh type\n let totalElements, totalNodes;\n\n if (isParsedMesh) {\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\n } else {\n // For structured mesh, calculate based on dimensions\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\n }\n\n return {\n nodesXCoordinates,\n nodesYCoordinates,\n totalNodesX,\n totalNodesY,\n nop,\n boundaryElements,\n totalElements,\n totalNodes,\n meshDimension,\n elementOrder,\n };\n}\n\n/**\n * Function to initialize the FEA matrices and numerical tools\n * @param {object} meshData - Object containing mesh data from prepareMesh()\n * @returns {object} An object containing initialized matrices and numerical tools\n */\nexport function initializeFEA(meshData) {\n const { totalNodes, nop, meshDimension, elementOrder } = meshData;\n\n // Initialize variables for matrix assembly\n let residualVector = [];\n let jacobianMatrix = [];\n let localToGlobalMap = [];\n\n // Initialize jacobianMatrix and residualVector arrays\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\n residualVector[nodeIndex] = 0;\n jacobianMatrix.push([]);\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\n jacobianMatrix[nodeIndex][colIndex] = 0;\n }\n }\n\n // Initialize the BasisFunctions class\n const basisFunctions = new BasisFunctions({\n meshDimension,\n elementOrder,\n });\n\n // Initialize the NumericalIntegration class\n const numericalIntegration = new NumericalIntegration({\n meshDimension,\n elementOrder,\n });\n\n // Calculate Gauss points and weights\n let gaussPointsAndWeights = numericalIntegration.getGaussPointsAndWeights();\n let gaussPoints = gaussPointsAndWeights.gaussPoints;\n let gaussWeights = gaussPointsAndWeights.gaussWeights;\n\n // Determine the number of nodes in the reference element based on the first element in the nop array\n const numNodes = nop[0].length;\n\n return {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 1D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping1D(params) {\n const { basisFunction, basisFunctionDerivKsi, nodesXCoordinates, localToGlobalMap, numNodes } = params;\n\n let xCoordinates = 0;\n let ksiDerivX = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n }\n let detJacobian = ksiDerivX;\n\n // Compute x-derivative of basis functions\n let basisFunctionDerivX = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian;\n }\n\n return {\n xCoordinates,\n detJacobian,\n basisFunctionDerivX,\n };\n}\n\n/**\n * Function to perform isoparametric mapping for 2D elements\n * @param {object} params - Parameters for the mapping\n * @returns {object} An object containing the mapped data\n */\nexport function performIsoparametricMapping2D(params) {\n const {\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n } = params;\n\n let xCoordinates = 0;\n let yCoordinates = 0;\n let ksiDerivX = 0;\n let etaDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivY = 0;\n\n // Isoparametric mapping\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n yCoordinates += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\n ksiDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivX += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n ksiDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\n etaDerivY += nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\n }\n let detJacobian = ksiDerivX * etaDerivY - etaDerivX * ksiDerivY;\n\n // Compute x-derivative and y-derivative of basis functions\n let basisFunctionDerivX = [];\n let basisFunctionDerivY = [];\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // The x-derivative of the n basis function\n basisFunctionDerivX[localNodeIndex] =\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\n detJacobian;\n // The y-derivative of the n basis function\n basisFunctionDerivY[localNodeIndex] =\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\n detJacobian;\n }\n\n return {\n xCoordinates,\n yCoordinates,\n detJacobian,\n basisFunctionDerivX,\n basisFunctionDerivY,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle thermal boundary conditions application\n */\nexport class ThermalBoundaryConditions {\n /**\n * Constructor to initialize the ThermalBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose constant temperature boundary conditions (Dirichlet type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the ConstantTemp value\n residualVector[globalNodeIndex] = tempValue;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant temperature boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantTempBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\n const tempValue = this.boundaryConditions[boundaryKey][1];\n debugLog(\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\n );\n\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant temperature to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n\n // Set boundary condition code and value\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = tempValue;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions (Robin type)\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n */\n imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 1;\n }\n } else if (this.elementOrder === \"quadratic\") {\n if (side === 0) {\n // Node at the left side of the reference element\n nodeIndex = 0;\n } else {\n // Node at the right side of the reference element\n nodeIndex = 2;\n }\n }\n\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\n debugLog(\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${localNodeIndex + 1})`\n );\n\n // Apply boundary condition with proper Jacobian for all sides\n residualVector[globalNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose convection boundary conditions for the frontal solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix with convection contributions\n * - localResidualVector: Residual vector with convection contributions\n */\n imposeConvectionBoundaryConditionsFront(\n elementIndex,\n nodesXCoordinates,\n nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n ) {\n // Extract convection parameters from boundary conditions\n let convectionHeatTranfCoeff = [];\n let convectionExtTemp = [];\n Object.keys(this.boundaryConditions).forEach((key) => {\n const boundaryCondition = this.boundaryConditions[key];\n if (boundaryCondition[0] === \"convection\") {\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\n convectionExtTemp[key] = boundaryCondition[2];\n }\n });\n\n // Initialize local Jacobian matrix and local residual vector\n const numNodes = this.nop[elementIndex].length;\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Check if this element is on a convection boundary\n for (const boundaryKey in this.boundaryElements) {\n if (this.boundaryConditions[boundaryKey]?.[0] === \"convection\") {\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\n const extTemp = convectionExtTemp[boundaryKey];\n debugLog(\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\n );\n\n // Find if this element is on this boundary and which side\n const boundaryElement = this.boundaryElements[boundaryKey].find(\n ([elemIdx, _]) => elemIdx === elementIndex\n );\n\n if (boundaryElement) {\n const side = boundaryElement[1];\n\n if (this.meshDimension === \"1D\") {\n // Handle 1D case\n let nodeIndex;\n if (this.elementOrder === \"linear\") {\n nodeIndex = side === 0 ? 0 : 1;\n } else if (this.elementOrder === \"quadratic\") {\n nodeIndex = side === 0 ? 0 : 2;\n }\n\n // Add contribution to local Jacobian matrix and local residual vector\n debugLog(\n ` - Applied convection boundary condition to node ${nodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n localResidualVector[nodeIndex] += -convectionCoeff * extTemp;\n localJacobianMatrix[nodeIndex][nodeIndex] += convectionCoeff;\n } else if (this.meshDimension === \"2D\") {\n // Handle 2D case\n if (this.elementOrder === \"linear\") {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 2;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 0;\n lastNodeIndex = 2;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[0];\n gaussPoint2 = 1;\n firstNodeIndex = 1;\n lastNodeIndex = 4;\n nodeIncrement = 2;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[0];\n firstNodeIndex = 2;\n lastNodeIndex = 4;\n nodeIncrement = 1;\n }\n\n // Get basis functions\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n const basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n const basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n // Calculate tangent vector components\n let ksiDerivX = 0,\n ksiDerivY = 0,\n etaDerivX = 0,\n etaDerivY = 0;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n } else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute tangent vector length\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[0] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n } else if (this.elementOrder === \"quadratic\") {\n // Handle quadratic elements (similar pattern but with more Gauss points)\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\n\n if (side === 0) {\n // Nodes at the bottom side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 0;\n firstNodeIndex = 0;\n lastNodeIndex = 7;\n nodeIncrement = 3;\n } else if (side === 1) {\n // Nodes at the left side of the reference element\n gaussPoint1 = 0;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 0;\n lastNodeIndex = 3;\n nodeIncrement = 1;\n } else if (side === 2) {\n // Nodes at the top side of the reference element\n gaussPoint1 = gaussPoints[gaussPointIndex];\n gaussPoint2 = 1;\n firstNodeIndex = 2;\n lastNodeIndex = 9;\n nodeIncrement = 3;\n } else if (side === 3) {\n // Nodes at the right side of the reference element\n gaussPoint1 = 1;\n gaussPoint2 = gaussPoints[gaussPointIndex];\n firstNodeIndex = 6;\n lastNodeIndex = 9;\n nodeIncrement = 1;\n }\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoint1, gaussPoint2);\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\n\n let ksiDerivX = 0;\n let ksiDerivY = 0;\n let etaDerivX = 0;\n let etaDerivY = 0;\n const numNodes = this.nop[elementIndex].length;\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n\n // For boundaries along Ksi (horizontal), use Ksi derivatives\n if (side === 0 || side === 2) {\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\n }\n // For boundaries along Eta (vertical), use Eta derivatives\n else if (side === 1 || side === 3) {\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\n }\n }\n\n // Compute the length of tangent vector\n let tangentVectorLength;\n if (side === 0 || side === 2) {\n tangentVectorLength = Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2);\n } else {\n tangentVectorLength = Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\n }\n\n // Apply boundary conditions to local matrices\n for (\n let localNodeIndex = firstNodeIndex;\n localNodeIndex < lastNodeIndex;\n localNodeIndex += nodeIncrement\n ) {\n localResidualVector[localNodeIndex] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n convectionCoeff *\n extTemp;\n\n for (\n let localNodeIndex2 = firstNodeIndex;\n localNodeIndex2 < lastNodeIndex;\n localNodeIndex2 += nodeIncrement\n ) {\n localJacobianMatrix[localNodeIndex][localNodeIndex2] +=\n -gaussWeights[gaussPointIndex] *\n tangentVectorLength *\n basisFunction[localNodeIndex] *\n basisFunction[localNodeIndex2] *\n convectionCoeff;\n }\n }\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the solid heat transfer model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\nexport function assembleHeatConductionMat(meshData, boundaryConditions) {\n basicLog(\"Starting solid heat transfer matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D solid heat transfer\n if (meshDimension === \"1D\") {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n // 2D solid heat transfer\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector is zero for this case\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Convection boundary conditions\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\n residualVector,\n jacobianMatrix,\n gaussPoints,\n gaussWeights,\n nodesXCoordinates,\n nodesYCoordinates,\n basisFunctions\n );\n\n // Impose ConstantTemp boundary conditions\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Solid heat transfer matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the solid heat transfer model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - localResidualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleHeatConductionFront({ elementIndex, nop, meshData, basisFunctions, FEAData }) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n if (meshDimension === \"1D\") {\n // 1D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n // 2D solid heat transfer\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Create mapping from local element space to global mesh (convert to 0-based indexing)\n const localToGlobalMap = ngl.map((globalIndex) => globalIndex - 1);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to handle generic boundary conditions application\n */\nexport class GenericBoundaryConditions {\n /**\n * Constructor to initialize the GenericBoundaryConditions class\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\n */\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\n this.boundaryConditions = boundaryConditions;\n this.boundaryElements = boundaryElements;\n this.nop = nop;\n this.meshDimension = meshDimension;\n this.elementOrder = elementOrder;\n }\n\n /**\n * Function to impose Dirichlet boundary conditions\n * @param {array} residualVector - The residual vector to be modified\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\n *\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n imposeDirichletBoundaryConditions(residualVector, jacobianMatrix) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n // Set the residual vector to the value\n residualVector[globalNodeIndex] = value;\n // Set the Jacobian matrix row to zero\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\n }\n // Set the diagonal entry of the Jacobian matrix to one\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\n });\n }\n });\n }\n });\n }\n }\n\n /**\n * Function to impose constant value (Dirichlet) boundary conditions for the frontal solver\n * @param {array} nodeConstraintCode - Array indicating boundary condition code for each node\n * @param {array} boundaryValues - Array containing boundary condition values\n */\n imposeConstantValueBoundaryConditionsFront(nodeConstraintCode, boundaryValues) {\n if (this.meshDimension === \"1D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 1: [1], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0], // Node at the left side of the reference element\n 2: [2], // Node at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n } else if (this.meshDimension === \"2D\") {\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\n if (this.boundaryConditions[boundaryKey][0] === \"constantValue\") {\n const value = this.boundaryConditions[boundaryKey][1];\n debugLog(`Boundary ${boundaryKey}: Applying constant value of ${value} (Dirichlet condition)`);\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\n if (this.elementOrder === \"linear\") {\n const boundarySides = {\n 0: [0, 2], // Nodes at the bottom side of the reference element\n 1: [0, 1], // Nodes at the left side of the reference element\n 2: [1, 3], // Nodes at the top side of the reference element\n 3: [2, 3], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n } else if (this.elementOrder === \"quadratic\") {\n const boundarySides = {\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\n 1: [0, 1, 2], // Nodes at the left side of the reference element\n 2: [2, 5, 8], // Nodes at the top side of the reference element\n 3: [6, 7, 8], // Nodes at the right side of the reference element\n };\n boundarySides[side].forEach((nodeIndex) => {\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\n debugLog(\n ` - Applied constant value to node ${globalNodeIndex + 1} (element ${\n elementIndex + 1\n }, local node ${nodeIndex + 1})`\n );\n nodeConstraintCode[globalNodeIndex] = 1;\n boundaryValues[globalNodeIndex] = value;\n });\n }\n });\n }\n });\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport {\n initializeFEA,\n performIsoparametricMapping1D,\n performIsoparametricMapping2D,\n} from \"../mesh/meshUtilsScript.js\";\nimport { basicLog, debugLog } from \"../utilities/loggingScript.js\";\n\n// Base viscous term that remains when eikonal equation is fully activated\nconst baseEikonalViscousTerm = 1e-2;\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the front propagation model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleFrontPropagationMat(\n meshData,\n boundaryConditions,\n solutionVector,\n eikonalActivationFlag\n) {\n basicLog(\"Starting front propagation matrix assembly...\");\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n debugLog(`eikonalViscousTerm: ${eikonalViscousTerm}`);\n debugLog(`eikonalActivationFlag: ${eikonalActivationFlag}`);\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Subtract 1 from nop in order to start numbering from 0\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // jacobianMatrix\n // TODO jacobianMatrix calculation here\n }\n }\n }\n // 2D front propagation (eikonal) equation\n else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex1],\n gaussPoints[gaussPointIndex2]\n );\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping2D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n basisFunctionDerivEta: basisFunctionsAndDerivatives.basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n\n // residualVector: Viscous term contribution (to stabilize the solution)\n residualVector[localToGlobalMap1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // residualVector: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n residualVector[localToGlobalMap1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n\n // jacobianMatrix: Viscous term contribution\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n -eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // jacobianMatrix: Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Impose Dirichlet boundary conditions\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n basicLog(\"Front propagation matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the local Jacobian matrix and residual vector for the front propagation model when using the frontal system solver\n * @param {number} elementIndex - Index of the element being processed\n * @param {array} nop - Nodal connectivity array (element-to-node mapping)\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} basisFunctions - Object containing basis functions and their derivatives\n * @param {object} FEAData - Object containing FEA-related data\n * @param {array} solutionVector - The solution vector for non-linear equations\n * @param {number} eikonalActivationFlag - Activation parameter for the eikonal equation\n * @returns {object} An object containing:\n * - localJacobianMatrix: Local Jacobian matrix\n * - residualVector: Residual vector contributions\n * - ngl: Array mapping local node indices to global node indices\n */\nexport function assembleFrontPropagationFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n solutionVector,\n eikonalActivationFlag,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n\n // Calculate eikonal viscous term\n let eikonalViscousTerm = 1 - eikonalActivationFlag + baseEikonalViscousTerm; // Viscous term for the front propagation (eikonal) equation\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\n // 1D front propagation (eikonal) equation\n if (meshDimension === \"1D\") {\n // Unsupported 1D front propagation\n errorLog(\"1D front propagation is not yet supported\");\n\n // Get basis functions for the current Gauss point\n let basisFunctionsAndDerivatives = basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1]);\n\n // Perform isoparametric mapping\n const mappingResult = performIsoparametricMapping1D({\n basisFunction: basisFunctionsAndDerivatives.basisFunction,\n basisFunctionDerivKsi: basisFunctionsAndDerivatives.basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Extract mapping results\n const { detJacobian, basisFunctionDerivX } = mappingResult;\n const basisFunction = basisFunctionsAndDerivatives.basisFunction;\n\n // Calculate solution derivative\n let solutionDerivX = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // residualVector\n // TODO residualVector calculation here\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\n // localJacobianMatrix\n // TODO localJacobianMatrix calculation here\n }\n }\n // 2D front propagation (eikonal) equation\n } else if (meshDimension === \"2D\") {\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta } =\n basisFunctions.getBasisFunctions(gaussPoints[gaussPointIndex1], gaussPoints[gaussPointIndex2]);\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX, basisFunctionDerivY } = performIsoparametricMapping2D({\n basisFunction,\n basisFunctionDerivKsi,\n basisFunctionDerivEta,\n nodesXCoordinates,\n nodesYCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate solution derivatives\n let solutionDerivX = 0;\n let solutionDerivY = 0;\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n solutionDerivX +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivX[localNodeIndex];\n solutionDerivY +=\n solutionVector[localToGlobalMap[localNodeIndex]] * basisFunctionDerivY[localNodeIndex];\n }\n\n // Computation of Galerkin's residuals and Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\n // Viscous term contribution\n localResidualVector[localNodeIndex1] +=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivX[localNodeIndex1] *\n solutionDerivX +\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunctionDerivY[localNodeIndex1] *\n solutionDerivY;\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localResidualVector[localNodeIndex1] +=\n eikonalActivationFlag *\n (gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1] *\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2) -\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n basisFunction[localNodeIndex1]);\n }\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Viscous term contribution\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n eikonalViscousTerm *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2] *\n detJacobian *\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\n\n // Eikonal equation contribution\n if (eikonalActivationFlag !== 0) {\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n eikonalActivationFlag *\n (-(\n detJacobian *\n solutionDerivX *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]\n ) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivX[localNodeIndex2] -\n eikonalActivationFlag *\n ((detJacobian *\n solutionDerivY *\n basisFunction[localNodeIndex1] *\n gaussWeights[gaussPointIndex1] *\n gaussWeights[gaussPointIndex2]) /\n Math.sqrt(solutionDerivX ** 2 + solutionDerivY ** 2 + 1e-8)) *\n basisFunctionDerivY[localNodeIndex2];\n }\n }\n }\n }\n }\n }\n\n return { localJacobianMatrix, localResidualVector, ngl };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { BasisFunctions } from \"../mesh/basisFunctionsScript.js\";\nimport { initializeFEA } from \"../mesh/meshUtilsScript.js\";\nimport { assembleHeatConductionFront } from \"../solvers/heatConductionScript.js\";\nimport { ThermalBoundaryConditions } from \"../solvers/thermalBoundaryConditionsScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\nimport { GenericBoundaryConditions } from \"../solvers/genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n// Create object templates\nconst frontalData = {};\nconst frontalState = {};\nconst elementData = { currentElementIndex: 0 };\nconst frontStorage = {};\nlet basisFunctions;\n\n/**\n * Function to run the frontal solver and obtain results for plotting\n * @param {function} assembleFront - Matrix assembler based on the physical model\n * @param {object} meshData - Object containing mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} [options] - Additional options for the solver\n * @returns {object} An object containing the solution vector and node coordinates\n */\nexport function runFrontalSolver(assembleFront, meshData, boundaryConditions, options = {}) {\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const totalNodes = meshData.nodesXCoordinates.length;\n const numElements = meshData.totalElements;\n const numNodes = FEAData.numNodes;\n\n // Calculate required array sizes\n initializeFrontalArrays(numNodes, numElements);\n\n // Start timing for system solving (frontal algorithm)\n basicLog(\"Solving system using frontal...\");\n console.time(\"systemSolving\");\n\n // Initialize basis functions\n basisFunctions = new BasisFunctions({\n meshDimension: meshData.meshDimension,\n elementOrder: meshData.elementOrder,\n });\n\n // Copy node connectivity array into frontalData storage\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n for (let nodeIndex = 0; nodeIndex < FEAData.numNodes; nodeIndex++) {\n frontalData.nodalNumbering[elementIndex][nodeIndex] = meshData.nop[elementIndex][nodeIndex];\n }\n }\n\n // Apply Dirichlet-type boundary conditions\n // Initialize all nodes with no boundary condition\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.nodeConstraintCode[nodeIndex] = 0;\n frontalData.boundaryValues[nodeIndex] = 0;\n }\n\n // Handle Dirichlet-type boundary conditions differently based on which solver is being used\n let dirichletBoundaryConditionsHandler;\n // Solid heat transfer model (heatConductionScript solver)\n if (assembleFront === assembleHeatConductionFront) {\n dirichletBoundaryConditionsHandler = new ThermalBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantTempBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n // Front propagation model (frontPropagationScript solver)\n } else if (assembleFront === assembleFrontPropagationFront) {\n dirichletBoundaryConditionsHandler = new GenericBoundaryConditions(\n boundaryConditions,\n meshData.boundaryElements,\n meshData.nop,\n meshData.meshDimension,\n meshData.elementOrder\n );\n\n dirichletBoundaryConditionsHandler.imposeConstantValueBoundaryConditionsFront(\n frontalData.nodeConstraintCode,\n frontalData.boundaryValues\n );\n }\n // Initialize global residual vector\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.globalResidualVector[nodeIndex] = 0;\n }\n\n frontalState.totalNodes = meshData.nodesXCoordinates.length;\n frontalState.writeFlag = 0;\n frontalState.transformationFlag = 1;\n frontalState.determinant = 1;\n\n for (let elementIndex = 0; elementIndex < meshData.totalElements; elementIndex++) {\n frontalState.nodesPerElement[elementIndex] = FEAData.numNodes;\n }\n\n // Parameters for non-linear assemblers\n frontalState.currentSolutionVector = options.solutionVector;\n frontalState.eikonalActivationFlag = options.eikonalActivationFlag;\n\n // Pass assembleFront and dirichletBoundaryConditionsHandler to runFrontalAlgorithm\n runFrontalAlgorithm(meshData, FEAData, dirichletBoundaryConditionsHandler, assembleFront);\n\n // Copy solution\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n frontalData.solutionVector[nodeIndex] = frontalState.globalSolutionVector[nodeIndex];\n }\n\n // Output results to console for debugging\n const { nodesXCoordinates, nodesYCoordinates } = meshData;\n for (let nodeIndex = 0; nodeIndex < meshData.nodesXCoordinates.length; nodeIndex++) {\n if (meshData.meshDimension === \"1D\") {\n // 1D case - only output X coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${frontalData.solutionVector[\n nodeIndex\n ].toExponential(5)}`\n );\n } else {\n // 2D case - output X, Y coordinates and temperature\n debugLog(\n `${nodesXCoordinates[nodeIndex].toExponential(5)} ${nodesYCoordinates[nodeIndex].toExponential(\n 5\n )} ${frontalData.solutionVector[nodeIndex].toExponential(5)}`\n );\n }\n }\n\n console.timeEnd(\"systemSolving\");\n basicLog(\"System solved successfully\");\n\n const { nodesXCoordinates: finalNodesX, nodesYCoordinates: finalNodesY } = meshData;\n return {\n solutionVector: frontalData.solutionVector.slice(0, totalNodes),\n nodesCoordinates: {\n nodesXCoordinates: finalNodesX,\n nodesYCoordinates: finalNodesY,\n },\n };\n}\n\n/**\n * Function to initialize arrays dynamically based on problem size\n * @param {number} numNodes - Number of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n */\nfunction initializeFrontalArrays(numNodes, numElements) {\n // Use the actual number of elements from the mesh\n frontalData.nodalNumbering = Array(numElements)\n .fill()\n .map(() => Array(numNodes).fill(0));\n frontalData.nodeConstraintCode = Array(numNodes).fill(0);\n frontalData.boundaryValues = Array(numNodes).fill(0);\n frontalData.globalResidualVector = Array(numNodes).fill(0);\n frontalData.solutionVector = Array(numNodes).fill(0);\n frontalData.topologyData = Array(numElements).fill(0);\n frontalData.lateralData = Array(numElements).fill(0);\n\n // Initialize frontalState arrays\n frontalState.writeFlag = 0;\n frontalState.totalNodes = numNodes;\n frontalState.transformationFlag = 0;\n frontalState.nodesPerElement = Array(numElements).fill(0);\n frontalState.determinant = 1;\n\n // For matrix operations, estimate required size based on problem complexity\n const systemSize = Math.max(numNodes, 2000);\n frontalState.globalSolutionVector = Array(systemSize).fill(0);\n frontalState.frontDataIndex = 0;\n\n // Initialize elementData arrays\n elementData.localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n elementData.currentElementIndex = 0;\n\n // Initialize frontStorage arrays\n const frontSize = estimateFrontSize(numNodes, numElements);\n frontStorage.frontValues = Array(frontSize).fill(0);\n frontStorage.columnHeaders = Array(systemSize).fill(0);\n frontStorage.pivotRow = Array(systemSize).fill(0);\n frontStorage.pivotData = Array(frontSize).fill(0);\n}\n\n/**\n * Function to estimate the required front size\n * @param {number} numNodes - Number of of nodes per element\n * @param {number} numElements - Number of elements in the mesh\n * @returns {number} Estimated front size\n */\nfunction estimateFrontSize(numNodes, numElements) {\n const frontWidthEstimate = Math.max(Math.ceil(Math.sqrt(numElements)) * numNodes, numNodes * 2);\n return frontWidthEstimate * numElements;\n}\n// Old function to estimate the required front size\n// function estimateFrontSize(numNodes, numElements, numNodes) {\n// const frontWidthEstimate = Math.ceil(Math.sqrt(numElements) * numNodes * 2);\n// const frontSize = frontWidthEstimate * numNodes * 4;\n// return Math.max(frontSize, 10000);\n// }\n\n/**\n * Function to compute local Jacobian matrix and local residual vector\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n const elementIndex = elementData.currentElementIndex - 1;\n\n // Guard against out-of-range indices\n if (elementIndex < 0 || elementIndex >= meshData.totalElements) {\n errorLog(`Skipping out-of-range elementIndex=${elementIndex} (totalElements=${meshData.totalElements})`);\n return false;\n }\n\n // Domain terms\n const { localJacobianMatrix, localResidualVector, ngl } = assembleFront({\n elementIndex,\n nop: frontalData.nodalNumbering,\n meshData,\n basisFunctions: basisFunctions,\n FEAData,\n // These are ignored by linear assemblers\n solutionVector: frontalState.currentSolutionVector,\n eikonalActivationFlag: frontalState.eikonalActivationFlag,\n });\n\n // Handle Robin-type boundary conditions differently based on which solver is being used\n let boundaryLocalJacobianMatrix = Array(FEAData.numNodes)\n .fill()\n .map(() => Array(FEAData.numNodes).fill(0));\n let boundaryResidualVector = Array(FEAData.numNodes).fill(0);\n\n // heatConductionScript solver\n if (assembleFront === assembleHeatConductionFront) {\n // Check if this element is on a Robin-type boundary\n let isOnRobinTypeBoundary = false;\n for (const boundaryKey in meshData.boundaryElements) {\n if (\n thermalBoundaryConditions.boundaryConditions[boundaryKey]?.[0] === \"convection\" &&\n meshData.boundaryElements[boundaryKey].some(([elemIdx, _]) => elemIdx === elementIndex)\n ) {\n isOnRobinTypeBoundary = true;\n break;\n }\n }\n\n // Only calculate Robin-type for elements when required\n if (isOnRobinTypeBoundary) {\n const { gaussPoints, gaussWeights } = FEAData;\n const result = thermalBoundaryConditions.imposeConvectionBoundaryConditionsFront(\n elementIndex,\n meshData.nodesXCoordinates,\n meshData.nodesYCoordinates,\n gaussPoints,\n gaussWeights,\n basisFunctions\n );\n boundaryLocalJacobianMatrix = result.localJacobianMatrix;\n boundaryResidualVector = result.localResidualVector;\n }\n } else if (assembleFront === assembleFrontPropagationFront) {\n // For now, no Robin-type boundary conditions exist for any other solver\n }\n\n // Combine domain and boundary contributions\n for (let localNodeI = 0; localNodeI < FEAData.numNodes; localNodeI++) {\n for (let localNodeJ = 0; localNodeJ < FEAData.numNodes; localNodeJ++) {\n elementData.localJacobianMatrix[localNodeI][localNodeJ] =\n localJacobianMatrix[localNodeI][localNodeJ] + boundaryLocalJacobianMatrix[localNodeI][localNodeJ];\n }\n }\n\n // Assemble local element residual\n for (let localNodeIndex = 0; localNodeIndex < FEAData.numNodes; localNodeIndex++) {\n const globalNodeIndex = ngl[localNodeIndex] - 1;\n frontalData.globalResidualVector[globalNodeIndex] +=\n localResidualVector[localNodeIndex] + boundaryResidualVector[localNodeIndex];\n }\n\n return true;\n}\n\n/**\n * Function to implement the frontal solver algorithm\n * @param {object} meshData - Object containing mesh data\n * @param {object} FEAData - Object containing FEA-related data\n * @param {object} thermalBoundaryConditions - Object containing thermal boundary conditions\n * @param {function} assembleFront - Matrix assembler based on the physical model\n */\nfunction runFrontalAlgorithm(meshData, FEAData, thermalBoundaryConditions, assembleFront) {\n // Allocate local arrays dynamically\n const totalElements = meshData.totalElements;\n const numNodes = meshData.nodesXCoordinates.length;\n const systemSize = Math.max(numNodes, frontalState.globalSolutionVector.length);\n let localDestination = Array(FEAData.numNodes).fill(0);\n let rowDestination = Array(FEAData.numNodes).fill(0);\n let rowHeaders = Array(systemSize).fill(0);\n let pivotRowIndices = Array(systemSize).fill(0);\n let pivotColumnIndices = Array(systemSize).fill(0);\n let modifiedRows = Array(systemSize).fill(0);\n let pivotColumn = Array(systemSize).fill(0);\n let frontMatrix = Array(systemSize)\n .fill()\n .map(() => Array(systemSize).fill(0));\n let rowSwapCount = Array(numNodes).fill(0);\n let columnSwapCount = Array(numNodes).fill(0);\n let lastAppearanceCheck = Array(numNodes).fill(0);\n let pivotColumnGlobalIndex; // Pivot column global index\n\n let frontDataCounter = 1;\n frontalState.writeFlag++;\n let pivotDataIndex = 1;\n let summedRows = 1;\n elementData.currentElementIndex = 0;\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n rowSwapCount[nodeIndex] = 0;\n columnSwapCount[nodeIndex] = 0;\n }\n\n if (frontalState.transformationFlag !== 0) {\n // Prefront: find last appearance of each node\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n lastAppearanceCheck[nodeIndex] = 0;\n }\n\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n let reverseElementIndex = totalElements - elementIndex - 1;\n for (\n let localNodeIndex = 0;\n localNodeIndex < frontalState.nodesPerElement[reverseElementIndex];\n localNodeIndex++\n ) {\n let globalNodeIndex = frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n if (lastAppearanceCheck[globalNodeIndex - 1] === 0) {\n lastAppearanceCheck[globalNodeIndex - 1] = 1;\n frontalData.nodalNumbering[reverseElementIndex][localNodeIndex] =\n -frontalData.nodalNumbering[reverseElementIndex][localNodeIndex];\n }\n }\n }\n }\n\n frontalState.transformationFlag = 0;\n let columnCount = 0;\n let rowCount = 0;\n\n for (let i = 0; i < systemSize; i++) {\n for (let j = 0; j < systemSize; j++) {\n frontMatrix[j][i] = 0;\n }\n }\n\n while (true) {\n // Assemble a new element only while we still have elements\n let assembled = false;\n let numElementNodes = 0;\n let numElementColumns = 0;\n\n if (elementData.currentElementIndex < totalElements) {\n elementData.currentElementIndex++;\n assembled = assembleElementContribution(meshData, FEAData, thermalBoundaryConditions, assembleFront);\n }\n\n if (assembled) {\n const currentElement = elementData.currentElementIndex;\n numElementNodes = frontalState.nodesPerElement[currentElement - 1];\n numElementColumns = frontalState.nodesPerElement[currentElement - 1];\n\n for (let localNodeIndex = 0; localNodeIndex < numElementColumns; localNodeIndex++) {\n let globalNodeIndex = frontalData.nodalNumbering[currentElement - 1][localNodeIndex];\n let columnIndex;\n\n if (columnCount === 0) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n for (columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(frontStorage.columnHeaders[columnIndex])) break;\n }\n\n if (columnIndex === columnCount) {\n columnCount++;\n localDestination[localNodeIndex] = columnCount;\n frontStorage.columnHeaders[columnCount - 1] = globalNodeIndex;\n } else {\n localDestination[localNodeIndex] = columnIndex + 1;\n frontStorage.columnHeaders[columnIndex] = globalNodeIndex;\n }\n }\n\n let rowIndex;\n if (rowCount === 0) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n if (Math.abs(globalNodeIndex) === Math.abs(rowHeaders[rowIndex])) break;\n }\n\n if (rowIndex === rowCount) {\n rowCount++;\n rowDestination[localNodeIndex] = rowCount;\n rowHeaders[rowCount - 1] = globalNodeIndex;\n } else {\n rowDestination[localNodeIndex] = rowIndex + 1;\n rowHeaders[rowIndex] = globalNodeIndex;\n }\n }\n }\n\n if (rowCount > systemSize || columnCount > systemSize) {\n errorLog(\"Error: systemSize not large enough\");\n return;\n }\n\n for (let localColumnIndex = 0; localColumnIndex < numElementColumns; localColumnIndex++) {\n let frontColumnIndex = localDestination[localColumnIndex];\n for (let localRowIndex = 0; localRowIndex < numElementNodes; localRowIndex++) {\n let frontRowIndex = rowDestination[localRowIndex];\n frontMatrix[frontRowIndex - 1][frontColumnIndex - 1] +=\n elementData.localJacobianMatrix[localRowIndex][localColumnIndex];\n }\n }\n }\n\n // Pivoting/elimination continues whether or not a new element was assembled\n let availableColumnCount = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n if (frontStorage.columnHeaders[columnIndex] < 0) {\n pivotColumnIndices[availableColumnCount] = columnIndex + 1;\n availableColumnCount++;\n }\n }\n\n let constrainedRowCount = 0;\n let availableRowCount = 0;\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n let globalNodeIndex = rowHeaders[rowIndex];\n if (globalNodeIndex < 0) {\n pivotRowIndices[availableRowCount] = rowIndex + 1;\n availableRowCount++;\n let absoluteNodeIndex = Math.abs(globalNodeIndex);\n if (frontalData.nodeConstraintCode[absoluteNodeIndex - 1] === 1) {\n modifiedRows[constrainedRowCount] = rowIndex + 1;\n constrainedRowCount++;\n frontalData.nodeConstraintCode[absoluteNodeIndex - 1] = 2;\n frontalData.globalResidualVector[absoluteNodeIndex - 1] =\n frontalData.boundaryValues[absoluteNodeIndex - 1];\n }\n }\n }\n\n if (constrainedRowCount > 0) {\n for (let constrainedIndex = 0; constrainedIndex < constrainedRowCount; constrainedIndex++) {\n let rowIndex = modifiedRows[constrainedIndex] - 1;\n let globalNodeIndex = Math.abs(rowHeaders[rowIndex]);\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] = 0;\n let columnGlobalIndex = Math.abs(frontStorage.columnHeaders[columnIndex]);\n if (columnGlobalIndex === globalNodeIndex) frontMatrix[rowIndex][columnIndex] = 1;\n }\n }\n }\n\n if (availableColumnCount > summedRows || elementData.currentElementIndex < totalElements) {\n if (availableColumnCount === 0) {\n errorLog(\"Error: no more rows fully summed\");\n return;\n }\n\n let pivotRowIndex = pivotRowIndices[0];\n let pivotColumnIndex = pivotColumnIndices[0];\n let pivotValue = frontMatrix[pivotRowIndex - 1][pivotColumnIndex - 1];\n\n if (Math.abs(pivotValue) < 1e-4) {\n pivotValue = 0;\n for (let columnIndex = 0; columnIndex < availableColumnCount; columnIndex++) {\n let testColumnIndex = pivotColumnIndices[columnIndex];\n for (let rowIndex = 0; rowIndex < availableRowCount; rowIndex++) {\n let testRowIndex = pivotRowIndices[rowIndex];\n let testValue = frontMatrix[testRowIndex - 1][testColumnIndex - 1];\n if (Math.abs(testValue) > Math.abs(pivotValue)) {\n pivotValue = testValue;\n pivotColumnIndex = testColumnIndex;\n pivotRowIndex = testRowIndex;\n }\n }\n }\n }\n\n let pivotGlobalRowIndex = Math.abs(rowHeaders[pivotRowIndex - 1]);\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]); // Assign, don't declare\n let permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n if (nodeIndex >= pivotGlobalRowIndex) rowSwapCount[nodeIndex]--;\n if (nodeIndex >= pivotColumnGlobalIndex) columnSwapCount[nodeIndex]--;\n }\n\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontMatrix[pivotRowIndex - 1][columnIndex] / pivotValue;\n }\n\n let rightHandSide = frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] = rightHandSide;\n pivotColumn[pivotRowIndex - 1] = pivotValue;\n\n if (pivotRowIndex > 1) {\n for (let rowIndex = 0; rowIndex < pivotRowIndex - 1; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1 && eliminationFactor !== 0) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex][columnIndex] -= eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n if (pivotRowIndex < rowCount) {\n for (let rowIndex = pivotRowIndex; rowIndex < rowCount; rowIndex++) {\n let globalRowIndex = Math.abs(rowHeaders[rowIndex]);\n let eliminationFactor = frontMatrix[rowIndex][pivotColumnIndex - 1];\n pivotColumn[rowIndex] = eliminationFactor;\n if (pivotColumnIndex > 1) {\n for (let columnIndex = 0; columnIndex < pivotColumnIndex - 1; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n if (pivotColumnIndex < columnCount) {\n for (let columnIndex = pivotColumnIndex; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowIndex - 1][columnIndex - 1] =\n frontMatrix[rowIndex][columnIndex] - eliminationFactor * frontStorage.pivotRow[columnIndex];\n }\n }\n frontalData.globalResidualVector[globalRowIndex - 1] -= eliminationFactor * rightHandSide;\n }\n }\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = pivotColumn[i];\n }\n pivotDataIndex += rowCount;\n\n for (let i = 0; i < rowCount; i++) {\n frontStorage.pivotData[pivotDataIndex + i - 1] = rowHeaders[i];\n }\n pivotDataIndex += rowCount;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.pivotRow[i];\n }\n frontDataCounter += columnCount;\n\n for (let i = 0; i < columnCount; i++) {\n frontStorage.frontValues[frontDataCounter - 1 + i] = frontStorage.columnHeaders[i];\n }\n frontDataCounter += columnCount;\n\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n frontMatrix[rowIndex][columnCount - 1] = 0;\n }\n\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontMatrix[rowCount - 1][columnIndex] = 0;\n }\n\n columnCount--;\n if (pivotColumnIndex < columnCount + 1) {\n for (let columnIndex = pivotColumnIndex - 1; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] = frontStorage.columnHeaders[columnIndex + 1];\n }\n }\n\n rowCount--;\n if (pivotRowIndex < rowCount + 1) {\n for (let rowIndex = pivotRowIndex - 1; rowIndex < rowCount; rowIndex++) {\n rowHeaders[rowIndex] = rowHeaders[rowIndex + 1];\n }\n }\n\n if (rowCount > 1 || elementData.currentElementIndex < totalElements) continue;\n\n pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[0]); // Assign, don't declare\n pivotRowIndex = 1;\n pivotValue = frontMatrix[0][0];\n pivotGlobalRowIndex = Math.abs(rowHeaders[0]);\n pivotColumnIndex = 1;\n permutationHelper =\n pivotGlobalRowIndex +\n pivotColumnGlobalIndex +\n rowSwapCount[pivotGlobalRowIndex - 1] +\n columnSwapCount[pivotColumnGlobalIndex - 1];\n frontalState.determinant =\n (frontalState.determinant * pivotValue * (-1) ** permutationHelper) / Math.abs(pivotValue);\n\n frontStorage.pivotRow[0] = 1;\n if (Math.abs(pivotValue) < 1e-10) {\n errorLog(\n `Matrix singular or ill-conditioned, currentElementIndex=${elementData.currentElementIndex}, pivotGlobalRowIndex=${pivotGlobalRowIndex}, pivotColumnGlobalIndex=${pivotColumnGlobalIndex}, pivotValue=${pivotValue}`\n );\n }\n\n if (pivotValue === 0) return;\n\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] =\n frontalData.globalResidualVector[pivotGlobalRowIndex - 1] / pivotValue;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.pivotRow[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = frontStorage.columnHeaders[0];\n frontDataCounter++;\n frontStorage.frontValues[frontDataCounter - 1] = pivotGlobalRowIndex;\n frontStorage.frontValues[frontDataCounter] = columnCount;\n frontStorage.frontValues[frontDataCounter + 1] = pivotColumnIndex;\n frontStorage.frontValues[frontDataCounter + 2] = pivotValue;\n frontDataCounter += 4;\n\n frontStorage.pivotData[pivotDataIndex - 1] = pivotColumn[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = rowHeaders[0];\n pivotDataIndex++;\n frontStorage.pivotData[pivotDataIndex - 1] = pivotRowIndex;\n pivotDataIndex++;\n\n frontalState.frontDataIndex = frontDataCounter;\n if (frontalState.writeFlag === 1)\n debugLog(`total ecs transfer in matrix reduction=${frontDataCounter}`);\n\n // Back substitution\n performBackSubstitution(frontDataCounter);\n break;\n }\n }\n}\n\n/**\n * Function to perform back substitution for the frontal solver\n * @param {number} frontDataCounter - Index counter for the element contributions\n */\nfunction performBackSubstitution(frontDataCounter) {\n for (let nodeIndex = 0; nodeIndex < frontalState.totalNodes; nodeIndex++) {\n frontalState.globalSolutionVector[nodeIndex] = frontalData.boundaryValues[nodeIndex];\n }\n\n for (let iterationIndex = 1; iterationIndex <= frontalState.totalNodes; iterationIndex++) {\n frontDataCounter -= 4;\n let pivotGlobalRowIndex = frontStorage.frontValues[frontDataCounter - 1];\n let columnCount = frontStorage.frontValues[frontDataCounter];\n let pivotColumnIndex = frontStorage.frontValues[frontDataCounter + 1];\n let pivotValue = frontStorage.frontValues[frontDataCounter + 2];\n\n if (iterationIndex === 1) {\n frontDataCounter--;\n frontStorage.columnHeaders[0] = frontStorage.frontValues[frontDataCounter - 1];\n frontDataCounter--;\n frontStorage.pivotRow[0] = frontStorage.frontValues[frontDataCounter - 1];\n } else {\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.columnHeaders[columnIndex] =\n frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n frontDataCounter -= columnCount;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n frontStorage.pivotRow[columnIndex] = frontStorage.frontValues[frontDataCounter - 1 + columnIndex];\n }\n }\n\n let pivotColumnGlobalIndex = Math.abs(frontStorage.columnHeaders[pivotColumnIndex - 1]);\n if (frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] > 0) continue;\n\n let accumulatedValue = 0;\n frontStorage.pivotRow[pivotColumnIndex - 1] = 0;\n for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {\n accumulatedValue -=\n frontStorage.pivotRow[columnIndex] *\n frontalState.globalSolutionVector[Math.abs(frontStorage.columnHeaders[columnIndex]) - 1];\n }\n\n frontalState.globalSolutionVector[pivotColumnGlobalIndex - 1] =\n accumulatedValue + frontalData.globalResidualVector[pivotGlobalRowIndex - 1];\n\n frontalData.nodeConstraintCode[pivotColumnGlobalIndex - 1] = 1;\n }\n\n if (frontalState.writeFlag === 1)\n debugLog(`value of frontDataCounter after backsubstitution=${frontDataCounter}`);\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { euclideanNorm } from \"../methods/euclideanNormScript.js\";\nimport { solveLinearSystem } from \"./linearSystemSolverScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\nimport { runFrontalSolver } from \"./frontalSolverScript.js\";\nimport { assembleFrontPropagationFront } from \"../solvers/frontPropagationScript.js\";\n\n/**\n * Function to solve a system of non-linear equations using the Newton-Raphson method\n * @param {function} assembleMat - Matrix assembler based on the physical model\n * @param {object} context - Context object containing simulation data and options\n * @param {number} [maxIterations=100] - Maximum number of iterations\n * @param {number} [tolerance=1e-4] - Convergence tolerance\n * @returns {object} An object containing:\n * - solutionVector: The solution vector\n * - iterations: The number of iterations performed\n * - converged: Boolean indicating whether the method converged\n */\n\nexport function newtonRaphson(assembleMat, context, maxIterations = 100, tolerance = 1e-4) {\n let errorNorm = 0;\n let converged = false;\n let iterations = 0;\n let deltaX = [];\n let solutionVector = [];\n let jacobianMatrix = [];\n let residualVector = [];\n\n // Calculate system size\n let totalNodes = context.meshData.nodesXCoordinates.length;\n\n // Initialize arrays with proper size\n for (let i = 0; i < totalNodes; i++) {\n deltaX[i] = 0;\n solutionVector[i] = 0;\n }\n\n // Initialize solution from context if available\n if (context.initialSolution && context.initialSolution.length === totalNodes) {\n solutionVector = [...context.initialSolution];\n }\n\n while (iterations < maxIterations && !converged) {\n // Update solution\n for (let i = 0; i < solutionVector.length; i++) {\n solutionVector[i] = Number(solutionVector[i]) + Number(deltaX[i]);\n }\n\n // Check if using frontal solver\n if (context.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleFrontPropagationFront,\n context.meshData,\n context.boundaryConditions,\n { solutionVector, eikonalActivationFlag: context.eikonalActivationFlag }\n );\n deltaX = frontalResult.solutionVector;\n } else {\n // Compute Jacobian and residual matrices\n ({ jacobianMatrix, residualVector } = assembleMat(\n context.meshData,\n context.boundaryConditions,\n solutionVector, // The solution vector is required in the case of a non-linear equation\n context.eikonalActivationFlag // Currently used only in the front propagation solver (TODO refactor in case of a solver not needing it)\n ));\n\n // Solve the linear system based on the specified solver method\n const linearSystemResult = solveLinearSystem(context.solverMethod, jacobianMatrix, residualVector);\n deltaX = linearSystemResult.solutionVector;\n }\n\n // Check convergence\n errorNorm = euclideanNorm(deltaX);\n\n // Norm for each iteration\n basicLog(`Newton-Raphson iteration ${iterations + 1}: Error norm = ${errorNorm.toExponential(4)}`);\n\n if (errorNorm <= tolerance) {\n converged = true;\n } else if (errorNorm > 1e2) {\n errorLog(`Solution not converged. Error norm: ${errorNorm}`);\n break;\n }\n\n iterations++;\n }\n\n return {\n solutionVector,\n converged,\n iterations,\n jacobianMatrix,\n residualVector,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { newtonRaphson } from \"./methods/newtonRaphsonScript.js\";\nimport { solveLinearSystem } from \"./methods/linearSystemSolverScript.js\";\nimport { prepareMesh } from \"./mesh/meshUtilsScript.js\";\nimport { assembleFrontPropagationMat } from \"./solvers/frontPropagationScript.js\";\nimport { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from \"./solvers/generalFormPDEScript.js\";\nimport { assembleHeatConductionMat, assembleHeatConductionFront } from \"./solvers/heatConductionScript.js\";\nimport { runFrontalSolver } from \"./methods/frontalSolverScript.js\";\nimport { basicLog, debugLog, warnLog, errorLog } from \"./utilities/loggingScript.js\";\n\n/**\n * Class to implement finite element analysis in JavaScript\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} meshConfig - Object containing computational mesh details\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\n * @returns {object} An object containing the solution vector and additional mesh information\n */\nexport class FEAScriptModel {\n constructor() {\n this.solverConfig = null;\n this.meshConfig = {};\n this.boundaryConditions = {};\n this.solverMethod = \"lusolve\"; // Default solver method\n this.coefficientFunctions = null; // Add storage for coefficient functions\n warnLog(\n \"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE\"\n );\n basicLog(\"FEAScriptModel instance created\");\n }\n\n /**\n * Sets the solver configuration\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {object} [options] - Optional additional configuration\n */\n setSolverConfig(solverConfig, options = {}) {\n this.solverConfig = solverConfig;\n\n // Store coefficient functions if provided\n if (options && options.coefficientFunctions) {\n this.coefficientFunctions = options.coefficientFunctions;\n debugLog(\"Coefficient functions set\");\n }\n\n debugLog(`Solver config set to: ${solverConfig}`);\n }\n\n setMeshConfig(meshConfig) {\n this.meshConfig = meshConfig;\n debugLog(`Mesh config set with dimensions: ${meshConfig.meshDimension}`);\n }\n\n addBoundaryCondition(boundaryKey, condition) {\n this.boundaryConditions[boundaryKey] = condition;\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\n }\n\n setSolverMethod(solverMethod) {\n this.solverMethod = solverMethod;\n debugLog(`Solver method set to: ${solverMethod}`);\n }\n\n solve() {\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\n console.error(error);\n throw new Error(error);\n }\n\n /**\n * For consistency across both linear and nonlinear formulations,\n * this project always refers to the assembled right-hand side vector\n * as `residualVector` and the assembled system matrix as `jacobianMatrix`.\n *\n * In linear problems `jacobianMatrix` is equivalent to the\n * classic stiffness/conductivity matrix and `residualVector`\n * corresponds to the traditional load (RHS) vector.\n */\n\n let jacobianMatrix = [];\n let residualVector = [];\n let solutionVector = [];\n let initialSolution = [];\n\n // Prepare the mesh\n basicLog(\"Preparing mesh...\");\n const meshData = prepareMesh(this.meshConfig);\n basicLog(\"Mesh preparation completed\");\n\n // Extract node coordinates from meshData\n const nodesCoordinates = {\n nodesXCoordinates: meshData.nodesXCoordinates,\n nodesYCoordinates: meshData.nodesYCoordinates,\n };\n\n // Select and execute the appropriate solver based on solverConfig\n basicLog(\"Beginning solving process...\");\n console.time(\"totalSolvingTime\");\n if (this.solverConfig === \"heatConductionScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n const frontalResult = runFrontalSolver(\n assembleHeatConductionFront,\n meshData,\n this.boundaryConditions\n );\n solutionVector = frontalResult.solutionVector;\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions));\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n } else if (this.solverConfig === \"frontPropagationScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n\n // Initialize eikonalActivationFlag\n let eikonalActivationFlag = 0;\n const eikonalExteralIterations = 5; // Number of incremental steps for the eikonal equation\n\n // Create context object with all necessary properties\n const context = {\n meshData: meshData,\n boundaryConditions: this.boundaryConditions,\n eikonalActivationFlag: eikonalActivationFlag,\n solverMethod: this.solverMethod,\n initialSolution,\n };\n\n while (eikonalActivationFlag <= 1) {\n // Update the context object with current eikonalActivationFlag\n context.eikonalActivationFlag = eikonalActivationFlag;\n\n // Pass the previous solution as initial guess\n if (solutionVector.length > 0) {\n context.initialSolution = [...solutionVector];\n }\n\n // Solve the assembled non-linear system\n const newtonRaphsonResult = newtonRaphson(assembleFrontPropagationMat, context, 100, 1e-4);\n\n // Extract results\n jacobianMatrix = newtonRaphsonResult.jacobianMatrix;\n residualVector = newtonRaphsonResult.residualVector;\n solutionVector = newtonRaphsonResult.solutionVector;\n\n // Increment for next iteration\n eikonalActivationFlag += 1 / eikonalExteralIterations;\n }\n } else if (this.solverConfig === \"generalFormPDEScript\") {\n basicLog(`Using solver: ${this.solverConfig}`);\n // Check if using frontal solver\n if (this.solverMethod === \"frontal\") {\n errorLog(\n \"Frontal solver is not yet supported for generalFormPDEScript. Please use 'lusolve' or 'jacobi'.\"\n );\n } else {\n // Use regular linear solver methods\n ({ jacobianMatrix, residualVector } = assembleGeneralFormPDEMat(\n meshData,\n this.boundaryConditions,\n this.coefficientFunctions\n ));\n\n const linearSystemResult = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector);\n solutionVector = linearSystemResult.solutionVector;\n }\n }\n console.timeEnd(\"totalSolvingTime\");\n basicLog(\"Solving process completed\");\n\n return { solutionVector, nodesCoordinates };\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { initializeFEA, performIsoparametricMapping1D } from \"../mesh/meshUtilsScript.js\";\nimport { GenericBoundaryConditions } from \"./genericBoundaryConditionsScript.js\";\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to assemble the Jacobian matrix and residuals vector for the general form PDE model\n * @param {object} meshData - Object containing prepared mesh data\n * @param {object} boundaryConditions - Object containing boundary conditions\n * @param {object} coefficientFunctions - Functions A(x), B(x), C(x), D(x) for the PDE\n * @returns {object} An object containing:\n * - jacobianMatrix: The assembled Jacobian matrix\n * - residualVector: The assembled residual vector\n */\nexport function assembleGeneralFormPDEMat(meshData, boundaryConditions, coefficientFunctions) {\n basicLog(\"Starting general form PDE matrix assembly...\");\n\n // Extract mesh data\n const {\n nodesXCoordinates,\n nodesYCoordinates,\n nop,\n boundaryElements,\n totalElements,\n meshDimension,\n elementOrder,\n } = meshData;\n\n // Extract coefficient functions\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize FEA components\n const FEAData = initializeFEA(meshData);\n const {\n residualVector,\n jacobianMatrix,\n localToGlobalMap,\n basisFunctions,\n gaussPoints,\n gaussWeights,\n numNodes,\n } = FEAData;\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Matrix assembly\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\n // Map local element nodes to global mesh nodes\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n // Convert to 0-based indexing\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of Galerkin's residuals and local Jacobian matrix\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n const globalNodeIndex1 = localToGlobalMap[localNodeIndex1];\n\n // Source term contribution to residual vector\n residualVector[globalNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n const globalNodeIndex2 = localToGlobalMap[localNodeIndex2];\n\n // Diffusion term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n jacobianMatrix[globalNodeIndex1][globalNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEMat.\");\n // 2D general form PDE - empty for now\n }\n\n // Apply boundary conditions\n const genericBoundaryConditions = new GenericBoundaryConditions(\n boundaryConditions,\n boundaryElements,\n nop,\n meshDimension,\n elementOrder\n );\n\n // Apply Dirichlet boundary conditions only\n genericBoundaryConditions.imposeDirichletBoundaryConditions(residualVector, jacobianMatrix);\n\n basicLog(\"General form PDE matrix assembly completed\");\n\n return {\n jacobianMatrix,\n residualVector,\n };\n}\n\n/**\n * Function to assemble the frontal solver matrix for the general form PDE model\n * @param {object} data - Object containing element data for the frontal solver\n * @returns {object} An object containing local Jacobian matrix and residual vector\n */\nexport function assembleGeneralFormPDEFront({\n elementIndex,\n nop,\n meshData,\n basisFunctions,\n FEAData,\n coefficientFunctions,\n}) {\n // Extract numerical integration parameters and mesh coordinates\n const { gaussPoints, gaussWeights, numNodes } = FEAData;\n const { nodesXCoordinates, nodesYCoordinates, meshDimension } = meshData;\n const { A, B, C, D } = coefficientFunctions;\n\n // Initialize local Jacobian matrix and local residual vector\n const localJacobianMatrix = Array(numNodes)\n .fill()\n .map(() => Array(numNodes).fill(0));\n const localResidualVector = Array(numNodes).fill(0);\n\n // Build the mapping from local node indices to global node indices\n const ngl = Array(numNodes);\n const localToGlobalMap = Array(numNodes);\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\n ngl[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]);\n localToGlobalMap[localNodeIndex] = Math.abs(nop[elementIndex][localNodeIndex]) - 1;\n }\n\n if (meshDimension === \"1D\") {\n // 1D general form PDE\n\n // Loop over Gauss points\n for (let gaussPointIndex = 0; gaussPointIndex < gaussPoints.length; gaussPointIndex++) {\n // Get basis functions for the current Gauss point\n const { basisFunction, basisFunctionDerivKsi } = basisFunctions.getBasisFunctions(\n gaussPoints[gaussPointIndex]\n );\n\n // Perform isoparametric mapping\n const { detJacobian, basisFunctionDerivX } = performIsoparametricMapping1D({\n basisFunction,\n basisFunctionDerivKsi,\n nodesXCoordinates,\n localToGlobalMap,\n numNodes,\n });\n\n // Calculate the physical coordinate for this Gauss point\n let xCoord = 0;\n for (let i = 0; i < numNodes; i++) {\n xCoord += nodesXCoordinates[localToGlobalMap[i]] * basisFunction[i];\n }\n\n // Evaluate coefficient functions at this physical coordinate\n const a = A(xCoord);\n const b = B(xCoord);\n const c = C(xCoord);\n const d = D(xCoord);\n\n // Computation of local Jacobian matrix and residual vector\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\n // Source term contribution to local residual vector\n localResidualVector[localNodeIndex1] -=\n gaussWeights[gaussPointIndex] * detJacobian * d * basisFunction[localNodeIndex1];\n\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\n // Diffusion term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] +=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n a *\n basisFunctionDerivX[localNodeIndex1] *\n basisFunctionDerivX[localNodeIndex2];\n\n // Advection term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n b *\n basisFunctionDerivX[localNodeIndex2] *\n basisFunction[localNodeIndex1];\n\n // Reaction term\n localJacobianMatrix[localNodeIndex1][localNodeIndex2] -=\n gaussWeights[gaussPointIndex] *\n detJacobian *\n c *\n basisFunction[localNodeIndex1] *\n basisFunction[localNodeIndex2];\n }\n }\n }\n } else if (meshDimension === \"2D\") {\n errorLog(\"2D general form PDE is not yet supported in assembleGeneralFormPDEFront.\");\n // 2D general form PDE - empty for now\n }\n\n return {\n localJacobianMatrix,\n localResidualVector,\n ngl,\n };\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// Internal imports\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\n */\nconst importGmshQuadTri = async (file) => {\n let result = {\n nodesXCoordinates: [],\n nodesYCoordinates: [],\n nodalNumbering: {\n quadElements: [],\n triangleElements: [],\n },\n boundaryElements: [],\n boundaryConditions: [],\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\n gmshV: 0,\n ascii: false,\n fltBytes: \"8\",\n totalNodesX: 0,\n totalNodesY: 0,\n physicalPropMap: [],\n elementTypes: {},\n };\n\n let content = await file.text();\n let lines = content\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line !== \"\" && line !== \" \");\n\n let section = \"\";\n let lineIndex = 0;\n\n let nodeEntityBlocks = 0;\n let totalNodes = 0;\n let nodeBlocksProcessed = 0;\n let currentNodeBlock = { numNodes: 0 };\n let nodeTagsCollected = 0;\n let nodeTags = [];\n let nodeCoordinatesCollected = 0;\n\n let elementEntityBlocks = 0;\n let totalElements = 0;\n let elementBlocksProcessed = 0;\n let currentElementBlock = {\n dim: 0,\n tag: 0,\n elementType: 0,\n numElements: 0,\n };\n let elementsProcessedInBlock = 0;\n\n let boundaryElementsByTag = {};\n\n while (lineIndex < lines.length) {\n const line = lines[lineIndex];\n\n if (line === \"$MeshFormat\") {\n section = \"meshFormat\";\n lineIndex++;\n continue;\n } else if (line === \"$EndMeshFormat\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$PhysicalNames\") {\n section = \"physicalNames\";\n lineIndex++;\n continue;\n } else if (line === \"$EndPhysicalNames\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Entities\") {\n section = \"entities\";\n lineIndex++;\n continue;\n } else if (line === \"$EndEntities\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Nodes\") {\n section = \"nodes\";\n lineIndex++;\n continue;\n } else if (line === \"$EndNodes\") {\n section = \"\";\n lineIndex++;\n continue;\n } else if (line === \"$Elements\") {\n section = \"elements\";\n lineIndex++;\n continue;\n } else if (line === \"$EndElements\") {\n section = \"\";\n lineIndex++;\n continue;\n }\n\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\n\n if (section === \"meshFormat\") {\n result.gmshV = parseFloat(parts[0]);\n result.ascii = parts[1] === \"0\";\n result.fltBytes = parts[2];\n } else if (section === \"physicalNames\") {\n if (parts.length >= 3) {\n if (!/^\\d+$/.test(parts[0])) {\n lineIndex++;\n continue;\n }\n\n const dimension = parseInt(parts[0], 10);\n const tag = parseInt(parts[1], 10);\n let name = parts.slice(2).join(\" \");\n name = name.replace(/^\"|\"$/g, \"\");\n\n result.physicalPropMap.push({\n tag,\n dimension,\n name,\n });\n }\n } else if (section === \"nodes\") {\n if (nodeEntityBlocks === 0) {\n nodeEntityBlocks = parseInt(parts[0], 10);\n totalNodes = parseInt(parts[1], 10);\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\n lineIndex++;\n continue;\n }\n\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\n currentNodeBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n parametric: parseInt(parts[2], 10),\n numNodes: parseInt(parts[3], 10),\n };\n\n nodeTags = [];\n nodeTagsCollected = 0;\n nodeCoordinatesCollected = 0;\n\n lineIndex++;\n continue;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\n nodeTags.push(parseInt(parts[i], 10));\n nodeTagsCollected++;\n }\n\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\n lineIndex++;\n continue;\n }\n\n lineIndex++;\n continue;\n }\n\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\n const x = parseFloat(parts[0]);\n const y = parseFloat(parts[1]);\n\n result.nodesXCoordinates[nodeTag] = x;\n result.nodesYCoordinates[nodeTag] = y;\n result.totalNodesX++;\n result.totalNodesY++;\n\n nodeCoordinatesCollected++;\n\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\n nodeBlocksProcessed++;\n currentNodeBlock = { numNodes: 0 };\n }\n }\n } else if (section === \"elements\") {\n if (elementEntityBlocks === 0) {\n elementEntityBlocks = parseInt(parts[0], 10);\n totalElements = parseInt(parts[1], 10);\n lineIndex++;\n continue;\n }\n\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\n currentElementBlock = {\n dim: parseInt(parts[0], 10),\n tag: parseInt(parts[1], 10),\n elementType: parseInt(parts[2], 10),\n numElements: parseInt(parts[3], 10),\n };\n\n result.elementTypes[currentElementBlock.elementType] =\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\n\n elementsProcessedInBlock = 0;\n lineIndex++;\n continue;\n }\n\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\n const elementTag = parseInt(parts[0], 10);\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\n\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\n const physicalTag = currentElementBlock.tag;\n\n if (!boundaryElementsByTag[physicalTag]) {\n boundaryElementsByTag[physicalTag] = [];\n }\n\n boundaryElementsByTag[physicalTag].push(nodeIndices);\n\n // Store boundary node pairs for later processing in meshGenerationScript\n if (!result.boundaryNodePairs[physicalTag]) {\n result.boundaryNodePairs[physicalTag] = [];\n }\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\n } else if (currentElementBlock.elementType === 2) {\n // Linear triangle elements (3 nodes)\n result.nodalNumbering.triangleElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 3) {\n // Linear quadrilateral elements (4 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n } else if (currentElementBlock.elementType === 10) {\n // Quadratic quadrilateral elements (9 nodes)\n result.nodalNumbering.quadElements.push(nodeIndices);\n }\n\n elementsProcessedInBlock++;\n\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\n elementBlocksProcessed++;\n currentElementBlock = { numElements: 0 };\n }\n }\n }\n\n lineIndex++;\n }\n\n // Store boundary conditions information\n result.physicalPropMap.forEach((prop) => {\n if (prop.dimension === 1) {\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\n\n if (boundaryNodes.length > 0) {\n result.boundaryConditions.push({\n name: prop.name,\n tag: prop.tag,\n nodes: boundaryNodes,\n });\n }\n }\n });\n\n debugLog(\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\n result.boundaryNodePairs\n )}. These pairs will be used to identify boundary elements in the mesh.`\n );\n\n return result;\n};\n\nexport { importGmshQuadTri };\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n/**\n * Function to create plots of the solution vector\n * @param {*} solutionVector - The computed solution vector\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\n * @param {string} solverConfig - Parameter specifying the type of solver\n * @param {string} meshDimension - The dimension of the solution\n * @param {string} plotType - The type of plot\n * @param {string} plotDivId - The id of the div where the plot will be rendered\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\n */\nexport function plotSolution(\n solutionVector,\n nodesCoordinates,\n solverConfig,\n meshDimension,\n plotType,\n plotDivId,\n meshType = \"structured\"\n) {\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\n\n if (meshDimension === \"1D\" && plotType === \"line\") {\n // Check if solutionVector is a nested array\n let yData;\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\n yData = solutionVector.map((arr) => arr[0]);\n } else {\n yData = solutionVector;\n }\n let xData = Array.from(nodesXCoordinates);\n\n let lineData = {\n x: xData,\n y: yData,\n mode: \"lines\",\n type: \"scatter\",\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\n name: \"Solution\",\n };\n\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxPlotWidth = Math.max(...xData);\n let zoomFactor = maxWindowWidth / maxPlotWidth;\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\n let plotHeight = 350;\n\n let layout = {\n title: `line plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"Solution\" },\n margin: { l: 70, r: 40, t: 50, b: 50 },\n };\n\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\n // Use the user-provided mesh type\n const isStructured = meshType === \"structured\";\n\n // For auto-detection (if needed)\n const uniqueXCoords = new Set(nodesXCoordinates).size;\n const uniqueYCoords = new Set(nodesYCoordinates).size;\n\n // Extract scalar values from solution vector\n let zValues;\n if (Array.isArray(solutionVector[0])) {\n zValues = solutionVector.map((val) => val[0]);\n } else {\n zValues = solutionVector;\n }\n\n // Common sizing parameters for both plot types\n let maxWindowWidth = Math.min(window.innerWidth, 700);\n let maxX = Math.max(...nodesXCoordinates);\n let maxY = Math.max(...nodesYCoordinates);\n let aspectRatio = maxY / maxX;\n let plotWidth = Math.min(maxWindowWidth, 600);\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\n\n // Common layout properties\n let layout = {\n title: `${plotType} plot - ${solverConfig}`,\n width: plotWidth,\n height: plotHeight,\n xaxis: { title: \"x\" },\n yaxis: { title: \"y\" },\n margin: { l: 50, r: 50, t: 50, b: 50 },\n hovermode: \"closest\",\n };\n\n if (isStructured) {\n // Calculate the number of nodes along the x-axis and y-axis\n const numNodesX = uniqueXCoords;\n const numNodesY = uniqueYCoords;\n\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\n\n // Reshape the solution array to match the grid dimensions\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\n\n // Transpose the reshapedSolution array to get column-wise data\n let transposedSolution = math.transpose(reshapedSolution);\n\n // Create an array for x-coordinates used in the contour plot\n let reshapedXForPlot = [];\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\n let xValue = nodesXCoordinates[i];\n reshapedXForPlot.push(xValue);\n }\n\n // Create the data structure for the contour plot\n let contourData = {\n z: transposedSolution,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n x: reshapedXForPlot,\n y: reshapedYCoordinates[0],\n name: \"Solution Field\",\n };\n\n // Create the plot using Plotly\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n } else {\n // Create an interpolated contour plot for the unstructured mesh\n let contourData = {\n x: nodesXCoordinates,\n y: nodesYCoordinates,\n z: zValues,\n type: \"contour\",\n contours: {\n coloring: \"heatmap\",\n showlabels: false,\n },\n //colorscale: 'Viridis',\n colorbar: {\n title: \"Solution\",\n },\n name: \"Solution Field\",\n };\n\n // Create the plot using only the contour fill\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\n }\n }\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\n// External imports\nimport * as Comlink from \"../vendor/comlink.mjs\";\n\n// Internal imports\nimport { basicLog } from \"../utilities/loggingScript.js\";\n\n/**\n * Class to facilitate communication with web workers for FEAScript operations\n */\nexport class FEAScriptWorker {\n /**\n * Constructor to initialize the FEAScriptWorker class\n * Sets up the worker and initializes the workerWrapper.\n */\n constructor() {\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n\n this._initWorker();\n }\n\n /**\n * Function to initialize the web worker and wrap it using Comlink.\n * @private\n * @throws Will throw an error if the worker fails to initialize.\n */\n async _initWorker() {\n try {\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\n type: \"module\",\n });\n\n this.worker.onerror = (event) => {\n console.error(\"FEAScriptWorker: Worker error:\", event);\n };\n const workerWrapper = Comlink.wrap(this.worker);\n\n this.feaWorker = await new workerWrapper();\n\n this.isReady = true;\n } catch (error) {\n console.error(\"Failed to initialize worker\", error);\n throw error;\n }\n }\n\n /**\n * Function to ensure that the worker is ready before performing any operations.\n * @private\n * @returns {Promise} Resolves when the worker is ready.\n * @throws Will throw an error if the worker is not ready within the timeout period.\n */\n async _ensureReady() {\n if (this.isReady) return Promise.resolve();\n\n return new Promise((resolve, reject) => {\n let attempts = 0;\n const maxAttempts = 50; // 5 seconds max\n\n const checkReady = () => {\n attempts++;\n if (this.isReady) {\n resolve();\n } else if (attempts >= maxAttempts) {\n reject(new Error(\"Timeout waiting for worker to be ready\"));\n } else {\n setTimeout(checkReady, 1000);\n }\n };\n checkReady();\n });\n }\n\n /**\n * Function to set the solver configuration in the worker.\n * @param {string} solverConfig - The solver configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setSolverConfig(solverConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\n return this.feaWorker.setSolverConfig(solverConfig);\n }\n\n /**\n * Sets the mesh configuration in the worker.\n * @param {object} meshConfig - The mesh configuration to set.\n * @returns {Promise} Resolves when the configuration is set.\n */\n async setMeshConfig(meshConfig) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting mesh config`);\n return this.feaWorker.setMeshConfig(meshConfig);\n }\n\n /**\n * Adds a boundary condition to the worker.\n * @param {string} boundaryKey - The key identifying the boundary.\n * @param {array} condition - The boundary condition to add.\n * @returns {Promise} Resolves when the boundary condition is added.\n */\n async addBoundaryCondition(boundaryKey, condition) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\n }\n\n /**\n * Sets the solver method in the worker.\n * @param {string} solverMethod - The solver method to set.\n * @returns {Promise} Resolves when the solver method is set.\n */\n async setSolverMethod(solverMethod) {\n await this._ensureReady();\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\n return this.feaWorker.setSolverMethod(solverMethod);\n }\n\n /**\n * Requests the worker to solve the problem.\n * @returns {Promise} Resolves with the solution result.\n */\n async solve() {\n await this._ensureReady();\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\n\n const startTime = performance.now();\n const result = await this.feaWorker.solve();\n const endTime = performance.now();\n\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\n return result;\n }\n\n /**\n * Retrieves model information from the worker.\n * @returns {Promise} Resolves with the model information.\n */\n async getModelInfo() {\n await this._ensureReady();\n return this.feaWorker.getModelInfo();\n }\n\n /**\n * Sends a ping request to the worker to check its availability.\n * @returns {Promise} Resolves if the worker responds.\n */\n async ping() {\n await this._ensureReady();\n return this.feaWorker.ping();\n }\n\n /**\n * Terminates the worker and cleans up resources.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n this.worker = null;\n this.feaWorker = null;\n this.isReady = false;\n }\n }\n}\n","// ______ ______ _____ _ _ //\n// | ____| ____| /\\ / ____| (_) | | //\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\n// | | | | //\n// |_| | |_ //\n// Website: https://feascript.com/ \\__| //\n\nexport { FEAScriptModel } from \"./FEAScript.js\";\nexport { importGmshQuadTri } from \"./readers/gmshReaderScript.js\";\nexport { logSystem } from \"./utilities/loggingScript.js\";\nexport { plotSolution } from \"./visualization/plotSolutionScript.js\";\nexport { FEAScriptWorker } from \"./workers/workerScript.js\";\nexport const printVersion = \"0.1.3\";"],"names":["euclideanNorm","vector","norm","i","length","Math","sqrt","currentLogLevel","logSystem","level","console","log","basicLog","debugLog","message","errorLog","solveLinearSystem","solverMethod","jacobianMatrix","residualVector","options","maxIterations","tolerance","solutionVector","converged","iterations","time","jacobianMatrixSparse","math","sparse","luFactorization","slu","solutionMatrix","lusolve","squeeze","valueOf","jacobiSolverResult","initialGuess","n","x","xNew","Array","iteration","sum","j","maxDiff","max","abs","jacobiSolver","fill","timeEnd","BasisFunctions","constructor","meshDimension","elementOrder","this","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","Mesh","numElementsX","maxX","numElementsY","maxY","parsedMesh","boundaryElementsProcessed","parseMeshFromGmsh","nodalNumbering","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","boundaryNodePairs","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","Mesh1D","super","generateMesh","nodesXCoordinates","totalNodesX","deltaX","nodeIndex","generate1DNodalNumbering","findBoundaryElements","nop","elementIndex","columnCounter","sideIndex","Mesh2D","nodesYCoordinates","totalNodesY","deltaY","nodeIndexY","nodeIndexX","nnode","generate2DNodalNumbering","rowCounter","elementIndexX","elementIndexY","nodeIndex1","nodeIndex2","NumericalIntegration","getGaussPointsAndWeights","gaussPoints","gaussWeights","initializeFEA","meshData","totalNodes","colIndex","basisFunctions","gaussPointsAndWeights","localToGlobalMap","numNodes","performIsoparametricMapping1D","params","xCoordinates","ksiDerivX","localNodeIndex","detJacobian","basisFunctionDerivX","performIsoparametricMapping2D","yCoordinates","etaDerivX","ksiDerivY","etaDerivY","basisFunctionDerivY","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","Object","keys","boundaryKey","tempValue","globalNodeIndex","imposeConstantTempBoundaryConditionsFront","nodeConstraintCode","boundaryValues","imposeConvectionBoundaryConditions","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","tangentVectorLength","localNodeIndex2","globalNodeIndex2","gaussPointIndex","imposeConvectionBoundaryConditionsFront","localJacobianMatrix","map","localResidualVector","boundaryElement","find","_","assembleHeatConductionFront","FEAData","ngl","gaussPointIndex1","localNodeIndex1","gaussPointIndex2","globalIndex","GenericBoundaryConditions","imposeDirichletBoundaryConditions","value","imposeConstantValueBoundaryConditionsFront","assembleFrontPropagationMat","eikonalActivationFlag","eikonalViscousTerm","totalElements","mappingResult","solutionDerivX","solutionDerivY","localToGlobalMap1","localToGlobalMap2","assembleFrontPropagationFront","frontalData","frontalState","elementData","currentElementIndex","frontStorage","runFrontalSolver","assembleFront","numElements","globalResidualVector","topologyData","lateralData","writeFlag","transformationFlag","nodesPerElement","determinant","systemSize","globalSolutionVector","frontDataIndex","frontSize","frontWidthEstimate","ceil","estimateFrontSize","frontValues","columnHeaders","pivotRow","pivotData","initializeFrontalArrays","dirichletBoundaryConditionsHandler","currentSolutionVector","thermalBoundaryConditions","pivotColumnGlobalIndex","localDestination","rowDestination","rowHeaders","pivotRowIndices","pivotColumnIndices","modifiedRows","pivotColumn","frontMatrix","rowSwapCount","columnSwapCount","lastAppearanceCheck","frontDataCounter","pivotDataIndex","summedRows","reverseElementIndex","columnCount","rowCount","assembled","numElementNodes","numElementColumns","assembleElementContribution","currentElement","columnIndex","rowIndex","localColumnIndex","frontColumnIndex","localRowIndex","availableColumnCount","constrainedRowCount","availableRowCount","absoluteNodeIndex","constrainedIndex","pivotRowIndex","pivotColumnIndex","pivotValue","testColumnIndex","testRowIndex","testValue","pivotGlobalRowIndex","permutationHelper","rightHandSide","globalRowIndex","eliminationFactor","performBackSubstitution","runFrontalAlgorithm","toExponential","finalNodesX","finalNodesY","slice","nodesCoordinates","boundaryLocalJacobianMatrix","boundaryResidualVector","isOnRobinTypeBoundary","some","result","localNodeI","localNodeJ","iterationIndex","accumulatedValue","newtonRaphson","assembleMat","context","errorNorm","initialSolution","Number","FEAScriptModel","solverConfig","meshConfig","coefficientFunctions","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","error","Error","mesh","nodesCoordinatesAndNumbering","prepareMesh","assembleHeatConductionMat","eikonalExteralIterations","newtonRaphsonResult","A","B","C","D","xCoord","a","b","d","globalNodeIndex1","assembleGeneralFormPDEMat","importGmshQuadTri","async","file","gmshV","ascii","fltBytes","lines","text","split","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","test","parseInt","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","plotSolution","plotType","plotDivId","meshType","yData","arr","xData","from","lineData","mode","type","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","r","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","val","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","serialized","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","isAllowedOrigin","warn","id","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","prototype","concat","handler","serializedValue","msg","floor","random","MAX_SAFE_INTEGER","FEAScriptWorker","worker","feaWorker","isReady","_initWorker","Worker","URL","url","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate","printVersion"],"mappings":"AAeO,SAASA,EAAcC,GAC5B,IAAIC,EAAO,EACX,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAOG,OAAQD,IACjCD,GAAQD,EAAOE,GAAKF,EAAOE,GAG7B,OADAD,EAAOG,KAAKC,KAAKJ,GACVA,CACT,CCXA,IAAIK,EAAkB,QAMf,SAASC,EAAUC,GACV,UAAVA,GAA+B,UAAVA,GACvBC,QAAQC,IACN,+BAAiCF,EAAQ,yBACzC,sCAEFF,EAAkB,UAElBA,EAAkBE,EAClBG,EAAS,qBAAqBH,KAElC,CAMO,SAASI,EAASC,GACC,UAApBP,GACFG,QAAQC,IAAI,aAAeG,EAAS,qCAExC,CAMO,SAASF,EAASE,GACvBJ,QAAQC,IAAI,YAAcG,EAAS,qCACrC,CAMO,SAASC,EAASD,GACvBJ,QAAQC,IAAI,aAAeG,EAAS,qCACtC,CC3BO,SAASE,EAAkBC,EAAcC,EAAgBC,EAAgBC,EAAU,CAAA,GACxF,MAAMC,cAAEA,EAAgB,IAAIC,UAAEA,EAAY,MAASF,EAEnD,IAAIG,EAAiB,GACjBC,GAAY,EACZC,EAAa,EAMjB,GAHAb,EAAS,wBAAwBK,QACjCP,QAAQgB,KAAK,iBAEQ,YAAjBT,EAA4B,CAE9B,MAAMU,EAAuBC,KAAKC,OAAOX,GACnCY,EAAkBF,KAAKG,IAAIJ,EAAsB,EAAG,GAC1D,IAAIK,EAAiBJ,KAAKK,QAAQH,EAAiBX,GACnDI,EAAiBK,KAAKM,QAAQF,GAAgBG,SAElD,MAAS,GAAqB,WAAjBlB,EAA2B,CAEpC,MACMmB,ECzBH,SAAsBlB,EAAgBC,EAAgBkB,EAAcjB,EAAU,CAAA,GACnF,MAAMC,cAAEA,EAAgB,IAAIC,UAAEA,EAAY,MAASF,EAC7CkB,EAAIpB,EAAed,O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EAAa0J,EACzD,CAOD,qBAAMC,CAAgBhT,GAGpB,aAFMsC,KAAKof,eACX/hB,EAAS,8CAA8CK,KAChDsC,KAAK0e,UAAUhO,gBAAgBhT,EACvC,CAMD,WAAMiT,SACE3Q,KAAKof,eACX/hB,EAAS,uDAET,MAAMoiB,EAAYC,YAAYC,MACxBpQ,QAAevP,KAAK0e,UAAU/N,QAIpC,OADAtT,EAAS,4CAFOqiB,YAAYC,MAEmCF,GAAa,KAAMG,QAAQ,OACnFrQ,CACR,CAMD,kBAAMsQ,GAEJ,aADM7f,KAAKof,eACJpf,KAAK0e,UAAUmB,cACvB,CAMD,UAAMC,GAEJ,aADM9f,KAAKof,eACJpf,KAAK0e,UAAUoB,MACvB,CAKD,SAAAC,GACM/f,KAAKye,SACPze,KAAKye,OAAOsB,YACZ/f,KAAKye,OAAS,KACdze,KAAK0e,UAAY,KACjB1e,KAAK2e,SAAU,EAElB,EC9JS,MAACqB,EAAe"} \ No newline at end of file +{"version":3,"file":"feascript.esm.js","sources":["../src/methods/numericalIntegrationScript.js","../src/utilities/loggingScript.js","../src/mesh/basisFunctionsScript.js","../src/mesh/meshGenerationScript.js","../src/solvers/thermalBoundaryConditionsScript.js","../src/FEAScript.js","../src/solvers/solidHeatTransferScript.js","../src/methods/jacobiMethodScript.js","../src/readers/gmshReaderScript.js","../src/visualization/plotSolutionScript.js","../src/vendor/comlink.mjs","../src/workers/workerScript.js"],"sourcesContent":["// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Class to handle numerical integration using Gauss quadrature\r\n */\r\nexport class numericalIntegration {\r\n /**\r\n * Constructor to initialize the numericalIntegration class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to return Gauss points and weights based on element configuration\r\n * @returns {object} An object containing:\r\n * - gaussPoints: Array of Gauss points\r\n * - gaussWeights: Array of Gauss weights\r\n */\r\n getGaussPointsAndWeights() {\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // For linear elements, use 1-point Gauss quadrature\r\n gaussPoints[0] = 0.5;\r\n gaussWeights[0] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // For quadratic elements, use 3-point Gauss quadrature\r\n gaussPoints[0] = (1 - Math.sqrt(3 / 5)) / 2;\r\n gaussPoints[1] = 0.5;\r\n gaussPoints[2] = (1 + Math.sqrt(3 / 5)) / 2;\r\n gaussWeights[0] = 5 / 18;\r\n gaussWeights[1] = 8 / 18;\r\n gaussWeights[2] = 5 / 18;\r\n }\r\n\r\n return { gaussPoints, gaussWeights };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Global logging level\r\nlet currentLogLevel = \"basic\";\r\n\r\n/**\r\n * Function to set the logging system level\r\n * @param {string} level - Logging level (basic, debug)\r\n */\r\nexport function logSystem(level) {\r\n if (level !== \"basic\" && level !== \"debug\") {\r\n console.log(\r\n \"%c[WARN] Invalid log level: \" + level + \". Using basic instead.\",\r\n \"color: #FFC107; font-weight: bold;\"\r\n ); // Yellow for warnings\r\n currentLogLevel = \"basic\";\r\n } else {\r\n currentLogLevel = level;\r\n basicLog(`Log level set to: ${level}`);\r\n }\r\n}\r\n\r\n/**\r\n * Function to log debug messages - only logs if level is 'debug'\r\n * @param {string} message - Message to log\r\n */\r\nexport function debugLog(message) {\r\n if (currentLogLevel === \"debug\") {\r\n console.log(\"%c[DEBUG] \" + message, \"color: #2196F3; font-weight: bold;\"); // Blue color for debug\r\n }\r\n}\r\n\r\n/**\r\n * Function to log basic information - always logs\r\n * @param {string} message - Message to log\r\n */\r\nexport function basicLog(message) {\r\n console.log(\"%c[INFO] \" + message, \"color: #4CAF50; font-weight: bold;\"); // Green color for basic info\r\n}\r\n\r\n/**\r\n * Function to log error messages\r\n * @param {string} message - Message to log\r\n */\r\nexport function errorLog(message) {\r\n console.log(\"%c[ERROR] \" + message, \"color: #F44336; font-weight: bold;\"); // Red color for errors\r\n}\r\n\r\n/**\r\n * Function to handle version information and fetch the latest update date and release from GitHub\r\n */\r\nexport async function printVersion() {\r\n basicLog(\"Fetching latest FEAScript version information...\");\r\n try {\r\n const commitResponse = await fetch(\"https://api.github.com/repos/FEAScript/FEAScript/commits/main\");\r\n const commitData = await commitResponse.json();\r\n const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();\r\n basicLog(`Latest FEAScript update: ${latestCommitDate}`);\r\n return latestCommitDate;\r\n } catch (error) {\r\n errorLog(\"Failed to fetch version information: \" + error);\r\n return \"Version information unavailable\";\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle basis functions and their derivatives based on element configuration\r\n */\r\nexport class basisFunctions {\r\n /**\r\n * Constructor to initialize the basisFunctions class\r\n * @param {string} meshDimension - The dimension of the mesh\r\n * @param {string} elementOrder - The order of elements\r\n */\r\n constructor({ meshDimension, elementOrder }) {\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to calculate basis functions and their derivatives based on the dimension and order\r\n * @param {number} ksi - Natural coordinate (for both 1D and 2D)\r\n * @param {number} [eta] - Second natural coordinate (only for 2D elements)\r\n * @returns {object} An object containing:\r\n * - basisFunction: Array of evaluated basis functions\r\n * - basisFunctionDerivKsi: Array of derivatives of basis functions with respect to ksi\r\n * - basisFunctionDerivEta: Array of derivatives of basis functions with respect to eta (only for 2D elements)\r\n */\r\n getBasisFunctions(ksi, eta = null) {\r\n let basisFunction = [];\r\n let basisFunctionDerivKsi = [];\r\n let basisFunctionDerivEta = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 1D elements\r\n basisFunction[0] = 1 - ksi;\r\n basisFunction[1] = ksi;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -1;\r\n basisFunctionDerivKsi[1] = 1;\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 1D elements\r\n basisFunction[0] = 1 - 3 * ksi + 2 * ksi ** 2;\r\n basisFunction[1] = 4 * ksi - 4 * ksi ** 2;\r\n basisFunction[2] = -ksi + 2 * ksi ** 2;\r\n\r\n // Derivatives of basis functions with respect to ksi\r\n basisFunctionDerivKsi[0] = -3 + 4 * ksi;\r\n basisFunctionDerivKsi[1] = 4 - 8 * ksi;\r\n basisFunctionDerivKsi[2] = -1 + 4 * ksi;\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (eta === null) {\r\n errorLog(\"Eta coordinate is required for 2D elements\");\r\n return;\r\n }\r\n\r\n if (this.elementOrder === \"linear\") {\r\n // Linear basis functions for 2D elements\r\n function l1(c) {\r\n return 1 - c;\r\n }\r\n function l2(c) {\r\n return c;\r\n }\r\n function dl1() {\r\n return -1;\r\n }\r\n function dl2() {\r\n return 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l2(ksi) * l1(eta);\r\n basisFunction[3] = l2(ksi) * l2(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1() * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1() * l2(eta);\r\n basisFunctionDerivKsi[2] = dl2() * l1(eta);\r\n basisFunctionDerivKsi[3] = dl2() * l2(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1();\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2();\r\n basisFunctionDerivEta[2] = l2(ksi) * dl1();\r\n basisFunctionDerivEta[3] = l2(ksi) * dl2();\r\n } else if (this.elementOrder === \"quadratic\") {\r\n // Quadratic basis functions for 2D elements\r\n function l1(c) {\r\n return 2 * c ** 2 - 3 * c + 1;\r\n }\r\n function l2(c) {\r\n return -4 * c ** 2 + 4 * c;\r\n }\r\n function l3(c) {\r\n return 2 * c ** 2 - c;\r\n }\r\n function dl1(c) {\r\n return 4 * c - 3;\r\n }\r\n function dl2(c) {\r\n return -8 * c + 4;\r\n }\r\n function dl3(c) {\r\n return 4 * c - 1;\r\n }\r\n\r\n // Evaluate basis functions at (ksi, eta)\r\n basisFunction[0] = l1(ksi) * l1(eta);\r\n basisFunction[1] = l1(ksi) * l2(eta);\r\n basisFunction[2] = l1(ksi) * l3(eta);\r\n basisFunction[3] = l2(ksi) * l1(eta);\r\n basisFunction[4] = l2(ksi) * l2(eta);\r\n basisFunction[5] = l2(ksi) * l3(eta);\r\n basisFunction[6] = l3(ksi) * l1(eta);\r\n basisFunction[7] = l3(ksi) * l2(eta);\r\n basisFunction[8] = l3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to ksi\r\n basisFunctionDerivKsi[0] = dl1(ksi) * l1(eta);\r\n basisFunctionDerivKsi[1] = dl1(ksi) * l2(eta);\r\n basisFunctionDerivKsi[2] = dl1(ksi) * l3(eta);\r\n basisFunctionDerivKsi[3] = dl2(ksi) * l1(eta);\r\n basisFunctionDerivKsi[4] = dl2(ksi) * l2(eta);\r\n basisFunctionDerivKsi[5] = dl2(ksi) * l3(eta);\r\n basisFunctionDerivKsi[6] = dl3(ksi) * l1(eta);\r\n basisFunctionDerivKsi[7] = dl3(ksi) * l2(eta);\r\n basisFunctionDerivKsi[8] = dl3(ksi) * l3(eta);\r\n\r\n // Derivatives with respect to eta\r\n basisFunctionDerivEta[0] = l1(ksi) * dl1(eta);\r\n basisFunctionDerivEta[1] = l1(ksi) * dl2(eta);\r\n basisFunctionDerivEta[2] = l1(ksi) * dl3(eta);\r\n basisFunctionDerivEta[3] = l2(ksi) * dl1(eta);\r\n basisFunctionDerivEta[4] = l2(ksi) * dl2(eta);\r\n basisFunctionDerivEta[5] = l2(ksi) * dl3(eta);\r\n basisFunctionDerivEta[6] = l3(ksi) * dl1(eta);\r\n basisFunctionDerivEta[7] = l3(ksi) * dl2(eta);\r\n basisFunctionDerivEta[8] = l3(ksi) * dl3(eta);\r\n }\r\n }\r\n\r\n return { basisFunction, basisFunctionDerivKsi, basisFunctionDerivEta };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle the generation of structured finite element meshes\r\n */\r\nexport class meshGeneration {\r\n /**\r\n * Constructor to initialize the meshGeneration class\r\n * @param {object} config - Configuration object for the mesh\r\n * @param {number} [config.numElementsX] - Number of elements along the x-axis (required for geometry-based mesh)\r\n * @param {number} [config.maxX] - Maximum x-coordinate of the mesh (required for geometry-based mesh)\r\n * @param {number} [config.numElementsY=1] - Number of elements along the y-axis (for 1D meshes)\r\n * @param {number} [config.maxY=0] - Maximum y-coordinate of the mesh (for 1D meshes)\r\n * @param {string} [config.meshDimension='2D'] - The dimension of the mesh, either 1D or 2D\r\n * @param {string} [config.elementOrder='linear'] - The order of elements, either 'linear' or 'quadratic'\r\n * @param {object} [config.parsedMesh=null] - Optional pre-parsed mesh data\r\n */\r\n constructor({\r\n numElementsX = null,\r\n maxX = null,\r\n numElementsY = null,\r\n maxY = null,\r\n meshDimension = null,\r\n elementOrder = \"linear\",\r\n parsedMesh = null,\r\n }) {\r\n this.numElementsX = numElementsX;\r\n this.numElementsY = numElementsY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n this.parsedMesh = parsedMesh;\r\n }\r\n\r\n /**\r\n * Function to generate the mesh based on the dimension or use a pre-parsed mesh\r\n * @returns {object} The generated mesh containing node coordinates and total nodes\r\n */\r\n generateMesh() {\r\n // If pre-parsed mesh data is provided, use it directly\r\n if (this.parsedMesh) {\r\n // Process the nodalNumbering from gmshReader format to the format expected by the solver\r\n if (this.parsedMesh.nodalNumbering) {\r\n if (\r\n typeof this.parsedMesh.nodalNumbering === \"object\" &&\r\n !Array.isArray(this.parsedMesh.nodalNumbering)\r\n ) {\r\n // Store the nodal numbering structure before converting\r\n const quadElements = this.parsedMesh.nodalNumbering.quadElements || [];\r\n const triangleElements = this.parsedMesh.nodalNumbering.triangleElements || [];\r\n\r\n debugLog(\r\n \"Initial parsed mesh nodal numbering from GMSH format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Check if it has quadElements or triangleElements structure from gmshReader\r\n if (this.parsedMesh.elementTypes[3] || this.parsedMesh.elementTypes[10]) {\r\n // Map nodal numbering from GMSH format to FEAScript format for quad elements\r\n const mappedNodalNumbering = [];\r\n\r\n for (let elemIdx = 0; elemIdx < quadElements.length; elemIdx++) {\r\n const gmshNodes = quadElements[elemIdx];\r\n const feaScriptNodes = new Array(gmshNodes.length);\r\n\r\n // Check for element type based on number of nodes\r\n if (gmshNodes.length === 4) {\r\n // Simple mapping for linear quad elements (4 nodes)\r\n // GMSH: FEAScript:\r\n // 3 --- 2 1 --- 3\r\n // | | --> | |\r\n // 0 --- 1 0 --- 2\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[3]; // 3 -> 1\r\n feaScriptNodes[2] = gmshNodes[1]; // 1 -> 2\r\n feaScriptNodes[3] = gmshNodes[2]; // 2 -> 3\r\n } else if (gmshNodes.length === 9) {\r\n // Mapping for quadratic quad elements (9 nodes)\r\n // GMSH: FEAScript:\r\n // 3--6--2 2--5--8\r\n // | | | |\r\n // 7 8 5 --> 1 4 7\r\n // | | | |\r\n // 0--4--1 0--3--6\r\n\r\n feaScriptNodes[0] = gmshNodes[0]; // 0 -> 0\r\n feaScriptNodes[1] = gmshNodes[7]; // 7 -> 1\r\n feaScriptNodes[2] = gmshNodes[3]; // 3 -> 2\r\n feaScriptNodes[3] = gmshNodes[4]; // 4 -> 3\r\n feaScriptNodes[4] = gmshNodes[8]; // 8 -> 4\r\n feaScriptNodes[5] = gmshNodes[6]; // 6 -> 5\r\n feaScriptNodes[6] = gmshNodes[1]; // 1 -> 6\r\n feaScriptNodes[7] = gmshNodes[5]; // 5 -> 7\r\n feaScriptNodes[8] = gmshNodes[2]; // 2 -> 8\r\n }\r\n\r\n mappedNodalNumbering.push(feaScriptNodes);\r\n }\r\n\r\n this.parsedMesh.nodalNumbering = mappedNodalNumbering;\r\n } else if (this.parsedMesh.elementTypes[2]) {\r\n }\r\n\r\n debugLog(\r\n \"Nodal numbering after mapping from GMSH to FEAScript format: \" +\r\n JSON.stringify(this.parsedMesh.nodalNumbering)\r\n );\r\n\r\n // Process boundary elements if they exist and if physical property mapping exists\r\n if (this.parsedMesh.physicalPropMap && this.parsedMesh.boundaryElements) {\r\n // Check if boundary elements need to be processed\r\n if (\r\n Array.isArray(this.parsedMesh.boundaryElements) &&\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n // Create a new array without the empty first element\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n\r\n // If boundary node pairs exist but boundary elements haven't been processed\r\n if (this.parsedMesh.boundaryNodePairs && !this.parsedMesh.boundaryElementsProcessed) {\r\n // Reset boundary elements array\r\n this.parsedMesh.boundaryElements = [];\r\n\r\n // Process each physical property from the Gmsh file\r\n this.parsedMesh.physicalPropMap.forEach((prop) => {\r\n // Only process 1D physical entities (boundary lines)\r\n if (prop.dimension === 1) {\r\n // Get all node pairs for this boundary\r\n const boundaryNodePairs = this.parsedMesh.boundaryNodePairs[prop.tag] || [];\r\n\r\n if (boundaryNodePairs.length > 0) {\r\n // Initialize array for this boundary tag\r\n if (!this.parsedMesh.boundaryElements[prop.tag]) {\r\n this.parsedMesh.boundaryElements[prop.tag] = [];\r\n }\r\n\r\n // For each boundary line segment (defined by a pair of nodes)\r\n boundaryNodePairs.forEach((nodesPair) => {\r\n const node1 = nodesPair[0]; // First node in the pair\r\n const node2 = nodesPair[1]; // Second node in the pair\r\n\r\n debugLog(\r\n `Processing boundary node pair: [${node1}, ${node2}] for boundary ${prop.tag} (${\r\n prop.name || \"unnamed\"\r\n })`\r\n );\r\n\r\n // Search through all elements to find which one contains both nodes\r\n let foundElement = false;\r\n\r\n // Loop through all elements in the mesh\r\n for (let elemIdx = 0; elemIdx < this.parsedMesh.nodalNumbering.length; elemIdx++) {\r\n const elemNodes = this.parsedMesh.nodalNumbering[elemIdx];\r\n\r\n // For linear quadrilateral linear elements (4 nodes)\r\n if (elemNodes.length === 4) {\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript linear quadrilateral numbering:\r\n // 1 --- 3\r\n // | |\r\n // 0 --- 2\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0)\r\n ) {\r\n side = 0; // Bottom side\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0)\r\n ) {\r\n side = 1; // Left side\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 1 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 1)\r\n ) {\r\n side = 2; // Top side\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 2)\r\n ) {\r\n side = 3; // Right side\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n } else if (elemNodes.length === 9) {\r\n // For quadratic quadrilateral elements (9 nodes)\r\n // Check if both boundary nodes are in this element\r\n if (elemNodes.includes(node1) && elemNodes.includes(node2)) {\r\n // Find which side of the element these nodes form\r\n let side;\r\n\r\n const node1Index = elemNodes.indexOf(node1);\r\n const node2Index = elemNodes.indexOf(node2);\r\n\r\n debugLog(\r\n ` Found element ${elemIdx} containing boundary nodes. Element nodes: [${elemNodes.join(\r\n \", \"\r\n )}]`\r\n );\r\n debugLog(\r\n ` Node ${node1} is at index ${node1Index}, Node ${node2} is at index ${node2Index} in the element`\r\n );\r\n\r\n // Based on FEAScript quadratic quadrilateral numbering:\r\n // 2--5--8\r\n // | |\r\n // 1 4 7\r\n // | |\r\n // 0--3--6\r\n\r\n if (\r\n (node1Index === 0 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 3) ||\r\n (node1Index === 3 && node2Index === 0) ||\r\n (node1Index === 3 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 3)\r\n ) {\r\n side = 0; // Bottom side (nodes 0, 3, 6)\r\n debugLog(` These nodes form the BOTTOM side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 0 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 0) ||\r\n (node1Index === 0 && node2Index === 1) ||\r\n (node1Index === 1 && node2Index === 0) ||\r\n (node1Index === 1 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 1)\r\n ) {\r\n side = 1; // Left side (nodes 0, 1, 2)\r\n debugLog(` These nodes form the LEFT side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 2 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 2) ||\r\n (node1Index === 2 && node2Index === 5) ||\r\n (node1Index === 5 && node2Index === 2) ||\r\n (node1Index === 5 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 5)\r\n ) {\r\n side = 2; // Top side (nodes 2, 5, 8)\r\n debugLog(` These nodes form the TOP side (${side}) of element ${elemIdx}`);\r\n } else if (\r\n (node1Index === 6 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 6) ||\r\n (node1Index === 6 && node2Index === 7) ||\r\n (node1Index === 7 && node2Index === 6) ||\r\n (node1Index === 7 && node2Index === 8) ||\r\n (node1Index === 8 && node2Index === 7)\r\n ) {\r\n side = 3; // Right side (nodes 6, 7, 8)\r\n debugLog(` These nodes form the RIGHT side (${side}) of element ${elemIdx}`);\r\n }\r\n\r\n // Add the element and side to the boundary elements array\r\n this.parsedMesh.boundaryElements[prop.tag].push([elemIdx, side]);\r\n debugLog(\r\n ` Added element-side pair [${elemIdx}, ${side}] to boundary tag ${prop.tag}`\r\n );\r\n foundElement = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!foundElement) {\r\n errorLog(\r\n `Could not find element containing boundary nodes ${node1} and ${node2}. Boundary may be incomplete.`\r\n );\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n // Mark as processed\r\n this.parsedMesh.boundaryElementsProcessed = true;\r\n\r\n // Fix boundary elements array - remove undefined entries\r\n if (\r\n this.parsedMesh.boundaryElements.length > 0 &&\r\n this.parsedMesh.boundaryElements[0] === undefined\r\n ) {\r\n const fixedBoundaryElements = [];\r\n for (let i = 1; i < this.parsedMesh.boundaryElements.length; i++) {\r\n if (this.parsedMesh.boundaryElements[i]) {\r\n fixedBoundaryElements.push(this.parsedMesh.boundaryElements[i]);\r\n }\r\n }\r\n this.parsedMesh.boundaryElements = fixedBoundaryElements;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Processed boundary elements by tag: \" + JSON.stringify(this.parsedMesh.boundaryElements));\r\n\r\n return this.parsedMesh;\r\n } else {\r\n // Validate required geometry parameters based on mesh dimension\r\n if (this.meshDimension === \"1D\") {\r\n if (this.numElementsX === null || this.maxX === null) {\r\n errorLog(\"numElementsX and maxX are required parameters when generating a 1D mesh from geometry\");\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (\r\n this.numElementsX === null ||\r\n this.maxX === null ||\r\n this.numElementsY === null ||\r\n this.maxY === null\r\n ) {\r\n errorLog(\r\n \"numElementsX, maxX, numElementsY, and maxY are required parameters when generating a 2D mesh from geometry\"\r\n );\r\n }\r\n }\r\n\r\n // Generate mesh based on dimension\r\n return this.generateMeshFromGeometry();\r\n }\r\n }\r\n\r\n /**\r\n * Function to generate a structured mesh based on the geometry configuration\r\n * @returns {object} An object containing the coordinates of nodes,\r\n * total number of nodes, nodal numbering (NOP) array, and boundary elements\r\n */\r\n generateMeshFromGeometry() {\r\n let nodesXCoordinates = [];\r\n let nodesYCoordinates = [];\r\n const xStart = 0;\r\n const yStart = 0;\r\n let totalNodesX, totalNodesY, deltaX, deltaY;\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n for (let nodeIndex = 1; nodeIndex < totalNodesX; nodeIndex++) {\r\n nodesXCoordinates[nodeIndex] = nodesXCoordinates[nodeIndex - 1] + deltaX / 2;\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n null, // numElementsY (not used in 1D)\r\n totalNodesX,\r\n null, // totalNodesY (not used in 1D)\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n\r\n // Return x coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n totalNodesX,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n } else if (this.meshDimension === \"2D\") {\r\n if (this.elementOrder === \"linear\") {\r\n totalNodesX = this.numElementsX + 1;\r\n totalNodesY = this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + nodeIndexY * deltaY;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + nodeIndexX * deltaX;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + nodeIndexY * deltaY;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n totalNodesX = 2 * this.numElementsX + 1;\r\n totalNodesY = 2 * this.numElementsY + 1;\r\n deltaX = (this.maxX - xStart) / this.numElementsX;\r\n deltaY = (this.maxY - yStart) / this.numElementsY;\r\n\r\n nodesXCoordinates[0] = xStart;\r\n nodesYCoordinates[0] = yStart;\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nodeIndexY] = nodesXCoordinates[0];\r\n nodesYCoordinates[nodeIndexY] = nodesYCoordinates[0] + (nodeIndexY * deltaY) / 2;\r\n }\r\n for (let nodeIndexX = 1; nodeIndexX < totalNodesX; nodeIndexX++) {\r\n const nnode = nodeIndexX * totalNodesY;\r\n nodesXCoordinates[nnode] = nodesXCoordinates[0] + (nodeIndexX * deltaX) / 2;\r\n nodesYCoordinates[nnode] = nodesYCoordinates[0];\r\n for (let nodeIndexY = 1; nodeIndexY < totalNodesY; nodeIndexY++) {\r\n nodesXCoordinates[nnode + nodeIndexY] = nodesXCoordinates[nnode];\r\n nodesYCoordinates[nnode + nodeIndexY] = nodesYCoordinates[nnode] + (nodeIndexY * deltaY) / 2;\r\n }\r\n }\r\n }\r\n // Generate nodal numbering (NOP) array\r\n const nodalNumbering = this.generateNodalNumbering(\r\n this.numElementsX,\r\n this.numElementsY,\r\n totalNodesX,\r\n totalNodesY,\r\n this.elementOrder\r\n );\r\n // Find boundary elements\r\n const boundaryElements = this.findBoundaryElements();\r\n\r\n debugLog(\"Generated node X coordinates: \" + JSON.stringify(nodesXCoordinates));\r\n debugLog(\"Generated node Y coordinates: \" + JSON.stringify(nodesYCoordinates));\r\n\r\n // Return x and y coordinates of nodes, total nodes, NOP array, and boundary elements\r\n return {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n totalNodesX,\r\n totalNodesY,\r\n nodalNumbering,\r\n boundaryElements,\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Function to find the elements that belong to each boundary of a domain\r\n * @returns {array} An array containing arrays of elements and their adjacent boundary side for each boundary\r\n * Each element in the array is of the form [elementIndex, side], where 'side' indicates which side\r\n * of the reference element is in contact with the physical boundary:\r\n *\r\n * For 1D domains (line segments):\r\n * 0 - Left node of reference element (maps to physical left endpoint)\r\n * 1 - Right node of reference element (maps to physical right endpoint)\r\n *\r\n * For 2D domains (rectangular):\r\n * 0 - Bottom side of reference element (maps to physical bottom boundary)\r\n * 1 - Left side of reference element (maps to physical left boundary)\r\n * 2 - Top side of reference element (maps to physical top boundary)\r\n * 3 - Right side of reference element (maps to physical right boundary)\r\n */\r\n findBoundaryElements() {\r\n const boundaryElements = [];\r\n const maxSides = this.meshDimension === \"1D\" ? 2 : 4; // Number of element sides based on mesh dimension\r\n for (let sideIndex = 0; sideIndex < maxSides; sideIndex++) {\r\n boundaryElements.push([]);\r\n }\r\n\r\n if (this.meshDimension === \"1D\") {\r\n // Left boundary (element 0, side 0)\r\n boundaryElements[0].push([0, 0]);\r\n\r\n // Right boundary (last element, side 1)\r\n boundaryElements[1].push([this.numElementsX - 1, 1]);\r\n } else if (this.meshDimension === \"2D\") {\r\n for (let elementIndexX = 0; elementIndexX < this.numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 0; elementIndexY < this.numElementsY; elementIndexY++) {\r\n const elementIndex = elementIndexX * this.numElementsY + elementIndexY;\r\n\r\n // Bottom boundary\r\n if (elementIndexY === 0) {\r\n boundaryElements[0].push([elementIndex, 0]);\r\n }\r\n\r\n // Left boundary\r\n if (elementIndexX === 0) {\r\n boundaryElements[1].push([elementIndex, 1]);\r\n }\r\n\r\n // Top boundary\r\n if (elementIndexY === this.numElementsY - 1) {\r\n boundaryElements[2].push([elementIndex, 2]);\r\n }\r\n\r\n // Right boundary\r\n if (elementIndexX === this.numElementsX - 1) {\r\n boundaryElements[3].push([elementIndex, 3]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n debugLog(\"Identified boundary elements by side: \" + JSON.stringify(boundaryElements));\r\n return boundaryElements;\r\n }\r\n\r\n /**\r\n * Function to generate the nodal numbering (NOP) array for a structured mesh\r\n * This array represents the connectivity between elements and their corresponding nodes\r\n * @param {number} numElementsX - Number of elements along the x-axis\r\n * @param {number} [numElementsY] - Number of elements along the y-axis (optional for 1D)\r\n * @param {number} totalNodesX - Total number of nodes along the x-axis\r\n * @param {number} [totalNodesY] - Total number of nodes along the y-axis (optional for 1D)\r\n * @param {string} elementOrder - The order of elements, either 'linear' or 'quadratic'\r\n * @returns {array} NOP - A two-dimensional array which represents the element-to-node connectivity for the entire mesh\r\n */\r\n generateNodalNumbering(numElementsX, numElementsY, totalNodesX, totalNodesY, elementOrder) {\r\n let elementIndex = 0;\r\n let nop = [];\r\n\r\n if (this.meshDimension === \"1D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear 1D elements with the following nodes representation:\r\n *\r\n * 1 --- 2\r\n *\r\n */\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 2; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic 1D elements with the following nodes representation:\r\n *\r\n * 1--2--3\r\n *\r\n */\r\n let columnCounter = 0;\r\n for (let elementIndex = 0; elementIndex < numElementsX; elementIndex++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex = 1; nodeIndex <= 3; nodeIndex++) {\r\n nop[elementIndex][nodeIndex - 1] = elementIndex + nodeIndex + columnCounter;\r\n }\r\n columnCounter += 1;\r\n }\r\n }\r\n } else if (this.meshDimension === \"2D\") {\r\n if (elementOrder === \"linear\") {\r\n /**\r\n * Linear rectangular elements with the following nodes representation:\r\n *\r\n * 1 --- 3\r\n * | |\r\n * 0 --- 2\r\n *\r\n */\r\n let rowCounter = 0;\r\n let columnCounter = 2;\r\n for (let elementIndex = 0; elementIndex < numElementsX * numElementsY; elementIndex++) {\r\n rowCounter += 1;\r\n nop[elementIndex] = [];\r\n nop[elementIndex][0] = elementIndex + columnCounter - 1;\r\n nop[elementIndex][1] = elementIndex + columnCounter;\r\n nop[elementIndex][2] = elementIndex + columnCounter + numElementsY;\r\n nop[elementIndex][3] = elementIndex + columnCounter + numElementsY + 1;\r\n if (rowCounter === numElementsY) {\r\n columnCounter += 1;\r\n rowCounter = 0;\r\n }\r\n }\r\n } else if (elementOrder === \"quadratic\") {\r\n /**\r\n * Quadratic rectangular elements with the following nodes representation:\r\n *\r\n * 2--5--8\r\n * | |\r\n * 1 4 7\r\n * | |\r\n * 0--3--6\r\n *\r\n */\r\n for (let elementIndexX = 1; elementIndexX <= numElementsX; elementIndexX++) {\r\n for (let elementIndexY = 1; elementIndexY <= numElementsY; elementIndexY++) {\r\n nop[elementIndex] = [];\r\n for (let nodeIndex1 = 1; nodeIndex1 <= 3; nodeIndex1++) {\r\n let nodeIndex2 = 3 * nodeIndex1 - 2;\r\n nop[elementIndex][nodeIndex2 - 1] =\r\n totalNodesY * (2 * elementIndexX + nodeIndex1 - 3) + 2 * elementIndexY - 1;\r\n nop[elementIndex][nodeIndex2] = nop[elementIndex][nodeIndex2 - 1] + 1;\r\n nop[elementIndex][nodeIndex2 + 1] = nop[elementIndex][nodeIndex2 - 1] + 2;\r\n }\r\n elementIndex = elementIndex + 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return nop;\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to handle thermal boundary conditions application\r\n */\r\nexport class ThermalBoundaryConditions {\r\n /**\r\n * Constructor to initialize the ThermalBoundaryConditions class\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @param {array} boundaryElements - Array containing elements that belong to each boundary\r\n * @param {array} nop - Nodal numbering (NOP) array representing the connectivity between elements and nodes\r\n * @param {string} meshDimension - The dimension of the mesh (e.g., \"2D\")\r\n * @param {string} elementOrder - The order of elements (e.g., \"linear\", \"quadratic\")\r\n */\r\n constructor(boundaryConditions, boundaryElements, nop, meshDimension, elementOrder) {\r\n this.boundaryConditions = boundaryConditions;\r\n this.boundaryElements = boundaryElements;\r\n this.nop = nop;\r\n this.meshDimension = meshDimension;\r\n this.elementOrder = elementOrder;\r\n }\r\n\r\n /**\r\n * Function to impose constant temperature boundary conditions (Dirichlet type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n */\r\n imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix) {\r\n basicLog(\"Applying constant temperature boundary conditions (Dirichlet type)\");\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 1: [1], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0], // Node at the left side of the reference element\r\n 2: [2], // Node at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"constantTemp\") {\r\n const tempValue = this.boundaryConditions[boundaryKey][1];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying constant temperature of ${tempValue} K (Dirichlet condition)`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n const boundarySides = {\r\n 0: [0, 2], // Nodes at the bottom side of the reference element\r\n 1: [0, 1], // Nodes at the left side of the reference element\r\n 2: [1, 3], // Nodes at the top side of the reference element\r\n 3: [2, 3], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n } else if (this.elementOrder === \"quadratic\") {\r\n const boundarySides = {\r\n 0: [0, 3, 6], // Nodes at the bottom side of the reference element\r\n 1: [0, 1, 2], // Nodes at the left side of the reference element\r\n 2: [2, 5, 8], // Nodes at the top side of the reference element\r\n 3: [6, 7, 8], // Nodes at the right side of the reference element\r\n };\r\n boundarySides[side].forEach((nodeIndex) => {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied fixed temperature to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n // Set the residual vector to the ConstantTemp value\r\n residualVector[globalNodeIndex] = tempValue;\r\n // Set the Jacobian matrix row to zero\r\n for (let colIndex = 0; colIndex < residualVector.length; colIndex++) {\r\n jacobianMatrix[globalNodeIndex][colIndex] = 0;\r\n }\r\n // Set the diagonal entry of the Jacobian matrix to one\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] = 1;\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Function to impose convection boundary conditions (Robin type)\r\n * @param {array} residualVector - The residual vector to be modified\r\n * @param {array} jacobianMatrix - The Jacobian matrix to be modified\r\n * @param {array} gaussPoints - Array of Gauss points for numerical integration\r\n * @param {array} gaussWeights - Array of Gauss weights for numerical integration\r\n * @param {array} nodesXCoordinates - Array of x-coordinates of nodes\r\n * @param {array} nodesYCoordinates - Array of y-coordinates of nodes\r\n * @param {object} basisFunctionsData - Object containing basis functions and their derivatives\r\n */\r\n imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n ) {\r\n basicLog(\"Applying convection boundary conditions (Robin type)\");\r\n // Extract convection parameters from boundary conditions\r\n let convectionHeatTranfCoeff = [];\r\n let convectionExtTemp = [];\r\n Object.keys(this.boundaryConditions).forEach((key) => {\r\n const boundaryCondition = this.boundaryConditions[key];\r\n if (boundaryCondition[0] === \"convection\") {\r\n convectionHeatTranfCoeff[key] = boundaryCondition[1];\r\n convectionExtTemp[key] = boundaryCondition[2];\r\n }\r\n });\r\n\r\n if (this.meshDimension === \"1D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n let nodeIndex;\r\n if (this.elementOrder === \"linear\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 1;\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n if (side === 0) {\r\n // Node at the left side of the reference element\r\n nodeIndex = 0;\r\n } else {\r\n // Node at the right side of the reference element\r\n nodeIndex = 2;\r\n }\r\n }\r\n\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${nodeIndex + 1})`\r\n );\r\n residualVector[globalNodeIndex] += -convectionCoeff * extTemp;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex] += convectionCoeff;\r\n });\r\n }\r\n });\r\n } else if (this.meshDimension === \"2D\") {\r\n Object.keys(this.boundaryConditions).forEach((boundaryKey) => {\r\n if (this.boundaryConditions[boundaryKey][0] === \"convection\") {\r\n const convectionCoeff = convectionHeatTranfCoeff[boundaryKey];\r\n const extTemp = convectionExtTemp[boundaryKey];\r\n debugLog(\r\n `Boundary ${boundaryKey}: Applying convection with heat transfer coefficient h=${convectionCoeff} W/(m²·K) and external temperature T∞=${extTemp} K`\r\n );\r\n this.boundaryElements[boundaryKey].forEach(([elementIndex, side]) => {\r\n if (this.elementOrder === \"linear\") {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 2;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 2;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[0];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 1;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 2;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[0];\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 4;\r\n nodeIncrement = 1;\r\n }\r\n\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[0] * tangentVectorLength * basisFunction[localNodeIndex] * convectionCoeff * extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[0] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n } else if (this.elementOrder === \"quadratic\") {\r\n for (let gaussPointIndex = 0; gaussPointIndex < 3; gaussPointIndex++) {\r\n let gaussPoint1, gaussPoint2, firstNodeIndex, lastNodeIndex, nodeIncrement;\r\n if (side === 0) {\r\n // Nodes at the bottom side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 0;\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 7;\r\n nodeIncrement = 3;\r\n } else if (side === 1) {\r\n // Nodes at the left side of the reference element\r\n gaussPoint1 = 0;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 0;\r\n lastNodeIndex = 3;\r\n nodeIncrement = 1;\r\n } else if (side === 2) {\r\n // Nodes at the top side of the reference element\r\n gaussPoint1 = gaussPoints[gaussPointIndex];\r\n gaussPoint2 = 1;\r\n firstNodeIndex = 2;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 3;\r\n } else if (side === 3) {\r\n // Nodes at the right side of the reference element\r\n gaussPoint1 = 1;\r\n gaussPoint2 = gaussPoints[gaussPointIndex];\r\n firstNodeIndex = 6;\r\n lastNodeIndex = 9;\r\n nodeIncrement = 1;\r\n }\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoint1,\r\n gaussPoint2\r\n );\r\n let basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n let basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n let basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n\r\n let ksiDerivX = 0;\r\n let ksiDerivY = 0;\r\n let etaDerivX = 0;\r\n let etaDerivY = 0;\r\n const numNodes = this.nop[elementIndex].length;\r\n for (let nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) {\r\n const globalNodeIndex = this.nop[elementIndex][nodeIndex] - 1;\r\n\r\n // For boundaries along Ksi (horizontal), use Ksi derivatives\r\n if (side === 0 || side === 2) {\r\n ksiDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n ksiDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivKsi[nodeIndex];\r\n }\r\n // For boundaries along Eta (vertical), use Eta derivatives\r\n else if (side === 1 || side === 3) {\r\n etaDerivX += nodesXCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n etaDerivY += nodesYCoordinates[globalNodeIndex] * basisFunctionDerivEta[nodeIndex];\r\n }\r\n }\r\n\r\n // Compute the length of tangent vector\r\n const tangentVectorLength =\r\n side === 0 || side === 2\r\n ? Math.sqrt(ksiDerivX ** 2 + ksiDerivY ** 2)\r\n : Math.sqrt(etaDerivX ** 2 + etaDerivY ** 2);\r\n\r\n for (\r\n let localNodeIndex = firstNodeIndex;\r\n localNodeIndex < lastNodeIndex;\r\n localNodeIndex += nodeIncrement\r\n ) {\r\n let globalNodeIndex = this.nop[elementIndex][localNodeIndex] - 1;\r\n debugLog(\r\n ` - Applied convection boundary condition to node ${globalNodeIndex + 1} (element ${\r\n elementIndex + 1\r\n }, local node ${localNodeIndex + 1})`\r\n );\r\n\r\n // Apply boundary condition with proper Jacobian for all sides\r\n residualVector[globalNodeIndex] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n convectionCoeff *\r\n extTemp;\r\n\r\n for (\r\n let localNodeIndex2 = firstNodeIndex;\r\n localNodeIndex2 < lastNodeIndex;\r\n localNodeIndex2 += nodeIncrement\r\n ) {\r\n let globalNodeIndex2 = this.nop[elementIndex][localNodeIndex2] - 1;\r\n jacobianMatrix[globalNodeIndex][globalNodeIndex2] +=\r\n -gaussWeights[gaussPointIndex] *\r\n tangentVectorLength *\r\n basisFunction[localNodeIndex] *\r\n basisFunction[localNodeIndex2] *\r\n convectionCoeff;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { jacobiMethod } from \"./methods/jacobiMethodScript.js\";\r\nimport { assembleSolidHeatTransferMat } from \"./solvers/solidHeatTransferScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"./utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to implement finite element analysis in JavaScript\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing the solution vector and additional mesh information\r\n */\r\nexport class FEAScriptModel {\r\n constructor() {\r\n this.solverConfig = null;\r\n this.meshConfig = {};\r\n this.boundaryConditions = {};\r\n this.solverMethod = \"lusolve\"; // Default solver method\r\n basicLog(\"FEAScriptModel instance created\");\r\n }\r\n\r\n setSolverConfig(solverConfig) {\r\n this.solverConfig = solverConfig;\r\n debugLog(`Solver config set to: ${solverConfig}`);\r\n }\r\n\r\n setMeshConfig(meshConfig) {\r\n this.meshConfig = meshConfig;\r\n debugLog(\r\n `Mesh config set with dimensions: ${meshConfig.meshDimension}`\r\n );\r\n }\r\n\r\n addBoundaryCondition(boundaryKey, condition) {\r\n this.boundaryConditions[boundaryKey] = condition;\r\n debugLog(`Boundary condition added for boundary: ${boundaryKey}, type: ${condition[0]}`);\r\n }\r\n\r\n setSolverMethod(solverMethod) {\r\n this.solverMethod = solverMethod;\r\n debugLog(`Solver method set to: ${solverMethod}`);\r\n }\r\n\r\n solve() {\r\n if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) {\r\n const error = \"Solver config, mesh config, and boundary conditions must be set before solving.\";\r\n console.error(error);\r\n throw new Error(error);\r\n }\r\n\r\n let jacobianMatrix = [];\r\n let residualVector = [];\r\n let solutionVector = [];\r\n let nodesCoordinates = {};\r\n\r\n // Assembly matrices\r\n basicLog(\"Beginning matrix assembly...\");\r\n console.time(\"assemblyMatrices\");\r\n if (this.solverConfig === \"solidHeatTransferScript\") {\r\n basicLog(`Using solver: ${this.solverConfig}`);\r\n ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat(\r\n this.meshConfig,\r\n this.boundaryConditions\r\n ));\r\n }\r\n console.timeEnd(\"assemblyMatrices\");\r\n basicLog(\"Matrix assembly completed\");\r\n\r\n // System solving\r\n basicLog(`Solving system using ${this.solverMethod}...`);\r\n console.time(\"systemSolving\");\r\n if (this.solverMethod === \"lusolve\") {\r\n solutionVector = math.lusolve(jacobianMatrix, residualVector);\r\n } else if (this.solverMethod === \"jacobi\") {\r\n // Create initial guess of zeros\r\n const initialGuess = new Array(residualVector.length).fill(0);\r\n // Call Jacobi method with desired max iterations and tolerance\r\n const jacobiResult = jacobiMethod(jacobianMatrix, residualVector, initialGuess, 1000, 1e-6);\r\n\r\n // Log convergence information\r\n if (jacobiResult.converged) {\r\n debugLog(`Jacobi method converged in ${jacobiResult.iterations} iterations`);\r\n } else {\r\n debugLog(`Jacobi method did not converge after ${jacobiResult.iterations} iterations`);\r\n }\r\n\r\n solutionVector = jacobiResult.solution;\r\n }\r\n console.timeEnd(\"systemSolving\");\r\n basicLog(\"System solved successfully\");\r\n\r\n return { solutionVector, nodesCoordinates };\r\n }\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { numericalIntegration } from \"../methods/numericalIntegrationScript.js\";\r\nimport { basisFunctions } from \"../mesh/basisFunctionsScript.js\";\r\nimport { meshGeneration } from \"../mesh/meshGenerationScript.js\";\r\nimport { ThermalBoundaryConditions } from \"./thermalBoundaryConditionsScript.js\";\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to assemble the solid heat transfer matrix\r\n * @param {object} meshConfig - Object containing computational mesh details\r\n * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis\r\n * @returns {object} An object containing:\r\n * - jacobianMatrix: The assembled Jacobian matrix\r\n * - residualVector: The assembled residual vector\r\n * - nodesCoordinates: Object containing x and y coordinates of nodes\r\n */\r\nexport function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {\r\n basicLog(\"Starting solid heat transfer matrix assembly...\");\r\n\r\n // Extract mesh details from the configuration object\r\n const {\r\n meshDimension, // The dimension of the mesh\r\n numElementsX, // Number of elements in x-direction\r\n numElementsY, // Number of elements in y-direction (only for 2D)\r\n maxX, // Max x-coordinate (m) of the domain\r\n maxY, // Max y-coordinate (m) of the domain (only for 2D)\r\n elementOrder, // The order of elements\r\n parsedMesh, // The pre-parsed mesh data (if available)\r\n } = meshConfig;\r\n\r\n // Create a new instance of the meshGeneration class\r\n debugLog(\"Generating mesh...\");\r\n const meshGenerationData = new meshGeneration({\r\n numElementsX,\r\n numElementsY,\r\n maxX,\r\n maxY,\r\n meshDimension,\r\n elementOrder,\r\n parsedMesh, // Pass the parsed mesh to the mesh generator\r\n });\r\n\r\n // Generate the mesh\r\n const nodesCoordinatesAndNumbering = meshGenerationData.generateMesh();\r\n\r\n // Extract nodes coordinates and nodal numbering (NOP) from the mesh data\r\n let nodesXCoordinates = nodesCoordinatesAndNumbering.nodesXCoordinates;\r\n let nodesYCoordinates = nodesCoordinatesAndNumbering.nodesYCoordinates;\r\n let totalNodesX = nodesCoordinatesAndNumbering.totalNodesX;\r\n let totalNodesY = nodesCoordinatesAndNumbering.totalNodesY;\r\n let nop = nodesCoordinatesAndNumbering.nodalNumbering;\r\n let boundaryElements = nodesCoordinatesAndNumbering.boundaryElements;\r\n\r\n // Check the mesh type\r\n const isParsedMesh = parsedMesh !== undefined && parsedMesh !== null;\r\n\r\n // Calculate totalElements and totalNodes based on mesh type\r\n let totalElements, totalNodes;\r\n\r\n if (isParsedMesh) {\r\n totalElements = nop.length; // Number of elements is the length of the nodal numbering array\r\n totalNodes = nodesXCoordinates.length; // Number of nodes is the length of the coordinates array\r\n\r\n // Debug log for mesh size\r\n debugLog(`Using parsed mesh with ${totalElements} elements and ${totalNodes} nodes`);\r\n } else {\r\n // For structured mesh, calculate based on dimensions\r\n totalElements = numElementsX * (meshDimension === \"2D\" ? numElementsY : 1);\r\n totalNodes = totalNodesX * (meshDimension === \"2D\" ? totalNodesY : 1);\r\n // Debug log for mesh size\r\n debugLog(`Using mesh generated from geometry with ${totalElements} elements and ${totalNodes} nodes`);\r\n }\r\n\r\n // Initialize variables for matrix assembly\r\n let localToGlobalMap = []; // Maps local element node indices to global mesh node indices\r\n let gaussPoints = []; // Gauss points\r\n let gaussWeights = []; // Gauss weights\r\n let basisFunction = []; // Basis functions\r\n let basisFunctionDerivKsi = []; // Derivatives of basis functions with respect to ksi\r\n let basisFunctionDerivEta = []; // Derivatives of basis functions with respect to eta (only for 2D)\r\n let basisFunctionDerivX = []; // The x-derivative of the basis function\r\n let basisFunctionDerivY = []; // The y-derivative of the basis function (only for 2D)\r\n let residualVector = []; // Galerkin residuals\r\n let jacobianMatrix = []; // Jacobian matrix\r\n let xCoordinates; // x-coordinate (physical coordinates)\r\n let yCoordinates; // y-coordinate (physical coordinates) (only for 2D)\r\n let ksiDerivX; // ksi-derivative of xCoordinates\r\n let etaDerivX; // eta-derivative of xCoordinates (ksi and eta are natural coordinates that vary within a reference element) (only for 2D)\r\n let ksiDerivY; // ksi-derivative of yCoordinates (only for 2D)\r\n let etaDerivY; // eta-derivative of yCoordinates (only for 2D)\r\n let detJacobian; // The jacobian of the isoparametric mapping\r\n\r\n // Initialize jacobianMatrix and residualVector arrays\r\n for (let nodeIndex = 0; nodeIndex < totalNodes; nodeIndex++) {\r\n residualVector[nodeIndex] = 0;\r\n jacobianMatrix.push([]);\r\n for (let colIndex = 0; colIndex < totalNodes; colIndex++) {\r\n jacobianMatrix[nodeIndex][colIndex] = 0;\r\n }\r\n }\r\n\r\n // Initialize the basisFunctions class\r\n const basisFunctionsData = new basisFunctions({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Initialize the numericalIntegration class\r\n const numIntegrationData = new numericalIntegration({\r\n meshDimension,\r\n elementOrder,\r\n });\r\n\r\n // Calculate Gauss points and weights\r\n let gaussPointsAndWeights = numIntegrationData.getGaussPointsAndWeights();\r\n gaussPoints = gaussPointsAndWeights.gaussPoints;\r\n gaussWeights = gaussPointsAndWeights.gaussWeights;\r\n\r\n // Determine the number of nodes in the reference element based on the first element in the nop array\r\n const numNodes = nop[0].length;\r\n\r\n // Matrix assembly\r\n for (let elementIndex = 0; elementIndex < totalElements; elementIndex++) {\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n // Subtract 1 from nop in order to start numbering from 0\r\n localToGlobalMap[localNodeIndex] = nop[elementIndex][localNodeIndex] - 1;\r\n }\r\n\r\n // Loop over Gauss points\r\n for (let gaussPointIndex1 = 0; gaussPointIndex1 < gaussPoints.length; gaussPointIndex1++) {\r\n // 1D solid heat transfer\r\n if (meshDimension === \"1D\") {\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n xCoordinates = 0;\r\n ksiDerivX = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates += nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n detJacobian = ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] = basisFunctionDerivKsi[localNodeIndex] / detJacobian; // The x-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2]);\r\n }\r\n }\r\n // 2D solid heat transfer\r\n } else if (meshDimension === \"2D\") {\r\n for (let gaussPointIndex2 = 0; gaussPointIndex2 < gaussPoints.length; gaussPointIndex2++) {\r\n // Initialise variables for isoparametric mapping\r\n let basisFunctionsAndDerivatives = basisFunctionsData.getBasisFunctions(\r\n gaussPoints[gaussPointIndex1],\r\n gaussPoints[gaussPointIndex2]\r\n );\r\n basisFunction = basisFunctionsAndDerivatives.basisFunction;\r\n basisFunctionDerivKsi = basisFunctionsAndDerivatives.basisFunctionDerivKsi;\r\n basisFunctionDerivEta = basisFunctionsAndDerivatives.basisFunctionDerivEta;\r\n xCoordinates = 0;\r\n yCoordinates = 0;\r\n ksiDerivX = 0;\r\n etaDerivX = 0;\r\n ksiDerivY = 0;\r\n etaDerivY = 0;\r\n detJacobian = 0;\r\n\r\n // Isoparametric mapping\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n xCoordinates +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n yCoordinates +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunction[localNodeIndex];\r\n ksiDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivX +=\r\n nodesXCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n ksiDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivKsi[localNodeIndex];\r\n etaDerivY +=\r\n nodesYCoordinates[localToGlobalMap[localNodeIndex]] * basisFunctionDerivEta[localNodeIndex];\r\n detJacobian = meshDimension === \"2D\" ? ksiDerivX * etaDerivY - etaDerivX * ksiDerivY : ksiDerivX;\r\n }\r\n\r\n // Compute x-derivative and y-derivative of basis functions\r\n for (let localNodeIndex = 0; localNodeIndex < numNodes; localNodeIndex++) {\r\n basisFunctionDerivX[localNodeIndex] =\r\n (etaDerivY * basisFunctionDerivKsi[localNodeIndex] -\r\n ksiDerivY * basisFunctionDerivEta[localNodeIndex]) /\r\n detJacobian; // The x-derivative of the n basis function\r\n basisFunctionDerivY[localNodeIndex] =\r\n (ksiDerivX * basisFunctionDerivEta[localNodeIndex] -\r\n etaDerivX * basisFunctionDerivKsi[localNodeIndex]) /\r\n detJacobian; // The y-derivative of the n basis function\r\n }\r\n\r\n // Computation of Galerkin's residuals and Jacobian matrix\r\n for (let localNodeIndex1 = 0; localNodeIndex1 < numNodes; localNodeIndex1++) {\r\n let localToGlobalMap1 = localToGlobalMap[localNodeIndex1];\r\n // residualVector is zero for this case\r\n\r\n for (let localNodeIndex2 = 0; localNodeIndex2 < numNodes; localNodeIndex2++) {\r\n let localToGlobalMap2 = localToGlobalMap[localNodeIndex2];\r\n jacobianMatrix[localToGlobalMap1][localToGlobalMap2] +=\r\n -gaussWeights[gaussPointIndex1] *\r\n gaussWeights[gaussPointIndex2] *\r\n detJacobian *\r\n (basisFunctionDerivX[localNodeIndex1] * basisFunctionDerivX[localNodeIndex2] +\r\n basisFunctionDerivY[localNodeIndex1] * basisFunctionDerivY[localNodeIndex2]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Create an instance of ThermalBoundaryConditions\r\n debugLog(\"Applying thermal boundary conditions...\");\r\n const thermalBoundaryConditions = new ThermalBoundaryConditions(\r\n boundaryConditions,\r\n boundaryElements,\r\n nop,\r\n meshDimension,\r\n elementOrder\r\n );\r\n\r\n // Impose Convection boundary conditions\r\n thermalBoundaryConditions.imposeConvectionBoundaryConditions(\r\n residualVector,\r\n jacobianMatrix,\r\n gaussPoints,\r\n gaussWeights,\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n basisFunctionsData\r\n );\r\n debugLog(\"Convection boundary conditions applied\");\r\n\r\n // Impose ConstantTemp boundary conditions\r\n thermalBoundaryConditions.imposeConstantTempBoundaryConditions(residualVector, jacobianMatrix);\r\n debugLog(\"Constant temperature boundary conditions applied\");\r\n\r\n basicLog(\"Solid heat transfer matrix assembly completed\");\r\n\r\n return {\r\n jacobianMatrix,\r\n residualVector,\r\n nodesCoordinates: {\r\n nodesXCoordinates,\r\n nodesYCoordinates,\r\n },\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to solve a system of linear equations using the Jacobi iterative method\r\n * @param {array} A - The coefficient matrix (must be square)\r\n * @param {array} b - The right-hand side vector\r\n * @param {array} x0 - Initial guess for solution vector\r\n * @param {number} [maxIterations=100] - Maximum number of iterations\r\n * @param {number} [tolerance=1e-7] - Convergence tolerance\r\n * @returns {object} An object containing:\r\n * - solution: The solution vector\r\n * - iterations: The number of iterations performed\r\n * - converged: Boolean indicating whether the method converged\r\n */\r\nexport function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) {\r\n const n = A.length; // Size of the square matrix\r\n let x = [...x0]; // Current solution (starts with initial guess)\r\n let xNew = new Array(n); // Next iteration's solution\r\n\r\n for (let iteration = 0; iteration < maxIterations; iteration++) {\r\n // Perform one iteration\r\n for (let i = 0; i < n; i++) {\r\n let sum = 0;\r\n // Calculate sum of A[i][j] * x[j] for j ≠ i\r\n for (let j = 0; j < n; j++) {\r\n if (j !== i) {\r\n sum += A[i][j] * x[j];\r\n }\r\n }\r\n // Update xNew[i] using the Jacobi formula\r\n xNew[i] = (b[i] - sum) / A[i][i];\r\n }\r\n\r\n // Check convergence\r\n let maxDiff = 0;\r\n for (let i = 0; i < n; i++) {\r\n maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i]));\r\n }\r\n\r\n // Update x for next iteration\r\n x = [...xNew];\r\n\r\n // Successfully converged if maxDiff is less than tolerance\r\n if (maxDiff < tolerance) {\r\n return {\r\n solution: x,\r\n iterations: iteration + 1,\r\n converged: true,\r\n };\r\n }\r\n }\r\n\r\n // maxIterations were reached without convergence\r\n return {\r\n solution: x,\r\n iterations: maxIterations,\r\n converged: false,\r\n };\r\n}\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// Internal imports\r\nimport { basicLog, debugLog, errorLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Function to import mesh data from Gmsh format containing quadrilateral and triangular elements\r\n * @param {File} file - The Gmsh file to be parsed (.msh version 4.1)\r\n * @returns {object} The parsed mesh data including node coordinates, element connectivity, and boundary conditions\r\n */\r\nconst importGmshQuadTri = async (file) => {\r\n let result = {\r\n nodesXCoordinates: [],\r\n nodesYCoordinates: [],\r\n nodalNumbering: {\r\n quadElements: [],\r\n triangleElements: [],\r\n },\r\n boundaryElements: [],\r\n boundaryConditions: [],\r\n boundaryNodePairs: {}, // Store boundary node pairs for processing in meshGenerationScript\r\n gmshV: 0,\r\n ascii: false,\r\n fltBytes: \"8\",\r\n totalNodesX: 0,\r\n totalNodesY: 0,\r\n physicalPropMap: [],\r\n elementTypes: {},\r\n };\r\n\r\n let content = await file.text();\r\n let lines = content\r\n .split(\"\\n\")\r\n .map((line) => line.trim())\r\n .filter((line) => line !== \"\" && line !== \" \");\r\n\r\n let section = \"\";\r\n let lineIndex = 0;\r\n\r\n let nodeEntityBlocks = 0;\r\n let totalNodes = 0;\r\n let nodeBlocksProcessed = 0;\r\n let currentNodeBlock = { numNodes: 0 };\r\n let nodeTagsCollected = 0;\r\n let nodeTags = [];\r\n let nodeCoordinatesCollected = 0;\r\n\r\n let elementEntityBlocks = 0;\r\n let totalElements = 0;\r\n let elementBlocksProcessed = 0;\r\n let currentElementBlock = {\r\n dim: 0,\r\n tag: 0,\r\n elementType: 0,\r\n numElements: 0,\r\n };\r\n let elementsProcessedInBlock = 0;\r\n\r\n let boundaryElementsByTag = {};\r\n\r\n while (lineIndex < lines.length) {\r\n const line = lines[lineIndex];\r\n\r\n if (line === \"$MeshFormat\") {\r\n section = \"meshFormat\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndMeshFormat\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$PhysicalNames\") {\r\n section = \"physicalNames\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndPhysicalNames\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Entities\") {\r\n section = \"entities\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndEntities\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Nodes\") {\r\n section = \"nodes\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndNodes\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$Elements\") {\r\n section = \"elements\";\r\n lineIndex++;\r\n continue;\r\n } else if (line === \"$EndElements\") {\r\n section = \"\";\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const parts = line.split(/\\s+/).filter((part) => part !== \"\");\r\n\r\n if (section === \"meshFormat\") {\r\n result.gmshV = parseFloat(parts[0]);\r\n result.ascii = parts[1] === \"0\";\r\n result.fltBytes = parts[2];\r\n } else if (section === \"physicalNames\") {\r\n if (parts.length >= 3) {\r\n if (!/^\\d+$/.test(parts[0])) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n const dimension = parseInt(parts[0], 10);\r\n const tag = parseInt(parts[1], 10);\r\n let name = parts.slice(2).join(\" \");\r\n name = name.replace(/^\"|\"$/g, \"\");\r\n\r\n result.physicalPropMap.push({\r\n tag,\r\n dimension,\r\n name,\r\n });\r\n }\r\n } else if (section === \"nodes\") {\r\n if (nodeEntityBlocks === 0) {\r\n nodeEntityBlocks = parseInt(parts[0], 10);\r\n totalNodes = parseInt(parts[1], 10);\r\n result.nodesXCoordinates = new Array(totalNodes).fill(0);\r\n result.nodesYCoordinates = new Array(totalNodes).fill(0);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeBlocksProcessed < nodeEntityBlocks && currentNodeBlock.numNodes === 0) {\r\n currentNodeBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n parametric: parseInt(parts[2], 10),\r\n numNodes: parseInt(parts[3], 10),\r\n };\r\n\r\n nodeTags = [];\r\n nodeTagsCollected = 0;\r\n nodeCoordinatesCollected = 0;\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n for (let i = 0; i < parts.length && nodeTagsCollected < currentNodeBlock.numNodes; i++) {\r\n nodeTags.push(parseInt(parts[i], 10));\r\n nodeTagsCollected++;\r\n }\r\n\r\n if (nodeTagsCollected < currentNodeBlock.numNodes) {\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (nodeCoordinatesCollected < currentNodeBlock.numNodes) {\r\n const nodeTag = nodeTags[nodeCoordinatesCollected] - 1;\r\n const x = parseFloat(parts[0]);\r\n const y = parseFloat(parts[1]);\r\n\r\n result.nodesXCoordinates[nodeTag] = x;\r\n result.nodesYCoordinates[nodeTag] = y;\r\n result.totalNodesX++;\r\n result.totalNodesY++;\r\n\r\n nodeCoordinatesCollected++;\r\n\r\n if (nodeCoordinatesCollected === currentNodeBlock.numNodes) {\r\n nodeBlocksProcessed++;\r\n currentNodeBlock = { numNodes: 0 };\r\n }\r\n }\r\n } else if (section === \"elements\") {\r\n if (elementEntityBlocks === 0) {\r\n elementEntityBlocks = parseInt(parts[0], 10);\r\n totalElements = parseInt(parts[1], 10);\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementBlocksProcessed < elementEntityBlocks && currentElementBlock.numElements === 0) {\r\n currentElementBlock = {\r\n dim: parseInt(parts[0], 10),\r\n tag: parseInt(parts[1], 10),\r\n elementType: parseInt(parts[2], 10),\r\n numElements: parseInt(parts[3], 10),\r\n };\r\n\r\n result.elementTypes[currentElementBlock.elementType] =\r\n (result.elementTypes[currentElementBlock.elementType] || 0) + currentElementBlock.numElements;\r\n\r\n elementsProcessedInBlock = 0;\r\n lineIndex++;\r\n continue;\r\n }\r\n\r\n if (elementsProcessedInBlock < currentElementBlock.numElements) {\r\n const elementTag = parseInt(parts[0], 10);\r\n const nodeIndices = parts.slice(1).map((idx) => parseInt(idx, 10));\r\n\r\n if (currentElementBlock.elementType === 1 || currentElementBlock.elementType === 8) {\r\n const physicalTag = currentElementBlock.tag;\r\n\r\n if (!boundaryElementsByTag[physicalTag]) {\r\n boundaryElementsByTag[physicalTag] = [];\r\n }\r\n\r\n boundaryElementsByTag[physicalTag].push(nodeIndices);\r\n\r\n // Store boundary node pairs for later processing in meshGenerationScript\r\n if (!result.boundaryNodePairs[physicalTag]) {\r\n result.boundaryNodePairs[physicalTag] = [];\r\n }\r\n result.boundaryNodePairs[physicalTag].push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 2) {\r\n // Linear triangle elements (3 nodes)\r\n result.nodalNumbering.triangleElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 3) {\r\n // Linear quadrilateral elements (4 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n } else if (currentElementBlock.elementType === 10) {\r\n // Quadratic quadrilateral elements (9 nodes)\r\n result.nodalNumbering.quadElements.push(nodeIndices);\r\n }\r\n\r\n elementsProcessedInBlock++;\r\n\r\n if (elementsProcessedInBlock === currentElementBlock.numElements) {\r\n elementBlocksProcessed++;\r\n currentElementBlock = { numElements: 0 };\r\n }\r\n }\r\n }\r\n\r\n lineIndex++;\r\n }\r\n\r\n // Store boundary conditions information\r\n result.physicalPropMap.forEach((prop) => {\r\n if (prop.dimension === 1) {\r\n const boundaryNodes = boundaryElementsByTag[prop.tag] || [];\r\n\r\n if (boundaryNodes.length > 0) {\r\n result.boundaryConditions.push({\r\n name: prop.name,\r\n tag: prop.tag,\r\n nodes: boundaryNodes,\r\n });\r\n }\r\n }\r\n });\r\n\r\n debugLog(\r\n `Parsed boundary node pairs by physical tag: ${JSON.stringify(\r\n result.boundaryNodePairs\r\n )}. These pairs will be used to identify boundary elements in the mesh.`\r\n );\r\n\r\n return result;\r\n};\r\n\r\nexport { importGmshQuadTri };\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n/**\r\n * Function to create plots of the solution vector\r\n * @param {*} solutionVector - The computed solution vector\r\n * @param {*} nodesCoordinates - Object containing x and y coordinates for the nodes\r\n * @param {string} solverConfig - Parameter specifying the type of solver\r\n * @param {string} meshDimension - The dimension of the solution\r\n * @param {string} plotType - The type of plot\r\n * @param {string} plotDivId - The id of the div where the plot will be rendered\r\n * @param {string} [meshType=\"structured\"] - Type of mesh: \"structured\" or \"unstructured\"\r\n */\r\nexport function plotSolution(\r\n solutionVector,\r\n nodesCoordinates,\r\n solverConfig,\r\n meshDimension,\r\n plotType,\r\n plotDivId,\r\n meshType = \"structured\"\r\n) {\r\n const { nodesXCoordinates, nodesYCoordinates } = nodesCoordinates;\r\n\r\n if (meshDimension === \"1D\" && plotType === \"line\") {\r\n // Check if solutionVector is a nested array\r\n let yData;\r\n if (solutionVector.length > 0 && Array.isArray(solutionVector[0])) {\r\n yData = solutionVector.map((arr) => arr[0]);\r\n } else {\r\n yData = solutionVector;\r\n }\r\n let xData = Array.from(nodesXCoordinates);\r\n\r\n let lineData = {\r\n x: xData,\r\n y: yData,\r\n mode: \"lines\",\r\n type: \"scatter\",\r\n line: { color: \"rgb(219, 64, 82)\", width: 2 },\r\n name: \"Solution\",\r\n };\r\n\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxPlotWidth = Math.max(...xData);\r\n let zoomFactor = maxWindowWidth / maxPlotWidth;\r\n let plotWidth = Math.max(zoomFactor * maxPlotWidth, 400);\r\n let plotHeight = 350;\r\n\r\n let layout = {\r\n title: `line plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"Solution\" },\r\n margin: { l: 70, r: 40, t: 50, b: 50 },\r\n };\r\n\r\n Plotly.newPlot(plotDivId, [lineData], layout, { responsive: true });\r\n } else if (meshDimension === \"2D\" && plotType === \"contour\") {\r\n // Use the user-provided mesh type\r\n const isStructured = meshType === \"structured\";\r\n \r\n // For auto-detection (if needed)\r\n const uniqueXCoords = new Set(nodesXCoordinates).size;\r\n const uniqueYCoords = new Set(nodesYCoordinates).size;\r\n \r\n // Extract scalar values from solution vector\r\n let zValues = Array.isArray(solutionVector[0]) \r\n ? solutionVector.map(val => val[0]) \r\n : solutionVector;\r\n \r\n // Common sizing parameters for both plot types\r\n let maxWindowWidth = Math.min(window.innerWidth, 700);\r\n let maxX = Math.max(...nodesXCoordinates);\r\n let maxY = Math.max(...nodesYCoordinates);\r\n let aspectRatio = maxY / maxX;\r\n let plotWidth = Math.min(maxWindowWidth, 600);\r\n let plotHeight = plotWidth * aspectRatio * 0.8; // Slightly reduce height for better appearance\r\n \r\n // Common layout properties\r\n let layout = {\r\n title: `${plotType} plot - ${solverConfig}`,\r\n width: plotWidth,\r\n height: plotHeight,\r\n xaxis: { title: \"x\" },\r\n yaxis: { title: \"y\" },\r\n margin: { l: 50, r: 50, t: 50, b: 50 },\r\n hovermode: 'closest'\r\n };\r\n \r\n if (isStructured) {\r\n // Calculate the number of nodes along the x-axis and y-axis\r\n const numNodesX = uniqueXCoords;\r\n const numNodesY = uniqueYCoords;\r\n\r\n // Reshape the nodesXCoordinates and nodesYCoordinates arrays to match the grid dimensions\r\n let reshapedXCoordinates = math.reshape(Array.from(nodesXCoordinates), [numNodesX, numNodesY]);\r\n let reshapedYCoordinates = math.reshape(Array.from(nodesYCoordinates), [numNodesX, numNodesY]);\r\n\r\n // Reshape the solution array to match the grid dimensions\r\n let reshapedSolution = math.reshape(Array.from(solutionVector), [numNodesX, numNodesY]);\r\n\r\n // Transpose the reshapedSolution array to get column-wise data\r\n let transposedSolution = math.transpose(reshapedSolution);\r\n\r\n // Create an array for x-coordinates used in the contour plot\r\n let reshapedXForPlot = [];\r\n for (let i = 0; i < numNodesX * numNodesY; i += numNodesY) {\r\n let xValue = nodesXCoordinates[i];\r\n reshapedXForPlot.push(xValue);\r\n }\r\n\r\n // Create the data structure for the contour plot\r\n let contourData = {\r\n z: transposedSolution,\r\n type: \"contour\",\r\n contours: {\r\n coloring: \"heatmap\",\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n x: reshapedXForPlot,\r\n y: reshapedYCoordinates[0],\r\n name: 'Solution Field'\r\n };\r\n\r\n // Create the plot using Plotly\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n } else {\r\n // Create an interpolated contour plot for the unstructured mesh\r\n let contourData = {\r\n x: nodesXCoordinates,\r\n y: nodesYCoordinates,\r\n z: zValues,\r\n type: 'contour',\r\n contours: {\r\n coloring: 'heatmap',\r\n showlabels: false\r\n },\r\n //colorscale: 'Viridis',\r\n colorbar: {\r\n title: 'Solution'\r\n },\r\n name: 'Solution Field'\r\n };\r\n \r\n // Create the plot using only the contour fill\r\n Plotly.newPlot(plotDivId, [contourData], layout, { responsive: true });\r\n }\r\n }\r\n}\r\n","/**\r\n * @license\r\n * Copyright 2019 Google LLC\r\n * SPDX-License-Identifier: Apache-2.0\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst finalizer = Symbol(\"Comlink.finalizer\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction isAllowedOrigin(allowedOrigins, origin) {\r\n for (const allowedOrigin of allowedOrigins) {\r\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\r\n return true;\r\n }\r\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\r\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* MessageType.GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* MessageType.SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* MessageType.APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* MessageType.RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\r\n obj[finalizer]();\r\n }\r\n }\r\n })\r\n .catch((error) => {\r\n // Send Serialization Error To Caller\r\n const [wireValue, transferables] = toWireValue({\r\n value: new TypeError(\"Unserializable return value\"),\r\n [throwMarker]: 0,\r\n });\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n const pendingListeners = new Map();\r\n ep.addEventListener(\"message\", function handleMessage(ev) {\r\n const { data } = ev;\r\n if (!data || !data.id) {\r\n return;\r\n }\r\n const resolver = pendingListeners.get(data.id);\r\n if (!resolver) {\r\n return;\r\n }\r\n try {\r\n resolver(data);\r\n }\r\n finally {\r\n pendingListeners.delete(data.id);\r\n }\r\n });\r\n return createProxy(ep, pendingListeners, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction releaseEndpoint(ep) {\r\n return requestResponseMessage(ep, new Map(), {\r\n type: \"RELEASE\" /* MessageType.RELEASE */,\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n });\r\n}\r\nconst proxyCounter = new WeakMap();\r\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\r\n new FinalizationRegistry((ep) => {\r\n const newCount = (proxyCounter.get(ep) || 0) - 1;\r\n proxyCounter.set(ep, newCount);\r\n if (newCount === 0) {\r\n releaseEndpoint(ep);\r\n }\r\n });\r\nfunction registerProxy(proxy, ep) {\r\n const newCount = (proxyCounter.get(ep) || 0) + 1;\r\n proxyCounter.set(ep, newCount);\r\n if (proxyFinalizers) {\r\n proxyFinalizers.register(proxy, ep, proxy);\r\n }\r\n}\r\nfunction unregisterProxy(proxy) {\r\n if (proxyFinalizers) {\r\n proxyFinalizers.unregister(proxy);\r\n }\r\n}\r\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n unregisterProxy(proxy);\r\n releaseEndpoint(ep);\r\n pendingListeners.clear();\r\n isProxyReleased = true;\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, pendingListeners, {\r\n type: \"GET\" /* MessageType.GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, pendingListeners, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"SET\" /* MessageType.SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, pendingListeners, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"APPLY\" /* MessageType.APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, pendingListeners, {\r\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n registerProxy(proxy, ep);\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* WireValueType.HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* WireValueType.RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* WireValueType.HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* WireValueType.RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n pendingListeners.set(id, resolve);\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\r\n\r\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\r\n//# sourceMappingURL=comlink.mjs.map\r\n","// ______ ______ _____ _ _ //\r\n// | ____| ____| /\\ / ____| (_) | | //\r\n// | |__ | |__ / \\ | (___ ___ ____ _ ____ | |_ //\r\n// | __| | __| / /\\ \\ \\___ \\ / __| __| | _ \\| __| //\r\n// | | | |____ / ____ \\ ____) | (__| | | | |_) | | //\r\n// |_| |______/_/ \\_\\_____/ \\___|_| |_| __/| | //\r\n// | | | | //\r\n// |_| | |_ //\r\n// Website: https://feascript.com/ \\__| //\r\n\r\n// External imports\r\nimport * as Comlink from \"../vendor/comlink.mjs\";\r\n\r\n// Internal imports\r\nimport { basicLog } from \"../utilities/loggingScript.js\";\r\n\r\n/**\r\n * Class to facilitate communication with web workers for FEAScript operations\r\n */\r\nexport class FEAScriptWorker {\r\n /**\r\n * Constructor to initialize the FEAScriptWorker class\r\n * Sets up the worker and initializes the workerWrapper.\r\n */\r\n constructor() {\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n\r\n this._initWorker();\r\n }\r\n\r\n /**\r\n * Function to initialize the web worker and wrap it using Comlink.\r\n * @private\r\n * @throws Will throw an error if the worker fails to initialize.\r\n */\r\n async _initWorker() {\r\n try {\r\n this.worker = new Worker(new URL(\"./wrapperScript.js\", import.meta.url), {\r\n type: \"module\",\r\n });\r\n\r\n this.worker.onerror = (event) => {\r\n console.error(\"FEAScriptWorker: Worker error:\", event);\r\n };\r\n const workerWrapper = Comlink.wrap(this.worker);\r\n\r\n this.feaWorker = await new workerWrapper();\r\n\r\n this.isReady = true;\r\n } catch (error) {\r\n console.error(\"Failed to initialize worker\", error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Function to ensure that the worker is ready before performing any operations.\r\n * @private\r\n * @returns {Promise} Resolves when the worker is ready.\r\n * @throws Will throw an error if the worker is not ready within the timeout period.\r\n */\r\n async _ensureReady() {\r\n if (this.isReady) return Promise.resolve();\r\n\r\n return new Promise((resolve, reject) => {\r\n let attempts = 0;\r\n const maxAttempts = 50; // 5 seconds max\r\n\r\n const checkReady = () => {\r\n attempts++;\r\n if (this.isReady) {\r\n resolve();\r\n } else if (attempts >= maxAttempts) {\r\n reject(new Error(\"Timeout waiting for worker to be ready\"));\r\n } else {\r\n setTimeout(checkReady, 1000);\r\n }\r\n };\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Function to set the solver configuration in the worker.\r\n * @param {string} solverConfig - The solver configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setSolverConfig(solverConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver config to: ${solverConfig}`);\r\n return this.feaWorker.setSolverConfig(solverConfig);\r\n }\r\n\r\n /**\r\n * Sets the mesh configuration in the worker.\r\n * @param {object} meshConfig - The mesh configuration to set.\r\n * @returns {Promise} Resolves when the configuration is set.\r\n */\r\n async setMeshConfig(meshConfig) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting mesh config`);\r\n return this.feaWorker.setMeshConfig(meshConfig);\r\n }\r\n\r\n /**\r\n * Adds a boundary condition to the worker.\r\n * @param {string} boundaryKey - The key identifying the boundary.\r\n * @param {array} condition - The boundary condition to add.\r\n * @returns {Promise} Resolves when the boundary condition is added.\r\n */\r\n async addBoundaryCondition(boundaryKey, condition) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Adding boundary condition for boundary: ${boundaryKey}`);\r\n return this.feaWorker.addBoundaryCondition(boundaryKey, condition);\r\n }\r\n\r\n /**\r\n * Sets the solver method in the worker.\r\n * @param {string} solverMethod - The solver method to set.\r\n * @returns {Promise} Resolves when the solver method is set.\r\n */\r\n async setSolverMethod(solverMethod) {\r\n await this._ensureReady();\r\n basicLog(`FEAScriptWorker: Setting solver method to: ${solverMethod}`);\r\n return this.feaWorker.setSolverMethod(solverMethod);\r\n }\r\n\r\n /**\r\n * Requests the worker to solve the problem.\r\n * @returns {Promise} Resolves with the solution result.\r\n */\r\n async solve() {\r\n await this._ensureReady();\r\n basicLog(\"FEAScriptWorker: Requesting solution from worker...\");\r\n\r\n const startTime = performance.now();\r\n const result = await this.feaWorker.solve();\r\n const endTime = performance.now();\r\n\r\n basicLog(`FEAScriptWorker: Solution completed in ${((endTime - startTime) / 1000).toFixed(2)}s`);\r\n return result;\r\n }\r\n\r\n /**\r\n * Retrieves model information from the worker.\r\n * @returns {Promise} Resolves with the model information.\r\n */\r\n async getModelInfo() {\r\n await this._ensureReady();\r\n return this.feaWorker.getModelInfo();\r\n }\r\n\r\n /**\r\n * Sends a ping request to the worker to check its availability.\r\n * @returns {Promise} Resolves if the worker responds.\r\n */\r\n async ping() {\r\n await this._ensureReady();\r\n return this.feaWorker.ping();\r\n }\r\n\r\n /**\r\n * Terminates the worker and cleans up resources.\r\n */\r\n terminate() {\r\n if (this.worker) {\r\n this.worker.terminate();\r\n this.worker = null;\r\n this.feaWorker = null;\r\n this.isReady = false;\r\n }\r\n }\r\n}\r\n"],"names":["numericalIntegration","constructor","meshDimension","elementOrder","this","getGaussPointsAndWeights","gaussPoints","gaussWeights","Math","sqrt","currentLogLevel","logSystem","level","console","log","basicLog","debugLog","message","errorLog","async","printVersion","commitResponse","fetch","commitData","json","latestCommitDate","Date","commit","committer","date","toLocaleString","error","basisFunctions","getBasisFunctions","ksi","eta","basisFunction","basisFunctionDerivKsi","basisFunctionDerivEta","l1","c","l2","l3","dl1","dl2","dl3","meshGeneration","numElementsX","maxX","numElementsY","maxY","parsedMesh","generateMesh","nodalNumbering","Array","isArray","quadElements","triangleElements","JSON","stringify","elementTypes","mappedNodalNumbering","elemIdx","length","gmshNodes","feaScriptNodes","push","physicalPropMap","boundaryElements","undefined","fixedBoundaryElements","i","boundaryNodePairs","boundaryElementsProcessed","forEach","prop","dimension","tag","nodesPair","node1","node2","name","foundElement","elemNodes","includes","side","node1Index","indexOf","node2Index","join","generateMeshFromGeometry","nodesXCoordinates","nodesYCoordinates","totalNodesX","totalNodesY","deltaX","deltaY","nodeIndex","generateNodalNumbering","findBoundaryElements","nodeIndexY","nodeIndexX","nnode","maxSides","sideIndex","elementIndexX","elementIndexY","elementIndex","nop","columnCounter","rowCounter","nodeIndex1","nodeIndex2","ThermalBoundaryConditions","boundaryConditions","imposeConstantTempBoundaryConditions","residualVector","jacobianMatrix","Object","keys","boundaryKey","tempValue","globalNodeIndex","colIndex","imposeConvectionBoundaryConditions","basisFunctionsData","convectionHeatTranfCoeff","convectionExtTemp","key","boundaryCondition","convectionCoeff","extTemp","gaussPoint1","gaussPoint2","firstNodeIndex","lastNodeIndex","nodeIncrement","basisFunctionsAndDerivatives","ksiDerivX","ksiDerivY","etaDerivX","etaDerivY","numNodes","tangentVectorLength","localNodeIndex","localNodeIndex2","globalNodeIndex2","gaussPointIndex","FEAScriptModel","solverConfig","meshConfig","solverMethod","setSolverConfig","setMeshConfig","addBoundaryCondition","condition","setSolverMethod","solve","Error","solutionVector","nodesCoordinates","time","nodesCoordinatesAndNumbering","totalElements","totalNodes","xCoordinates","yCoordinates","detJacobian","localToGlobalMap","basisFunctionDerivX","basisFunctionDerivY","gaussPointsAndWeights","gaussPointIndex1","localNodeIndex1","localToGlobalMap1","localToGlobalMap2","gaussPointIndex2","thermalBoundaryConditions","assembleSolidHeatTransferMat","timeEnd","math","lusolve","jacobiResult","A","b","x0","maxIterations","tolerance","n","x","xNew","iteration","sum","j","maxDiff","max","abs","solution","iterations","converged","jacobiMethod","fill","importGmshQuadTri","file","result","gmshV","ascii","fltBytes","lines","text","split","map","line","trim","filter","section","lineIndex","nodeEntityBlocks","nodeBlocksProcessed","currentNodeBlock","nodeTagsCollected","nodeTags","nodeCoordinatesCollected","elementEntityBlocks","elementBlocksProcessed","currentElementBlock","dim","elementType","numElements","elementsProcessedInBlock","boundaryElementsByTag","parts","part","parseFloat","test","parseInt","slice","replace","parametric","nodeTag","y","nodeIndices","idx","physicalTag","boundaryNodes","nodes","plotSolution","plotType","plotDivId","meshType","yData","arr","xData","from","lineData","mode","type","color","width","maxWindowWidth","min","window","innerWidth","maxPlotWidth","zoomFactor","layout","title","height","xaxis","yaxis","margin","l","r","t","Plotly","newPlot","responsive","isStructured","uniqueXCoords","Set","size","uniqueYCoords","zValues","val","aspectRatio","plotWidth","hovermode","numNodesX","numNodesY","reshape","reshapedYCoordinates","reshapedSolution","transposedSolution","transpose","reshapedXForPlot","xValue","contourData","z","contours","coloring","showlabels","colorbar","proxyMarker","Symbol","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","wrap","value","serialized","isError","stack","assign","ep","globalThis","allowedOrigins","addEventListener","callback","ev","data","origin","allowedOrigin","RegExp","isAllowedOrigin","warn","id","path","argumentList","fromWireValue","returnValue","parent","reduce","rawValue","apply","proxy","transfers","transferCache","set","transfer","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","TypeError","endpoint","isMessagePort","close","target","pendingListeners","resolver","get","delete","createProxy","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","WeakMap","proxyFinalizers","FinalizationRegistry","newCount","isProxyReleased","Proxy","_target","unregister","unregisterProxy","clear","p","toString","bind","_thisArg","rawArgumentList","last","processArguments","construct","register","registerProxy","processed","v","prototype","concat","handler","serializedValue","msg","floor","random","Number","MAX_SAFE_INTEGER","FEAScriptWorker","worker","feaWorker","isReady","_initWorker","Worker","URL","url","onerror","event","workerWrapper","Comlink.wrap","_ensureReady","reject","attempts","checkReady","setTimeout","startTime","performance","now","toFixed","getModelInfo","ping","terminate"],"mappings":"AAaO,MAAMA,EAMX,WAAAC,EAAYC,cAAEA,EAAaC,aAAEA,IAC3BC,KAAKF,cAAgBA,EACrBE,KAAKD,aAAeA,CACrB,CAQD,wBAAAE,GACE,IAAIC,EAAc,GACdC,EAAe,GAgBnB,MAd0B,WAAtBH,KAAKD,cAEPG,EAAY,GAAK,GACjBC,EAAa,GAAK,GACa,cAAtBH,KAAKD,eAEdG,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CH,EAAY,GAAK,GACjBA,EAAY,IAAM,EAAIE,KAAKC,KAAK,KAAU,EAC1CF,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,GACtBA,EAAa,GAAK,EAAI,IAGjB,CAAED,cAAaC,eACvB,ECtCH,IAAIG,EAAkB,QAMf,SAASC,EAAUC,GACV,UAAVA,GAA+B,UAAVA,GACvBC,QAAQC,IACN,+BAAiCF,EAAQ,yBACzC,sCAEFF,EAAkB,UAElBA,EAAkBE,EAClBG,EAAS,qBAAqBH,KAElC,CAMO,SAASI,EAASC,GACC,UAApBP,GACFG,QAAQC,IAAI,aAAeG,EAAS,qCAExC,CAMO,SAASF,EAASE,GACvBJ,QAAQC,IAAI,YAAcG,EAAS,qCACrC,CAMO,SAASC,EAASD,GACvBJ,QAAQC,IAAI,aAAeG,EAAS,qCACtC,CAKOE,eAAeC,IACpBL,EAAS,oDACT,IACE,MAAMM,QAAuBC,MAAM,iEAC7BC,QAAmBF,EAAeG,OAClCC,EAAmB,IAAIC,KAAKH,EAAWI,OAAOC,UAAUC,MAAMC,iBAEpE,OADAf,EAAS,4BAA4BU,KAC9BA,CACR,CAAC,MAAOM,GAEP,OADAb,EAAS,wCAA0Ca,GAC5C,iCACR,CACH,CCvDO,MAAMC,EAMX,WAAA/B,EAAYC,cAAEA,EAA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a,KAAKia,eACJja,KAAKuZ,UAAUoB,MACvB,CAKD,SAAAC,GACM5a,KAAKsZ,SACPtZ,KAAKsZ,OAAOsB,YACZ5a,KAAKsZ,OAAS,KACdtZ,KAAKuZ,UAAY,KACjBvZ,KAAKwZ,SAAU,EAElB"} \ No newline at end of file diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html index cde12b3..c8091cc 100644 --- a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html +++ b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html @@ -35,8 +35,8 @@

Heat Conduction in 2D Fin - Conjugate Gradient Solver

model.setMeshConfig({ meshDimension: "2D", elementOrder: "quadratic", - numElementsX: 40, - numElementsY: 20, + numElementsX: 20, + numElementsY: 10, maxX: 4000, maxY: 2000, }); diff --git a/src/FEAScript.js b/src/FEAScript.js index ee5fb0f..595cf3a 100644 --- a/src/FEAScript.js +++ b/src/FEAScript.js @@ -82,13 +82,24 @@ export class FEAScriptModel { let solutionVector = []; let nodesCoordinates = {}; + // Prepare the mesh + basicLog("Preparing mesh..."); + const meshData = prepareMesh(this.meshConfig); + basicLog("Mesh preparation completed"); + + // Extract node coordinates from meshData + nodesCoordinates = { + nodesXCoordinates: meshData.nodesXCoordinates, + nodesYCoordinates: meshData.nodesYCoordinates, + }; + // Assembly matrices basicLog("Beginning matrix assembly..."); console.time("assemblyMatrices"); if (this.solverConfig === "solidHeatTransferScript") { basicLog(`Using solver: ${this.solverConfig}`); - ({ jacobianMatrix, residualVector, nodesCoordinates } = assembleSolidHeatTransferMat( - this.meshConfig, + ({ jacobianMatrix, residualVector } = assembleHeatConductionMat( + meshData, this.boundaryConditions )); } diff --git a/src/methods/jacobiMethodScript.js b/src/methods/jacobiMethodScript.js index b267dc6..687d1d8 100644 --- a/src/methods/jacobiMethodScript.js +++ b/src/methods/jacobiMethodScript.js @@ -21,7 +21,7 @@ import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; * @param {number} [tolerance=1e-7] - Convergence tolerance * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision * @returns {object} An object containing: - * - solution: The solution vector + * - solutionVector: The solution vector * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ diff --git a/src/methods/jacobiSolverScript.js b/src/methods/jacobiSolverScript.js index 687d1d8..0e82b90 100644 --- a/src/methods/jacobiSolverScript.js +++ b/src/methods/jacobiSolverScript.js @@ -8,35 +8,47 @@ // |_| | |_ // // Website: https://feascript.com/ \__| // -import * as Comlink from "../vendor/comlink.mjs"; -import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; - /** - * Function to solve a system of linear equations using the Jacobi iterative method - * This version uses the WebGPU compute engine for maximum performance and reusability + * Function to solve a system of linear equations using the Jacobi iterative method (CPU synchronous version) * @param {array} A - The coefficient matrix (must be square) * @param {array} b - The right-hand side vector * @param {array} x0 - Initial guess for solution vector - * @param {number} [maxIterations=100] - Maximum number of iterations - * @param {number} [tolerance=1e-7] - Convergence tolerance - * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision + * @param {object} [options] - Additional options for the solver + * @param {number} [options.maxIterations=1000] - Maximum number of iterations + * @param {number} [options.tolerance=1e-6] - Convergence tolerance * @returns {object} An object containing: * - solutionVector: The solution vector * - iterations: The number of iterations performed * - converged: Boolean indicating whether the method converged */ -export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { - // Use the dedicated worker file - const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' }); - const jacobiWorker = Comlink.wrap(worker); +export function jacobiSolver(A, b, x0, options = {}) { + const { maxIterations = 1000, tolerance = 1e-6 } = options; + const n = A.length; + let x = [...x0]; + let xNew = new Array(n); + + for (let iter = 0; iter < maxIterations; iter++) { + for (let i = 0; i < n; i++) { + let sum = 0; + for (let j = 0; j < n; j++) { + if (i !== j) { + sum += A[i][j] * x[j]; + } + } + xNew[i] = (b[i] - sum) / A[i][i]; + } + + let maxDiff = 0; + for (let i = 0; i < n; i++) { + maxDiff = Math.max(maxDiff, Math.abs(xNew[i] - x[i])); + } - try { - const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64); - return result; - } catch (error) { - console.error("Error in WebGPU Jacobi method:", error); - throw error; - } finally { - worker.terminate(); + x = [...xNew]; + + if (maxDiff < tolerance) { + return { solutionVector: x, iterations: iter + 1, converged: true }; + } } + + return { solutionVector: x, iterations: maxIterations, converged: false }; } \ No newline at end of file diff --git a/src/workers/webgpuJacobiWorker.js b/src/workers/webgpuJacobiWorker.js index aceb1dc..a5e4d10 100644 --- a/src/workers/webgpuJacobiWorker.js +++ b/src/workers/webgpuJacobiWorker.js @@ -65,7 +65,7 @@ class WebGPUJacobiWorker { xNew = await xNewField.toArray(); // Check convergence by computing max difference - const diffField = ti.field(ti.f32, [n]); + const absDiffField = ti.field(ti.f32, [n]); diffField.fromArray(xNew.map((val, i) => val - x[i])); ti.addToKernelScope({diffField, absDiffField}); diff --git a/testWebGPU.html b/testWebGPU.html deleted file mode 100644 index d0ea066..0000000 --- a/testWebGPU.html +++ /dev/null @@ -1,651 +0,0 @@ - - - - - - WebGPU Compute Engine Test - - - -

WebGPU Compute Engine Test

-

This page tests the basic functionality of the WebGPU compute engine.

- -
-

Vector Addition Test

- -
-
- -
-

Matrix-Vector Multiplication Test

- -
-
- -
-

Dot Product Test

- -
-
- -
-

Vector Norm Test

- -
-
- -
-

Vector Normalization Test

- -
-
- -
-

Matrix-Matrix Multiplication Test

- -
-
- -
-

Matrix Transpose Test

- -
-
- -
-

Matrix Diagonal Test

- -
-
- -
-

Sparse Matrix-Vector Multiplication Test

- -
-
- -
-

Copy Test

- -
-
- -
-

Fill Test

- -
-
- -
-

Scale Test

- -
-
- -
-

Conjugate Gradient Solver Test

- -
-
- -
-

Cleanup

- -
-
- - - - \ No newline at end of file From fe316da6c624c976311753b6839f47bebdd03020 Mon Sep 17 00:00:00 2001 From: sridhar <2019309038@student.annauniv.edu> Date: Tue, 21 Oct 2025 10:55:45 +0000 Subject: [PATCH 08/12] Enhance WebGPUComputeWorker initialization to allow customizable power preference --- src/workers/webgpuComputeWorker.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/workers/webgpuComputeWorker.js b/src/workers/webgpuComputeWorker.js index 06f354f..dfec012 100644 --- a/src/workers/webgpuComputeWorker.js +++ b/src/workers/webgpuComputeWorker.js @@ -18,8 +18,14 @@ class WebGPUComputeWorker { this.initialized = false; } - async initialize() { + async initialize(powerPreference = 'high-performance') { if (!this.initialized) { + // Override the requestAdapter to set power preference + const originalRequestAdapter = navigator.gpu.requestAdapter; + navigator.gpu.requestAdapter = async (options = {}) => { + return originalRequestAdapter({ ...options, powerPreference }); + }; + await ti.init(); this.initialized = true; } From 913cddc93eb9dde555e96030121e8c591a3b8d9a Mon Sep 17 00:00:00 2001 From: nikoscham Date: Wed, 29 Oct 2025 12:15:57 +0200 Subject: [PATCH 09/12] Refactor WebGPU solver methods, and remove deprecated files --- NOTICE.md | 6 +- README.md | 46 +++++---- .../HeatConduction2DFinCG.html | 96 ------------------- .../HeatConduction2DFinGPU.html | 92 ++++++++++++++++++ src/FEAScript.js | 58 +++++++++-- src/methods/jacobiMethodScript.js | 42 -------- src/methods/linearSystemSolverScript.js | 69 +++++++++++++ src/workers/webgpuComputeWorker.js | 10 +- src/workers/webgpuJacobiWorker.js | 2 +- 9 files changed, 246 insertions(+), 175 deletions(-) delete mode 100644 examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html create mode 100644 examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html delete mode 100644 src/methods/jacobiMethodScript.js diff --git a/NOTICE.md b/NOTICE.md index b5d901d..8fb6960 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -11,4 +11,8 @@ FEAScript makes use of the following third-party software: 3. **Comlink** - License: Apache 2.0 (https://github.com/GoogleChromeLabs/comlink/blob/main/LICENSE) - - Source: https://github.com/GoogleChromeLabs/comlink \ No newline at end of file + - Source: https://github.com/GoogleChromeLabs/comlink + +4. **taichi.js** + - License: MIT (https://github.com/AmesingFlank/taichi.js/blob/main/LICENSE) + - Source: https://github.com/AmesingFlank/taichi.js \ No newline at end of file diff --git a/README.md b/README.md index 56d59e4..ee86118 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ [![npm version](https://img.shields.io/npm/v/feascript)](https://www.npmjs.com/package/feascript) - - [FEAScript](https://feascript.com/) is a lightweight finite element simulation library written in JavaScript. It empowers users to perform simulations for physics and engineering applications in both browser-based and server-side environments. This is the core library of the FEAScript project. > 🚧 **FEAScript is currently under heavy development.** Its functionality and interfaces may change rapidly as new features and enhancements are introduced. @@ -13,11 +11,11 @@ ## Contents - [Ways to Use FEAScript](#ways-to-use-feascript) - - [JavaScript API (FEAScript Core)](#javascript-api-feascript-core) + - [FEAScript API](#feascript-api) - [Use FEAScript in the Browser](#use-feascript-in-the-browser) - [Use FEAScript with Node.js](#use-feascript-with-nodejs) - - [Use FEAScript with Scribbler](#use-feascript-with-scribbler) - - [Visual Editor (FEAScript Platform)](#visual-editor-feascript-platform) + - [Use FEAScript in JavaScript Playgrounds](#use-feascript-in-javascript-playgrounds) + - [FEAScript Platform](#feascript-platform) - [Quick Example](#quick-example) - [Support FEAScript](#support-feascript) - [Contributing](#contributing) @@ -27,22 +25,22 @@ FEAScript offers two main approaches to creating simulations: -1. **[JavaScript API (FEAScript Core)](#javascript-api-feascript-core)** – For developers comfortable with coding, providing full programmatic control in browsers, Node.js, or interactive notebooks. -2. **[Visual Editor (FEAScript Platform)](#visual-editor-feascript-platform)** – For users who prefer a no-code approach, offering a block-based visual interface built with [Blockly](https://developers.google.com/blockly). +1. **[FEAScript API](#feascript-api)** – For developers comfortable with coding, providing full programmatic control in browsers, Node.js, or interactive notebooks. +2. **[FEAScript Platform](#feascript-platform)** – For users who prefer a no-code approach, offering a block-based visual interface built with [Blockly](https://blockly.com/). Each approach is explained in detail below. -### JavaScript API (FEAScript Core) +### FEAScript API -The JavaScript API is the core programmatic interface for FEAScript. Written entirely in pure JavaScript, it runs in three environments: +The FEAScript API is the core programmatic interface for FEAScript. Written entirely in pure JavaScript, it runs in three environments: 1. **[In the browser](#use-feascript-in-the-browser)** – Use FEAScript in a simple HTML page, running simulations locally without additional installations or cloud services. 2. **[With Node.js](#use-feascript-with-nodejs)** – Use FEAScript in server-side JavaScript applications or CLI tools. -3. **[With Scribbler](#use-feascript-with-scribbler)** – Use FEAScript in the [Scribbler](https://scribbler.live/) interactive JavaScript notebook environment. +3. **[In JavaScript playgrounds](#use-feascript-in-javascript-playgrounds)** – Use FEAScript in the [Scribbler](https://scribbler.live/) interactive JavaScript notebook environment. #### Use FEAScript in the Browser -You can use FEAScript in browser environments in two ways: +You can use FEAScript in browser environments in three ways: - **Import from Hosted ESM Build:** @@ -52,6 +50,14 @@ You can use FEAScript in browser environments in two ways: ``` +- **Import from CDN:** + + ```html + + ``` + - **Download and Use Locally:** You can download the latest stable release from [GitHub Releases](https://github.com/FEAScript/FEAScript-core/releases). @@ -89,27 +95,29 @@ When running examples from within this repository, this step isn’t needed as t 👉 Explore Node.js use cases on the [examples directory](https://github.com/FEAScript/FEAScript-core/tree/main/examples). -#### Use FEAScript with Scribbler +#### Use FEAScript in JavaScript Playgrounds -FEAScript also works well in interactive JavaScript notebook environments where you can write code, visualize results inline, and share your work with others. [Scribbler](https://scribbler.live/) is one such platform that comes with preloaded scientific libraries, making it an excellent choice for FEAScript simulations. +FEAScript works well in interactive JavaScript playgrounds where you can write code, visualize results inline, and share your work. -👉 Explore FEAScript notebook examples on the [Scribbler Hub](https://hub.scribbler.live/portfolio/#!nikoscham/FEAScript-Scribbler-examples). +👉 Explore the following examples: +- [CodePen (interactive pens)](https://codepen.io/FEAScript) +- [Scribbler (notebooks)](https://hub.scribbler.live/portfolio/#!nikoscham/FEAScript-Scribbler-examples) -### Visual Editor (FEAScript Platform) +### FEAScript Platform -For users who prefer a visual approach to creating simulations, we offer the [FEAScript Platform](https://platform.feascript.com/) - a browser-based visual editor built on the [Blockly](https://developers.google.com/blockly) library. This no-code interface allows you to: +For users who prefer a visual approach to creating simulations, we offer the [FEAScript Platform](https://feascript.com/feascript-platform.html) - a browser-based visual editor built on the [Blockly](https://blockly.com/) library. This no-code interface allows you to: - Build and run finite element simulations directly in your browser by connecting visual blocks together. - Create complex simulations without writing any JavaScript code. - Save and load projects in XML format for easy sharing and reuse. -While FEAScript's JavaScript API offers full programmatic control for advanced customization, the FEAScript Platform provides an accessible entry point for users without coding experience. +While FEAScript API offers full programmatic control for advanced customization, the FEAScript Platform provides an accessible entry point for users without coding experience. -👉 Explore FEAScript Platform examples on our [website](https://feascript.com/#tutorials). + ## Quick Example -Here is a minimal browser-based example using the JavaScript API. Adapt paths, solver types, and boundary conditions as needed for your specific problem: +Here is a minimal browser-based example using the FEAScript API. Adapt paths, solver types, and boundary conditions as needed for your specific problem: ```html diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html deleted file mode 100644 index c8091cc..0000000 --- a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinCG.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Heat Conduction 2D Fin - CG Solver - - - - - -

Heat Conduction in 2D Fin - Conjugate Gradient Solver

-
-
- - - - \ No newline at end of file diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html new file mode 100644 index 0000000..dd5ccd9 --- /dev/null +++ b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html @@ -0,0 +1,92 @@ + + + + + + + Heat Conduction 2D Fin - GPU Jacobi Solver + + + + + + +

Heat Conduction in 2D Fin - GPU Jacobi Solver

+
+
+ + + + + \ No newline at end of file diff --git a/src/FEAScript.js b/src/FEAScript.js index 595cf3a..9e7038e 100644 --- a/src/FEAScript.js +++ b/src/FEAScript.js @@ -11,6 +11,7 @@ // Internal imports import { newtonRaphson } from "./methods/newtonRaphsonScript.js"; import { solveLinearSystem } from "./methods/linearSystemSolverScript.js"; +import { solveLinearSystemAsync } from "./methods/linearSystemSolverScript.js"; import { prepareMesh } from "./mesh/meshUtilsScript.js"; import { assembleFrontPropagationMat } from "./solvers/frontPropagationScript.js"; import { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from "./solvers/generalFormPDEScript.js"; @@ -23,7 +24,7 @@ import { basicLog, debugLog, warnLog, errorLog } from "./utilities/loggingScript * @param {string} solverConfig - Parameter specifying the type of solver * @param {object} meshConfig - Object containing computational mesh details * @param {object} boundaryConditions - Object containing boundary conditions for the finite element analysis - * @returns {object} An object containing the solution vector and additional mesh information + * @returns {object} An object containifng the solution vector and additional mesh information */ export class FEAScriptModel { constructor() { @@ -70,11 +71,9 @@ export class FEAScriptModel { debugLog(`Solver method set to: ${solverMethod}`); } - async solveWithWebGPU(computeEngine) { + async solveWithWebgpu(computeEngine) { if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { - const error = "Solver config, mesh config, and boundary conditions must be set before solving."; - console.error(error); - throw new Error(error); + errorLog("Solver config, mesh config, and boundary conditions must be set before solving."); } let jacobianMatrix = []; @@ -106,7 +105,7 @@ export class FEAScriptModel { console.timeEnd("assemblyMatrices"); basicLog("Matrix assembly completed"); - // System solving with WebGPU CG + // System solving with WebGPU Jacobi basicLog("Solving system using WebGPU Jacobi..."); console.time("systemSolving"); @@ -115,7 +114,6 @@ export class FEAScriptModel { const b = Array.isArray(residualVector) ? residualVector : residualVector.toArray(); // For heat conduction FEM, the matrix might be negative definite - // Use Jacobi method instead of CG for better stability console.log("Matrix diagonal sample:", A.slice(0, 5).map((row, i) => row[i])); console.log("RHS sample:", b.slice(0, 5)); @@ -131,9 +129,7 @@ export class FEAScriptModel { solve() { if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { - const error = "Solver config, mesh config, and boundary conditions must be set before solving."; - console.error(error); - throw new Error(error); + errorLog("Solver config, mesh config, and boundary conditions must be set before solving."); } /** @@ -242,4 +238,46 @@ export class FEAScriptModel { return { solutionVector, nodesCoordinates }; } + + async solveAsync(computeEngine, options = {}) { + if (!this.solverConfig || !this.meshConfig || !this.boundaryConditions) { + errorLog("Solver config, mesh config, and boundary conditions must be set before solving."); + } + + let jacobianMatrix = []; + let residualVector = []; + let solutionVector = []; + + basicLog("Preparing mesh..."); + const meshData = prepareMesh(this.meshConfig); + basicLog("Mesh preparation completed"); + const nodesCoordinates = { + nodesXCoordinates: meshData.nodesXCoordinates, + nodesYCoordinates: meshData.nodesYCoordinates, + }; + + basicLog("Beginning solving process..."); + console.time("totalSolvingTime"); + + if (this.solverConfig === "heatConductionScript") { + + ({ jacobianMatrix, residualVector } = assembleHeatConductionMat(meshData, this.boundaryConditions)); + + if (this.solverMethod === "jacobi-gpu") { + const { solutionVector: x } = await solveLinearSystemAsync("jacobi-gpu", jacobianMatrix, residualVector, { + computeEngine, + maxIterations: options.maxIterations, + tolerance: options.tolerance, + }); + solutionVector = x; + } else { + const { solutionVector: x } = solveLinearSystem(this.solverMethod, jacobianMatrix, residualVector); + solutionVector = x; + } + } + console.timeEnd("totalSolvingTime"); + basicLog("Solving process completed"); + + return { solutionVector, nodesCoordinates }; + } } diff --git a/src/methods/jacobiMethodScript.js b/src/methods/jacobiMethodScript.js deleted file mode 100644 index 687d1d8..0000000 --- a/src/methods/jacobiMethodScript.js +++ /dev/null @@ -1,42 +0,0 @@ -// ______ ______ _____ _ _ // -// | ____| ____| /\ / ____| (_) | | // -// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // -// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // -// | | | |____ / ____ \ ____) | (__| | | | |_) | | // -// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // -// | | | | // -// |_| | |_ // -// Website: https://feascript.com/ \__| // - -import * as Comlink from "../vendor/comlink.mjs"; -import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; - -/** - * Function to solve a system of linear equations using the Jacobi iterative method - * This version uses the WebGPU compute engine for maximum performance and reusability - * @param {array} A - The coefficient matrix (must be square) - * @param {array} b - The right-hand side vector - * @param {array} x0 - Initial guess for solution vector - * @param {number} [maxIterations=100] - Maximum number of iterations - * @param {number} [tolerance=1e-7] - Convergence tolerance - * @param {boolean} [useFloat64=true] - Whether to use Float64Array for higher precision - * @returns {object} An object containing: - * - solutionVector: The solution vector - * - iterations: The number of iterations performed - * - converged: Boolean indicating whether the method converged - */ -export async function jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7, useFloat64 = true) { - // Use the dedicated worker file - const worker = new Worker('./workers/webgpuJacobiWorker.js', { type: 'module' }); - const jacobiWorker = Comlink.wrap(worker); - - try { - const result = await jacobiWorker.jacobiMethod(A, b, x0, maxIterations, tolerance, useFloat64); - return result; - } catch (error) { - console.error("Error in WebGPU Jacobi method:", error); - throw error; - } finally { - worker.terminate(); - } -} \ No newline at end of file diff --git a/src/methods/linearSystemSolverScript.js b/src/methods/linearSystemSolverScript.js index 0c0a2c2..5dfe7aa 100644 --- a/src/methods/linearSystemSolverScript.js +++ b/src/methods/linearSystemSolverScript.js @@ -11,6 +11,7 @@ // Internal imports import { jacobiSolver } from "./jacobiSolverScript.js"; import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js"; +import * as Comlink from "../vendor/comlink.mjs"; /** * Function to solve a system of linear equations using different solver methods @@ -70,3 +71,71 @@ export function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, return { solutionVector, converged, iterations }; } + +// Helper to lazily create a default WebGPU compute engine (Comlink + worker) +async function createDefaultComputeEngine() { + const worker = new Worker(new URL("../workers/webgpuComputeWorker.js", import.meta.url), { + type: "module", + }); + const computeEngine = Comlink.wrap(worker); + await computeEngine.initialize(); + return { computeEngine, worker }; +} + +// Async variant of solveLinearSystem +export async function solveLinearSystemAsync(solverMethod, jacobianMatrix, residualVector, options = {}) { + const { maxIterations = 10000, tolerance = 1e-3 } = options; + + basicLog(`Solving system using ${solverMethod}...`); + console.time("systemSolving"); + + // Normalize inputs + const A = Array.isArray(jacobianMatrix) ? jacobianMatrix : jacobianMatrix?.toArray?.() ?? jacobianMatrix; + const b = Array.isArray(residualVector) ? residualVector : residualVector?.toArray?.() ?? residualVector; + + let created = null; + let computeEngine = null; + + let solutionVector = []; + let converged = true; + let iterations; + + if (solverMethod === "jacobi-gpu") { + // Spin up a worker-backed compute engine + created = await createDefaultComputeEngine(); + computeEngine = created.computeEngine; + + const x0 = new Array(b.length).fill(0); + let result; + + if (computeEngine && typeof computeEngine.jacobiSolve === "function") { + result = await computeEngine.jacobiSolve(A, b, x0, maxIterations, tolerance); + } else { + // Fallback to CPU Jacobi + warnLog("Falling back to CPU Jacobi: computeEngine.jacobiSolve not available"); + const cpu = jacobiSolver(A, b, x0, { maxIterations, tolerance }); + result = { x: cpu.solutionVector, converged: cpu.converged, iterations: cpu.iterations }; + } + + if (Array.isArray(result)) { + solutionVector = result; + } else { + solutionVector = result?.x ?? result?.solutionVector ?? []; + converged = result?.converged ?? true; + iterations = result?.iterations; + } + } else { + errorLog(`Unknown solver method: ${solverMethod}`); + } + + // Success-only logging and cleanup + console.timeEnd("systemSolving"); + basicLog(`System solved successfully (${solverMethod})`); + + if (created) { + await computeEngine?.destroy?.().catch(() => { }); + created.worker.terminate(); + } + + return { solutionVector, converged, iterations }; +} diff --git a/src/workers/webgpuComputeWorker.js b/src/workers/webgpuComputeWorker.js index dfec012..5719931 100644 --- a/src/workers/webgpuComputeWorker.js +++ b/src/workers/webgpuComputeWorker.js @@ -20,8 +20,7 @@ class WebGPUComputeWorker { async initialize(powerPreference = 'high-performance') { if (!this.initialized) { - // Override the requestAdapter to set power preference - const originalRequestAdapter = navigator.gpu.requestAdapter; + const originalRequestAdapter = navigator.gpu.requestAdapter.bind(navigator.gpu); navigator.gpu.requestAdapter = async (options = {}) => { return originalRequestAdapter({ ...options, powerPreference }); }; @@ -31,7 +30,6 @@ class WebGPUComputeWorker { } if (!this.computeEngine) { this.computeEngine = new WebGPUComputeEngine(); - // Don't initialize again, already done } } @@ -76,7 +74,7 @@ class WebGPUComputeWorker { bField.fromArray(b); resultField.fromArray([0]); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -97,7 +95,7 @@ class WebGPUComputeWorker { aField.fromArray(vector); resultField.fromArray([0]); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -123,7 +121,7 @@ class WebGPUComputeWorker { aField.fromArray(vector); tempField.fromArray([0]); - ti.addToKernelScope({aField, resultField, tempField}); + ti.addToKernelScope({ aField, resultField, tempField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { diff --git a/src/workers/webgpuJacobiWorker.js b/src/workers/webgpuJacobiWorker.js index a5e4d10..a82a301 100644 --- a/src/workers/webgpuJacobiWorker.js +++ b/src/workers/webgpuJacobiWorker.js @@ -23,7 +23,7 @@ class WebGPUJacobiWorker { this.initialized = true; } - async jacobiMethod(A, b, x0, maxIterations = 100, tolerance = 1e-7) { + async jacobiWebgpuSolver(A, b, x0, maxIterations = 100, tolerance = 1e-7) { await this.initialize(); const n = A.length; From 4532b2b6a2a821673fe25be2d841dc2bacd37da6 Mon Sep 17 00:00:00 2001 From: nikoscham Date: Wed, 29 Oct 2025 22:02:16 +0200 Subject: [PATCH 10/12] Perform various modification for cleaning up the GPU solvers --- ...PU.html => HeatConduction2DFinWebgpu.html} | 0 src/FEAScript.js | 8 +- src/methods/frontalSolverScript.js | 8 +- src/methods/linearSystemSolverScript.js | 8 +- src/methods/newtonRaphsonScript.js | 2 +- .../webgpuComputeEngineScript.js} | 273 ++++++++++++------ .../frontPropagationScript.js | 0 .../generalFormPDEScript.js | 0 .../genericBoundaryConditionsScript.js | 0 .../heatConductionScript.js | 0 .../thermalBoundaryConditionsScript.js | 0 src/workers/webgpuComputeWorker.js | 192 ------------ src/workers/webgpuJacobiWorker.js | 109 ------- src/workers/webgpuWorkerScript.js | 236 +++++++++++++++ 14 files changed, 441 insertions(+), 395 deletions(-) rename examples/heatConductionScript/heatConduction2DFin/{HeatConduction2DFinGPU.html => HeatConduction2DFinWebgpu.html} (100%) rename src/{utilities/webgpuComputeEngine.js => methods/webgpuComputeEngineScript.js} (64%) rename src/{solvers => models}/frontPropagationScript.js (100%) rename src/{solvers => models}/generalFormPDEScript.js (100%) rename src/{solvers => models}/genericBoundaryConditionsScript.js (100%) rename src/{solvers => models}/heatConductionScript.js (100%) rename src/{solvers => models}/thermalBoundaryConditionsScript.js (100%) delete mode 100644 src/workers/webgpuComputeWorker.js delete mode 100644 src/workers/webgpuJacobiWorker.js create mode 100644 src/workers/webgpuWorkerScript.js diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html similarity index 100% rename from examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinGPU.html rename to examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html diff --git a/src/FEAScript.js b/src/FEAScript.js index 9e7038e..34f67b7 100644 --- a/src/FEAScript.js +++ b/src/FEAScript.js @@ -13,9 +13,9 @@ import { newtonRaphson } from "./methods/newtonRaphsonScript.js"; import { solveLinearSystem } from "./methods/linearSystemSolverScript.js"; import { solveLinearSystemAsync } from "./methods/linearSystemSolverScript.js"; import { prepareMesh } from "./mesh/meshUtilsScript.js"; -import { assembleFrontPropagationMat } from "./solvers/frontPropagationScript.js"; -import { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from "./solvers/generalFormPDEScript.js"; -import { assembleHeatConductionMat, assembleHeatConductionFront } from "./solvers/heatConductionScript.js"; +import { assembleFrontPropagationMat } from "./models/frontPropagationScript.js"; +import { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from "./models/generalFormPDEScript.js"; +import { assembleHeatConductionMat, assembleHeatConductionFront } from "./models/heatConductionScript.js"; import { runFrontalSolver } from "./methods/frontalSolverScript.js"; import { basicLog, debugLog, warnLog, errorLog } from "./utilities/loggingScript.js"; @@ -119,7 +119,7 @@ export class FEAScriptModel { // Use WebGPU Jacobi method const initialGuess = new Array(b.length).fill(0); - solutionVector = await computeEngine.jacobiSolve(A, b, initialGuess, 10000, 1e-3); + solutionVector = await computeEngine.webgpuJacobiSolver(A, b, initialGuess, 10000, 1e-3); console.timeEnd("systemSolving"); basicLog("System solved successfully with WebGPU Jacobi"); diff --git a/src/methods/frontalSolverScript.js b/src/methods/frontalSolverScript.js index ef3de7a..7a88e6b 100644 --- a/src/methods/frontalSolverScript.js +++ b/src/methods/frontalSolverScript.js @@ -11,10 +11,10 @@ // Internal imports import { BasisFunctions } from "../mesh/basisFunctionsScript.js"; import { initializeFEA } from "../mesh/meshUtilsScript.js"; -import { assembleHeatConductionFront } from "../solvers/heatConductionScript.js"; -import { ThermalBoundaryConditions } from "../solvers/thermalBoundaryConditionsScript.js"; -import { assembleFrontPropagationFront } from "../solvers/frontPropagationScript.js"; -import { GenericBoundaryConditions } from "../solvers/genericBoundaryConditionsScript.js"; +import { assembleHeatConductionFront } from "../models/heatConductionScript.js"; +import { ThermalBoundaryConditions } from "../models/thermalBoundaryConditionsScript.js"; +import { assembleFrontPropagationFront } from "../models/frontPropagationScript.js"; +import { GenericBoundaryConditions } from "../models/genericBoundaryConditionsScript.js"; import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js"; // Create object templates diff --git a/src/methods/linearSystemSolverScript.js b/src/methods/linearSystemSolverScript.js index 5dfe7aa..2dfb03e 100644 --- a/src/methods/linearSystemSolverScript.js +++ b/src/methods/linearSystemSolverScript.js @@ -74,7 +74,7 @@ export function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, // Helper to lazily create a default WebGPU compute engine (Comlink + worker) async function createDefaultComputeEngine() { - const worker = new Worker(new URL("../workers/webgpuComputeWorker.js", import.meta.url), { + const worker = new Worker(new URL("../workers/webgpuWorkerScript.js", import.meta.url), { type: "module", }); const computeEngine = Comlink.wrap(worker); @@ -108,11 +108,11 @@ export async function solveLinearSystemAsync(solverMethod, jacobianMatrix, resid const x0 = new Array(b.length).fill(0); let result; - if (computeEngine && typeof computeEngine.jacobiSolve === "function") { - result = await computeEngine.jacobiSolve(A, b, x0, maxIterations, tolerance); + if (computeEngine && typeof computeEngine.webgpuJacobiSolver === "function") { + result = await computeEngine.webgpuJacobiSolver(A, b, x0, maxIterations, tolerance); } else { // Fallback to CPU Jacobi - warnLog("Falling back to CPU Jacobi: computeEngine.jacobiSolve not available"); + warnLog("Falling back to CPU Jacobi: computeEngine.webgpuJacobiSolver not available"); const cpu = jacobiSolver(A, b, x0, { maxIterations, tolerance }); result = { x: cpu.solutionVector, converged: cpu.converged, iterations: cpu.iterations }; } diff --git a/src/methods/newtonRaphsonScript.js b/src/methods/newtonRaphsonScript.js index 4514797..1154f2f 100644 --- a/src/methods/newtonRaphsonScript.js +++ b/src/methods/newtonRaphsonScript.js @@ -13,7 +13,7 @@ import { euclideanNorm } from "../methods/euclideanNormScript.js"; import { solveLinearSystem } from "./linearSystemSolverScript.js"; import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js"; import { runFrontalSolver } from "./frontalSolverScript.js"; -import { assembleFrontPropagationFront } from "../solvers/frontPropagationScript.js"; +import { assembleFrontPropagationFront } from "../models/frontPropagationScript.js"; /** * Function to solve a system of non-linear equations using the Newton-Raphson method diff --git a/src/utilities/webgpuComputeEngine.js b/src/methods/webgpuComputeEngineScript.js similarity index 64% rename from src/utilities/webgpuComputeEngine.js rename to src/methods/webgpuComputeEngineScript.js index 99537a9..4c45e7f 100644 --- a/src/utilities/webgpuComputeEngine.js +++ b/src/methods/webgpuComputeEngineScript.js @@ -1,3 +1,14 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +// External imports import * as ti from '../vendor/taichi.esm.js'; export class WebGPUComputeEngine { @@ -6,7 +17,7 @@ export class WebGPUComputeEngine { } /** - * Initialize Taichi + * Function to initialize the WebGPU compute engine */ async initialize() { if (this.initialized) return; @@ -16,14 +27,22 @@ export class WebGPUComputeEngine { } /** - * Read data from a buffer (compatibility method) + * Function to read data from a buffer + * @param {object} data - The buffer to read from + * @param {number} size - The size of the data to read + * @param {object} [type=Float32Array] - The type of the data array + * @returns {object} The data read from the buffer */ async readBuffer(data, size, type = Float32Array) { return data; } /** - * Matrix-vector multiplication: y = A * x + * Function to perform matrix-vector multiplication: y = A * x + * @param {array} A - The matrix + * @param {array} x - The vector + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async matVecMul(A, x, resultBuffer = null) { const n = A.length; @@ -37,7 +56,7 @@ export class WebGPUComputeEngine { matrixField.fromArray(flatMatrix); vectorField.fromArray(x); - ti.addToKernelScope({matrixField, vectorField, resultField}); + ti.addToKernelScope({ matrixField, vectorField, resultField }); ti.kernel((n, m) => { for (let i of ti.ndrange(n)) { @@ -54,7 +73,11 @@ export class WebGPUComputeEngine { } /** - * Vector addition: result = a + b + * Function to perform vector addition: result = a + b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async vecAdd(a, b, resultBuffer = null) { const n = a.length; @@ -65,7 +88,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -77,8 +100,12 @@ export class WebGPUComputeEngine { return result; } - /** - * Vector subtraction: result = a - b + /** + * Function to perform vector subtraction: result = a - b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async vecSub(a, b, resultBuffer = null) { const n = a.length; @@ -89,7 +116,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -102,7 +129,11 @@ export class WebGPUComputeEngine { } /** - * Element-wise vector multiplication: result = a * b + * Function to perform element-wise vector multiplication: result = a * b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async vecMul(a, b, resultBuffer = null) { const n = a.length; @@ -113,7 +144,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -126,7 +157,11 @@ export class WebGPUComputeEngine { } /** - * Vector division: result = a / b + * Function to perform vector division: result = a / b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async vecDiv(a, b, resultBuffer = null) { const n = a.length; @@ -137,7 +172,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -150,7 +185,9 @@ export class WebGPUComputeEngine { } /** - * Find maximum value in vector + * Function to find the maximum value in a vector + * @param {array} vector - The input vector + * @returns {number} The maximum value in the vector */ async vecMax(vector) { const n = vector.length; @@ -160,7 +197,7 @@ export class WebGPUComputeEngine { vectorField.fromArray(vector); maxField.fromArray([-1e10]); - ti.addToKernelScope({vectorField, maxField}); + ti.addToKernelScope({ vectorField, maxField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -174,8 +211,14 @@ export class WebGPUComputeEngine { return Math.max(...result); } - /** - * Jacobi update: x_new = D^(-1) * (b - R * x_old) + /** + * Function to perform a Jacobi update step: x_new = D^(-1) * (b - R * x_old) + * @param {array} A - The system matrix + * @param {array} b - The right-hand side vector + * @param {array} x - The current solution vector + * @param {number} [omega=1.0] - The relaxation factor + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The updated solution vector */ async jacobiUpdate(A, b, x, omega = 1.0, resultBuffer = null) { const n = x.length; @@ -189,7 +232,7 @@ export class WebGPUComputeEngine { bField.fromArray(b); xField.fromArray(x); - ti.addToKernelScope({AField, bField, xField, resultField}); + ti.addToKernelScope({ AField, bField, xField, resultField }); ti.kernel((n, omega) => { for (let i = 0; i < n; i++) { @@ -208,7 +251,11 @@ export class WebGPUComputeEngine { } /** - * Element-wise operation on vector: result[i] = op(a[i]) + * Function to perform an element-wise operation on a vector: result[i] = op(a[i]) + * @param {array} a - The input vector + * @param {string} op - The operation to perform ('abs', 'sqrt', 'exp', 'log', 'sin', 'cos', 'tan') + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async elementWiseOp(a, op, resultBuffer = null) { const n = a.length; @@ -217,7 +264,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n, op) => { for (let i of ti.ndrange(n)) { @@ -246,7 +293,12 @@ export class WebGPUComputeEngine { } /** - * Scalar operation on vector: result[i] = op(a[i], scalar) + * Function to perform a scalar operation on a vector: result[i] = op(a[i], scalar) + * @param {array} a - The input vector + * @param {number} scalar - The scalar value + * @param {string} op - The operation to perform ('add', 'mul', 'div', 'pow') + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async scalarOp(a, scalar, op, resultBuffer = null) { const n = a.length; @@ -255,7 +307,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n, scalar, op) => { for (let i of ti.ndrange(n)) { @@ -278,11 +330,10 @@ export class WebGPUComputeEngine { } /** - * Vector L2 norm: result = ||a||_2 - */ - - /** - * Vector addition: c = a + b + * Function to perform vector addition: c = a + b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @returns {array} The resulting vector */ async vecAdd(a, b) { const n = a.length; @@ -293,7 +344,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, cField}); + ti.addToKernelScope({ aField, bField, cField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -306,7 +357,10 @@ export class WebGPUComputeEngine { } /** - * Element-wise vector multiplication: c = a .* b + * Function to perform element-wise vector multiplication: c = a .* b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @returns {array} The resulting vector */ async vecMul(a, b) { const n = a.length; @@ -317,7 +371,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); bField.fromArray(b); - ti.addToKernelScope({aField, bField, cField}); + ti.addToKernelScope({ aField, bField, cField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -329,7 +383,10 @@ export class WebGPUComputeEngine { return result; } /** - * Vector dot product: result = a · b + * Function to compute the dot product of two vectors: result = a · b + * @param {array} a - The first vector + * @param {array} b - The second vector + * @returns {number} The dot product */ async dotProduct(a, b) { const n = a.length; @@ -341,7 +398,7 @@ export class WebGPUComputeEngine { bField.fromArray(b); resultField.fromArray([0]); - ti.addToKernelScope({aField, bField, resultField}); + ti.addToKernelScope({ aField, bField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -354,7 +411,9 @@ export class WebGPUComputeEngine { } /** - * Vector L2 norm: result = ||a||_2 + * Function to compute the L2 norm of a vector: result = ||a||_2 + * @param {array} a - The input vector + * @returns {number} The L2 norm of the vector */ async norm(a) { const n = a.length; @@ -364,7 +423,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); resultField.fromArray([0]); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -380,6 +439,11 @@ export class WebGPUComputeEngine { return result[0]; } + /** + * Function to normalize a vector + * @param {array} a - The vector to normalize + * @returns {array} The normalized vector + */ async normalize(a) { const n = a.length; const aField = ti.field(ti.f32, [n]); @@ -389,7 +453,7 @@ export class WebGPUComputeEngine { aField.fromArray(a); tempField.fromArray([0]); - ti.addToKernelScope({aField, resultField, tempField}); + ti.addToKernelScope({ aField, resultField, tempField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -409,41 +473,51 @@ export class WebGPUComputeEngine { } /** - * Matrix-matrix multiplication: C = A * B - */ - /** - * Matrix-vector multiplication: y = A * x + * Function to perform matrix-matrix multiplication: C = A * B + * @param {array} A - The first matrix + * @param {array} B - The second matrix + * @returns {array} The resulting matrix */ - async matVecMul(A, x) { + async matMatMul(A, B) { const m = A.length; - const n = A[0].length; + const k = A[0].length; + const n = B[0].length; - const AField = ti.field(ti.f32, [m * n]); - const xField = ti.field(ti.f32, [n]); - const yField = ti.field(ti.f32, [m]); + const AField = ti.field(ti.f32, [m * k]); + const BField = ti.field(ti.f32, [k * n]); + const CField = ti.field(ti.f32, [m * n]); - const flatA = A.flat(); - AField.fromArray(flatA); - xField.fromArray(x); + AField.fromArray(A.flat()); + BField.fromArray(B.flat()); - ti.addToKernelScope({AField, xField, yField}); + ti.addToKernelScope({ AField, BField, CField }); - ti.kernel((m, n) => { + ti.kernel((m, n, k) => { for (let i of ti.ndrange(m)) { - let sum = 0.0; for (let j of ti.ndrange(n)) { - sum += AField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; + let sum = 0.0; + for (let p of ti.ndrange(k)) { + sum += AField[ti.i32(i) * ti.i32(k) + ti.i32(p)] * + BField[ti.i32(p) * ti.i32(n) + ti.i32(j)]; + } + CField[ti.i32(i) * ti.i32(n) + ti.i32(j)] = sum; } - yField[i] = sum; } - })(m, n); + })(m, n, k); - const result = await yField.toArray(); - return result; + const flatC = await CField.toArray(); + const C = []; + for (let i = 0; i < m; i++) { + C.push(flatC.slice(i * n, (i + 1) * n)); + } + return C; } /** - * Matrix transpose: B = A^T + * Function to transpose a matrix: B = A^T + * @param {array} A - The matrix to transpose + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The transposed matrix */ async transpose(A, resultBuffer = null) { const m = A.length; @@ -455,7 +529,7 @@ export class WebGPUComputeEngine { const flatA = A.flat(); AField.fromArray(flatA); - ti.addToKernelScope({AField, BField}); + ti.addToKernelScope({ AField, BField }); ti.kernel((m, n) => { for (let i of ti.ndrange(m)) { @@ -475,7 +549,10 @@ export class WebGPUComputeEngine { } /** - * Extract diagonal elements: result = diag(A) + * Function to extract the diagonal elements of a matrix: result = diag(A) + * @param {array} A - The input matrix + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The vector of diagonal elements */ async diagonal(A, resultBuffer = null) { const n = Math.min(A.length, A[0].length); @@ -486,7 +563,7 @@ export class WebGPUComputeEngine { const flatA = A.flat(); AField.fromArray(flatA); - ti.addToKernelScope({AField, resultField}); + ti.addToKernelScope({ AField, resultField }); ti.kernel((n, cols) => { for (let i of ti.ndrange(n)) { @@ -499,8 +576,11 @@ export class WebGPUComputeEngine { } /** - * Sparse matrix-vector multiplication using CSR format - * sparseMatrix should have: {values, col_indices, row_indices, rows, cols} + * Function to perform sparse matrix-vector multiplication using CSR format + * @param {object} sparseMatrix - Object with {values, col_indices, row_indices, rows, cols} + * @param {array} x - The vector to multiply with + * @param {object} [resultBuffer=null] - Optional buffer to store the result + * @returns {array} The resulting vector */ async sparseMatVecMul(sparseMatrix, x, resultBuffer = null) { const { values, col_indices, row_indices, rows, cols } = sparseMatrix; @@ -518,7 +598,7 @@ export class WebGPUComputeEngine { xField.fromArray(x); resultField.fromArray(new Array(rows).fill(0)); - ti.addToKernelScope({valuesField, colIndicesField, rowIndicesField, xField, resultField}); + ti.addToKernelScope({ valuesField, colIndicesField, rowIndicesField, xField, resultField }); ti.kernel((nnz) => { for (let k of ti.ndrange(nnz)) { @@ -531,7 +611,9 @@ export class WebGPUComputeEngine { } /** - * Deep copy vector or matrix + * Function to create a deep copy of a vector or matrix + * @param {array} data - The vector or matrix to copy + * @returns {array} A deep copy of the input data */ async copy(data) { if (Array.isArray(data[0])) { @@ -544,7 +626,7 @@ export class WebGPUComputeEngine { const flatA = data.flat(); AField.fromArray(flatA); - ti.addToKernelScope({AField, resultField}); + ti.addToKernelScope({ AField, resultField }); ti.kernel((total) => { for (let i of ti.ndrange(total)) { @@ -567,7 +649,7 @@ export class WebGPUComputeEngine { aField.fromArray(data); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n) => { for (let i of ti.ndrange(n)) { @@ -581,7 +663,10 @@ export class WebGPUComputeEngine { } /** - * Fill vector or matrix with constant value + * Function to fill a vector or matrix with a constant value + * @param {array} data - The vector or matrix to fill (determines size) + * @param {number} value - The value to fill with + * @returns {array} The filled vector or matrix */ async fill(data, value) { if (Array.isArray(data[0])) { @@ -590,7 +675,7 @@ export class WebGPUComputeEngine { const n = data[0].length; const resultField = ti.field(ti.f32, [m * n]); - ti.addToKernelScope({resultField}); + ti.addToKernelScope({ resultField }); ti.kernel((total, value) => { for (let i of ti.ndrange(total)) { @@ -610,7 +695,7 @@ export class WebGPUComputeEngine { const n = data.length; const resultField = ti.field(ti.f32, [n]); - ti.addToKernelScope({resultField}); + ti.addToKernelScope({ resultField }); ti.kernel((n, value) => { for (let i of ti.ndrange(n)) { @@ -624,7 +709,10 @@ export class WebGPUComputeEngine { } /** - * Scale vector or matrix by scalar + * Function to scale a vector or matrix by a scalar + * @param {array} data - The vector or matrix to scale + * @param {number} scalar - The scalar value to scale by + * @returns {array} The scaled vector or matrix */ async scale(data, scalar) { if (Array.isArray(data[0])) { @@ -637,7 +725,7 @@ export class WebGPUComputeEngine { const flatA = data.flat(); AField.fromArray(flatA); - ti.addToKernelScope({AField, resultField}); + ti.addToKernelScope({ AField, resultField }); ti.kernel((total, scalar) => { for (let i of ti.ndrange(total)) { @@ -660,7 +748,7 @@ export class WebGPUComputeEngine { aField.fromArray(data); - ti.addToKernelScope({aField, resultField}); + ti.addToKernelScope({ aField, resultField }); ti.kernel((n, scalar) => { for (let i of ti.ndrange(n)) { @@ -674,7 +762,11 @@ export class WebGPUComputeEngine { } /** - * Compute residual vector: r = b - A * x + * Function to compute the residual vector: r = b - A * x + * @param {array} A - The system matrix + * @param {array} x - The solution vector + * @param {array} b - The right-hand side vector + * @returns {array} The residual vector */ async residual(A, x, b) { const Ax = await this.matVecMul(A, x); @@ -682,8 +774,12 @@ export class WebGPUComputeEngine { } /** - * Apply preconditioner: solve M * z = r for z - * type: 'jacobi' or 'ssor' + * Function to apply a preconditioner: solve M * z = r for z + * @param {array} A - The system matrix + * @param {array} r - The residual vector + * @param {string} [type='jacobi'] - The type of preconditioner ('jacobi' or 'ssor') + * @param {number} [omega=1.0] - The relaxation factor for SSOR + * @returns {array} The vector z */ async preconditioner(A, r, type = 'jacobi', omega = 1.0) { const n = r.length; @@ -698,7 +794,7 @@ export class WebGPUComputeEngine { // This is a basic implementation; full SSOR would require forward/backward sweeps const diag = await this.diagonal(A); const invDiag = diag.map(d => omega / d); - + // For simplicity, approximate with Jacobi-like application // Full SSOR would need iterative application or matrix splitting return this.vecMul(invDiag, r); @@ -708,10 +804,16 @@ export class WebGPUComputeEngine { } /** - * Conjugate Gradient solver: solve A * x = b - * Returns approximate solution x + * Function to solve a system of linear equations using the Conjugate Gradient method (GPU asynchronous version) + * @param {array} A - The system matrix + * @param {array} b - The right-hand side vector + * @param {array} [x0=null] - The initial guess for the solution + * @param {number} [tol=1e-6] - The convergence tolerance + * @param {number} [maxIter=1000] - The maximum number of iterations + * @param {string} [preconditionerType=null] - The type of preconditioner to use + * @returns {array} The solution vector */ - async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + async webgpuConjugateGradientSolver(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { const n = b.length; let x = x0 ? await this.copy(x0) : new Array(n).fill(0.0); @@ -786,10 +888,16 @@ export class WebGPUComputeEngine { } /** - * Jacobi iterative solver: solve A * x = b - * Returns approximate solution x + * Function to solve a system of linear equations using the Jacobi iterative method (GPU asynchronous version) + * + * @param {array} A - The coefficient matrix (must be square) + * @param {array} b - The right-hand side vector + * @param {array} x0 - Initial guess for solution vector + * @param {number} [maxIter=1000] - Maximum number of iterations + * @param {number} [tol=1e-6] - Convergence tolerance + * @returns {array} The solution vector */ - async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { + async webgpuJacobiSolver(A, b, x0, maxIter = 1000, tol = 1e-6) { const n = b.length; let x = await this.copy(x0); let x_new = await this.copy(x0); @@ -823,6 +931,9 @@ export class WebGPUComputeEngine { return x; } + /** + * Function to destroy the compute engine and clean up resources + */ async destroy() { if (this.initialized) { // Clean up Taichi.js resources and WebGPU context diff --git a/src/solvers/frontPropagationScript.js b/src/models/frontPropagationScript.js similarity index 100% rename from src/solvers/frontPropagationScript.js rename to src/models/frontPropagationScript.js diff --git a/src/solvers/generalFormPDEScript.js b/src/models/generalFormPDEScript.js similarity index 100% rename from src/solvers/generalFormPDEScript.js rename to src/models/generalFormPDEScript.js diff --git a/src/solvers/genericBoundaryConditionsScript.js b/src/models/genericBoundaryConditionsScript.js similarity index 100% rename from src/solvers/genericBoundaryConditionsScript.js rename to src/models/genericBoundaryConditionsScript.js diff --git a/src/solvers/heatConductionScript.js b/src/models/heatConductionScript.js similarity index 100% rename from src/solvers/heatConductionScript.js rename to src/models/heatConductionScript.js diff --git a/src/solvers/thermalBoundaryConditionsScript.js b/src/models/thermalBoundaryConditionsScript.js similarity index 100% rename from src/solvers/thermalBoundaryConditionsScript.js rename to src/models/thermalBoundaryConditionsScript.js diff --git a/src/workers/webgpuComputeWorker.js b/src/workers/webgpuComputeWorker.js deleted file mode 100644 index 5719931..0000000 --- a/src/workers/webgpuComputeWorker.js +++ /dev/null @@ -1,192 +0,0 @@ -// ______ ______ _____ _ _ // -// | ____| ____| /\ / ____| (_) | | // -// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // -// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // -// | | | |____ / ____ \ ____) | (__| | | | |_) | | // -// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // -// | | | | // -// |_| | |_ // -// Website: https://feascript.com/ \__| // - -import * as Comlink from "../vendor/comlink.mjs"; -import * as ti from "../vendor/taichi.esm.js"; -import { WebGPUComputeEngine } from "../utilities/webgpuComputeEngine.js"; - -class WebGPUComputeWorker { - constructor() { - this.computeEngine = null; - this.initialized = false; - } - - async initialize(powerPreference = 'high-performance') { - if (!this.initialized) { - const originalRequestAdapter = navigator.gpu.requestAdapter.bind(navigator.gpu); - navigator.gpu.requestAdapter = async (options = {}) => { - return originalRequestAdapter({ ...options, powerPreference }); - }; - - await ti.init(); - this.initialized = true; - } - if (!this.computeEngine) { - this.computeEngine = new WebGPUComputeEngine(); - } - } - - async vecAdd(a, b) { - await this.initialize(); - return this.computeEngine.vecAdd(a, b); - } - - async matVecMul(A, x) { - await this.initialize(); - return this.computeEngine.matVecMul(A, x); - } - - async matMatMul(A, B) { - await this.initialize(); - return this.computeEngine.matMatMul(A, B); - } - - async transpose(A) { - await this.initialize(); - return this.computeEngine.transpose(A); - } - - async diagonal(A) { - await this.initialize(); - return this.computeEngine.diagonal(A); - } - - async sparseMatVecMul(sparseMatrix, x) { - await this.initialize(); - return this.computeEngine.sparseMatVecMul(sparseMatrix, x); - } - - async dotProduct(a, b) { - await this.initialize(); - const n = a.length; - const aField = ti.field(ti.f32, [n]); - const bField = ti.field(ti.f32, [n]); - const resultField = ti.field(ti.f32, [1]); - - aField.fromArray(a); - bField.fromArray(b); - resultField.fromArray([0]); - - ti.addToKernelScope({ aField, bField, resultField }); - - ti.kernel((n) => { - for (let i of ti.ndrange(n)) { - ti.atomicAdd(resultField[0], aField[i] * bField[i]); - } - })(n); - - const result = await resultField.toArray(); - return result[0]; - } - - async norm(vector) { - await this.initialize(); - const n = vector.length; - const aField = ti.field(ti.f32, [n]); - const resultField = ti.field(ti.f32, [1]); - - aField.fromArray(vector); - resultField.fromArray([0]); - - ti.addToKernelScope({ aField, resultField }); - - ti.kernel((n) => { - for (let i of ti.ndrange(n)) { - ti.atomicAdd(resultField[0], aField[i] * aField[i]); - } - })(n); - - ti.kernel(() => { - resultField[0] = ti.sqrt(resultField[0]); - })(); - - const result = await resultField.toArray(); - return result[0]; - } - - async normalize(vector) { - await this.initialize(); - const n = vector.length; - const aField = ti.field(ti.f32, [n]); - const resultField = ti.field(ti.f32, [n]); - const tempField = ti.field(ti.f32, [1]); - - aField.fromArray(vector); - tempField.fromArray([0]); - - ti.addToKernelScope({ aField, resultField, tempField }); - - ti.kernel((n) => { - for (let i of ti.ndrange(n)) { - ti.atomicAdd(tempField[0], aField[i] * aField[i]); - } - })(n); - - ti.kernel((n) => { - const normVal = ti.sqrt(tempField[0]); - for (let i of ti.ndrange(n)) { - resultField[i] = aField[i] / normVal; - } - })(n); - - const result = await resultField.toArray(); - return result; - } - - async copy(data) { - await this.initialize(); - return this.computeEngine.copy(data); - } - - async fill(data, value) { - await this.initialize(); - return this.computeEngine.fill(data, value); - } - - async scale(data, scalar) { - await this.initialize(); - return this.computeEngine.scale(data, scalar); - } - - async residual(A, x, b) { - await this.initialize(); - return this.computeEngine.residual(A, x, b); - } - - async preconditioner(A, r, type = 'jacobi', omega = 1.0) { - await this.initialize(); - return this.computeEngine.preconditioner(A, r, type, omega); - } - - async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { - await this.initialize(); - return this.computeEngine.conjugateGradient(A, b, x0, tol, maxIter, preconditionerType); - } - - async jacobiSolve(A, b, x0, maxIter = 1000, tol = 1e-6) { - await this.initialize(); - try { - return await this.computeEngine.jacobiSolve(A, b, x0, maxIter, tol); - } catch (e) { - console.error('Error in jacobiSolve:', e); - throw new Error('Jacobi solve failed: ' + e.message); - } - } - - async destroy() { - if (this.computeEngine) { - this.computeEngine.destroy(); - this.computeEngine = null; - } - this.initialized = false; - } -} - -Comlink.expose(new WebGPUComputeWorker()); \ No newline at end of file diff --git a/src/workers/webgpuJacobiWorker.js b/src/workers/webgpuJacobiWorker.js deleted file mode 100644 index a82a301..0000000 --- a/src/workers/webgpuJacobiWorker.js +++ /dev/null @@ -1,109 +0,0 @@ -// ______ ______ _____ _ _ // -// | ____| ____| /\ / ____| (_) | | // -// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // -// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // -// | | | |____ / ____ \ ____) | (__| | | | |_) | | // -// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // -// | | | | // -// |_| | |_ // -// Website: https://feascript.com/ \__| // - -import * as Comlink from "../vendor/comlink.mjs"; -import * as ti from '../vendor/taichi.esm.js'; - -class WebGPUJacobiWorker { - constructor() { - this.initialized = false; - } - - async initialize() { - if (this.initialized) return; - - await ti.init(); - this.initialized = true; - } - - async jacobiWebgpuSolver(A, b, x0, maxIterations = 100, tolerance = 1e-7) { - await this.initialize(); - - const n = A.length; - let x = [...x0]; - let xNew = new Array(n).fill(0); - - let iterationsCompleted = 0; - let hasConverged = false; - - // Main iteration loop - for (let iteration = 0; iteration < maxIterations; iteration++) { - // Perform Jacobi update using Taichi - const matrixField = ti.field(ti.f32, [n * n]); - const bField = ti.field(ti.f32, [n]); - const xField = ti.field(ti.f32, [n]); - const xNewField = ti.field(ti.f32, [n]); - - // Flatten the matrix for Taichi - const flatA = A.flat(); - matrixField.fromArray(flatA); - bField.fromArray(b); - xField.fromArray(x); - - ti.addToKernelScope({matrixField, bField, xField, xNewField}); - - ti.kernel((n) => { - for (let i = 0; i < n; i++) { - let sum = 0.0; - for (let j = 0; j < n; j++) { - if (j !== i) { - sum += matrixField[ti.i32(i) * ti.i32(n) + ti.i32(j)] * xField[j]; - } - } - let diagonal = matrixField[ti.i32(i) * ti.i32(n) + ti.i32(i)]; - xNewField[i] = (bField[i] - sum) / diagonal; - } - })(n); - - xNew = await xNewField.toArray(); - - // Check convergence by computing max difference - const absDiffField = ti.field(ti.f32, [n]); - diffField.fromArray(xNew.map((val, i) => val - x[i])); - - ti.addToKernelScope({diffField, absDiffField}); - - ti.kernel((n) => { - for (let i = 0; i < n; i++) { - absDiffField[i] = ti.abs(diffField[i]); - } - })(n); - - const absDiffData = await absDiffField.toArray(); - - // Find maximum absolute difference - let maxDiff = 0; - for (let i = 0; i < n; i++) { - if (absDiffData[i] > maxDiff) maxDiff = absDiffData[i]; - } - - if (maxDiff < tolerance) { - hasConverged = true; - iterationsCompleted = iteration + 1; - break; - } - - // Swap for next iteration - x = [...xNew]; - - if (iteration === maxIterations - 1) { - iterationsCompleted = maxIterations; - } - } - - return { - solution: xNew, - iterations: iterationsCompleted, - converged: hasConverged, - }; - } -} - -Comlink.expose(new WebGPUJacobiWorker()); \ No newline at end of file diff --git a/src/workers/webgpuWorkerScript.js b/src/workers/webgpuWorkerScript.js new file mode 100644 index 0000000..a917395 --- /dev/null +++ b/src/workers/webgpuWorkerScript.js @@ -0,0 +1,236 @@ +// ______ ______ _____ _ _ // +// | ____| ____| /\ / ____| (_) | | // +// | |__ | |__ / \ | (___ ___ ____ _ ____ | |_ // +// | __| | __| / /\ \ \___ \ / __| __| | _ \| __| // +// | | | |____ / ____ \ ____) | (__| | | | |_) | | // +// |_| |______/_/ \_\_____/ \___|_| |_| __/| | // +// | | | | // +// |_| | |_ // +// Website: https://feascript.com/ \__| // + +// External imports +import * as Comlink from "../vendor/comlink.mjs"; +import * as ti from "../vendor/taichi.esm.js"; + +// Internal imports +import { WebGPUComputeEngine } from "../methods/webgpuComputeEngineScript.js"; + +/** + * Worker for handling FEAScript WebGPU computations + */ +class webgpuFEAScriptWorker { + /** + * Function to construct the WebGPU worker + */ + constructor() { + this.computeEngine = null; + this.initialized = false; + } + + /** + * Function to initialize the WebGPU worker and compute engine + * @param {string} [powerPreference='high-performance'] - The power preference for the GPU adapter + */ + async initialize(powerPreference = 'high-performance') { + if (!this.initialized) { + const originalRequestAdapter = navigator.gpu.requestAdapter.bind(navigator.gpu); + navigator.gpu.requestAdapter = async (options = {}) => { + return originalRequestAdapter({ ...options, powerPreference }); + }; + + await ti.init(); + this.initialized = true; + } + if (!this.computeEngine) { + this.computeEngine = new WebGPUComputeEngine(); + } + } + + /** + * Function to perform vector addition + * @param {array} a - The first vector + * @param {array} b - The second vector + * @returns {array} The resulting vector + */ + async vecAdd(a, b) { + await this.initialize(); + return this.computeEngine.vecAdd(a, b); + } + + /** + * Function to perform matrix-vector multiplication + * @param {array} A - The matrix + * @param {array} x - The vector + * @returns {array} The resulting vector + */ + async matVecMul(A, x) { + await this.initialize(); + return this.computeEngine.matVecMul(A, x); + } + + /** + * Function to transpose a matrix + * @param {array} A - The matrix to transpose + * @returns {array} The transposed matrix + */ + async transpose(A) { + await this.initialize(); + return this.computeEngine.transpose(A); + } + + /** + * Function to extract the diagonal of a matrix + * @param {array} A - The input matrix + * @returns {array} The diagonal vector + */ + async diagonal(A) { + await this.initialize(); + return this.computeEngine.diagonal(A); + } + + /** + * Function to perform sparse matrix-vector multiplication + * @param {object} sparseMatrix - The sparse matrix in CSR format + * @param {array} x - The vector + * @returns {array} The resulting vector + */ + async sparseMatVecMul(sparseMatrix, x) { + await this.initialize(); + return this.computeEngine.sparseMatVecMul(sparseMatrix, x); + } + + /** + * Function to compute the dot product of two vectors + * @param {array} a - The first vector + * @param {array} b - The second vector + * @returns {number} The dot product + */ + async dotProduct(a, b) { + await this.initialize(); + return this.computeEngine.dotProduct(a, b); + } + + /** + * Function to compute the L2 norm of a vector + * @param {array} vector - The input vector + * @returns {number} The L2 norm + */ + async norm(vector) { + await this.initialize(); + return this.computeEngine.norm(vector); + } + + /** + * Function to normalize a vector + * @param {array} vector - The vector to normalize + * @returns {array} The normalized vector + */ + async normalize(vector) { + await this.initialize(); + return this.computeEngine.normalize(vector); + } + + /** + * Function to create a deep copy of a vector or matrix + * @param {array} data - The data to copy + * @returns {array} The copied data + */ + async copy(data) { + await this.initialize(); + return this.computeEngine.copy(data); + } + + /** + * Function to fill a vector or matrix with a value + * @param {array} data - The data structure to fill + * @param {number} value - The value to fill with + * @returns {array} The filled data structure + */ + async fill(data, value) { + await this.initialize(); + return this.computeEngine.fill(data, value); + } + + /** + * Function to scale a vector or matrix by a scalar + * @param {array} data - The data to scale + * @param {number} scalar - The scalar value + * @returns {array} The scaled data + */ + async scale(data, scalar) { + await this.initialize(); + return this.computeEngine.scale(data, scalar); + } + + /** + * Function to compute the residual vector r = b - A*x + * @param {array} A - The matrix + * @param {array} x - The vector + * @param {array} b - The right-hand side vector + * @returns {array} The residual vector + */ + async residual(A, x, b) { + await this.initialize(); + return this.computeEngine.residual(A, x, b); + } + + /** + * Function to apply a preconditioner + * @param {array} A - The system matrix + * @param {array} r - The residual vector + * @param {string} [type='jacobi'] - The preconditioner type + * @param {number} [omega=1.0] - The relaxation factor + * @returns {array} The result of the preconditioning step + */ + async preconditioner(A, r, type = 'jacobi', omega = 1.0) { + await this.initialize(); + return this.computeEngine.preconditioner(A, r, type, omega); + } + + /** + * Function to solve a linear system using the Conjugate Gradient method + * @param {array} A - The system matrix + * @param {array} b - The right-hand side vector + * @param {array} [x0=null] - The initial guess + * @param {number} [tol=1e-6] - The convergence tolerance + * @param {number} [maxIter=1000] - The maximum number of iterations + * @param {string} [preconditionerType=null] - The type of preconditioner + * @returns {array} The solution vector + */ + async conjugateGradient(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + await this.initialize(); + return this.computeEngine.conjugateGradient(A, b, x0, tol, maxIter, preconditionerType); + } + + /** + * Function to solve a linear system using the Jacobi method + * @param {array} A - The system matrix + * @param {array} b - The right-hand side vector + * @param {array} x0 - The initial guess + * @param {number} [maxIter=1000] - The maximum number of iterations + * @param {number} [tol=1e-6] - The convergence tolerance + * @returns {array} The solution vector + */ + async webgpuJacobiSolver(A, b, x0, maxIter = 1000, tol = 1e-6) { + await this.initialize(); + try { + return await this.computeEngine.webgpuJacobiSolver(A, b, x0, maxIter, tol); + } catch (e) { + console.error('Error in webgpuJacobiSolver:', e); + throw new Error('Jacobi solve failed: ' + e.message); + } + } + + /** + * Function to destroy the compute engine and release resources + */ + async destroy() { + if (this.computeEngine) { + this.computeEngine.destroy(); + this.computeEngine = null; + } + this.initialized = false; + } +} + +Comlink.expose(new webgpuFEAScriptWorker()); \ No newline at end of file From 23a34459c0ffdc50bd09efc2861a37210a6aee0b Mon Sep 17 00:00:00 2001 From: nikoscham Date: Wed, 29 Oct 2025 22:19:27 +0200 Subject: [PATCH 11/12] Refactor Heat Conduction 2D Fin example to improve UI elements --- .../HeatConduction2DFinWebgpu.html | 210 ++++++++++++++---- 1 file changed, 165 insertions(+), 45 deletions(-) diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html index dd5ccd9..ef299da 100644 --- a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html +++ b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html @@ -2,45 +2,165 @@ - - - Heat Conduction 2D Fin - GPU Jacobi Solver - - - + FEAScript: Heat Conduction in a 2D Fin (WebGPU) + + + + + + + + + + + + + + + -

Heat Conduction in 2D Fin - GPU Jacobi Solver

-
-
+

+ + + + +

+

Heat Conduction in a 2D Fin Tutorial (WebGPU)

+ + + +
+

+ This page demonstrates solving the 2D heat conduction fin problem using FEAScript with a WebGPU-accelerated + Jacobi solver. For the mathematical formulation and theory, see the + basic tutorial. +

+

+ ⚠️ Important: This feature is experimental and requires a browser that supports WebGPU. +

+
+ +

WebGPU Implementation

+

+ The code below shows how to use FEAScript with the WebGPU-accelerated Jacobi solver. The solution is plotted as + a 2D contour. +

+ +
+<script type="module">
+  // Import FEAScript library
+  import { FEAScriptModel, plotSolution } from "../../../src/index.js";
+  
+  window.addEventListener("DOMContentLoaded", async () => {
+
+    // Create and configure model
+    const model = new FEAScriptModel();
+    model.setSolverConfig("heatConductionScript");
+    model.setMeshConfig({
+      meshDimension: "2D",
+      elementOrder: "quadratic",
+      numElementsX: 20,
+      numElementsY: 10,
+      maxX: 4,
+      maxY: 2,
+    });
+
+    // Apply boundary conditions
+    model.addBoundaryCondition("0", ["constantTemp", 200]);
+    model.addBoundaryCondition("1", ["symmetry"]);
+    model.addBoundaryCondition("2", ["convection", 1, 20]);
+    model.addBoundaryCondition("3", ["constantTemp", 200]);
+
+    // Set solver method to use the GPU-accelerated Jacobi solver
+    model.setSolverMethod("jacobi-gpu");
+
+    // Solve
+    const { solutionVector, nodesCoordinates } = await model.solveAsync({
+      maxIterations: 10000,
+      tolerance: 1e-3,
+    });
+
+    // Plot results
+    plotSolution(
+      solutionVector,
+      nodesCoordinates,
+      "heatConductionScript",
+      "2D",
+      "contour",
+      "resultsCanvas"
+    );
+  });
+</script>
+ +

Results

+

+ Below is the 2D contour plot of the computed temperature distribution. This plot is generated in real time using + FEAScript. +

+ +
+
+ Solving... +
+
+
+ + + +
+

© 2023- FEAScript

+
+ \ No newline at end of file From ef7e37ee12732658fca429227232673f39844847 Mon Sep 17 00:00:00 2001 From: nikoscham Date: Thu, 30 Oct 2025 10:24:43 +0200 Subject: [PATCH 12/12] Cleanup WebGPU functions --- .../HeatConduction2DFinWebgpu.html | 212 ------------------ package.json | 2 +- src/index.js | 2 +- src/methods/linearSystemSolverScript.js | 7 +- src/methods/webgpuComputeEngineScript.js | 26 ++- 5 files changed, 20 insertions(+), 229 deletions(-) delete mode 100644 examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html diff --git a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html b/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html deleted file mode 100644 index ef299da..0000000 --- a/examples/heatConductionScript/heatConduction2DFin/HeatConduction2DFinWebgpu.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - FEAScript: Heat Conduction in a 2D Fin (WebGPU) - - - - - - - - - - - - - - - - - - -

- - - - -

-

Heat Conduction in a 2D Fin Tutorial (WebGPU)

- - - -
-

- This page demonstrates solving the 2D heat conduction fin problem using FEAScript with a WebGPU-accelerated - Jacobi solver. For the mathematical formulation and theory, see the - basic tutorial. -

-

- ⚠️ Important: This feature is experimental and requires a browser that supports WebGPU. -

-
- -

WebGPU Implementation

-

- The code below shows how to use FEAScript with the WebGPU-accelerated Jacobi solver. The solution is plotted as - a 2D contour. -

- -
-<script type="module">
-  // Import FEAScript library
-  import { FEAScriptModel, plotSolution } from "../../../src/index.js";
-  
-  window.addEventListener("DOMContentLoaded", async () => {
-
-    // Create and configure model
-    const model = new FEAScriptModel();
-    model.setSolverConfig("heatConductionScript");
-    model.setMeshConfig({
-      meshDimension: "2D",
-      elementOrder: "quadratic",
-      numElementsX: 20,
-      numElementsY: 10,
-      maxX: 4,
-      maxY: 2,
-    });
-
-    // Apply boundary conditions
-    model.addBoundaryCondition("0", ["constantTemp", 200]);
-    model.addBoundaryCondition("1", ["symmetry"]);
-    model.addBoundaryCondition("2", ["convection", 1, 20]);
-    model.addBoundaryCondition("3", ["constantTemp", 200]);
-
-    // Set solver method to use the GPU-accelerated Jacobi solver
-    model.setSolverMethod("jacobi-gpu");
-
-    // Solve
-    const { solutionVector, nodesCoordinates } = await model.solveAsync({
-      maxIterations: 10000,
-      tolerance: 1e-3,
-    });
-
-    // Plot results
-    plotSolution(
-      solutionVector,
-      nodesCoordinates,
-      "heatConductionScript",
-      "2D",
-      "contour",
-      "resultsCanvas"
-    );
-  });
-</script>
- -

Results

-

- Below is the 2D contour plot of the computed temperature distribution. This plot is generated in real time using - FEAScript. -

- -
-
- Solving... -
-
-
- - - - - -
-

© 2023- FEAScript

-
- - - - \ No newline at end of file diff --git a/package.json b/package.json index 951b86a..b09b06c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "feascript", - "version": "0.1.3", + "version": "0.1.4", "description": "Lightweight finite element simulation library built in JavaScript for browser-based physics and engineering simulations", "main": "dist/feascript.cjs.js", "module": "dist/feascript.esm.js", diff --git a/src/index.js b/src/index.js index 49cd871..4b47cba 100644 --- a/src/index.js +++ b/src/index.js @@ -13,4 +13,4 @@ export { importGmshQuadTri } from "./readers/gmshReaderScript.js"; export { logSystem } from "./utilities/loggingScript.js"; export { plotSolution } from "./visualization/plotSolutionScript.js"; export { FEAScriptWorker } from "./workers/workerScript.js"; -export const printVersion = "0.1.3"; \ No newline at end of file +export const printVersion = "0.1.4"; \ No newline at end of file diff --git a/src/methods/linearSystemSolverScript.js b/src/methods/linearSystemSolverScript.js index 2dfb03e..fab01aa 100644 --- a/src/methods/linearSystemSolverScript.js +++ b/src/methods/linearSystemSolverScript.js @@ -19,15 +19,15 @@ import * as Comlink from "../vendor/comlink.mjs"; * @param {Array} jacobianMatrix - The coefficient matrix * @param {Array} residualVector - The right-hand side vector * @param {object} [options] - Additional options for the solver - * @param {number} [options.maxIterations=1000] - Maximum iterations for iterative methods - * @param {number} [options.tolerance=1e-6] - Convergence tolerance for iterative methods + * @param {number} [options.maxIterations=10000] - Maximum iterations for iterative methods + * @param {number} [options.tolerance=1e-3] - Convergence tolerance for iterative methods * @returns {object} An object containing: * - solutionVector: The solution vector * - converged: Boolean indicating whether the method converged (for iterative methods) * - iterations: Number of iterations performed (for iterative methods) */ export function solveLinearSystem(solverMethod, jacobianMatrix, residualVector, options = {}) { - const { maxIterations = 1000, tolerance = 1e-6 } = options; + const { maxIterations = 10000, tolerance = 1e-3 } = options; let solutionVector = []; let converged = true; @@ -128,7 +128,6 @@ export async function solveLinearSystemAsync(solverMethod, jacobianMatrix, resid errorLog(`Unknown solver method: ${solverMethod}`); } - // Success-only logging and cleanup console.timeEnd("systemSolving"); basicLog(`System solved successfully (${solverMethod})`); diff --git a/src/methods/webgpuComputeEngineScript.js b/src/methods/webgpuComputeEngineScript.js index 4c45e7f..9198831 100644 --- a/src/methods/webgpuComputeEngineScript.js +++ b/src/methods/webgpuComputeEngineScript.js @@ -11,6 +11,9 @@ // External imports import * as ti from '../vendor/taichi.esm.js'; +// Internal imports +import { basicLog, debugLog, errorLog } from "../utilities/loggingScript.js"; + export class WebGPUComputeEngine { constructor() { this.initialized = false; @@ -799,7 +802,8 @@ export class WebGPUComputeEngine { // Full SSOR would need iterative application or matrix splitting return this.vecMul(invDiag, r); } else { - throw new Error(`Unsupported preconditioner type: ${type}`); + errorLog(`Unsupported preconditioner type: ${type}`); + return null; } } @@ -813,7 +817,7 @@ export class WebGPUComputeEngine { * @param {string} [preconditionerType=null] - The type of preconditioner to use * @returns {array} The solution vector */ - async webgpuConjugateGradientSolver(A, b, x0 = null, tol = 1e-6, maxIter = 1000, preconditionerType = null) { + async webgpuConjugateGradientSolver(A, b, x0 = null, tol, maxIter, preconditionerType = null) { const n = b.length; let x = x0 ? await this.copy(x0) : new Array(n).fill(0.0); @@ -822,10 +826,10 @@ export class WebGPUComputeEngine { let rr = await this.dotProduct(r, r); let rnorm0 = Math.sqrt(rr); - console.log(`CG: Initial residual norm: ${rnorm0}`); + basicLog(`CG: Initial residual norm: ${rnorm0}`); if (rnorm0 < tol) { - console.log(`CG: Already converged`); + basicLog(`CG: Already converged`); return x; } @@ -840,7 +844,7 @@ export class WebGPUComputeEngine { const pAp = await this.dotProduct(p, Ap); if (Math.abs(pAp) < 1e-16) { - console.log(`CG: p^T * A * p is too small (${pAp}), stopping`); + errorLog(`CG: p^T * A * p is too small (${pAp}), stopping`); break; } @@ -859,11 +863,11 @@ export class WebGPUComputeEngine { const rr_new = await this.dotProduct(r, r); const rnorm = Math.sqrt(rr_new); - console.log(`CG: Iteration ${iter + 1}, residual norm: ${rnorm}`); + basicLog(`CG: Iteration ${iter + 1}, residual norm: ${rnorm}`); // Check convergence if (rnorm < tol * rnorm0) { - console.log(`CG: Converged in ${iter + 1} iterations`); + basicLog(`CG: Converged in ${iter + 1} iterations`); break; } @@ -897,7 +901,7 @@ export class WebGPUComputeEngine { * @param {number} [tol=1e-6] - Convergence tolerance * @returns {array} The solution vector */ - async webgpuJacobiSolver(A, b, x0, maxIter = 1000, tol = 1e-6) { + async webgpuJacobiSolver(A, b, x0, maxIter, tol) { const n = b.length; let x = await this.copy(x0); let x_new = await this.copy(x0); @@ -911,10 +915,10 @@ export class WebGPUComputeEngine { // Check convergence const rnorm = await this.norm(r); - console.log(`Jacobi: Iteration ${iter + 1}, residual norm: ${rnorm}`); + basicLog(`Jacobi: Iteration ${iter + 1}, residual norm: ${rnorm}`); if (rnorm < tol) { - console.log(`Jacobi: Converged in ${iter + 1} iterations`); + basicLog(`Jacobi: Converged in ${iter + 1} iterations`); return x; } @@ -927,7 +931,7 @@ export class WebGPUComputeEngine { [x, x_new] = [x_new, x]; } - console.log(`Jacobi: Did not converge in ${maxIter} iterations`); + errorLog(`Jacobi: Did not converge in ${maxIter} iterations`); return x; }