@arcgis/core 5.1.0-next.88 → 5.1.0-next.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arcade/validation/arcadeValidator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0840e7dd62643c56ae9e.js +1 -0
- package/assets/esri/core/workers/chunks/{500be1fb7cc9efec875c.js → 0e3dcf99382478181366.js} +1 -1
- package/assets/esri/core/workers/chunks/{aae40d70eb01249c1bab.js → 1e4e7111d43f01c149b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{2549a07f403447482f4e.js → 2dcfc4d7e76c922bcbf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{4dc91c2208201ba34c90.js → 3397eae416622c64e628.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9e163f4a898e50cc854.js → 39d6032d79720935910d.js} +1 -1
- package/assets/esri/core/workers/chunks/{d05a7ce6c1d4b883ed4c.js → 41cbde4738ae4adf973d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a401d44a5b45c05072c2.js → 4b9b9e6136c11d5d7901.js} +1 -1
- package/assets/esri/core/workers/chunks/5409369d0d637cb30257.js +1 -0
- package/assets/esri/core/workers/chunks/{defac06f9e2b43090677.js → 73af4c947e8151d411c1.js} +2 -2
- package/assets/esri/core/workers/chunks/{01bd1b86ba899c6aa4c0.js → 75c09a2fa4c34b4844c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2983f521d8c96becd8a.js → 7ed5b669010db58845f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{8178e9ba3c568d406a87.js → 81d761c837b7456ec99f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7185486c6dc28fc367a1.js → 90a8dfb03a437fe8a6e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9065cee85eb8dde6a42.js → a2159df718a7f2f59271.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f34fa9f154f5101cb13.js → a232d05c0a055f398c6e.js} +1 -1
- package/assets/esri/core/workers/chunks/a508104179e08f0f268c.js +2 -0
- package/assets/esri/core/workers/chunks/{4baf66314f82cfa76beb.js → adfa5c136c72c1e65770.js} +1 -1
- package/assets/esri/core/workers/chunks/{004af103a94d21cb4889.js → aefeb5a17bb481c95da3.js} +1 -1
- package/assets/esri/core/workers/chunks/{164ee62f2211987ad850.js → bb8d596f15fd3a0d783a.js} +1 -1
- package/assets/esri/core/workers/chunks/bea2fd831d7a864e5995.js +596 -0
- package/assets/esri/core/workers/chunks/{3cf77b7a61f78f9bcd62.js → ceff78c9e31e3572a082.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cc38ac051d3d0557920.js → cfaa6e205bfc0c94a1b1.js} +1 -1
- package/assets/esri/core/workers/chunks/d5ad036d282df54b9ddc.js +1 -0
- package/assets/esri/core/workers/chunks/{475394218caaa4cd3e86.js → d7e7f3efd1d28617b808.js} +1 -1
- package/assets/esri/core/workers/chunks/{f37e4ae0e9be80210db0.js → f2c11f54255fd506655e.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/ComponentShader.glsl.js +3 -3
- package/chunks/index.js +1 -1
- package/config.js +1 -1
- package/interfaces.d.ts +7 -0
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/support/IntegratedMesh3DTilesVertexProcessing.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +22 -16
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/TextureBufferCache.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +2 -0
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +64 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +2 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +2 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +4 -2
- package/assets/esri/core/workers/chunks/3e72bd6dbfc52d956c06.js +0 -1
- package/assets/esri/core/workers/chunks/a429355534bf6cbd8304.js +0 -1
- package/assets/esri/core/workers/chunks/d00dddc3881fa29446e1.js +0 -1
- package/assets/esri/core/workers/chunks/f9fe3c9867b0bdb2aec6.js +0 -596
- package/assets/esri/core/workers/chunks/fe30e61652716fcccf16.js +0 -2
- /package/assets/esri/core/workers/chunks/{defac06f9e2b43090677.js.LICENSE.txt → 73af4c947e8151d411c1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fe30e61652716fcccf16.js.LICENSE.txt → a508104179e08f0f268c.js.LICENSE.txt} +0 -0
package/chunks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const e={False:"false",Null:"null",True:"true"},t={Break:"break",Continue:"continue",Else:"else",For:"for",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},u={From:"from",Of:"of"},i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberAccessChainExpression:"MemberAccessChainExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SafeMemberExpression:"SafeMemberExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},n=["++","--"],r=["-","+","!","~"],s=["=","/=","*=","%=","+=","-="],a=["||","&&"],o=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],D="?.",h={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},c={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},l=["Unknown","Boolean","<end>","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],d={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentifierExpected:"IdentifierExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},C={[d.InvalidModuleUri]:"Module uri must be a text literal.",[d.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[d.IdentifierExpected]:"'${value}' is an invalid identifier.",[d.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[d.InvalidExpression]:"Invalid expression.",[d.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[d.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[d.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[d.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[d.InvalidTemplateHead]:"Invalid template structure.",[d.InvalidVariableAssignment]:"Invalid variable assignment.",[d.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[d.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[d.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[d.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[d.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[d.PunctuatorExpected]:"'${value}' expected.",[d.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[d.UnexpectedBoolean]:"Unexpected boolean literal.",[d.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[d.UnexpectedIdentifier]:"Unexpected identifier.",[d.UnexpectedKeyword]:"Unexpected keyword.",[d.UnexpectedNull]:"Unexpected null literal.",[d.UnexpectedNumber]:"Unexpected number.",[d.UnexpectedPunctuator]:"Unexpected punctuator.",[d.UnexpectedString]:"Unexpected text literal.",[d.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[d.UnexpectedToken]:"Unexpected token '${value}'."};class F extends Error{constructor({code:e,index:t,line:u,column:i,len:n=0,description:r,data:s}){super(r??e),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=e,this.index=t,this.line=u,this.column=i,this.len=n,this.data=s,this.description=r,this.range={start:{line:u,column:i-1},end:{line:u,column:i+n}},Error.captureStackTrace?.(this,F)}}function p(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.Program}function E(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.BlockStatement}function A(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.BlockComment}function m(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.EmptyStatement}function x(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.VariableDeclaration}function B(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.Identifier}function f(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.VariableDeclarator}function k(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function g(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}class S{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!E(e)||0!==e.body.length)return;const t=[];for(let u=this._newComments.length-1;u>=0;u--){const i=this._newComments[u];e.range[1]>=i.range[0]&&(t.unshift(i),this._newComments.splice(u,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){const t=this._nodeStack.at(-1);if(!t)return;if(E(e)&&g(t,e))for(let i=this._newComments.length-1;i>=0;i--){const u=this._newComments[i];g(u,e)&&(t.trailingComments=[...t.trailingComments??[],u],this._newComments.splice(i,1))}let u=[];if(this._newComments.length>0)for(let i=this._newComments.length-1;i>=0;i--){const n=this._newComments[i];k(n,t)?(t.trailingComments=[...t.trailingComments??[],n],this._newComments.splice(i,1)):k(n,e)&&(u.unshift(n),this._newComments.splice(i,1))}if(t.trailingComments){k(t.trailingComments[0],e)&&(u=[...u,...t.trailingComments],delete t.trailingComments)}u.length>0&&(e.trailingComments=u)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){const u=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=u.range[0]))break;t=u,this._nodeStack.pop()}const u=[],i=[];if(null!=t){if(!t.leadingComments)return;for(let n=t.leadingComments.length-1;n>=0;n--){const r=t.leadingComments[n];e.range[0]>=r.range[1]?(u.unshift(r),t.leadingComments.splice(n,1)):f(e)&&!A(r)&&(i.unshift(r),t.leadingComments.splice(n,1))}return 0===t.leadingComments.length&&delete t.leadingComments,u.length&&(e.leadingComments=u),void(i.length&&(e.trailingComments=[...i,...e.trailingComments??[]]))}for(let n=this._newComments.length-1;n>=0;n--){const t=this._newComments[n];e.range[0]>=t.range[0]&&(u.unshift(t),this._newComments.splice(n,1))}u.length&&(e.leadingComments=u)}attachComments(e){if(p(e)&&e.body.length>0){const t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}}const w=/\$\{(.*?)\}/gu;function y(e,t){const u=C[e];return t?u.replace(w,(e,u)=>t[u]?.toString()??""):u}class I{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??=y(e.code,e.data),new F(e)}tolerateError(e){e.description??=y(e.code,e.data);const t=new F(e);if(!this.tolerant)throw t;this.recordError(t)}}function T(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}const b={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},L={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>10===e||13===e||8232===e||8233===e,isIdentifierStart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&b.NonAsciiIdentifierStart.test(L.fromCodePoint(e)),isIdentifierPart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&b.NonAsciiIdentifierPart.test(L.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function v(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function N(e){return"01234567".indexOf(e)}const U=[[],[],[]];n.forEach(e=>U[e.length-1].push(e)),r.forEach(e=>U[e.length-1].push(e)),a.forEach(e=>U[e.length-1].push(e)),s.forEach(e=>U[e.length-1].push(e)),o.forEach(e=>U[e.length-1].push(e)),U[D.length-1].push(D);class P{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=d.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=d.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const t=[],u=this.index-e,i={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(this.index+=1,L.isLineTerminator(n)){i.end={line:this.lineNumber,column:this.index-this.lineStart-1};const r={multiLine:!1,start:u+e,end:this.index-1,range:[u,this.index-1],loc:i};return t.push(r),13===n&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}i.end={line:this.lineNumber,column:this.index-this.lineStart};const n={multiLine:!1,start:u+e,end:this.index,range:[u,this.index],loc:i};return t.push(n),t}skipMultiLineComment(){const e=[],t=this.index-2,u={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(L.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1)){this.index+=2,u.end={line:this.lineNumber,column:this.index-this.lineStart};const i={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:u};return e.push(i),e}this.index+=1}else this.index+=1}u.end={line:this.lineNumber,column:this.index-this.lineStart};const i={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:u};return e.push(i),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(L.isWhiteSpace(t))this.index+=1;else if(L.isLineTerminator(t))this.index+=1,13===t&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(47!==t)break;if(t=this.source.charCodeAt(this.index+1),47===t){this.index+=2;const t=this.skipSingleLineComment(2);e=[...e,...t]}else{if(42!==t)break;{this.index+=2;const t=this.skipMultiLineComment();e=[...e,...t]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===t.If||e===t.In;case 3:return e===t.Var||e===t.For;case 4:return e===t.Else;case 5:return e===t.Break||e===t.While;case 6:return e===t.Return||e===t.Import||e===t.Export;case 8:return e===t.Function||e===t.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const u=this.source.charCodeAt(e+1);u>=56320&&u<=57343&&(t=1024*(t-55296)+u-56320+65536)}return t}scanHexEscape(e){const t="u"===e?4:2;let u=0;for(let i=0;i<t;i++){if(this.eof()||!L.isHexDigit(this.source.charCodeAt(this.index)))return null;u=16*u+v(this.source[this.index]??""),this.index+=1}return String.fromCharCode(u)}scanUnicodeCodePointEscape(){let e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index]??"",this.index+=1,L.isHexDigit(e.charCodeAt(0)));)t=16*t+v(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),L.fromCodePoint(t)}getIdentifier(){const e=this.index;for(this.index+=1;!this.eof();){const t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!L.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),u=L.fromCodePoint(t);for(this.index+=u.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!L.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u=e);!this.eof()&&(t=this.codePointAt(this.index),L.isIdentifierPart(t));)e=L.fromCodePoint(t),u+=e,this.index+=e.length,92===t&&(u=u.substring(0,u.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!L.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u+=e);return u}octalToDecimal(e){let t="0"!==e,u=N(e);return!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,u=8*u+N(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index))&&(u=8*u+N(this.source[this.index]??""),this.index+=1)),{code:u,octal:t}}scanIdentifier(){let t;const u=this.index,i=92===this.source.charCodeAt(u)?this.getComplexIdentifier():this.getIdentifier();if(t=1===i.length?c.Identifier:this.isKeyword(i)?c.Keyword:i.toLowerCase()===e.Null?c.NullLiteral:i.toLowerCase()===e.True||i.toLowerCase()===e.False?c.BooleanLiteral:c.Identifier,t!==c.Identifier&&u+i.length!==this.index){const e=this.index;this.index=u,this.tolerateUnexpectedToken(d.InvalidEscapedReservedWord),this.index=e}return{type:t,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}scanPunctuator(){const e=this.index;let t=this.source[this.index]??"";switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let e=U.length;e>0;e--)if(t=this.source.substring(this.index,this.index+e),U[e-1]?.includes(t)){this.index+=e;break}}return this.index===e&&this.throwUnexpectedToken(),{type:c.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&L.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return 0===t.length&&this.throwUnexpectedToken(),L.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){const e=this.source[this.index];if("0"!==e&&"1"!==e)break;t+=this.source[this.index],this.index+=1}if(0===t.length&&this.throwUnexpectedToken(),!this.eof()){const e=this.source.charCodeAt(this.index);(L.isIdentifierStart(e)||L.isDecimalDigit(e))&&this.throwUnexpectedToken()}return{type:c.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let u="",i=!1;for(L.isOctalDigit(e.charCodeAt(0))&&(i=!0,u=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;return!i&&0===u.length&&this.throwUnexpectedToken(),(L.isIdentifierStart(this.source.charCodeAt(this.index))||L.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseInt(u,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){const e=this.index;let t=this.source[e]??"";T(L.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");let u="";if("."!==t){if(u=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"","0"===u){if("x"===t||"X"===t)return this.index+=1,this.scanHexLiteral(e);if("b"===t||"B"===t)return this.index+=1,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e)}for(;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("."===t){for(u+=this.source[this.index],this.index+=1;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("e"===t||"E"===t)if(u+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",("+"===t||"-"===t)&&(u+=this.source[this.index],this.index+=1),L.isDecimalDigit(this.source.charCodeAt(this.index)))for(;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return L.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseFloat(u),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let t=this.source[e];T("'"===t||'"'===t,"String literal must starts with a quote"),this.index+=1;let u=!1,i="";for(;!this.eof();){let e=this.source[this.index]??"";if(this.index+=1,e===t){t="";break}if("\\"===e)if(e=this.source[this.index]??"",this.index+=1,e&&L.isLineTerminator(e.charCodeAt(0)))this.lineNumber+=1,"\r"===e&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(e){case"u":if("{"===this.source[this.index])this.index+=1,i+=this.scanUnicodeCodePointEscape();else{const t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(),i+=t}break;case"x":{const t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(d.InvalidHexEscapeSequence),i+=t;break}case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;case"8":case"9":i+=e,this.tolerateUnexpectedToken();break;default:if(e&&L.isOctalDigit(e.charCodeAt(0))){const t=this.octalToDecimal(e);u=t.octal||u,i+=String.fromCharCode(t.code)}else i+=e}else{if(L.isLineTerminator(e.charCodeAt(0)))break;i+=e}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:c.StringLiteral,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1;const u=this.index,i="`"===this.source[u];let n=!1,r=2;for(this.index+=1;!this.eof();){let u=this.source[this.index]??"";if(this.index+=1,"`"===u){r=1,n=!0,t=!0;break}if("$"!==u)if("\\"!==u)L.isLineTerminator(u.charCodeAt(0))?(this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index,e+="\n"):e+=u;else if(u=this.source[this.index]??"",this.index+=1,L.isLineTerminator(u.charCodeAt(0)))this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])this.index+=1,e+=this.scanUnicodeCodePointEscape();else{const t=this.index,i=this.scanHexEscape(u);null!==i?e+=i:(this.index=t,e+=u)}break;case"x":{const t=this.scanHexEscape(u);null===t&&this.throwUnexpectedToken(d.InvalidHexEscapeSequence),e+=t;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(L.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(d.TemplateOctalLiteral),e+="\0"):L.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(d.TemplateOctalLiteral):e+=u}else{if("{"===this.source[this.index]){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=u}}return t||this.throwUnexpectedToken(),i||this.curlyStack.pop(),{type:c.Template,value:this.source.slice(u+1,this.index-r),cooked:e,head:i,tail:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}lex(){if(this.eof())return{type:c.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return L.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?L.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():L.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&L.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}}const M={None:0,Function:1,IfClause:2,ForLoop:4,ForOfLoop:8,WhileLoop:16},O={AsObject:0,Automatic:1};function R(e,t=0){let u=e.start-e.lineStart,i=e.lineNumber;return u<0&&(u+=t,i-=1),{index:e.start,line:i,column:u}}function z(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function K(e){return e in h?h[e]:0}class H{constructor(e,t={},u){this.delegate=u,this.hasLineTerminator=!1,this.options={tokens:"boolean"==typeof t.tokens&&t.tokens,comments:"boolean"==typeof t.comments&&t.comments,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.options.comments&&(this.commentHandler=new S),this.errorHandler=new I(this.options.tolerant),this.scanner=new P(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:M.None,curlyParsingType:O.AsObject},this.rawToken={type:c.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:u,invalidTypes:i}){u?.some(t=>e.type===t)||i?.some(t=>e.type===t)&&this.throwError(d.InvalidExpression,t)}throwError(e,t,u=this.endMarker){const{index:i,line:n,column:r}=t,s=u.index-i-1;this.errorHandler.throwError({code:e,index:i,line:n,column:r+1,len:s})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:t}=e;let u,{code:i,data:n}=e;if(t){if(!i)switch(t.type){case c.EOF:i=d.UnexpectedEndOfScript;break;case c.Identifier:i=d.UnexpectedIdentifier;break;case c.NumericLiteral:i=d.UnexpectedNumber;break;case c.StringLiteral:i=d.UnexpectedString;break;case c.Template:i=d.UnexpectedTemplate}u=t.value.toString()}else u="ILLEGAL";i??=d.UnexpectedToken,n??={value:u};const r=y(i,n);if(t){const e=t.start,u=t.lineNumber,s=t.start-t.lineStart+1;return new F({code:i,index:e,line:u,column:s,len:t.end-t.start-1,data:n,description:r})}const{index:s,line:a}=this.endMarker;return new F({code:i,index:s,line:a,column:this.endMarker.column+1,data:n,description:r})}throwUnexpectedToken(e={}){throw e.rawToken??=this.rawToken,this.unexpectedTokenError(e)}collectComments(e){const{commentHandler:t}=this;!t||!e.length||e.forEach(e=>{const u={type:e.multiLine?i.BlockComment:i.LineComment,value:this.getSourceValue(e),range:e.range,loc:e.loc};t.collectComment(u)})}peekAhead(e){const t=()=>(this.scanner.scanComments(),this.scanner.lex()),u=this.scanner.saveState(),i=e.call(this,t);return this.scanner.restoreState(u),i}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:l[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==c.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){const t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:d.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==c.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==c.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===c.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===c.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===c.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if("string"==typeof e&&(e=e.split("")),this.rawToken.type===c.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const u=e.call(this);return this.context.isAssignmentTarget=t,u}inheritCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const u=e.call(this);return this.context.isAssignmentTarget&&=t,u}withBlockContext(e,t){const u=this.context.blockContext;this.context.blockContext|=e;const i=this.context.curlyParsingType;this.context.curlyParsingType=O.Automatic;const n=t.call(this);return this.context.blockContext=u,this.context.curlyParsingType=i,n}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===c.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){const t=this.captureStartMarker(),u=this.rawToken;switch(u.type){case c.Identifier:return this.readNextRawToken(),this.finalize({type:i.Identifier,name:u.value,...this.getItemLocation(t)});case c.NumericLiteral:case c.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:u.value,raw:this.getSourceValue(u),isString:"string"==typeof u.value,...this.getItemLocation(t)});case c.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:u.value.toLowerCase()===e.True,raw:this.getSourceValue(u),isString:!1,...this.getItemLocation(t)});case c.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:null,raw:this.getSourceValue(u),isString:!1,...this.getItemLocation(t)});case c.Template:return this.parseTemplateLiteral();case c.Punctuator:switch(u.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case c.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const e=this.captureStartMarker();this.expectPunctuator("[");const t=[];for(;!this.matchPunctuator("]");){const e=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(d.InvalidExpression,e)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:i.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case c.StringLiteral:return this.readNextRawToken(),this.finalize({type:i.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case c.Identifier:case c.BooleanLiteral:case c.NullLiteral:case c.Keyword:return this.readNextRawToken(),this.finalize({type:i.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(d.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,t=this.captureStartMarker(),u=this.parseObjectPropertyKey();let n=!1,r=null;return this.matchPunctuator(":")?(this.readNextRawToken(),r=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===c.Identifier?(n=!0,r=this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:i.Property,kind:"init",key:u,value:r,shorthand:n,...this.getItemLocation(t)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:i.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const t=this.rawToken;t.type!==c.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:d.InvalidTemplateHead,rawToken:t});const u=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:r,tail:s}=t,a=this.finalize({type:i.TemplateElement,value:{raw:n,cooked:r},tail:s,...this.getItemLocation(u)});return a.loc.start.column+=1,a.loc.end.column-=s?1:2,a}parseTemplateLiteral(){const e=this.captureStartMarker(),t=[],u=[];let n=this.parseTemplateElement(!0);for(u.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),u.push(n);return this.finalize({type:i.TemplateLiteral,quasis:u,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");const e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");const e=[];if(!this.matchPunctuator(")"))for(;;){const t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==c.NullLiteral&&e.type!==c.Identifier&&e.type!==c.Keyword&&e.type!==c.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let t=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this));const u=this.captureStartMarker();let n,r=!1;for(;n=this.getMatchingPunctuator(["(","[",".",D]);){let s=!1;switch(n===D&&(r=!0,s=!0,this.expectPunctuator(D),n=this.getMatchingPunctuator("[")?"[":"."),n){case"(":{this.context.isAssignmentTarget=!1,t.type!==i.Identifier&&t.type!==i.MemberExpression&&t.type!==i.SafeMemberExpression&&this.throwError(d.IdentifierExpected,e,u);const n=this.parseArguments();t=this.finalize({type:i.CallExpression,callee:t,arguments:n,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!s,this.expectPunctuator("[");const u=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),t=this.finalize({type:s?i.SafeMemberExpression:i.MemberExpression,computed:!0,object:t,property:u,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!s,s||this.expectPunctuator(".");const u=this.parseMemberName();t=this.finalize({type:s?i.SafeMemberExpression:i.MemberExpression,computed:!1,object:t,property:u,...this.getItemLocation(e)});continue}}}return r?this.finalize({type:i.MemberAccessChainExpression,expression:t,...this.getItemLocation(e)}):t}parseUpdateExpression(){const e=this.captureStartMarker();let t=this.getMatchingPunctuator(n);if(t){this.readNextRawToken();const u=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return n.type!==i.Identifier&&n.type!==i.MemberExpression&&n.type!==i.CallExpression&&this.throwError(d.InvalidExpression,u),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:i.UpdateExpression,operator:t,argument:n,prefix:!0,...this.getItemLocation(e)})}const u=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),s=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(n),!t)?r:(r.type!==i.Identifier&&r.type!==i.MemberExpression&&this.throwError(d.InvalidExpression,u,s),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:i.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){const e=this.getMatchingPunctuator(r);if(e){const t=this.captureStartMarker();this.readNextRawToken();const u=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:i.UnaryExpression,operator:e,argument:u,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==c.Punctuator)return t;const u=this.rawToken.value;let i=K(u);if(0===i)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const n=[e,this.rawToken];let r=t,s=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));const a=[r,u,s],o=[i];for(;this.rawToken.type===c.Punctuator&&(i=K(this.rawToken.value))>0;){for(;a.length>2&&i<=o[o.length-1];){s=a.pop();const e=a.pop();o.pop(),r=a.pop(),n.pop();const t=n[n.length-1],u=R(t,t.lineStart);a.push(this.finalize(this.createBinaryOrLogicalExpression(u,e,r,s)))}a.push(this.rawToken.value),o.push(i),n.push(this.rawToken),this.readNextRawToken(),a.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let D=a.length-1;t=a[D];let h=n.pop();for(;D>1;){const e=n.pop();if(!e)break;const u=h?.lineStart,i=R(e,u),r=a[D-1];t=this.finalize(this.createBinaryOrLogicalExpression(i,r,a[D-2],t)),D-=2,h=e}return t}createBinaryOrLogicalExpression(e,t,u,n){return a.includes(t)?((u.type===i.AssignmentExpression||u.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,...z(u)),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,...z(u)),{type:i.LogicalExpression,operator:t,left:u,right:n,...this.getItemLocation(e)}):{type:i.BinaryExpression,operator:t,left:u,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),u=this.captureStartMarker(),n=this.getMatchingPunctuator(s);if(!n)return t;t.type!==i.Identifier&&t.type!==i.MemberExpression&&this.throwError(d.InvalidExpression,e,u),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const r=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:i.AssignmentExpression,left:t,operator:n,right:r,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){const t=[];for(;this.rawToken.type!==c.EOF&&!this.matchPunctuator(e);){const e=this.parseStatementListItem();m(e)||t.push(e)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(t.Function)?this.parseFunctionDeclaration():this.matchKeyword(t.Export)?this.parseExportDeclaration():this.matchKeyword(t.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:i.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:i.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===O.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==c.Identifier&&t.type!==c.StringLiteral||(t=e(),t.type!==c.Punctuator||":"!==t.value))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==c.Identifier)return null;const t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){const e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:d.IdentifierExpected});let u=null;if(this.matchPunctuator("=")){this.readNextRawToken();const e=this.rawToken;try{u=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:e,code:d.InvalidVariableAssignment})}}return this.finalize({type:i.VariableDeclarator,id:t,init:u,...this.getItemLocation(e)})}parseVariableDeclarators(){const e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){const e=this.captureStartMarker();this.expectKeyword(t.Var);const u=this.parseVariableDeclarators();return this.consumeSemicolon(),this.finalize({type:i.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:i.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:i.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(M.IfClause,this.parseStatement.bind(this))}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword(t.If),this.expectPunctuator("(");const u=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,u,r);const s=this.parseIfClause();let a=null;return this.matchKeyword(t.Else)&&(this.readNextRawToken(),a=this.parseIfClause()),this.finalize({type:i.IfStatement,test:n,consequent:s,alternate:a,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword(t.While),this.expectPunctuator("(");const u=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,u,r);const s=this.withBlockContext(M.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:i.WhileStatement,test:n,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=i.ForStatement,n=null,r=null,s=null,a=null,o=null;const D=this.captureStartMarker();if(this.expectKeyword(t.For),this.expectPunctuator("("),this.matchKeyword(t.Var)){const r=this.captureStartMarker();this.readNextRawToken();const s=this.parseVariableDeclarators();n=this.finalize({type:i.VariableDeclaration,declarations:s,kind:"var",...this.getItemLocation(r)});const o=this.matchKeyword(t.In),D=this.matchContextualKeyword(u.Of);1===s.length&&(o||D)&&(s[0].init&&this.throwError(d.ForInOfLoopInitializer,r),e=o?i.ForInStatement:i.ForOfStatement,a=n)}else if(!this.matchPunctuator(";")){const r=this.context.isAssignmentTarget,s=this.captureStartMarker();n=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));const o=this.matchKeyword(t.In),D=this.matchContextualKeyword(u.Of);o||D?(this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInForIn,s),n.type!==i.Identifier&&this.throwError(d.InvalidLeftHandSideInForIn,s),e=o?i.ForInStatement:i.ForOfStatement,a=n):this.context.isAssignmentTarget=r}e===i.ForStatement?(this.expectPunctuator(";"),r=this.matchPunctuator(";")?null:this.isolateCoverGrammar(this.parseExpression.bind(this)),this.expectPunctuator(";"),s=this.matchPunctuator(")")?null:this.isolateCoverGrammar(this.parseExpression.bind(this))):(this.readNextRawToken(),o=this.parseExpression()),this.expectPunctuator(")");const h=this.withBlockContext(e===i.ForOfStatement?M.ForOfLoop:M.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return e===i.ForInStatement||e===i.ForOfStatement?this.finalize({type:e,left:a,right:o,body:h,...this.getItemLocation(D)}):this.finalize({type:e,init:n,test:r,update:s,body:h,...this.getItemLocation(D)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword(t.Continue),this.consumeSemicolon(),this.finalize({type:i.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword(t.Break),this.consumeSemicolon(),this.finalize({type:i.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword(t.Return);const u=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===c.EOF)&&this.rawToken.type!==c.StringLiteral&&this.rawToken.type!==c.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:i.ReturnStatement,argument:u,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case c.BooleanLiteral:case c.NullLiteral:case c.NumericLiteral:case c.StringLiteral:case c.Template:case c.Identifier:return this.parseExpressionStatement();case c.Punctuator:return"{"===this.rawToken.value?this.parseBlockOrObjectStatement():"("===this.rawToken.value?this.parseExpressionStatement():";"===this.rawToken.value?this.parseEmptyStatement():this.parseExpressionStatement();case c.Keyword:switch(this.rawToken.value.toLowerCase()){case t.Break:return this.parseBreakStatement();case t.Continue:return this.parseContinueStatement();case t.For:return this.parseForStatement();case t.Function:return this.parseFunctionDeclaration();case t.If:return this.parseIfStatement();case t.Return:return this.parseReturnStatement();case t.Var:return this.parseVariableDeclaration();case t.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==c.EOF;){const t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:d.IdentifierExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&M.Function)===M.Function&&this.throwUnexpectedToken({code:d.NoFunctionInsideFunction}),((this.context.blockContext&M.WhileLoop)===M.WhileLoop||(this.context.blockContext&M.ForOfLoop)===M.ForOfLoop||(this.context.blockContext&M.IfClause)===M.IfClause)&&this.throwUnexpectedToken({code:d.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword(t.Function);const u=this.parseIdentifier();u||this.throwUnexpectedToken({code:d.InvalidFunctionIdentifier});const n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=M.Function;const s=this.parseBlock();return this.context.blockContext=r,this.finalize({type:i.FunctionDeclaration,id:u,params:n,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),t=this.parseStatements(),u=this.finalize({type:i.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(u.tokens=this.tokens),this.options.tolerant&&(u.errors=this.errorHandler.errors),u}parseExportDeclaration(){this.context.blockContext!==M.None&&this.throwUnexpectedToken({code:d.ModuleExportRootOnly});let e=null;const u=this.captureStartMarker();return this.expectKeyword(t.Export),this.matchKeyword(t.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:d.InvalidExpression}),this.finalize({type:i.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(u)})}parseModuleSpecifier(){const e=this.captureStartMarker(),t=this.rawToken;if(t.type===c.StringLiteral)return this.readNextRawToken(),this.finalize({type:i.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(d.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:d.IdentifierExpected}),this.finalize({type:i.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==M.None&&this.throwUnexpectedToken({code:d.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword(t.Import);const n=this.parseDefaultSpecifier();this.expectContextualKeyword(u.From);const r=this.parseModuleSpecifier();return this.finalize({type:i.ImportDeclaration,specifiers:[n],source:r,...this.getItemLocation(e)})}}function V(e,t,u){return new H(e,t,u).parseScript()}export{E as O,B as S,d as a,m as b,C as e,x as f,i,V as j,t as l,F as y};
|
|
2
|
+
const e={False:"false",Null:"null",True:"true"},t={Break:"break",Continue:"continue",Else:"else",For:"for",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},u={From:"from",Of:"of"},i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberAccessChainExpression:"MemberAccessChainExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SafeMemberExpression:"SafeMemberExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},n=["++","--"],r=["-","+","!","~"],s=["=","/=","*=","%=","+=","-="],a=["||","&&"],o=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],D="?.",h={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},c={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},l=["Unknown","Boolean","<end>","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],d={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentifierExpected:"IdentifierExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},C={[d.InvalidModuleUri]:"Module uri must be a text literal.",[d.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[d.IdentifierExpected]:"'${value}' is an invalid identifier.",[d.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[d.InvalidExpression]:"Invalid expression.",[d.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[d.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[d.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[d.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[d.InvalidTemplateHead]:"Invalid template structure.",[d.InvalidVariableAssignment]:"Invalid variable assignment.",[d.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[d.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[d.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[d.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[d.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[d.PunctuatorExpected]:"'${value}' expected.",[d.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[d.UnexpectedBoolean]:"Unexpected boolean literal.",[d.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[d.UnexpectedIdentifier]:"Unexpected identifier.",[d.UnexpectedKeyword]:"Unexpected keyword.",[d.UnexpectedNull]:"Unexpected null literal.",[d.UnexpectedNumber]:"Unexpected number.",[d.UnexpectedPunctuator]:"Unexpected punctuator.",[d.UnexpectedString]:"Unexpected text literal.",[d.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[d.UnexpectedToken]:"Unexpected token '${value}'."};class F extends Error{constructor({code:e,index:t,line:u,column:i,len:n=0,description:r,data:s}){super(r??e),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=e,this.index=t,this.line=u,this.column=i,this.len=n,this.data=s,this.description=r,this.range={start:{line:u,column:i-1},end:{line:u,column:i+n}},Error.captureStackTrace?.(this,F)}}function p(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.Program}function E(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.BlockStatement}function A(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.BlockComment}function m(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.EmptyStatement}function x(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.VariableDeclaration}function B(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.Identifier}function f(e){return!!e&&"object"==typeof e&&"type"in e&&e.type===i.VariableDeclarator}function k(e,t){return t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function g(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}class S{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!E(e)||0!==e.body.length)return;const t=[];for(let u=this._newComments.length-1;u>=0;u--){const i=this._newComments[u];e.range[1]>=i.range[0]&&(t.unshift(i),this._newComments.splice(u,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){const t=this._nodeStack.at(-1);if(!t)return;if(E(e)&&g(t,e))for(let i=this._newComments.length-1;i>=0;i--){const u=this._newComments[i];g(u,e)&&(t.trailingComments=[...t.trailingComments??[],u],this._newComments.splice(i,1))}let u=[];if(this._newComments.length>0)for(let i=this._newComments.length-1;i>=0;i--){const n=this._newComments[i];k(n,t)?(t.trailingComments=[...t.trailingComments??[],n],this._newComments.splice(i,1)):k(n,e)&&(u.unshift(n),this._newComments.splice(i,1))}if(t.trailingComments){k(t.trailingComments[0],e)&&(u=[...u,...t.trailingComments],delete t.trailingComments)}u.length>0&&(e.trailingComments=u)}attachLeadingComments(e){let t;for(;this._nodeStack.length>0;){const u=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=u.range[0]))break;t=u,this._nodeStack.pop()}const u=[],i=[];if(null!=t){if(!t.leadingComments)return;for(let n=t.leadingComments.length-1;n>=0;n--){const r=t.leadingComments[n];e.range[0]>=r.range[1]?(u.unshift(r),t.leadingComments.splice(n,1)):f(e)&&!A(r)&&(i.unshift(r),t.leadingComments.splice(n,1))}return 0===t.leadingComments.length&&delete t.leadingComments,u.length&&(e.leadingComments=u),void(i.length&&(e.trailingComments=[...i,...e.trailingComments??[]]))}for(let n=this._newComments.length-1;n>=0;n--){const t=this._newComments[n];e.range[0]>=t.range[0]&&(u.unshift(t),this._newComments.splice(n,1))}u.length&&(e.leadingComments=u)}attachComments(e){if(p(e)&&e.body.length>0){const t=this._nodeStack.at(-1);return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}}const w=/\$\{(.*?)\}/gu;function y(e,t){const u=C[e];return t?u.replace(w,(e,u)=>t[u]?.toString()??""):u}class I{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description??=y(e.code,e.data),new F(e)}tolerateError(e){e.description??=y(e.code,e.data);const t=new F(e);if(!this.tolerant)throw t;this.recordError(t)}}function T(e,t){if(!e)throw new Error(`ASSERT: ${t}`)}const b={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u},L={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>10===e||13===e||8232===e||8233===e,isIdentifierStart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&b.NonAsciiIdentifierStart.test(L.fromCodePoint(e)),isIdentifierPart:e=>36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&b.NonAsciiIdentifierPart.test(L.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function v(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function N(e){return"01234567".indexOf(e)}const U=[[],[],[]];n.forEach(e=>U[e.length-1].push(e)),r.forEach(e=>U[e.length-1].push(e)),a.forEach(e=>U[e.length-1].push(e)),s.forEach(e=>U[e.length-1].push(e)),o.forEach(e=>U[e.length-1].push(e)),U[D.length-1].push(D);class P{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=d.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(e=d.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const t=[],u=this.index-e,i={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(this.index+=1,L.isLineTerminator(n)){i.end={line:this.lineNumber,column:this.index-this.lineStart-1};const r={multiLine:!1,start:u+e,end:this.index-1,range:[u,this.index-1],loc:i};return t.push(r),13===n&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,t}}i.end={line:this.lineNumber,column:this.index-this.lineStart};const n={multiLine:!1,start:u+e,end:this.index,range:[u,this.index],loc:i};return t.push(n),t}skipMultiLineComment(){const e=[],t=this.index-2,u={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(L.isLineTerminator(i))13===i&&10===this.source.charCodeAt(this.index+1)&&(this.index+=1),this.lineNumber+=1,this.index+=1,this.lineStart=this.index;else if(42===i){if(47===this.source.charCodeAt(this.index+1)){this.index+=2,u.end={line:this.lineNumber,column:this.index-this.lineStart};const i={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:u};return e.push(i),e}this.index+=1}else this.index+=1}u.end={line:this.lineNumber,column:this.index-this.lineStart};const i={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:u};return e.push(i),this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(L.isWhiteSpace(t))this.index+=1;else if(L.isLineTerminator(t))this.index+=1,13===t&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else{if(47!==t)break;if(t=this.source.charCodeAt(this.index+1),47===t){this.index+=2;const t=this.skipSingleLineComment(2);e=[...e,...t]}else{if(42!==t)break;{this.index+=2;const t=this.skipMultiLineComment();e=[...e,...t]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===t.If||e===t.In;case 3:return e===t.Var||e===t.For;case 4:return e===t.Else;case 5:return e===t.Break||e===t.While;case 6:return e===t.Return||e===t.Import||e===t.Export;case 8:return e===t.Function||e===t.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const u=this.source.charCodeAt(e+1);u>=56320&&u<=57343&&(t=1024*(t-55296)+u-56320+65536)}return t}scanHexEscape(e){const t="u"===e?4:2;let u=0;for(let i=0;i<t;i++){if(this.eof()||!L.isHexDigit(this.source.charCodeAt(this.index)))return null;u=16*u+v(this.source[this.index]??""),this.index+=1}return String.fromCharCode(u)}scanUnicodeCodePointEscape(){let e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index]??"",this.index+=1,L.isHexDigit(e.charCodeAt(0)));)t=16*t+v(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),L.fromCodePoint(t)}getIdentifier(){const e=this.index;for(this.index+=1;!this.eof();){const t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!L.isIdentifierPart(t))break;this.index+=1}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),u=L.fromCodePoint(t);for(this.index+=u.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!L.isIdentifierStart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u=e);!this.eof()&&(t=this.codePointAt(this.index),L.isIdentifierPart(t));)e=L.fromCodePoint(t),u+=e,this.index+=e.length,92===t&&(u=u.substring(0,u.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),(null===e||"\\"===e||!L.isIdentifierPart(e.charCodeAt(0)))&&this.throwUnexpectedToken()),u+=e);return u}octalToDecimal(e){let t="0"!==e,u=N(e);return!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,u=8*u+N(this.source[this.index]??""),this.index+=1,"0123".includes(e)&&!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index))&&(u=8*u+N(this.source[this.index]??""),this.index+=1)),{code:u,octal:t}}scanIdentifier(){let t;const u=this.index,i=92===this.source.charCodeAt(u)?this.getComplexIdentifier():this.getIdentifier();if(t=1===i.length?c.Identifier:this.isKeyword(i)?c.Keyword:i.toLowerCase()===e.Null?c.NullLiteral:i.toLowerCase()===e.True||i.toLowerCase()===e.False?c.BooleanLiteral:c.Identifier,t!==c.Identifier&&u+i.length!==this.index){const e=this.index;this.index=u,this.tolerateUnexpectedToken(d.InvalidEscapedReservedWord),this.index=e}return{type:t,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}scanPunctuator(){const e=this.index;let t=this.source[this.index]??"";switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),this.index+=1;break;case".":case")":case";":case",":case"[":case"]":case":":case"~":this.index+=1;break;case"}":this.index+=1,this.curlyStack.pop();break;default:for(let e=U.length;e>0;e--)if(t=this.source.substring(this.index,this.index+e),U[e-1]?.includes(t)){this.index+=e;break}}return this.index===e&&this.throwUnexpectedToken(),{type:c.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&L.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index],this.index+=1;return 0===t.length&&this.throwUnexpectedToken(),L.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseInt(`0x${t}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){const e=this.source[this.index];if("0"!==e&&"1"!==e)break;t+=this.source[this.index],this.index+=1}if(0===t.length&&this.throwUnexpectedToken(),!this.eof()){const e=this.source.charCodeAt(this.index);(L.isIdentifierStart(e)||L.isDecimalDigit(e))&&this.throwUnexpectedToken()}return{type:c.NumericLiteral,value:Number.parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let u="",i=!1;for(L.isOctalDigit(e.charCodeAt(0))&&(i=!0,u=`0${this.source[this.index]}`),this.index+=1;!this.eof()&&L.isOctalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;return!i&&0===u.length&&this.throwUnexpectedToken(),(L.isIdentifierStart(this.source.charCodeAt(this.index))||L.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseInt(u,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){const e=this.index;let t=this.source[e]??"";T(L.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");let u="";if("."!==t){if(u=this.source[this.index]??"",this.index+=1,t=this.source[this.index]??"","0"===u){if("x"===t||"X"===t)return this.index+=1,this.scanHexLiteral(e);if("b"===t||"B"===t)return this.index+=1,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e)}for(;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("."===t){for(u+=this.source[this.index],this.index+=1;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;t=this.source[this.index]??""}if("e"===t||"E"===t)if(u+=this.source[this.index],this.index+=1,t=this.source[this.index]??"",("+"===t||"-"===t)&&(u+=this.source[this.index],this.index+=1),L.isDecimalDigit(this.source.charCodeAt(this.index)))for(;L.isDecimalDigit(this.source.charCodeAt(this.index));)u+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken();return L.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:c.NumericLiteral,value:Number.parseFloat(u),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let t=this.source[e];T("'"===t||'"'===t,"String literal must starts with a quote"),this.index+=1;let u=!1,i="";for(;!this.eof();){let e=this.source[this.index]??"";if(this.index+=1,e===t){t="";break}if("\\"===e)if(e=this.source[this.index]??"",this.index+=1,e&&L.isLineTerminator(e.charCodeAt(0)))this.lineNumber+=1,"\r"===e&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(e){case"u":if("{"===this.source[this.index])this.index+=1,i+=this.scanUnicodeCodePointEscape();else{const t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(),i+=t}break;case"x":{const t=this.scanHexEscape(e);null===t&&this.throwUnexpectedToken(d.InvalidHexEscapeSequence),i+=t;break}case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;case"8":case"9":i+=e,this.tolerateUnexpectedToken();break;default:if(e&&L.isOctalDigit(e.charCodeAt(0))){const t=this.octalToDecimal(e);u=t.octal||u,i+=String.fromCharCode(t.code)}else i+=e}else{if(L.isLineTerminator(e.charCodeAt(0)))break;i+=e}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:c.StringLiteral,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1;const u=this.index,i="`"===this.source[u];let n=!1,r=2;for(this.index+=1;!this.eof();){let u=this.source[this.index]??"";if(this.index+=1,"`"===u){r=1,n=!0,t=!0;break}if("$"!==u)if("\\"!==u)L.isLineTerminator(u.charCodeAt(0))?(this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index,e+="\n"):e+=u;else if(u=this.source[this.index]??"",this.index+=1,L.isLineTerminator(u.charCodeAt(0)))this.lineNumber+=1,"\r"===u&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(u){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])this.index+=1,e+=this.scanUnicodeCodePointEscape();else{const t=this.index,i=this.scanHexEscape(u);null!==i?e+=i:(this.index=t,e+=u)}break;case"x":{const t=this.scanHexEscape(u);null===t&&this.throwUnexpectedToken(d.InvalidHexEscapeSequence),e+=t;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===u?(L.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(d.TemplateOctalLiteral),e+="\0"):L.isOctalDigit(u.charCodeAt(0))?this.throwUnexpectedToken(d.TemplateOctalLiteral):e+=u}else{if("{"===this.source[this.index]){this.curlyStack.push("${"),this.index+=1,t=!0;break}e+=u}}return t||this.throwUnexpectedToken(),i||this.curlyStack.pop(),{type:c.Template,value:this.source.slice(u+1,this.index-r),cooked:e,head:i,tail:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:u,end:this.index}}lex(){if(this.eof())return{type:c.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return L.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?L.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():L.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&L.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}}const M={None:0,Function:1,IfClause:2,ForLoop:4,ForOfLoop:8,WhileLoop:16},O={AsObject:0,Automatic:1};function R(e,t=0){let u=e.start-e.lineStart,i=e.lineNumber;return u<0&&(u+=t,i-=1),{index:e.start,line:i,column:u}}function z(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function K(e){return e in h?h[e]:0}class H{constructor(e,t={},u){this.delegate=u,this.hasLineTerminator=!1,this.options={tokens:"boolean"==typeof t.tokens&&t.tokens,comments:"boolean"==typeof t.comments&&t.comments,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.options.comments&&(this.commentHandler=new S),this.errorHandler=new I(this.options.tolerant),this.scanner=new P(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:M.None,curlyParsingType:O.AsObject},this.rawToken={type:c.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:u,invalidTypes:i}){u?.some(t=>e.type===t)||i?.some(t=>e.type===t)&&this.throwError(d.InvalidExpression,t)}throwError(e,t,u=this.endMarker){const{index:i,line:n,column:r}=t,s=u.index-i-1;this.errorHandler.throwError({code:e,index:i,line:n,column:r+1,len:s})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:t}=e;let u,{code:i,data:n}=e;if(t){if(!i)switch(t.type){case c.EOF:i=d.UnexpectedEndOfScript;break;case c.Identifier:i=d.UnexpectedIdentifier;break;case c.NumericLiteral:i=d.UnexpectedNumber;break;case c.StringLiteral:i=d.UnexpectedString;break;case c.Template:i=d.UnexpectedTemplate}u=t.value.toString()}else u="ILLEGAL";i??=d.UnexpectedToken,n??={value:u};const r=y(i,n);if(t){const e=t.start,u=t.lineNumber,s=t.start-t.lineStart+1;return new F({code:i,index:e,line:u,column:s,len:t.end-t.start-1,data:n,description:r})}const{index:s,line:a}=this.endMarker;return new F({code:i,index:s,line:a,column:this.endMarker.column+1,data:n,description:r})}throwUnexpectedToken(e={}){throw e.rawToken??=this.rawToken,this.unexpectedTokenError(e)}collectComments(e){const{commentHandler:t}=this;!t||!e.length||e.forEach(e=>{const u={type:e.multiLine?i.BlockComment:i.LineComment,value:this.getSourceValue(e),range:e.range,loc:e.loc};t.collectComment(u)})}peekAhead(e){const t=()=>(this.scanner.scanComments(),this.scanner.lex()),u=this.scanner.saveState(),i=e.call(this,t);return this.scanner.restoreState(u),i}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:l[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==c.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate??this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){const t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:d.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==c.Keyword||this.rawToken.value.toLowerCase()!==e.toString()?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==c.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===c.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===c.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===c.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if("string"==typeof e&&(e=e.split("")),this.rawToken.type===c.Punctuator&&e.length)return e.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const u=e.call(this);return this.context.isAssignmentTarget=t,u}inheritCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const u=e.call(this);return this.context.isAssignmentTarget&&=t,u}withBlockContext(e,t){const u=this.context.blockContext;this.context.blockContext|=e;const i=this.context.curlyParsingType;this.context.curlyParsingType=O.Automatic;const n=t.call(this);return this.context.blockContext=u,this.context.curlyParsingType=i,n}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator){if(this.rawToken.type===c.EOF||this.matchPunctuator("}"))return this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column);this.throwUnexpectedToken({rawToken:this.rawToken})}}parsePrimaryExpression(){const t=this.captureStartMarker(),u=this.rawToken;switch(u.type){case c.Identifier:return this.readNextRawToken(),this.finalize({type:i.Identifier,name:u.value,...this.getItemLocation(t)});case c.NumericLiteral:case c.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:u.value,raw:this.getSourceValue(u),isString:"string"==typeof u.value,...this.getItemLocation(t)});case c.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:u.value.toLowerCase()===e.True,raw:this.getSourceValue(u),isString:!1,...this.getItemLocation(t)});case c.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:i.Literal,value:null,raw:this.getSourceValue(u),isString:!1,...this.getItemLocation(t)});case c.Template:return this.parseTemplateLiteral();case c.Punctuator:switch(u.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case"[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case"{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case c.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const e=this.captureStartMarker();this.expectPunctuator("[");const t=[];for(;!this.matchPunctuator("]");){const e=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(d.InvalidExpression,e)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:i.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case c.StringLiteral:return this.readNextRawToken(),this.finalize({type:i.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case c.Identifier:case c.BooleanLiteral:case c.NullLiteral:case c.Keyword:return this.readNextRawToken(),this.finalize({type:i.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(d.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,t=this.captureStartMarker(),u=this.parseObjectPropertyKey();let n=!1,r=null;return this.matchPunctuator(":")?(this.readNextRawToken(),r=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):e.type===c.Identifier?(n=!0,r=this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:i.Property,kind:"init",key:u,value:r,shorthand:n,...this.getItemLocation(t)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:i.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const t=this.rawToken;t.type!==c.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:d.InvalidTemplateHead,rawToken:t});const u=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:r,tail:s}=t,a=this.finalize({type:i.TemplateElement,value:{raw:n,cooked:r},tail:s,...this.getItemLocation(u)});return a.loc.start.column+=1,a.loc.end.column-=s?1:2,a}parseTemplateLiteral(){const e=this.captureStartMarker(),t=[],u=[];let n=this.parseTemplateElement(!0);for(u.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),u.push(n);return this.finalize({type:i.TemplateLiteral,quasis:u,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");const e=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");const e=[];if(!this.matchPunctuator(")"))for(;;){const t=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==c.NullLiteral&&e.type!==c.Identifier&&e.type!==c.Keyword&&e.type!==c.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let t,u=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),n=!1;for(;t=this.getMatchingPunctuator(["(","[",".",D]);){let r=!1;switch(t===D&&(n=!0,r=!0,this.expectPunctuator(D),t=this.getMatchingPunctuator("[")?"[":"."),t){case"(":{this.context.isAssignmentTarget=!1;const t=this.parseArguments();u=this.finalize({type:i.CallExpression,callee:u,arguments:t,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!r,this.expectPunctuator("[");const t=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]"),u=this.finalize({type:r?i.SafeMemberExpression:i.MemberExpression,computed:!0,object:u,property:t,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!r,r||this.expectPunctuator(".");const t=this.parseMemberName();u=this.finalize({type:r?i.SafeMemberExpression:i.MemberExpression,computed:!1,object:u,property:t,...this.getItemLocation(e)});continue}}}return n?this.finalize({type:i.MemberAccessChainExpression,expression:u,...this.getItemLocation(e)}):u}parseUpdateExpression(){const e=this.captureStartMarker();let t=this.getMatchingPunctuator(n);if(t){this.readNextRawToken();const u=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return n.type!==i.Identifier&&n.type!==i.MemberExpression&&n.type!==i.CallExpression&&this.throwError(d.InvalidExpression,u),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:i.UpdateExpression,operator:t,argument:n,prefix:!0,...this.getItemLocation(e)})}const u=this.captureStartMarker(),r=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this)),s=this.captureStartMarker();return this.hasLineTerminator||(t=this.getMatchingPunctuator(n),!t)?r:(r.type!==i.Identifier&&r.type!==i.MemberExpression&&this.throwError(d.InvalidExpression,u,s),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:i.UpdateExpression,operator:t,argument:r,prefix:!1,...this.getItemLocation(e)}))}parseUnaryExpression(){const e=this.getMatchingPunctuator(r);if(e){const t=this.captureStartMarker();this.readNextRawToken();const u=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:i.UnaryExpression,operator:e,argument:u,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let t=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(this.rawToken.type!==c.Punctuator)return t;const u=this.rawToken.value;let i=K(u);if(0===i)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const n=[e,this.rawToken];let r=t,s=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));const a=[r,u,s],o=[i];for(;this.rawToken.type===c.Punctuator&&(i=K(this.rawToken.value))>0;){for(;a.length>2&&i<=o[o.length-1];){s=a.pop();const e=a.pop();o.pop(),r=a.pop(),n.pop();const t=n[n.length-1],u=R(t,t.lineStart);a.push(this.finalize(this.createBinaryOrLogicalExpression(u,e,r,s)))}a.push(this.rawToken.value),o.push(i),n.push(this.rawToken),this.readNextRawToken(),a.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}let D=a.length-1;t=a[D];let h=n.pop();for(;D>1;){const e=n.pop();if(!e)break;const u=h?.lineStart,i=R(e,u),r=a[D-1];t=this.finalize(this.createBinaryOrLogicalExpression(i,r,a[D-2],t)),D-=2,h=e}return t}createBinaryOrLogicalExpression(e,t,u,n){return a.includes(t)?((u.type===i.AssignmentExpression||u.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,...z(u)),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,...z(u)),{type:i.LogicalExpression,operator:t,left:u,right:n,...this.getItemLocation(e)}):{type:i.BinaryExpression,operator:t,left:u,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this)),u=this.captureStartMarker(),n=this.getMatchingPunctuator(s);if(!n)return t;t.type!==i.Identifier&&t.type!==i.MemberExpression&&this.throwError(d.InvalidExpression,e,u),this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const r=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:i.AssignmentExpression,left:t,operator:n,right:r,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(e){const t=[];for(;this.rawToken.type!==c.EOF&&!this.matchPunctuator(e);){const e=this.parseStatementListItem();m(e)||t.push(e)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(t.Function)?this.parseFunctionDeclaration():this.matchKeyword(t.Export)?this.parseExportDeclaration():this.matchKeyword(t.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:i.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:i.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===O.AsObject||this.peekAhead(e=>{let t=e();return!(t.type!==c.Identifier&&t.type!==c.StringLiteral||(t=e(),t.type!==c.Punctuator||":"!==t.value))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==c.Identifier)return null;const t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:i.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){const e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:d.IdentifierExpected});let u=null;if(this.matchPunctuator("=")){this.readNextRawToken();const e=this.rawToken;try{u=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:e,code:d.InvalidVariableAssignment})}}return this.finalize({type:i.VariableDeclarator,id:t,init:u,...this.getItemLocation(e)})}parseVariableDeclarators(){const e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){const e=this.captureStartMarker();this.expectKeyword(t.Var);const u=this.parseVariableDeclarators();return this.consumeSemicolon(),this.finalize({type:i.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:i.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:i.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(M.IfClause,this.parseStatement.bind(this))}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword(t.If),this.expectPunctuator("(");const u=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,u,r);const s=this.parseIfClause();let a=null;return this.matchKeyword(t.Else)&&(this.readNextRawToken(),a=this.parseIfClause()),this.finalize({type:i.IfStatement,test:n,consequent:s,alternate:a,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword(t.While),this.expectPunctuator("(");const u=this.captureStartMarker(),n=this.parseExpression(),r=this.captureStartMarker();this.expectPunctuator(")"),(n.type===i.AssignmentExpression||n.type===i.UpdateExpression)&&this.throwError(d.InvalidExpression,u,r);const s=this.withBlockContext(M.WhileLoop,this.parseStatement.bind(this));return this.finalize({type:i.WhileStatement,test:n,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=i.ForStatement,n=null,r=null,s=null,a=null,o=null;const D=this.captureStartMarker();if(this.expectKeyword(t.For),this.expectPunctuator("("),this.matchKeyword(t.Var)){const r=this.captureStartMarker();this.readNextRawToken();const s=this.parseVariableDeclarators();n=this.finalize({type:i.VariableDeclaration,declarations:s,kind:"var",...this.getItemLocation(r)});const o=this.matchKeyword(t.In),D=this.matchContextualKeyword(u.Of);1===s.length&&(o||D)&&(s[0].init&&this.throwError(d.ForInOfLoopInitializer,r),e=o?i.ForInStatement:i.ForOfStatement,a=n)}else if(!this.matchPunctuator(";")){const r=this.context.isAssignmentTarget,s=this.captureStartMarker();n=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));const o=this.matchKeyword(t.In),D=this.matchContextualKeyword(u.Of);o||D?(this.context.isAssignmentTarget||this.tolerateError(d.InvalidLeftHandSideInForIn,s),n.type!==i.Identifier&&this.throwError(d.InvalidLeftHandSideInForIn,s),e=o?i.ForInStatement:i.ForOfStatement,a=n):this.context.isAssignmentTarget=r}e===i.ForStatement?(this.expectPunctuator(";"),r=this.matchPunctuator(";")?null:this.isolateCoverGrammar(this.parseExpression.bind(this)),this.expectPunctuator(";"),s=this.matchPunctuator(")")?null:this.isolateCoverGrammar(this.parseExpression.bind(this))):(this.readNextRawToken(),o=this.parseExpression()),this.expectPunctuator(")");const h=this.withBlockContext(e===i.ForOfStatement?M.ForOfLoop:M.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return e===i.ForInStatement||e===i.ForOfStatement?this.finalize({type:e,left:a,right:o,body:h,...this.getItemLocation(D)}):this.finalize({type:e,init:n,test:r,update:s,body:h,...this.getItemLocation(D)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword(t.Continue),this.consumeSemicolon(),this.finalize({type:i.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword(t.Break),this.consumeSemicolon(),this.finalize({type:i.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword(t.Return);const u=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||this.rawToken.type===c.EOF)&&this.rawToken.type!==c.StringLiteral&&this.rawToken.type!==c.Template?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:i.ReturnStatement,argument:u,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case c.BooleanLiteral:case c.NullLiteral:case c.NumericLiteral:case c.StringLiteral:case c.Template:case c.Identifier:return this.parseExpressionStatement();case c.Punctuator:return"{"===this.rawToken.value?this.parseBlockOrObjectStatement():"("===this.rawToken.value?this.parseExpressionStatement():";"===this.rawToken.value?this.parseEmptyStatement():this.parseExpressionStatement();case c.Keyword:switch(this.rawToken.value.toLowerCase()){case t.Break:return this.parseBreakStatement();case t.Continue:return this.parseContinueStatement();case t.For:return this.parseForStatement();case t.Function:return this.parseFunctionDeclaration();case t.If:return this.parseIfStatement();case t.Return:return this.parseReturnStatement();case t.Var:return this.parseVariableDeclaration();case t.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==c.EOF;){const t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:d.IdentifierExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&M.Function)===M.Function&&this.throwUnexpectedToken({code:d.NoFunctionInsideFunction}),((this.context.blockContext&M.WhileLoop)===M.WhileLoop||(this.context.blockContext&M.ForOfLoop)===M.ForOfLoop||(this.context.blockContext&M.IfClause)===M.IfClause)&&this.throwUnexpectedToken({code:d.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword(t.Function);const u=this.parseIdentifier();u||this.throwUnexpectedToken({code:d.InvalidFunctionIdentifier});const n=this.parseFormalParameters(),r=this.context.blockContext;this.context.blockContext|=M.Function;const s=this.parseBlock();return this.context.blockContext=r,this.finalize({type:i.FunctionDeclaration,id:u,params:n,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),t=this.parseStatements(),u=this.finalize({type:i.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(u.tokens=this.tokens),this.options.tolerant&&(u.errors=this.errorHandler.errors),u}parseExportDeclaration(){this.context.blockContext!==M.None&&this.throwUnexpectedToken({code:d.ModuleExportRootOnly});let e=null;const u=this.captureStartMarker();return this.expectKeyword(t.Export),this.matchKeyword(t.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:d.InvalidExpression}),this.finalize({type:i.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(u)})}parseModuleSpecifier(){const e=this.captureStartMarker(),t=this.rawToken;if(t.type===c.StringLiteral)return this.readNextRawToken(),this.finalize({type:i.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(d.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:d.IdentifierExpected}),this.finalize({type:i.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==M.None&&this.throwUnexpectedToken({code:d.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword(t.Import);const n=this.parseDefaultSpecifier();this.expectContextualKeyword(u.From);const r=this.parseModuleSpecifier();return this.finalize({type:i.ImportDeclaration,specifiers:[n],source:r,...this.getItemLocation(e)})}}function V(e,t,u){return new H(e,t,u).parseScript()}export{E as O,B as S,d as a,C as e,x as f,V as j,t as l,i as n,m as r,F as y};
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.89";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
package/interfaces.d.ts
CHANGED
|
@@ -13963,6 +13963,13 @@ declare namespace __esri {
|
|
|
13963
13963
|
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
13964
13964
|
export type BatchAttributeFormLayerInfo = import("./widgets/BatchAttributeForm/types.js").AttributeFormSupportedLayerInfo;
|
|
13965
13965
|
|
|
13966
|
+
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
13967
|
+
export type AttachmentElementInputProperties = import("./widgets/BatchAttributeForm/inputs/AttachmentElementInput.js").AttachmentElementInputProperties;
|
|
13968
|
+
|
|
13969
|
+
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
13970
|
+
export type AttachmentElementInput = import("./widgets/BatchAttributeForm/inputs/AttachmentElementInput.js").default;
|
|
13971
|
+
export const AttachmentElementInput: typeof import("./widgets/BatchAttributeForm/inputs/AttachmentElementInput.js").default;
|
|
13972
|
+
|
|
13966
13973
|
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
13967
13974
|
export type BatchFormInputsProperties = import("./widgets/BatchAttributeForm/inputs/BatchFormInputs.js").BatchFormInputsProperties;
|
|
13968
13975
|
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.89",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import i from"../request.js";import{has}from"../applications/Components/baUtils.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as L}from"../views/support/Scheduler.js";import{Yield as k}from"../views/support/Yield.js";const R=3857,C=32662,S=4326,W=5773,V=115700;let j=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(L.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),k}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);t&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i),t.needFrame=!0,t.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const d="global"===this.view.viewingMode?5:3;if(5===d)this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W;else if(this.view.renderSpatialReference?.wkid===C)this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=f(this.view.heightModelInfo);if(e)this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=e;else{const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?W:V}}const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new b(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0,t.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===R?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{o(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(n()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(e){const i=this._lyr3DMain;if(i){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:t,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:t,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};i.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;i.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let t=0,s=0;this._layers.forEach(e=>{t+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),t/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-t-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,t,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,i){for(;!i.done&&e.length>0;){e.shift()(this._lyr3DMain),i.madeProgress()}}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc)),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc));const{data:s}=i,r=e=>{const r=s.byteLength,a=e._malloc(r);try{new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(t.jobId,i.jobDescJson,a,r)}finally{e._free(a)}};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,t)}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const o=this._getRequestPromises(e.urls,i,t,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const i of e)o.inputs.push(i);return this._workerHandle.invoke(o,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc))})}};try{const i=await this._getInitialPromise(e,n,d,s,o,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,o,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;if(this._lyr3DMain&&!t.layerView.destroyed){const{layerId:t,handle:r}=e,{memUsageBytes:a}=i;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!0,t,r,a,s))}this._decrementRenderableCount(t)}).catch(i=>{if(l(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&!t.layerView.destroyed){const{layerId:i,handle:t}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,i,t,0,0))}this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:w};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=u(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=c.values[c[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),t.vcsWkid&&this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],j.prototype,"view",void 0),e([h({readOnly:!0})],j.prototype,"isTerrainReady",null),j=e([_("esri.layers.Lyr3DWasmPerSceneView")],j);const I=j;export{I as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import i from"../request.js";import{has}from"../applications/Components/baUtils.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as R}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as M}from"../views/support/Scheduler.js";import{Yield as k}from"../views/support/Yield.js";const L=3857,C=32662,S=4326,W=5773;let V=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(M.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),k}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);t&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i),t.needFrame=!0,t.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=f(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===C?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new b(R(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0,t.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{o(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(n()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(e){const i=this._lyr3DMain;if(i){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:t,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:t,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};i.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;i.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let t=0,s=0;this._layers.forEach(e=>{t+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),t/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-t-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,t,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,i){for(;!i.done&&e.length>0;){e.shift()(this._lyr3DMain),i.madeProgress()}}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc)),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc));const{data:s}=i,r=e=>{const r=s.byteLength,a=e._malloc(r);try{new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(t.jobId,i.jobDescJson,a,r)}finally{e._free(a)}};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,t)}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const o=this._getRequestPromises(e.urls,i,t,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const i of e)o.inputs.push(i);return this._workerHandle.invoke(o,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc))})}};try{const i=await this._getInitialPromise(e,n,d,s,o,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,o,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;if(this._lyr3DMain&&!t.layerView.destroyed){const{layerId:t,handle:r}=e,{memUsageBytes:a}=i;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!0,t,r,a,s))}this._decrementRenderableCount(t)}).catch(i=>{if(l(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&!t.layerView.destroyed){const{layerId:i,handle:t}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,i,t,0,0))}this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:w};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=u(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=c.values[c[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&t.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],V.prototype,"view",void 0),e([h({readOnly:!0})],V.prototype,"isTerrainReady",null),V=e([_("esri.layers.Lyr3DWasmPerSceneView")],V);const j=V;export{j as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.89",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.17.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.90",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.0-next.42",
|
|
25
25
|
"@vaadin/grid": "~25.1.2",
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const c="
|
|
2
|
+
const c="20260501",e="953ffe7a6665912cc6de0820a64c7a5e03d29b73";export{c as buildDate,e as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{GamepadKeyboardController as t}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as e}from"../../../input/VisibilityChange.js";class o extends i{constructor(t,i){super(!0),this._view=t,this._keyToDirection=new Map,this._keyToAction=new Map,this.
|
|
2
|
+
import{GamepadKeyboardController as t}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as e}from"../../../input/VisibilityChange.js";class o extends i{constructor(t,i){super(!0),this._view=t,this._keyToDirection=new Map,this._keyToAction=new Map,this._stickyKeyTimeoutHandle=void 0,this._stickyKeyDuration=200,this._addKeysMapping(i),this.registerIncoming("key-down",null,t=>this._handleKeyDown(t)),this.registerIncoming("key-up",null,t=>this._handleKeyUp(t)),this.registerIncoming("blur",null,()=>this._handleStop()),this._visibilityHandle=e(t=>t?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}setStickyKeyDuration(t){this._stickyKeyDuration=t}_addKeysMapping(t){this._addKeyMapping(t.pan.left,0),this._addKeyMapping(t.pan.right,1),this._addKeyMapping(t.pan.forward,2),this._addKeyMapping(t.pan.backward,3),this._addKeyMapping(t.pan.up,4),this._addKeyMapping(t.pan.down,5),this._addKeyMapping(t.lookAround.headingLeft,6),this._addKeyMapping(t.lookAround.headingRight,7),this._addKeyMapping(t.lookAround.tiltUp,8),this._addKeyMapping(t.lookAround.tiltDown,9),this._addKeyMapping(t.zoom.zoomIn,10),this._addKeyMapping(t.zoom.zoomOut,11),this._addKeyAction(t.reset.heading,()=>this._resetHeading()),this._addKeyAction(t.reset.tilt,()=>this._resetTilt())}_addKeyMapping(t,i){for(const e of this._eachKey(t))this._keyToDirection.set(e,i)}*_eachKey(t){"string"==typeof t?yield t:yield*t}_addKeyAction(t,i){for(const e of this._eachKey(t))this._keyToAction.set(e,i)}_handleKeyDown(i){if(i.data.native.ctrlKey||i.data.native.metaKey)return;const e=this._keyToAction.get(i.data.key);if(null!=e)return i.stopPropagation(),void e();const o=this._keyToDirection.get(i.data.key);if(null!=o&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.running||(this._cameraControllerKeyboard=new t({view:this._view}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.running)){if(i.stopPropagation(),this._cameraControllerKeyboard.directionActive(o))return;if(this._cameraControllerKeyboard.activateDirection(o),this._cameraControllerKeyboard.countActiveDirections()>1||!this._isPanning(o))return;this._stickyKeyDuration>0&&(this._stickyKeyTimeoutHandle=setTimeout(()=>{this._stickyKeyTimeoutHandle=void 0,null!=this._stickyDirection&&void 0!==this._stickyDirection&&(this._cameraControllerKeyboard?.deactivateDirection(this._stickyDirection),this._stickyDirection=void 0)},this._stickyKeyDuration))}}_handleStop(){this._cameraControllerKeyboard?.running&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(t){if(t.data.native.ctrlKey||t.data.native.metaKey||!this._cameraControllerKeyboard?.running)return;const i=this._keyToDirection.get(t.data.key);if(null==i)return;t.stopPropagation();const e=void 0===this._stickyKeyTimeoutHandle;void 0===this._stickyKeyTimeoutHandle||1!==this._cameraControllerKeyboard?.countActiveDirections()?(this._cameraControllerKeyboard?.deactivateDirection(i),e&&(this._stickyDirection=void 0)):this._stickyDirection=i}_isPanning(t){return t<=3}_resetHeading(){this._view.goTo({heading:0}).catch(()=>{})}_resetTilt(){this._view.goTo({tilt:0}).catch(()=>{})}}export{o as KeyboardNavigation};
|