@arcgis/core 6.0.0-next.12 → 6.0.0-next.14
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/containerUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/portal.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcgisGlobal.d.ts +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{5566f14afb63065e438f.js → 0050916e462e3c9e0627.js} +1 -1
- package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +1 -0
- package/assets/esri/core/workers/chunks/09bd5df07eab80ae7b15.js +1 -0
- package/assets/esri/core/workers/chunks/0da6abe3ceabfe78f7a0.js +1 -0
- package/assets/esri/core/workers/chunks/0f617980c7dd9ad0444f.js +1 -0
- package/assets/esri/core/workers/chunks/{10445313d0d57b34511b.js → 2145a512d269d64036b0.js} +1 -1
- package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +1 -0
- package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +1 -0
- package/assets/esri/core/workers/chunks/25f19fc929f25ddd628c.js +1 -0
- package/assets/esri/core/workers/chunks/28b74bc77f7c13080074.js +1 -0
- package/assets/esri/core/workers/chunks/{2ef5237e4c876d6a4ee0.js → 2bd4ee083ca4ad221f8b.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4f9d08b2df856e3b694.js → 2eae542fe7f0f6576ac1.js} +1 -1
- package/assets/esri/core/workers/chunks/{2aeb5cc32284dd3e4d22.js → 33e4ff228a8c81b99022.js} +1 -1
- package/assets/esri/core/workers/chunks/{42323093827adffe56d3.js → 3418877328f4f0830300.js} +1 -1
- package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js → 34cbaf844730ac2d92c2.js} +2 -2
- package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js → 3c301a689c7853c9fa67.js} +2 -2
- package/assets/esri/core/workers/chunks/{02253bdffbd580af22d8.js → 3ff6d1ed3c0f1285f3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{67e4b5651fd7ff7d8cf0.js → 4ac1d3e49e242e373a92.js} +1 -1
- package/assets/esri/core/workers/chunks/4df6cb1bee5d0720a43e.js +1 -0
- package/assets/esri/core/workers/chunks/{8d0c2de92770a1567536.js → 4e6f40cbdb8c508e6df1.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc486a3595b6d57018bb.js → 5bfea0c55aca826de536.js} +1 -1
- package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +1 -0
- package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +1 -0
- package/assets/esri/core/workers/chunks/{2686fe5b62dd0be699c0.js → 634523cc7757da9020e4.js} +1 -1
- package/assets/esri/core/workers/chunks/67ebc5a3d46b254b725c.js +1 -0
- package/assets/esri/core/workers/chunks/{6e62581d933e7298d1f6.js → 6f4e6022a52de0c54aab.js} +1 -1
- package/assets/esri/core/workers/chunks/{a518ae5683367eeda74c.js → 70d3055f15d8b0cf4074.js} +1 -1
- package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js → 76ab353d80d786777161.js} +2 -2
- package/assets/esri/core/workers/chunks/{45800373650fbc8262e6.js → 7d11710e1586a3d75887.js} +1 -1
- package/assets/esri/core/workers/chunks/7f8e327acad48c9e75ea.js +1 -0
- package/assets/esri/core/workers/chunks/8052da8be251c3ff2176.js +1 -0
- package/assets/esri/core/workers/chunks/{f6e62d2d279a328cbed7.js → 90bdf86f553e2742d67c.js} +1 -1
- package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +1 -0
- package/assets/esri/core/workers/chunks/{3d9d7d3a40b51eb7ee3d.js → 953ba13299e7aa92c1a0.js} +1 -1
- package/assets/esri/core/workers/chunks/{f46d9a19f79d4a4bd354.js → 9e1a3b6a08c96dcefdde.js} +1 -1
- package/assets/esri/core/workers/chunks/9f0a973a0dd28953ce25.js +1 -0
- package/assets/esri/core/workers/chunks/a2ad3e620c98e2b2eb06.js +1 -0
- package/assets/esri/core/workers/chunks/a34b3d2e11a777e1ff3f.js +1 -0
- package/assets/esri/core/workers/chunks/{140f2eeb11e39ab15734.js → aa36c3a9bbaa086e3757.js} +1 -1
- package/assets/esri/core/workers/chunks/aadfe34a99c9ec7a0e11.js +1 -0
- package/assets/esri/core/workers/chunks/b49df4ebd4be1181b0f9.js +2 -0
- package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js → b557824bc1fa163d72a3.js} +2 -2
- package/assets/esri/core/workers/chunks/b8337492e2b753aefac4.js +1 -0
- package/assets/esri/core/workers/chunks/bc915fb182d463d804e6.js +1 -0
- package/assets/esri/core/workers/chunks/{58032aab28a20a327f6c.js → d03b82e962c70a3fd377.js} +1 -1
- package/assets/esri/core/workers/chunks/{992f102992c2bed7b34e.js → d5d0fe8e198ff5a902ee.js} +1 -1
- package/assets/esri/core/workers/chunks/e2190361247f35b02b32.js +1 -0
- package/assets/esri/core/workers/chunks/e2f42aec02bff33b25dd.js +1 -0
- package/assets/esri/core/workers/chunks/ead49b513e070951a964.js +1 -0
- package/assets/esri/core/workers/chunks/ebc1a2ef3aed8aa29424.js +1 -0
- package/assets/esri/core/workers/chunks/ed6e9d7f71bfd2691717.js +1 -0
- package/assets/esri/core/workers/chunks/ee6679ef9efa1504e7eb.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/chunks/BlendWeights.glsl.js +10 -10
- package/chunks/Blur.glsl.js +2 -2
- package/chunks/EdgeDetect.glsl.js +24 -19
- package/chunks/HUDMaterial.glsl.js +11 -1
- package/chunks/HighlightApply.glsl.js +4 -5
- package/chunks/HighlightBlur.glsl.js +5 -5
- package/chunks/HighlightDownsample.glsl.js +2 -2
- package/chunks/HighlightSharpApply.glsl.js +61 -0
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +2 -2
- package/chunks/portal.js +1 -1
- package/config.js +1 -1
- package/geometry/operators/simplifyOGCOperator.d.ts +10 -4
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/mathUtils.js +1 -1
- package/interfaces.d.ts +1 -1
- package/kernel.js +1 -1
- package/layers/CSVLayer.d.ts +1 -1
- package/layers/CatalogLayer.d.ts +1 -1
- package/layers/FeatureLayer.d.ts +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/SceneLayer.d.ts +4 -5
- package/layers/SceneLayer.js +1 -1
- package/layers/SketchLayer.d.ts +4 -2
- package/layers/SubtypeGroupLayer.d.ts +1 -1
- package/layers/WFSLayer.d.ts +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/geospatialPDF/projectionToWKTUtils.js +2 -2
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
- package/layers/mixins/ArcGISImageService.d.ts +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/functions/clipUtils.js +1 -1
- package/layers/support/FeatureFilter.d.ts +1 -1
- package/layers/support/SubtypeSublayer.d.ts +1 -1
- package/layers/support/{TimeSeriesCalculation.d.ts → TimeSeriesCalculationMethod.d.ts} +6 -6
- package/layers/support/{TimeSeriesCalculation.js → TimeSeriesCalculationMethod.js} +1 -1
- package/layers/support/TimeSeriesInfo.d.ts +5 -5
- package/layers/support/TimeSeriesInfo.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/timeSeriesUtils.d.ts +6 -2
- package/layers/support/timeSeriesUtils.js +1 -1
- package/package.json +4 -4
- package/portal/schemas/definitions.js +1 -1
- package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
- package/smartMapping/statistics/support/timeSeriesUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/types.d.ts +1 -1
- package/views/2d/engine/webgl/GlyphWorker.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +20 -6
- package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApply.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightCellGridScreenSpacePassParameters.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightDownsample.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightSharpApply.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/HighlightSharpApplyTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/smaa/BlendWeights.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/Blur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/EdgeDetect.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAAPassParameters.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAATechniqueConfiguration.js +2 -0
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/MultipointPlugin.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/draw/support/types.d.ts +5 -2
- package/views/layers/FeatureLikeLayerView.d.ts +1 -1
- package/views/layers/PointCloudLayerView.d.ts +1 -1
- package/views/layers/SceneLayerView.d.ts +1 -1
- package/views/support/HighlightDefaults.js +1 -1
- package/webdoc/applicationProperties/SearchLayerField.d.ts +7 -1
- package/webdoc/applicationProperties/SearchLayerField.js +1 -1
- package/webdoc/applicationProperties/SearchTableField.d.ts +7 -1
- package/webdoc/applicationProperties/SearchTableField.js +1 -1
- package/webdoc/applicationProperties/searchMode.js +2 -0
- package/widgets/BatchAttributeForm/attachmentUtils.d.ts +10 -0
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +10 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/Search/LayerSearchSource.d.ts +23 -1
- package/widgets/Search/LayerSearchSource.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/Search/types.d.ts +7 -0
- package/widgets/support/forms/formUtils.js +1 -1
- package/widgets/support/forms/types.d.ts +1 -1
- package/assets/esri/core/workers/chunks/0dc66b03ff55d0ea5a09.js +0 -1
- package/assets/esri/core/workers/chunks/175c268e64ccd01f8c25.js +0 -1
- package/assets/esri/core/workers/chunks/216e6065b224309e1051.js +0 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +0 -2
- package/assets/esri/core/workers/chunks/37d6a264a3f1d8072aa0.js +0 -1
- package/assets/esri/core/workers/chunks/3df5500a85345577480a.js +0 -1
- package/assets/esri/core/workers/chunks/3f7d583b676b23b3fadb.js +0 -1
- package/assets/esri/core/workers/chunks/4503b20ca6a80fb63d72.js +0 -1
- package/assets/esri/core/workers/chunks/4a640548032355e57acd.js +0 -1
- package/assets/esri/core/workers/chunks/4debf2d9c3465250ef7a.js +0 -1
- package/assets/esri/core/workers/chunks/53be85d04cd2da4f391d.js +0 -1
- package/assets/esri/core/workers/chunks/54778dec1598818d93cb.js +0 -1
- package/assets/esri/core/workers/chunks/567a65f4203f6e81f4b4.js +0 -1
- package/assets/esri/core/workers/chunks/5982c6a8459c1237b298.js +0 -1
- package/assets/esri/core/workers/chunks/74b5c00f93cfc0d59029.js +0 -1
- package/assets/esri/core/workers/chunks/78472a57c2ba146fec65.js +0 -1
- package/assets/esri/core/workers/chunks/7c2c8f786a30267a5f05.js +0 -1
- package/assets/esri/core/workers/chunks/88e54449261ef94e390d.js +0 -1
- package/assets/esri/core/workers/chunks/917f53833b853898facc.js +0 -1
- package/assets/esri/core/workers/chunks/9e142551163acf752618.js +0 -1
- package/assets/esri/core/workers/chunks/aaba33611753c6aada68.js +0 -1
- package/assets/esri/core/workers/chunks/af75747b06d79446a855.js +0 -1
- package/assets/esri/core/workers/chunks/b5fdcc80d5973b6e26d1.js +0 -1
- package/assets/esri/core/workers/chunks/d6ad4390df576198e45b.js +0 -1
- package/assets/esri/core/workers/chunks/dba280c370df13196711.js +0 -1
- package/assets/esri/core/workers/chunks/f1f90adae13b04898008.js +0 -1
- package/assets/esri/core/workers/chunks/f47c7065da3b5001245f.js +0 -1
- /package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js.LICENSE.txt → 34cbaf844730ac2d92c2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js.LICENSE.txt → 3c301a689c7853c9fa67.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js.LICENSE.txt → 76ab353d80d786777161.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2a1ec30f9ad305763f81.js.LICENSE.txt → b49df4ebd4be1181b0f9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js.LICENSE.txt → b557824bc1fa163d72a3.js.LICENSE.txt} +0 -0
package/chunks/lyr3DWorker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
async function e(e={}){var t
|
|
3
|
-
`)),!e)return null;Ne=Ie(e)}return Ne.shift()},j={ttys:[],init(){},shutdown(){},register(e,t){j.ttys[e]={input:[],output:[],ops:t},F.registerDevice(e,j.stream_ops)},stream_ops:{open(e){var t=j.ttys[e.node.rdev];if(!t)throw new F.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,i){if(!e.tty||!e.tty.ops.get_char)throw new F.ErrnoError(60);for(var a=0,o=0;o<r;o++){var s;try{s=e.tty.ops.get_char(e.tty)}catch{throw new F.ErrnoError(29)}if(s===void 0&&a===0)throw new F.ErrnoError(6);if(s==null)break;a++,t[n+o]=s}return a&&(e.node.atime=Date.now()),a},write(e,t,n,r,i){if(!e.tty||!e.tty.ops.put_char)throw new F.ErrnoError(60);try{for(var a=0;a<r;a++)e.tty.ops.put_char(e.tty,t[n+a])}catch{throw new F.ErrnoError(29)}return r&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return Le()},put_char(e,t){t===null||t===10?(f(A(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output?.length>0&&(f(A(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(p(A(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output?.length>0&&(p(A(e.output)),e.output=[])}}},Re=e=>{g()},M={ops_table:null,mount(e){return M.createNode(null,`/`,16895,0)},createNode(e,t,n,r){if(F.isBlkdev(n)||F.isFIFO(n))throw new F.ErrnoError(63);M.ops_table||={dir:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr,lookup:M.node_ops.lookup,mknod:M.node_ops.mknod,rename:M.node_ops.rename,unlink:M.node_ops.unlink,rmdir:M.node_ops.rmdir,readdir:M.node_ops.readdir,symlink:M.node_ops.symlink},stream:{llseek:M.stream_ops.llseek}},file:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr},stream:{llseek:M.stream_ops.llseek,read:M.stream_ops.read,write:M.stream_ops.write,mmap:M.stream_ops.mmap,msync:M.stream_ops.msync}},link:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr,readlink:M.node_ops.readlink},stream:{}},chrdev:{node:{getattr:M.node_ops.getattr,setattr:M.node_ops.setattr},stream:F.chrdev_stream_ops}};var i=F.createNode(e,t,n,r);return F.isDir(i.mode)?(i.node_ops=M.ops_table.dir.node,i.stream_ops=M.ops_table.dir.stream,i.contents={}):F.isFile(i.mode)?(i.node_ops=M.ops_table.file.node,i.stream_ops=M.ops_table.file.stream,i.usedBytes=0,i.contents=M.emptyFileContents??=new Uint8Array):F.isLink(i.mode)?(i.node_ops=M.ops_table.link.node,i.stream_ops=M.ops_table.link.stream):F.isChrdev(i.mode)&&(i.node_ops=M.ops_table.chrdev.node,i.stream_ops=M.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[t]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return e.contents.subarray(0,e.usedBytes)},expandFileStorage(e,t){var n=e.contents.length;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),n&&(t=Math.max(t,256));var r=M.getFileDataAsTypedArray(e);e.contents=new Uint8Array(t),e.contents.set(r)}},resizeFileStorage(e,t){if(e.usedBytes!=t){var n=e.contents;e.contents=new Uint8Array(t),e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=F.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,t.size=F.isDir(e.mode)?4096:F.isFile(e.mode)?e.usedBytes:F.isLink(e.mode)?e.link.length:0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){for(let n of[`mode`,`atime`,`mtime`,`ctime`])t[n]!=null&&(e[n]=t[n]);t.size!==void 0&&M.resizeFileStorage(e,t.size)},lookup(e,t){throw M.doesNotExistError||(M.doesNotExistError=new F.ErrnoError(44),M.doesNotExistError.stack=`<generic error, no stack>`),M.doesNotExistError},mknod(e,t,n,r){return M.createNode(e,t,n,r)},rename(e,t,n){var r;try{r=F.lookupNode(t,n)}catch{}if(r){if(F.isDir(e.mode))for(var i in r.contents)throw new F.ErrnoError(55);F.hashRemoveNode(r)}delete e.parent.contents[e.name],t.contents[n]=e,e.name=n,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.contents[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){for(var n in F.lookupNode(e,t).contents)throw new F.ErrnoError(55);delete e.contents[t],e.ctime=e.mtime=Date.now()},readdir(e){return[`.`,`..`,...Object.keys(e.contents)]},symlink(e,t,n){var r=M.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!F.isLink(e.mode))throw new F.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-i,r);return t.set(a.subarray(i,i+o),n),o},write(e,t,n,r,i,a){if(t.buffer===b.buffer&&(a=!1),!r)return 0;var o=e.node;return o.mtime=o.ctime=Date.now(),a?(o.contents=t.subarray(n,n+r),o.usedBytes=r):o.usedBytes===0&&i===0?(o.contents=t.slice(n,n+r),o.usedBytes=r):(M.expandFileStorage(o,i+r),o.contents.set(t.subarray(n,n+r),i),o.usedBytes=Math.max(o.usedBytes,i+r)),r},llseek(e,t,n){var r=t;if(n===1?r+=e.position:n===2&&F.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new F.ErrnoError(28);return r},mmap(e,t,n,r,i){if(!F.isFile(e.node.mode))throw new F.ErrnoError(43);var a,o,s=e.node.contents;if(!(i&2)&&s.buffer===b.buffer)o=!1,a=s.byteOffset;else{if(o=!0,a=Re(),!a)throw new F.ErrnoError(48);s&&((n>0||n+t<s.length)&&(s=s.subarray?s.subarray(n,n+t):Array.prototype.slice.call(s,n,n+t)),b.set(s,a))}return{ptr:a,allocated:o}},msync(e,t,n,r,i){return M.stream_ops.write(e,t,0,r,n,!1),0}}},ze=e=>{if(typeof e!=`string`)return e;var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(t===void 0)throw Error(`Unknown file open mode: ${e}`);return t},Be=e=>(typeof e==`string`&&(e=Ie(e)),e.subarray||(e=new Uint8Array(e)),e),Ve=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},He=async e=>{var t=await u(e);return new Uint8Array(t)},Ue=(...e)=>F.createDataFile(...e),N=0,P=null,We=e=>{if(N--,n.monitorRunDependencies?.(N),N==0&&P){var t=P;P=null,t()}},Ge=e=>{N++,n.monitorRunDependencies?.(N)},Ke=[],qe=async(e,t)=>{typeof Browser<`u`&&Browser.init();for(var n of Ke)if(n.canHandle(t))return n.handle(e,t);return e},Je=async(e,t,n,r,i,a,o,s)=>{var c=t?k.resolve(O.join2(e,t)):e;Ge();try{var l=n;typeof n==`string`&&(l=await He(n)),l=await qe(l,c),s?.(),a||Ue(e,t,l,r,i,o)}finally{We()}},Ye=(e,t,n,r,i,a,o,s,c,l)=>{Je(e,t,n,r,i,s,c,l).then(a).catch(o)},F={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:`/`,initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name=`ErrnoError`;constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!=1}get isWrite(){return!!(this.flags&2097155)}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,t,n,r){e||=this,this.parent=e,this.mount=e.mount,this.id=F.nextInode++,this.name=t,this.mode=n,this.rdev=r,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return F.isDir(this.mode)}get isDevice(){return F.isChrdev(this.mode)}},lookupPath(e,t={}){if(!e)throw new F.ErrnoError(44);t.follow_mount??=!0,O.isAbs(e)||(e=F.cwd()+`/`+e);linkloop:for(var n=0;n<40;n++){for(var r=e.split(`/`).filter(e=>!!e),i=F.root,a=`/`,o=0;o<r.length;o++){var s=o===r.length-1;if(s&&t.parent)break;if(r[o]!==`.`){if(r[o]===`..`){if(a=O.dirname(a),F.isRoot(i)){e=a+`/`+r.slice(o+1).join(`/`),n--;continue linkloop}i=i.parent}else{a=O.join2(a,r[o]);try{i=F.lookupNode(i,r[o])}catch(e){if(e?.errno===44&&s&&t.noent_okay)return{path:a};throw e}if(F.isMountpoint(i)&&(!s||t.follow_mount)&&(i=i.mounted.root),F.isLink(i.mode)&&(!s||t.follow)){if(!i.node_ops.readlink)throw new F.ErrnoError(52);var c=i.node_ops.readlink(i);O.isAbs(c)||(c=O.dirname(a)+`/`+c),e=c+`/`+r.slice(o+1).join(`/`);continue linkloop}}}}return{path:a,node:i}}throw new F.ErrnoError(32)},getPath(e){for(var t;;){if(F.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]===`/`?n+t:`${n}/${t}`:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%F.nameTable.length},hashAddNode(e){var t=F.hashName(e.parent.id,e.name);e.name_next=F.nameTable[t],F.nameTable[t]=e},hashRemoveNode(e){var t=F.hashName(e.parent.id,e.name);if(F.nameTable[t]===e)F.nameTable[t]=e.name_next;else for(var n=F.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=F.mayLookup(e);if(n)throw new F.ErrnoError(n);for(var r=F.hashName(e.id,t),i=F.nameTable[r];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===t)return i}return F.lookup(e,t)},createNode(e,t,n,r){var i=new F.FSNode(e,t,n,r);return F.hashAddNode(i),i},destroyNode(e){F.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)==32768},isDir(e){return(e&61440)==16384},isLink(e){return(e&61440)==40960},isChrdev(e){return(e&61440)==8192},isBlkdev(e){return(e&61440)==24576},isFIFO(e){return(e&61440)==4096},isSocket(e){return(e&49152)==49152},flagsToPermissionString(e){var t=[`r`,`w`,`rw`][e&3];return e&512&&(t+=`w`),t},nodePermissions(e,t){return F.ignorePermissions?0:t.includes(`r`)&&!(e.mode&292)||t.includes(`w`)&&!(e.mode&146)||t.includes(`x`)&&!(e.mode&73)?2:0},mayLookup(e){return F.isDir(e.mode)?F.nodePermissions(e,`x`)||(e.node_ops.lookup?0:2):54},mayCreate(e,t){if(!F.isDir(e.mode))return 54;try{return F.lookupNode(e,t),20}catch{}return F.nodePermissions(e,`wx`)},mayDelete(e,t,n){var r;try{r=F.lookupNode(e,t)}catch(e){return e.errno}var i=F.nodePermissions(e,`wx`);if(i)return i;if(n){if(!F.isDir(r.mode))return 54;if(F.isRoot(r)||F.getPath(r)===F.cwd())return 10}else if(F.isDir(r.mode))return 31;return 0},mayOpen(e,t){if(!e)return 44;if(F.isLink(e.mode))return 32;var n=F.flagsToPermissionString(t);return F.isDir(e.mode)&&(n!==`r`||t&576)?31:F.nodePermissions(e,n)},checkOpExists(e,t){if(!e)throw new F.ErrnoError(t);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=F.MAX_OPEN_FDS;e++)if(!F.streams[e])return e;throw new F.ErrnoError(33)},getStreamChecked(e){var t=F.getStream(e);if(!t)throw new F.ErrnoError(8);return t},getStream:e=>F.streams[e],createStream(e,t=-1){return e=Object.assign(new F.FSStream,e),t==-1&&(t=F.nextfd()),e.fd=t,F.streams[t]=e,e},closeStream(e){F.streams[e]=null},dupStream(e,t=-1){var n=F.createStream(e,t);return n.stream_ops?.dup?.(n),n},doSetAttr(e,t,n){var r=e?.stream_ops.setattr,i=r?e:t;r??=t.node_ops.setattr,F.checkOpExists(r,63);try{r(i,n)}catch(e){throw e instanceof RangeError?new F.ErrnoError(22):e}},chrdev_stream_ops:{open(e){e.stream_ops=F.getDevice(e.node.rdev).stream_ops,e.stream_ops.open?.(e)},llseek(){throw new F.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){F.devices[e]={stream_ops:t}},getDevice:e=>F.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e==`function`&&(t=e,e=!1),F.syncFSRequests++,F.syncFSRequests>1&&p(`warning: ${F.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=F.getMounts(F.root.mount),r=0;function i(e){return F.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,i(e));++r>=n.length&&i(null)}for(var o of n)o.type.syncfs?o.type.syncfs(o,e,a):a(null)},mount(e,t,n){var r=n===`/`,i=!n,a;if(r&&F.root)throw new F.ErrnoError(10);if(!r&&!i){var o=F.lookupPath(n,{follow_mount:!1});if(n=o.path,a=o.node,F.isMountpoint(a))throw new F.ErrnoError(10);if(!F.isDir(a.mode))throw new F.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,r?F.root=c:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),c},unmount(e){var t=F.lookupPath(e,{follow_mount:!1});if(!F.isMountpoint(t.node))throw new F.ErrnoError(28);var n=t.node,r=n.mounted,i=F.getMounts(r);for(var[a,o]of Object.entries(F.nameTable))for(;o;){var s=o.name_next;i.includes(o.mount)&&F.destroyNode(o),o=s}n.mounted=null;var c=n.mount.mounts.indexOf(r);n.mount.mounts.splice(c,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=F.lookupPath(e,{parent:!0}).node,i=O.basename(e);if(!i)throw new F.ErrnoError(28);if(i===`.`||i===`..`)throw new F.ErrnoError(20);var a=F.mayCreate(r,i);if(a)throw new F.ErrnoError(a);if(!r.node_ops.mknod)throw new F.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},statfs(e){return F.statfsNode(F.lookupPath(e,{follow:!0}).node)},statfsStream(e){return F.statfsNode(e.node)},statfsNode(e){var t={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:F.nextInode,ffree:F.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(t,e.node_ops.statfs(e.mount.opts.root)),t},create(e,t=438){return t&=4095,t|=32768,F.mknod(e,t,0)},mkdir(e,t=511){return t&=1023,t|=16384,F.mknod(e,t,0)},mkdirTree(e,t){var n=e.split(`/`),r=``;for(var i of n)if(i){(r||O.isAbs(e))&&(r+=`/`),r+=i;try{F.mkdir(r,t)}catch(e){if(e.errno!=20)throw e}}},mkdev(e,t,n){return n===void 0&&(n=t,t=438),t|=8192,F.mknod(e,t,n)},symlink(e,t){if(!k.resolve(e))throw new F.ErrnoError(44);var n=F.lookupPath(t,{parent:!0}).node;if(!n)throw new F.ErrnoError(44);var r=O.basename(t),i=F.mayCreate(n,r);if(i)throw new F.ErrnoError(i);if(!n.node_ops.symlink)throw new F.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n=O.dirname(e),r=O.dirname(t),i=O.basename(e),a=O.basename(t),o=F.lookupPath(e,{parent:!0}),s=o.node,c;if(o=F.lookupPath(t,{parent:!0}),c=o.node,!s||!c)throw new F.ErrnoError(44);if(s.mount!==c.mount)throw new F.ErrnoError(75);var l=F.lookupNode(s,i),u=k.relative(e,r);if(u.charAt(0)!==`.`)throw new F.ErrnoError(28);if(u=k.relative(t,n),u.charAt(0)!==`.`)throw new F.ErrnoError(55);var d;try{d=F.lookupNode(c,a)}catch{}if(l!==d){var f=F.isDir(l.mode),p=F.mayDelete(s,i,f);if(p||(p=d?F.mayDelete(c,a,f):F.mayCreate(c,a),p))throw new F.ErrnoError(p);if(!s.node_ops.rename)throw new F.ErrnoError(63);if(F.isMountpoint(l)||d&&F.isMountpoint(d))throw new F.ErrnoError(10);if(c!==s&&(p=F.nodePermissions(s,`w`),p))throw new F.ErrnoError(p);F.hashRemoveNode(l);try{s.node_ops.rename(l,c,a),l.parent=c}catch(e){throw e}finally{F.hashAddNode(l)}}},rmdir(e){var t=F.lookupPath(e,{parent:!0}).node,n=O.basename(e),r=F.lookupNode(t,n),i=F.mayDelete(t,n,!0);if(i)throw new F.ErrnoError(i);if(!t.node_ops.rmdir)throw new F.ErrnoError(63);if(F.isMountpoint(r))throw new F.ErrnoError(10);t.node_ops.rmdir(t,n),F.destroyNode(r)},readdir(e){var t=F.lookupPath(e,{follow:!0}).node;return F.checkOpExists(t.node_ops.readdir,54)(t)},unlink(e){var t=F.lookupPath(e,{parent:!0}).node;if(!t)throw new F.ErrnoError(44);var n=O.basename(e),r=F.lookupNode(t,n),i=F.mayDelete(t,n,!1);if(i)throw new F.ErrnoError(i);if(!t.node_ops.unlink)throw new F.ErrnoError(63);if(F.isMountpoint(r))throw new F.ErrnoError(10);t.node_ops.unlink(t,n),F.destroyNode(r)},readlink(e){var t=F.lookupPath(e).node;if(!t)throw new F.ErrnoError(44);if(!t.node_ops.readlink)throw new F.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,t){var n=F.lookupPath(e,{follow:!t}).node;return F.checkOpExists(n.node_ops.getattr,63)(n)},fstat(e){var t=F.getStreamChecked(e),n=t.node,r=t.stream_ops.getattr,i=r?t:n;return r??=n.node_ops.getattr,F.checkOpExists(r,63),r(i)},lstat(e){return F.stat(e,!0)},doChmod(e,t,n,r){F.doSetAttr(e,t,{mode:n&4095|t.mode&-4096,ctime:Date.now(),dontFollow:r})},chmod(e,t,n){var r=typeof e==`string`?F.lookupPath(e,{follow:!n}).node:e;F.doChmod(null,r,t,n)},lchmod(e,t){F.chmod(e,t,!0)},fchmod(e,t){var n=F.getStreamChecked(e);F.doChmod(n,n.node,t,!1)},doChown(e,t,n){F.doSetAttr(e,t,{timestamp:Date.now(),dontFollow:n})},chown(e,t,n,r){var i=typeof e==`string`?F.lookupPath(e,{follow:!r}).node:e;F.doChown(null,i,r)},lchown(e,t,n){F.chown(e,t,n,!0)},fchown(e,t,n){var r=F.getStreamChecked(e);F.doChown(r,r.node,!1)},doTruncate(e,t,n){if(F.isDir(t.mode))throw new F.ErrnoError(31);if(!F.isFile(t.mode))throw new F.ErrnoError(28);var r=F.nodePermissions(t,`w`);if(r)throw new F.ErrnoError(r);F.doSetAttr(e,t,{size:n,timestamp:Date.now()})},truncate(e,t){if(t<0)throw new F.ErrnoError(28);var n=typeof e==`string`?F.lookupPath(e,{follow:!0}).node:e;F.doTruncate(null,n,t)},ftruncate(e,t){var n=F.getStreamChecked(e);if(t<0||!(n.flags&2097155))throw new F.ErrnoError(28);F.doTruncate(n,n.node,t)},utime(e,t,n){var r=F.lookupPath(e,{follow:!0}).node;F.checkOpExists(r.node_ops.setattr,63)(r,{atime:t,mtime:n})},open(e,t,n=438){if(e===``)throw new F.ErrnoError(44);t=ze(t),n=t&64?n&4095|32768:0;var r,i;if(typeof e==`object`)r=e;else{i=e.endsWith(`/`);var a=F.lookupPath(e,{follow:!(t&131072),noent_okay:!0});r=a.node,e=a.path}var o=!1;if(t&64){if(r){if(t&128)throw new F.ErrnoError(20)}else if(i)throw new F.ErrnoError(31);else r=F.mknod(e,n|511,0),o=!0}if(!r)throw new F.ErrnoError(44);if(F.isChrdev(r.mode)&&(t&=-513),t&65536&&!F.isDir(r.mode))throw new F.ErrnoError(54);if(!o){var s=F.mayOpen(r,t);if(s)throw new F.ErrnoError(s)}t&512&&!o&&F.truncate(r,0),t&=-131713;var c=F.createStream({node:r,path:F.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),o&&F.chmod(r,n&511),c},close(e){if(F.isClosed(e))throw new F.ErrnoError(8);e.getdents&&=null;try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{F.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(F.isClosed(e))throw new F.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new F.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new F.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,i){if(r<0||i<0)throw new F.ErrnoError(28);if(F.isClosed(e)||(e.flags&2097155)==1)throw new F.ErrnoError(8);if(F.isDir(e.node.mode))throw new F.ErrnoError(31);if(!e.stream_ops.read)throw new F.ErrnoError(28);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new F.ErrnoError(70);var o=e.stream_ops.read(e,t,n,r,i);return a||(e.position+=o),o},write(e,t,n,r,i,a){if(r<0||i<0)throw new F.ErrnoError(28);if(F.isClosed(e)||!(e.flags&2097155))throw new F.ErrnoError(8);if(F.isDir(e.node.mode))throw new F.ErrnoError(31);if(!e.stream_ops.write)throw new F.ErrnoError(28);e.seekable&&e.flags&1024&&F.llseek(e,0,2);var o=i!==void 0;if(!o)i=e.position;else if(!e.seekable)throw new F.ErrnoError(70);var s=e.stream_ops.write(e,t,n,r,i,a);return o||(e.position+=s),s},mmap(e,t,n,r,i){if(r&2&&!(i&2)&&(e.flags&2097155)!=2||(e.flags&2097155)==1)throw new F.ErrnoError(2);if(!e.stream_ops.mmap)throw new F.ErrnoError(43);if(!t)throw new F.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,i)},msync(e,t,n,r,i){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new F.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){t.flags=t.flags??0,t.encoding=t.encoding??`binary`,t.encoding!==`utf8`&&t.encoding!==`binary`&&g(`Invalid encoding type "${t.encoding}"`);var n=F.open(e,t.flags),r=F.stat(e).size,i=new Uint8Array(r);return F.read(n,i,0,r,0),t.encoding===`utf8`&&(i=A(i)),F.close(n),i},writeFile(e,t,n={}){n.flags=n.flags??577;var r=F.open(e,n.flags,n.mode);t=Be(t),F.write(r,t,0,t.byteLength,void 0,n.canOwn),F.close(r)},cwd:()=>F.currentPath,chdir(e){var t=F.lookupPath(e,{follow:!0});if(t.node===null)throw new F.ErrnoError(44);if(!F.isDir(t.node.mode))throw new F.ErrnoError(54);var n=F.nodePermissions(t.node,`x`);if(n)throw new F.ErrnoError(n);F.currentPath=t.path},createDefaultDirectories(){F.mkdir(`/tmp`),F.mkdir(`/home`),F.mkdir(`/home/web_user`)},createDefaultDevices(){F.mkdir(`/dev`),F.registerDevice(F.makedev(1,3),{read:()=>0,write:(e,t,n,r,i)=>r,llseek:()=>0}),F.mkdev(`/dev/null`,F.makedev(1,3)),j.register(F.makedev(5,0),j.default_tty_ops),j.register(F.makedev(6,0),j.default_tty1_ops),F.mkdev(`/dev/tty`,F.makedev(5,0)),F.mkdev(`/dev/tty1`,F.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(Ae(e),t=e.byteLength),e[--t]);F.createDevice(`/dev`,`random`,n),F.createDevice(`/dev`,`urandom`,n),F.mkdir(`/dev/shm`),F.mkdir(`/dev/shm/tmp`)},createSpecialDirectories(){F.mkdir(`/proc`);var e=F.mkdir(`/proc/self`);F.mkdir(`/proc/self/fd`),F.mount({mount(){var t=F.createNode(e,`fd`,16895,73);return t.stream_ops={llseek:M.stream_ops.llseek},t.node_ops={lookup(e,t){var n=+t,r=F.getStreamChecked(n),i={parent:null,mount:{mountpoint:`fake`},node_ops:{readlink:()=>r.path},id:n+1};return i.parent=i,i},readdir(){return Array.from(F.streams.entries()).filter(([e,t])=>t).map(([e,t])=>e.toString())}},t}},{},`/proc/self/fd`)},createStandardStreams(e,t,n){e?F.createDevice(`/dev`,`stdin`,e):F.symlink(`/dev/tty`,`/dev/stdin`),t?F.createDevice(`/dev`,`stdout`,null,t):F.symlink(`/dev/tty`,`/dev/stdout`),n?F.createDevice(`/dev`,`stderr`,null,n):F.symlink(`/dev/tty1`,`/dev/stderr`),F.open(`/dev/stdin`,0),F.open(`/dev/stdout`,1),F.open(`/dev/stderr`,1)},staticInit(){F.nameTable=Array(4096),F.mount(M,{},`/`),F.createDefaultDirectories(),F.createDefaultDevices(),F.createSpecialDirectories(),F.filesystems={MEMFS:M}},init(e,t,r){F.initialized=!0,e??=n.stdin,t??=n.stdout,r??=n.stderr,F.createStandardStreams(e,t,r)},quit(){F.initialized=!1;for(var e of F.streams)e&&F.close(e)},findObject(e,t){var n=F.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{var n=F.lookupPath(e,{follow:!t});e=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=F.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=O.basename(e),n=F.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path===`/`}catch(e){r.error=e.errno}return r},createPath(e,t,n,r){e=typeof e==`string`?e:F.getPath(e);for(var i=t.split(`/`).reverse();i.length;){var a=i.pop();if(a){var o=O.join2(e,a);try{F.mkdir(o)}catch(e){if(e.errno!=20)throw e}e=o}}return o},createFile(e,t,n,r,i){var a=O.join2(typeof e==`string`?e:F.getPath(e),t),o=Ve(r,i);return F.create(a,o)},createDataFile(e,t,n,r,i,a){var o=t;e&&(e=typeof e==`string`?e:F.getPath(e),o=t?O.join2(e,t):e);var s=Ve(r,i),c=F.create(o,s);if(n){n=Be(n),F.chmod(c,s|146);var l=F.open(c,577);F.write(l,n,0,n.length,0,a),F.close(l),F.chmod(c,s)}},createDevice(e,t,n,r){var i=O.join2(typeof e==`string`?e:F.getPath(e),t),a=Ve(!!n,!!r);F.createDevice.major??=64;var o=F.makedev(F.createDevice.major++,0);return F.registerDevice(o,{open(e){e.seekable=!1},close(e){r?.buffer?.length&&r(10)},read(e,t,r,i,a){for(var o=0,s=0;s<i;s++){var c;try{c=n()}catch{throw new F.ErrnoError(29)}if(c===void 0&&o===0)throw new F.ErrnoError(6);if(c==null)break;o++,t[r+s]=c}return o&&(e.node.atime=Date.now()),o},write(e,t,n,i,a){for(var o=0;o<i;o++)try{r(t[n+o])}catch{throw new F.ErrnoError(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),o}}),F.mkdev(i,a,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)g(`Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.`);else try{e.contents=d(e.url)}catch{throw new F.ErrnoError(29)}},createLazyFile(e,t,n,r,a){class o{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;e.open(`HEAD`,n,!1),e.send(null),e.status>=200&&e.status<300||e.status===304||g(`Couldn't load `+n+`. Status: `+e.status);var t=Number(e.getResponseHeader(`Content-length`)),r,i=(r=e.getResponseHeader(`Accept-Ranges`))&&r===`bytes`,a=(r=e.getResponseHeader(`Content-Encoding`))&&r===`gzip`,o=1048576;i||(o=t);var s=(e,r)=>{e>r&&g(`invalid range (${e}, ${r}) or no bytes requested!`),r>t-1&&g(`only ${t} bytes available! programmer error!`);var i=new XMLHttpRequest;return i.open(`GET`,n,!1),t!==o&&i.setRequestHeader(`Range`,`bytes=`+e+`-`+r),i.responseType=`arraybuffer`,i.overrideMimeType&&i.overrideMimeType(`text/plain; charset=x-user-defined`),i.send(null),i.status>=200&&i.status<300||i.status===304||g(`Couldn't load `+n+`. Status: `+i.status),i.response===void 0?Ie(i.responseText??``):new Uint8Array(i.response||[])},c=this;c.setDataGetter(e=>{var n=e*o,r=(e+1)*o-1;return r=Math.min(r,t-1),c.chunks[e]===void 0&&(c.chunks[e]=s(n,r)),c.chunks[e]===void 0&&g(`doXHR failed!`),c.chunks[e]}),(a||!t)&&(o=t=1,t=this.getter(0).length,o=t,f(`LazyFiles on gzip forces download of the whole file when length is accessed`)),this._length=t,this._chunkSize=o,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){i||g(`Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc`);var s={isDevice:!1,contents:new o}}else var s={isDevice:!1,url:n};var c=F.createFile(e,t,s,r,a);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};for(let[e,t]of Object.entries(c.stream_ops))l[e]=(...e)=>(F.forceLoadFile(c),t(...e));function u(e,t,n,r,i){var a=e.node.contents;if(i>=a.length)return 0;var o=Math.min(a.length-i,r);if(a.slice)for(var s=0;s<o;s++)t[n+s]=a[i+s];else for(var s=0;s<o;s++)t[n+s]=a.get(i+s);return o}return l.read=(e,t,n,r,i)=>(F.forceLoadFile(c),u(e,t,n,r,i)),l.mmap=(e,t,n,r,i)=>{F.forceLoadFile(c);var a=Re();if(!a)throw new F.ErrnoError(48);return u(e,b,a,t,n),{ptr:a,allocated:!0}},c.stream_ops=l,c}},I=(e,t,n)=>e?A(C,e,t,n):``,L={currentUmask:18,calculateAt(e,t,n){if(O.isAbs(t))return t;var r=e===-100?F.cwd():L.getStreamFromFD(e).path;if(t.length==0){if(!n)throw new F.ErrnoError(44);return r}return r+`/`+t},writeStat(e,t){S[e>>2]=t.dev,S[e+4>>2]=t.mode,S[e+8>>2]=t.nlink,S[e+12>>2]=t.uid,S[e+16>>2]=t.gid,S[e+20>>2]=t.rdev,y[e+24>>3]=BigInt(t.size),v[e+32>>2]=4096,v[e+36>>2]=t.blocks;var n=t.atime.getTime(),r=t.mtime.getTime(),i=t.ctime.getTime();return y[e+40>>3]=BigInt(Math.floor(n/1e3)),S[e+48>>2]=n%1e3*1e3*1e3,y[e+56>>3]=BigInt(Math.floor(r/1e3)),S[e+64>>2]=r%1e3*1e3*1e3,y[e+72>>3]=BigInt(Math.floor(i/1e3)),S[e+80>>2]=i%1e3*1e3*1e3,y[e+88>>3]=BigInt(t.ino),0},writeStatFs(e,t){S[e+4>>2]=t.bsize,S[e+60>>2]=t.bsize,y[e+8>>3]=BigInt(t.blocks),y[e+16>>3]=BigInt(t.bfree),y[e+24>>3]=BigInt(t.bavail),y[e+32>>3]=BigInt(t.files),y[e+40>>3]=BigInt(t.ffree),S[e+48>>2]=t.fsid,S[e+64>>2]=t.flags,S[e+56>>2]=t.namelen},doMsync(e,t,n,r,i){if(!F.isFile(t.node.mode))throw new F.ErrnoError(43);if(r&2)return 0;var a=C.slice(e,e+n);F.msync(t,a,i,n,r)},getStreamFromFD(e){return F.getStreamChecked(e)},varargs:void 0,getStr(e){return I(e)}};function Xe(e,t,n){L.varargs=n;try{var r=L.getStreamFromFD(e);switch(t){case 0:var i=E();if(i<0)return-28;for(;F.streams[i];)i++;return F.dupStream(r,i).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:var i=E(),a=289792;return r.flags=r.flags&~a|i&a,0;case 12:var i=D(),o=0;return _[i+o>>1]=2,0;case 13:case 14:return 0}return-28}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function Ze(e,t,n){L.varargs=n;try{var r=L.getStreamFromFD(e);switch(t){case 21509:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var i=r.tty.ops.ioctl_tcgets(r),a=D();v[a>>2]=i.c_iflag||0,v[a+4>>2]=i.c_oflag||0,v[a+8>>2]=i.c_cflag||0,v[a+12>>2]=i.c_lflag||0;for(var o=0;o<32;o++)b[a+o+17]=i.c_cc[o]||0;return 0}return 0;case 21510:case 21511:case 21512:return r.tty?0:-59;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){for(var a=D(),s=v[a>>2],c=v[a+4>>2],l=v[a+8>>2],u=v[a+12>>2],d=[],o=0;o<32;o++)d.push(b[a+o+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:c,c_cflag:l,c_lflag:u,c_cc:d})}return 0;case 21519:if(!r.tty)return-59;var a=D();return v[a>>2]=0,0;case 21520:return r.tty?-28:-59;case 21537:case 21531:var a=D();return F.ioctl(r,t,a);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var f=r.tty.ops.ioctl_tiocgwinsz(r.tty),a=D();_[a>>1]=f[0],_[a+2>>1]=f[1]}return 0;case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function Qe(e,t,n,r){L.varargs=r;try{t=L.getStr(t),t=L.calculateAt(e,t);var i=r?E():0;return n&64&&(i&=~L.currentUmask),F.open(t,n,i).fd}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}var $e=()=>g(``),et={},tt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function nt(e){return this.fromWireType(S[e>>2])}var R={},z={},B={},rt=class extends Error{constructor(e){super(e),this.name=`InternalError`}},it=e=>{throw new rt(e)},at=(e,t,n)=>{e.forEach(e=>B[e]=t);function r(t){var r=n(t);r.length!==e.length&&it(`Mismatched type converter count`);for(var i=0;i<e.length;++i)U(e[i],r[i])}var i=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())z.hasOwnProperty(n)?i[e]=z[n]:(a.push(n),R.hasOwnProperty(n)||(R[n]=[]),R[n].push(()=>{i[e]=z[n],++o,o===a.length&&r(i)}));a.length===0&&r(i)},ot=e=>{var t=et[e];delete et[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.fields,a=i.map(e=>e.getterReturnType).concat(i.map(e=>e.setterArgumentType));at([e],a,e=>{var a={};for(var[o,s]of i.entries()){let t=e[o],n=s.getter,r=s.getterContext,c=e[o+i.length],l=s.setter,u=s.setterContext;a[s.fieldName]={read:e=>t.fromWireType(n(r,e)),write:(e,t)=>{var n=[];l(u,e,c.toWireType(n,t)),tt(n)},optional:t.optional}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in a)t[n]=a[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var i in a)if(!(i in t)&&!a[i].optional)throw TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return e!==null&&e.push(r,o),o},readValueFromPointer:nt,destructorFunction:r}]})},V=e=>{for(var t=``;;){var n=C[e++];if(!n)return t;t+=String.fromCharCode(n)}},st=class extends Error{constructor(e){super(e),this.name=`BindingError`}},H=e=>{throw new st(e)};function ct(e,t,n={}){var r=t.name;if(e||H(`type "${r}" must have a positive integer typeid pointer`),z.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;H(`Cannot register type '${r}' twice`)}if(z[e]=t,delete B[e],R.hasOwnProperty(e)){var i=R[e];delete R[e],i.forEach(e=>e())}}function U(e,t,n={}){return ct(e,t,n)}var lt=(e,t,n)=>{switch(t){case 1:return n?e=>b[e]:e=>C[e];case 2:return n?e=>_[e>>1]:e=>x[e>>1];case 4:return n?e=>v[e>>2]:e=>S[e>>2];case 8:return n?e=>y[e>>3]:e=>be[e>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},ut=(e,t,n,r,i)=>{t=V(t);let a=r===0n,o=e=>e;if(a){let e=n*8;o=t=>BigInt.asUintN(e,t),i=o(i)}U(e,{name:t,fromWireType:o,toWireType:(e,t)=>(typeof t==`number`&&(t=BigInt(t)),t),readValueFromPointer:lt(t,n,!a),destructorFunction:null})},dt=(e,t,n,r)=>{t=V(t),U(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(C[e])},destructorFunction:null})},ft=[],W=[0,1,,1,null,1,!0,1,!1,1],pt=e=>{e>9&&--W[e+1]===0&&(W[e],W[e]=void 0,ft.push(e))},G={toValue:e=>(e||H(`Cannot use deleted val. handle = ${e}`),W[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=ft.pop()||W.length;return W[t]=e,W[t+1]=1,t}}}},mt={name:`emscripten::val`,fromWireType:e=>{var t=G.toValue(e);return pt(e),t},toWireType:(e,t)=>G.toHandle(t),readValueFromPointer:nt,destructorFunction:null},ht=e=>U(e,mt),gt=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(ve[e>>2])};case 8:return function(e){return this.fromWireType(ye[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},_t=(e,t,n)=>{t=V(t),U(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:gt(t,n),destructorFunction:null})},vt=(e,t)=>Object.defineProperty(t,"name",{value:e});function yt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function bt(e,t,n,r,i,a){var o=t.length;o<2&&H(`argTypes array size mismatch! Must at least get return value and 'this' types!`),t[1];var s=yt(t),c=!t[0].isVoid,l=o-2,u=Array(l),d=[],f=[];return vt(e,function(...e){f.length=0;var n;d.length=1,d[0]=i;for(var a=0;a<l;++a)u[a]=t[a+2].toWireType(f,e[a]),d.push(u[a]);var o=r(...d);function p(e){if(s)tt(f);else for(var r=2;r<t.length;r++){var i=r===1?n:u[r-2];t[r].destructorFunction!==null&&t[r].destructorFunction(i)}if(c)return t[0].fromWireType(e)}return p(o)})}var xt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(...r){return e[t].overloadTable.hasOwnProperty(r.length)||H(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},St=(e,t,r)=>{n.hasOwnProperty(e)?((r===void 0||n[e].overloadTable!==void 0&&n[e].overloadTable[r]!==void 0)&&H(`Cannot register public name '${e}' twice`),xt(n,e,e),n[e].overloadTable.hasOwnProperty(r)&&H(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),n[e].overloadTable[r]=t):(n[e]=t,n[e].argCount=r)},Ct=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(S[t+r*4>>2]);return n},wt=(e,t,r)=>{n.hasOwnProperty(e)||it(`Replacing nonexistent public symbol`),n[e].overloadTable!==void 0&&r!==void 0?n[e].overloadTable[r]=t:(n[e]=t,n[e].argCount=r)},Tt=[],K=e=>{var t=Tt[e];return t||(Tt[e]=t=$.get(e)),t},q=(e,t,n=!1)=>{e=V(e);function r(){return K(t)}var i=r();return typeof i!=`function`&&H(`unknown function pointer with signature ${e}: ${t}`),i};class Et extends Error{}var Dt=e=>{var t=qn(e),n=V(t);return Z(t),n},Ot=(e,t)=>{var n=[],r={};function i(e){r[e]||z[e]||(B[e]?B[e].forEach(i):(n.push(e),r[e]=!0))}throw t.forEach(i),new Et(`${e}: `+n.map(Dt).join([`, `]))},kt=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},At=(e,t,n,r,i,a,o,s)=>{var c=Ct(t,n);e=V(e),e=kt(e),i=q(r,i,o),St(e,function(){Ot(`Cannot call ${e} due to unbound types`,c)},t-1),at([],c,n=>{var r=[n[0],null].concat(n.slice(1));return wt(e,bt(e,r,null,i,a),t-1),[]})},jt=(e,t,n,r,i)=>{t=V(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}U(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:lt(t,n,r!==0),destructorFunction:null})},Mt=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function i(e){var t=S[e>>2],n=S[e+4>>2];return new r(b.buffer,n,t)}n=V(n),U(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},J=(e,t,n)=>Fe(e,C,t,n),Nt=(e,t)=>{t=V(t),U(e,{name:t,fromWireType(e){var t=S[e>>2],n=I(e+4,t,!0);return Z(e),n},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n,r=typeof t==`string`;r||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||H(`Cannot pass non-string to std::string`),n=r?Pe(t):t.length;var i=Jn(4+n+1),a=i+4;return S[i>>2]=n,r?J(t,a,n+1):C.set(t,a),e!==null&&e.push(Z,i),i},readValueFromPointer:nt,destructorFunction(e){Z(e)}})},Pt=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,Ft=(e,t,n)=>{var r=e>>1,i=Me(x,r,t/2,n);if(i-r>16&&Pt)return Pt.decode(x.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=x[o];a+=String.fromCharCode(s)}return a},It=(e,t,n)=>{if(n??=2147483647,n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);_[t>>1]=o,t+=2}return _[t>>1]=0,t-r},Lt=e=>e.length*2,Rt=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=S[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},zt=(e,t,n)=>{if(n??=2147483647,n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,v[t>>2]=o,t+=4,t+4>i)break}return v[t>>2]=0,t-r},Bt=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},Vt=(e,t,n)=>{n=V(n);var r,i,a;t===2?(r=Ft,i=It,a=Lt):(r=Rt,i=zt,a=Bt),U(e,{name:n,fromWireType:e=>{var n=S[e>>2],i=r(e+4,n*t,!0);return Z(e),i},toWireType:(e,r)=>{typeof r!=`string`&&H(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Jn(4+o+t);return S[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(Z,s),s},readValueFromPointer:nt,destructorFunction(e){Z(e)}})},Ht=(e,t,n,r,i,a)=>{et[e]={name:V(t),rawConstructor:q(n,r),rawDestructor:q(i,a),fields:[]}},Ut=(e,t,n,r,i,a,o,s,c,l)=>{et[e].fields.push({fieldName:V(t),getterReturnType:n,getter:q(r,i),getterContext:a,setterArgumentType:o,setter:q(s,c),setterContext:l})},Wt=(e,t)=>{t=V(t),U(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},Gt=e=>{do{var t=S[e>>2];e+=4;var n=S[e>>2];e+=4;var r=S[e>>2];e+=4;var i=I(t);F.createPath(`/`,O.dirname(i)),F.createDataFile(i,null,b.subarray(r,r+n),!0,!0,!0)}while(S[e>>2])},Kt=()=>{throw new te},qt=(e,t)=>{e=G.toValue(e),t=G.toValue(t),e.set(t)},Jt=[],Yt=e=>{var t=Jt.length;return Jt.push(e),t},Xt=(e,t)=>{var n=z[e];return n===void 0&&H(`${t} has unknown type ${Dt(e)}`),n},Zt=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=Xt(S[t+r*4>>2],`parameter ${r}`);return n},Qt=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(S[t>>2]=G.toHandle(r)),i},$t={},en=e=>{var t=$t[e];return t===void 0?V(e):t},tn=(e,t,n)=>{var[r,...i]=Zt(e,t),a=r.toWireType.bind(r),o=i.map(e=>e.readValueFromPointer.bind(e));e--;var s=Array(e);return Yt(vt(`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,(t,r,i,c)=>{for(var l=0,u=0;u<e;++u)s[u]=o[u](c+l),l+=8;var d;switch(n){case 0:d=G.toValue(t).apply(null,s);break;case 2:d=Reflect.construct(G.toValue(t),s);break;case 3:d=s[0];break;case 1:d=G.toValue(t)[en(r)](...s)}return Qt(a,i,d)}))},nn=e=>e?(e=en(e),G.toHandle(globalThis[e])):G.toHandle(globalThis),rn=(e,t)=>(e=G.toValue(e),t=G.toValue(t),G.toHandle(e[t])),an=e=>{e>9&&(W[e+1]+=1)},on=(e,t,n,r,i)=>Jt[e](t,n,r,i),sn=()=>G.toHandle([]),cn=e=>G.toHandle(en(e)),ln=e=>{tt(G.toValue(e)),pt(e)},un=(e,t,n)=>{e=G.toValue(e),t=G.toValue(t),n=G.toValue(n),e[t]=n},dn=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);S[e>>2]=l*60,v[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(J(d,n,17),J(f,r,17)):(J(d,r,17),J(f,n,17))},fn=()=>2147483648,pn=(e,t)=>Math.ceil(e/t)*t,mn=e=>{var t=(e-Zn.buffer.byteLength+65535)/65536|0;try{return Zn.grow(t),ae(),1}catch{}},hn=e=>{var t=C.length;e>>>=0;var n=fn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),mn(Math.min(n,pn(Math.max(e,i),65536))))return!0}return!1},gn={},_n=()=>a,Y=()=>{if(!Y.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:_n()};for(var t in gn)gn[t]===void 0?delete e[t]:e[t]=gn[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);Y.strings=n}return Y.strings},vn=(e,t)=>{var n=0,r=0;for(var i of Y()){var a=t+n;S[e+r>>2]=a,n+=J(i,a,1/0)+1,r+=4}return 0},yn=(e,t)=>{var n=Y();S[e>>2]=n.length;var r=0;for(var i of n)r+=Pe(i)+1;return S[t>>2]=r,0},bn=0,xn=()=>Ee||bn>0,Sn=e=>{xn()||(n.onExit?.(e),ee=!0),o(e,new _e(e))},Cn=(e,t)=>{Sn(e)};function wn(e){try{var t=L.getStreamFromFD(e);return F.close(t),0}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var Tn=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=S[t>>2],s=S[t+4>>2];t+=8;var c=F.read(e,b,o,s,r);if(c<0)return-1;if(i+=c,c<s)break}return i};function En(e,t,n,r){try{var i=Tn(L.getStreamFromFD(e),t,n);return S[r>>2]=i,0}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var Dn=9007199254740992,On=-9007199254740992,kn=e=>e<On||e>Dn?NaN:Number(e);function An(e,t,n,r){t=kn(t);try{if(isNaN(t))return 22;var i=L.getStreamFromFD(e);return F.llseek(i,t,n),y[r>>3]=BigInt(i.position),i.getdents&&t===0&&n===0&&(i.getdents=null),0}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var jn=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=S[t>>2],s=S[t+4>>2];t+=8;var c=F.write(e,b,o,s,r);if(c<0)return-1;if(i+=c,c<s)break}return i};function Mn(e,t,n,r){try{var i=jn(L.getStreamFromFD(e),t,n);return S[r>>2]=i,0}catch(e){if(F===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var Nn=(e,t)=>{if(X)for(var n=e;n<e+t;n++){var r=K(n);r&&X.set(r,n)}},X,Pn=e=>(X||(X=new WeakMap,Nn(0,$.length)),X.get(e)||0),Fn=[],In=()=>Fn.length?Fn.pop():$.grow(1),Ln=(e,t)=>{$.set(e,t),Tt[e]=$.get(e)},Rn=e=>{let t=e.length;return[t%128|128,t>>7,...e]},zn={i:127,p:127,j:126,f:125,d:124,e:111},Bn=e=>Rn(Array.from(e,e=>zn[e])),Vn=(e,t)=>{var n=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Rn([1,96,...Bn(t.slice(1)),...Bn(t[0]===`v`?``:t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(n);return new WebAssembly.Instance(r,{e:{f:e}}).exports.f},Hn=(e,t)=>{var n=Pn(e);if(n)return n;var r=In();try{Ln(r,e)}catch(n){if(!(n instanceof TypeError))throw n;Ln(r,Vn(e,t))}return X.set(e,r),r},Un=(...e)=>F.createPath(...e),Wn=(...e)=>F.unlink(...e),Gn=(...e)=>F.createLazyFile(...e),Kn=(...e)=>F.createDevice(...e);if(F.createPreloadedFile=Ye,F.preloadFile=Je,F.staticInit(),n.noExitRuntime&&(Ee=n.noExitRuntime),n.preloadPlugins&&(Ke=n.preloadPlugins),n.print&&(f=n.print),n.printErr&&(p=n.printErr),n.wasmBinary&&(m=n.wasmBinary),n.arguments&&n.arguments,n.thisProgram&&(a=n.thisProgram),n.preInit)for(typeof n.preInit==`function`&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();n.addRunDependency=Ge,n.removeRunDependency=We,n.addFunction=Hn,n.UTF8ToString=I,n.FS_preloadFile=Je,n.FS_unlink=Wn,n.FS_createPath=Un,n.FS_createDevice=Kn,n.FS_createDataFile=Ue,n.FS_createLazyFile=Gn,n.Emval=G;var qn,Jn,Z,Q,Yn,Xn,Zn,$;function Qn(e){qn=e._,Jn=n._malloc=e.aa,Z=n._free=e.ba,Q=e.ca,Yn=e.da,Xn=e.ea,Zn=e.Y,$=e.$}var $n={n:Oe,x:Xe,M:Ze,N:Qe,O:$e,A:ot,z:ut,T:dt,R:ht,y:_t,o:At,d:jt,b:Mt,S:Nt,t:Vt,B:Ht,c:Ut,U:Wt,Q:Gt,F:Kt,W:qt,k:tn,a:pt,X:nn,p:rn,j:an,i:on,C:sn,m:cn,h:ln,V:un,H:dn,G:hn,J:vn,K:yn,P:Cn,v:wn,L:En,I:An,w:Mn,q:er,l:rr,r:ar,u:or,E:cr,s:ir,g:tr,D:lr,e:sr,f:nr};function er(e,t){var n=T();try{return K(e)(t)}catch(e){if(w(n),!(e instanceof h))throw e;Q(1,0)}}function tr(e,t){var n=T();try{K(e)(t)}catch(e){if(w(n),!(e instanceof h))throw e;Q(1,0)}}function nr(e,t,n,r){var i=T();try{K(e)(t,n,r)}catch(e){if(w(i),!(e instanceof h))throw e;Q(1,0)}}function rr(e,t,n){var r=T();try{return K(e)(t,n)}catch(e){if(w(r),!(e instanceof h))throw e;Q(1,0)}}function ir(e){var t=T();try{K(e)()}catch(e){if(w(t),!(e instanceof h))throw e;Q(1,0)}}function ar(e,t,n,r){var i=T();try{return K(e)(t,n,r)}catch(e){if(w(i),!(e instanceof h))throw e;Q(1,0)}}function or(e,t,n,r,i){var a=T();try{return K(e)(t,n,r,i)}catch(e){if(w(a),!(e instanceof h))throw e;Q(1,0)}}function sr(e,t,n){var r=T();try{K(e)(t,n)}catch(e){if(w(r),!(e instanceof h))throw e;Q(1,0)}}function cr(e,t,n,r,i,a,o,s,c,l){var u=T();try{return K(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(w(u),!(e instanceof h))throw e;Q(1,0)}}function lr(e,t,n,r){var i=T();try{K(e)(t,n,r)}catch(e){if(w(i),!(e instanceof h))throw e;Q(1,0)}}function ur(){if(N>0||(oe(),N>0)){P=ur;return}function e(){n.calledRun=!0,!ee&&(se(),ne?.(n),n.onRuntimeInitialized?.(),ce())}n.setStatus?(n.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>n.setStatus(``),1),e()},1)):e()}var dr=await ge();return ur(),t=ie?n:new Promise((e,t)=>{ne=e,re=t}),t}export{e as default};
|
|
2
|
+
async function e(e={}){var t=e,n=!!globalThis.window,r=!!globalThis.WorkerGlobalScope;globalThis.process?.versions?.node&&globalThis.process;var i=`./this.program`,a=(e,t)=>{throw t},o=``,s=``;function c(e){return t.locateFile?t.locateFile(e,s):s+e}var l,u;if(n||r){try{s=new URL(`.`,o).href}catch{}r&&(u=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),l=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var d=console.log.bind(console),f=console.error.bind(console),p=!1;class m{}class h extends m{}function ee(){return on.buffer}function te(){if(!_?.buffer?.resizable){var e=ee();_=new Int8Array(e),F=new Int16Array(e),t.HEAPU8=j=new Uint8Array(e),t.HEAPU16=V=new Uint16Array(e),x=new Int32Array(e),t.HEAPU32=b=new Uint32Array(e),t.HEAPF32=it=new Float32Array(e),t.HEAPF64=at=new Float64Array(e),N=new BigInt64Array(e),$e=new BigUint64Array(e)}}function ne(){var e=t.preRun;e&&(typeof e==`function`&&(e=[e]),he.push(...e)),pe(he)}function re(){!t.noFSInit&&!A.initialized&&A.init(),$.Z(),A.ignorePermissions=!1}function ie(){var e=t.postRun;e&&(typeof e==`function`&&(e=[e]),me.push(...e)),pe(me)}function g(e){throw t.onAbort?.(e),e=`Aborted(${e})`,f(e),p=!0,e+=`. Build with -sASSERTIONS for more info.`,new WebAssembly.RuntimeError(e)}var ae;function oe(){return t.locateFile?c(`lyr3DWorker.wasm`):new URL(`lyr3DWorker.wasm`,``).href}function se(e){if(u)return u(e);throw`both async and sync fetching of the wasm failed`}async function ce(e){try{var t=await l(e);return new Uint8Array(t)}catch{}return se(e)}async function le(e,t){try{var n=await ce(e);return await WebAssembly.instantiate(n,t)}catch(e){f(`failed to asynchronously prepare wasm: ${e}`),g(e)}}async function ue(e,t,n){try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){f(`wasm streaming compile failed: ${e}`),f(`falling back to ArrayBuffer instantiation`)}return le(t,n)}function de(){return{a:cn}}class fe{name=`ExitStatus`;constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var _,pe=e=>{for(;e.length>0;)e.shift()(t)},me=[],he=[],ge=!0,v=e=>nn(e),y=()=>an(),b;class _e{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){b[this.ptr+4>>2]=e}get_type(){return b[this.ptr+4>>2]}set_destructor(e){b[this.ptr+8>>2]=e}get_destructor(){return b[this.ptr+8>>2]}set_caught(e){e=+!!e,_[this.ptr+12]=e}get_caught(){return _[this.ptr+12]!=0}set_rethrown(e){e=+!!e,_[this.ptr+13]=e}get_rethrown(){return _[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){b[this.ptr+16>>2]=e}get_adjusted_ptr(){return b[this.ptr+16>>2]}}var ve=()=>{g()},x,S=()=>{var e=x[P.varargs>>2];return P.varargs+=4,e},C=S,w={isAbs:e=>e.charAt(0)===`/`,splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];i===`.`?e.splice(r,1):i===`..`?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(`..`);return e},normalize:e=>{var t=w.isAbs(e),n=e.slice(-1)===`/`;return e=w.normalizeArray(e.split(`/`).filter(e=>!!e),!t).join(`/`),!e&&!t&&(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},dirname:e=>{var t=w.splitPath(e),n=t[0],r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,-1),n+r)},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>w.normalize(e.join(`/`)),join2:(e,t)=>w.normalize(e+`/`+t)},ye=()=>e=>(crypto.getRandomValues(e),0),be=e=>(be=ye())(e),T={resolve:(...e)=>{for(var t=``,n=!1,r=e.length-1;r>=-1&&!n;r--){var i=r>=0?e[r]:A.cwd();if(typeof i!=`string`)throw TypeError(`Arguments to path.resolve must be strings`);if(!i)return``;t=i+`/`+t,n=w.isAbs(i)}return t=w.normalizeArray(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`},relative:(e,t)=>{e=T.resolve(e).slice(1),t=T.resolve(t).slice(1);function n(e){for(var t=0;t<e.length&&e[t]===``;t++);for(var n=e.length-1;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}for(var r=n(e.split(`/`)),i=n(t.split(`/`)),a=Math.min(r.length,i.length),o=a,s=0;s<a;s++)if(r[s]!==i[s]){o=s;break}var c=[];for(s=o;s<r.length;s++)c.push(`..`);return c=c.concat(i.slice(o)),c.join(`/`)}},xe=globalThis.TextDecoder&&new TextDecoder,Se=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},E=(e,t=0,n,r)=>{var i=Se(e,t,n,r);if(i-t>16&&e.buffer&&xe)return xe.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128))a+=String.fromCharCode(o);else{var s=e[t++]&63;if((o&224)==192)a+=String.fromCharCode((o&31)<<6|s);else{var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}}}return a},Ce=[],we=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},Te=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},Ee=(e,t,n)=>{var r=we(e)+1,i=Array(r);return i.length=Te(e,i,0,i.length),i},De=()=>{if(!Ce.length){var e=null;if(globalThis.window?.prompt&&(e=window.prompt(`Input: `),e!==null&&(e+=`
|
|
3
|
+
`)),!e)return null;Ce=Ee(e)}return Ce.shift()},D={ttys:[],init(){},shutdown(){},register(e,t){D.ttys[e]={input:[],output:[],ops:t},A.registerDevice(e,D.stream_ops)},stream_ops:{open(e){var t=D.ttys[e.node.rdev];if(!t)throw new A.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,i){if(!e.tty||!e.tty.ops.get_char)throw new A.ErrnoError(60);for(var a=0,o=0;o<r;o++){var s;try{s=e.tty.ops.get_char(e.tty)}catch{throw new A.ErrnoError(29)}if(s===void 0&&!a)throw new A.ErrnoError(6);if(s==null||(a++,t[n+o]=s,s===10))break}return a&&(e.node.atime=Date.now()),a},write(e,t,n,r,i){if(!e.tty||!e.tty.ops.put_char)throw new A.ErrnoError(60);try{for(var a=0;a<r;a++)e.tty.ops.put_char(e.tty,t[n+a])}catch{throw new A.ErrnoError(29)}return r&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char(e){return De()},put_char(e,t){t===null||t===10?(d(E(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output?.length>0&&(d(E(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(f(E(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output?.length>0&&(f(E(e.output)),e.output=[])}}},Oe=()=>{g()},O={ops_table:null,mount(e){return O.createNode(null,`/`,16895,0)},createNode(e,t,n,r){if(A.isBlkdev(n)||A.isFIFO(n))throw new A.ErrnoError(63);O.ops_table||={dir:{node:{getattr:O.node_ops.getattr,setattr:O.node_ops.setattr,lookup:O.node_ops.lookup,mknod:O.node_ops.mknod,rename:O.node_ops.rename,unlink:O.node_ops.unlink,rmdir:O.node_ops.rmdir,readdir:O.node_ops.readdir,symlink:O.node_ops.symlink},stream:{llseek:O.stream_ops.llseek}},file:{node:{getattr:O.node_ops.getattr,setattr:O.node_ops.setattr},stream:{llseek:O.stream_ops.llseek,read:O.stream_ops.read,write:O.stream_ops.write,mmap:O.stream_ops.mmap,msync:O.stream_ops.msync}},link:{node:{getattr:O.node_ops.getattr,setattr:O.node_ops.setattr,readlink:O.node_ops.readlink},stream:{}},chrdev:{node:{getattr:O.node_ops.getattr,setattr:O.node_ops.setattr},stream:A.chrdev_stream_ops}};var i=A.createNode(e,t,n,r);return A.isDir(i.mode)?(i.node_ops=O.ops_table.dir.node,i.stream_ops=O.ops_table.dir.stream,i.contents={}):A.isFile(i.mode)?(i.node_ops=O.ops_table.file.node,i.stream_ops=O.ops_table.file.stream,i.usedBytes=0,i.contents=O.emptyFileContents??=new Uint8Array):A.isLink(i.mode)?(i.node_ops=O.ops_table.link.node,i.stream_ops=O.ops_table.link.stream):A.isChrdev(i.mode)&&(i.node_ops=O.ops_table.chrdev.node,i.stream_ops=O.ops_table.chrdev.stream),i.atime=i.mtime=i.ctime=Date.now(),e&&(e.contents[t]=i,e.atime=e.mtime=e.ctime=i.atime),i},getFileDataAsTypedArray(e){return e.contents.subarray(0,e.usedBytes)},expandFileStorage(e,t){var n=e.contents.length;if(!(n>=t)){t=Math.max(t,n*(n<1048576?2:1.125)>>>0),n&&(t=Math.max(t,256));var r=O.getFileDataAsTypedArray(e);e.contents=new Uint8Array(t),e.contents.set(r)}},resizeFileStorage(e,t){if(e.usedBytes!=t){var n=e.contents;e.contents=new Uint8Array(t),e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=A.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,t.size=A.isDir(e.mode)?4096:A.isFile(e.mode)?e.usedBytes:A.isLink(e.mode)?e.link.length:0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){for(let n of[`mode`,`atime`,`mtime`,`ctime`])t[n]!=null&&(e[n]=t[n]);t.size!==void 0&&O.resizeFileStorage(e,t.size)},lookup(e,t){throw O.doesNotExistError||(O.doesNotExistError=new A.ErrnoError(44),O.doesNotExistError.stack=`<generic error, no stack>`),O.doesNotExistError},mknod(e,t,n,r){return O.createNode(e,t,n,r)},rename(e,t,n){var r;try{r=A.lookupNode(t,n)}catch{}if(r&&A.isDir(e.mode))for(var i in r.contents)throw new A.ErrnoError(55);delete e.parent.contents[e.name],t.contents[n]=e,e.name=n,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.contents[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){for(var n in A.lookupNode(e,t).contents)throw new A.ErrnoError(55);delete e.contents[t],e.ctime=e.mtime=Date.now()},readdir(e){return[`.`,`..`,...Object.keys(e.contents)]},symlink(e,t,n){var r=O.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!A.isLink(e.mode))throw new A.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-i,r);return t.set(a.subarray(i,i+o),n),o},write(e,t,n,r,i,a){if(t.buffer===_.buffer&&(a=!1),!r)return 0;var o=e.node;return o.mtime=o.ctime=Date.now(),a?(o.contents=t.subarray(n,n+r),o.usedBytes=r):!o.usedBytes&&!i?(o.contents=t.slice(n,n+r),o.usedBytes=r):(O.expandFileStorage(o,i+r),o.contents.set(t.subarray(n,n+r),i),o.usedBytes=Math.max(o.usedBytes,i+r)),r},llseek(e,t,n){var r=t;if(n===1?r+=e.position:n===2&&A.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new A.ErrnoError(28);return r},mmap(e,t,n,r,i){if(!A.isFile(e.node.mode))throw new A.ErrnoError(43);var a,o,s=e.node.contents;if(!(i&2)&&s.buffer===_.buffer)o=!1,a=s.byteOffset;else{if(o=!0,a=Oe(),!a)throw new A.ErrnoError(48);s&&((n>0||n+t<s.length)&&(s=s.subarray?s.subarray(n,n+t):Array.prototype.slice.call(s,n,n+t)),_.set(s,a))}return{ptr:a,allocated:o}},msync(e,t,n,r,i){return O.stream_ops.write(e,t,0,r,n,!1),0}}},ke=e=>{if(typeof e!=`string`)return e;var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(t===void 0)throw Error(`Unknown file open mode: ${e}`);return t},Ae=e=>(typeof e==`string`&&(e=Ee(e)),e.subarray||(e=new Uint8Array(e)),e),je=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},Me=async e=>{var t=await l(e);return new Uint8Array(t)},Ne=(...e)=>A.createDataFile(...e),Pe=null,Fe=async()=>Pe,k=0,Ie=null,Le=()=>{k--,t.monitorRunDependencies?.(k),k||Ie()},Re=()=>{k||(Pe=new Promise(e=>Ie=e)),k++,t.monitorRunDependencies?.(k)},ze=[],Be=async(e,t)=>{typeof Browser<`u`&&Browser.init();for(var n of ze)if(n.canHandle(t))return n.handle(e,t);return e},Ve=async(e,t,n,r,i,a,o,s)=>{var c=t?T.resolve(w.join2(e,t)):e;Re();try{var l=n;typeof n==`string`&&(l=await Me(n)),l=await Be(l,c),s?.(),a||Ne(e,t,l,r,i,o)}finally{Le()}},A={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:[],currentPath:`/`,initialized:!1,ignorePermissions:!0,syncFSRequests:0,ErrnoError:class{name=`ErrnoError`;constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!=1}get isWrite(){return!!(this.flags&2097155)}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,t,n,r){e||=this,this.parent=e,this.mount=e.mount,this.id=A.nextInode++,this.name=t,this.mode=n,this.rdev=r,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return A.isDir(this.mode)}get isDevice(){return A.isChrdev(this.mode)}addListener(e,t=!1){var n={cb:e,exclusive:t},r=this.listeners??=new Set;return r.add(n),{listeners:r,entry:n}}notifyListeners(e){if(this.listeners){var t;for(var n of this.listeners)n.exclusive?(t||=[]).push(n):n.cb(e);if(t){var r=(this.exclTurn||0)%t.length;this.exclTurn=r+1,t[r].cb(e)}}}},lookupPath(e,t={}){if(!e)throw new A.ErrnoError(44);t.follow_mount??=!0,w.isAbs(e)||(e=A.cwd()+`/`+e);linkloop:for(var n=0;n<40;n++){for(var r=e.split(`/`).filter(e=>!!e),i=A.root,a=`/`,o=0;o<r.length;o++){var s=o===r.length-1;if(s&&t.parent)break;if(r[o]!==`.`){if(r[o]===`..`){if(a=w.dirname(a),A.isRoot(i)){e=a+`/`+r.slice(o+1).join(`/`),n--;continue linkloop}i=i.parent}else{a=w.join2(a,r[o]);try{i=A.lookupNode(i,r[o])}catch(e){if(e?.errno===44&&s&&t.noent_okay)return{path:a};throw e}if(A.isMountpoint(i)&&(!s||t.follow_mount)&&(i=i.mounted.root),A.isLink(i.mode)&&(!s||t.follow)){if(!i.node_ops.readlink)throw new A.ErrnoError(52);var c=i.node_ops.readlink(i);w.isAbs(c)||(c=w.dirname(a)+`/`+c),e=c+`/`+r.slice(o+1).join(`/`);continue linkloop}}}}return{path:a,node:i}}throw new A.ErrnoError(32)},getPath(e){for(var t;;){if(A.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]===`/`?n+t:`${n}/${t}`:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%A.nameTable.length},hashAddNode(e){var t=A.hashName(e.parent.id,e.name);e.name_next=A.nameTable[t],A.nameTable[t]=e},hashRemoveNode(e){var t=A.hashName(e.parent.id,e.name);if(A.nameTable[t]===e)A.nameTable[t]=e.name_next;else for(var n=A.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=A.mayLookup(e);if(n)throw new A.ErrnoError(n);for(var r=A.hashName(e.id,t),i=A.nameTable[r];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===t)return i}return A.lookup(e,t)},createNode(e,t,n,r){var i=new A.FSNode(e,t,n,r);return A.hashAddNode(i),i},destroyNode(e){A.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)==32768},isDir(e){return(e&61440)==16384},isLink(e){return(e&61440)==40960},isChrdev(e){return(e&61440)==8192},isBlkdev(e){return(e&61440)==24576},isFIFO(e){return(e&61440)==4096},isSocket(e){return(e&49152)==49152},flagsToPermissionString(e){var t=[`r`,`w`,`rw`][e&3];return e&512&&(t+=`w`),t},nodePermissions(e,t){return A.ignorePermissions?0:t.includes(`r`)&&!(e.mode&292)||t.includes(`w`)&&!(e.mode&146)||t.includes(`x`)&&!(e.mode&73)?2:0},mayLookup(e){return A.isDir(e.mode)?A.nodePermissions(e,`x`)||(e.node_ops.lookup?0:2):54},mayCreate(e,t){if(!A.isDir(e.mode))return 54;try{return A.lookupNode(e,t),20}catch{}return A.nodePermissions(e,`wx`)},mayDelete(e,t,n){var r;try{r=A.lookupNode(e,t)}catch(e){return e.errno}var i=A.nodePermissions(e,`wx`);if(i)return i;if(n){if(!A.isDir(r.mode))return 54;if(A.isRoot(r)||A.getPath(r)===A.cwd())return 10}else if(A.isDir(r.mode))return 31;return 0},mayOpen(e,t){if(!e)return 44;if(A.isLink(e.mode))return 32;var n=A.flagsToPermissionString(t);return A.isDir(e.mode)&&(n!==`r`||t&576)?31:A.nodePermissions(e,n)},checkOpExists(e,t){if(!e)throw new A.ErrnoError(t);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=A.MAX_OPEN_FDS;e++)if(!A.streams[e])return e;throw new A.ErrnoError(33)},getStreamChecked(e){var t=A.getStream(e);if(!t)throw new A.ErrnoError(8);return t},getStream:e=>A.streams[e],createStream(e,t=-1){return e=Object.assign(new A.FSStream,e),t==-1&&(t=A.nextfd()),e.fd=t,A.streams[t]=e,e},closeStream(e){A.streams[e]=null},dupStream(e,t=-1){var n=A.createStream(e,t);return n.stream_ops?.dup?.(n),n},doSetAttr(e,t,n){var r=e?.stream_ops.setattr,i=r?e:t;r??=t.node_ops.setattr,A.checkOpExists(r,63);try{r(i,n)}catch(e){throw e instanceof RangeError?new A.ErrnoError(22):e}},chrdev_stream_ops:{open(e){e.stream_ops=A.getDevice(e.node.rdev).stream_ops,e.stream_ops.open?.(e)},llseek(){throw new A.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){A.devices[e]={stream_ops:t}},getDevice:e=>A.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e==`function`&&(t=e,e=!1),A.syncFSRequests++,A.syncFSRequests>1&&f(`warning: ${A.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=A.getMounts(A.root.mount),r=0;function i(e){return A.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,i(e));++r>=n.length&&i(null)}for(var o of n)o.type.syncfs?o.type.syncfs(o,e,a):a(null)},mount(e,t,n){var r=n===`/`,i=!n,a;if(r&&A.root)throw new A.ErrnoError(10);if(!r&&!i){var o=A.lookupPath(n,{follow_mount:!1});if(n=o.path,a=o.node,A.isMountpoint(a))throw new A.ErrnoError(10);if(!A.isDir(a.mode))throw new A.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,r?A.root=c:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),c},unmount(e){var t=A.lookupPath(e,{follow_mount:!1});if(!A.isMountpoint(t.node))throw new A.ErrnoError(28);var n=t.node,r=n.mounted,i=A.getMounts(r);for(var[a,o]of Object.entries(A.nameTable))for(;o;){var s=o.name_next;i.includes(o.mount)&&A.destroyNode(o),o=s}n.mounted=null;var c=n.mount.mounts.indexOf(r);n.mount.mounts.splice(c,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=A.lookupPath(e,{parent:!0}).node,i=w.basename(e);if(!i)throw new A.ErrnoError(28);if(i===`.`||i===`..`)throw new A.ErrnoError(20);var a=A.mayCreate(r,i);if(a)throw new A.ErrnoError(a);if(!r.node_ops.mknod)throw new A.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},statfs(e){return A.statfsNode(A.lookupPath(e,{follow:!0}).node)},statfsStream(e){return A.statfsNode(e.node)},statfsNode(e){var t={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:A.nextInode,ffree:A.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(t,e.node_ops.statfs(e.mount.opts.root)),t},create(e,t=438){return t&=4095,t|=32768,A.mknod(e,t,0)},mkdir(e,t=511){return t&=1023,t|=16384,A.mknod(e,t,0)},mkdirTree(e,t=511){var n=e.split(`/`),r=``;for(var i of n)if(i){(r||w.isAbs(e))&&(r+=`/`),r+=i;try{A.mkdir(r,t)}catch(e){if(e.errno!=20)throw e}}},mkdev(e,t,n){return n===void 0&&(n=t,t=438),t|=8192,A.mknod(e,t,n)},symlink(e,t){if(!T.resolve(e))throw new A.ErrnoError(44);var n=A.lookupPath(t,{parent:!0}).node;if(!n)throw new A.ErrnoError(44);var r=w.basename(t),i=A.mayCreate(n,r);if(i)throw new A.ErrnoError(i);if(!n.node_ops.symlink)throw new A.ErrnoError(63);return n.node_ops.symlink(n,r,e)},link(e,t,n){var r=A.lookupPath(t,{parent:!0}).node;if(!r)throw new A.ErrnoError(44);var i=w.basename(t),a=A.mayCreate(r,i);if(a)throw new A.ErrnoError(a);if(!r.node_ops.link)throw new A.ErrnoError(34);return r.node_ops.link(r,i,e,n)},rename(e,t){var n=w.dirname(e),r=w.dirname(t),i=w.basename(e),a=w.basename(t),o=A.lookupPath(e,{parent:!0}),s=o.node,c;if(o=A.lookupPath(t,{parent:!0}),c=o.node,!s||!c)throw new A.ErrnoError(44);if(s.mount!==c.mount)throw new A.ErrnoError(75);var l=A.lookupNode(s,i),u=T.relative(e,r);if(u.charAt(0)!==`.`)throw new A.ErrnoError(28);if(u=T.relative(t,n),u.charAt(0)!==`.`)throw new A.ErrnoError(55);var d;try{d=A.lookupNode(c,a)}catch{}if(l!==d){var f=A.isDir(l.mode),p=A.mayDelete(s,i,f);if(p||(p=d?A.mayDelete(c,a,f):A.mayCreate(c,a),p))throw new A.ErrnoError(p);if(!s.node_ops.rename)throw new A.ErrnoError(63);if(A.isMountpoint(l)||d&&A.isMountpoint(d))throw new A.ErrnoError(10);if(c!==s&&(p=A.nodePermissions(s,`w`),p))throw new A.ErrnoError(p);A.hashRemoveNode(l);try{s.node_ops.rename(l,c,a),d&&A.hashRemoveNode(d),l.parent=c}catch(e){throw e}finally{A.hashAddNode(l)}}},rmdir(e){var t=A.lookupPath(e,{parent:!0}).node,n=w.basename(e),r=A.lookupNode(t,n),i=A.mayDelete(t,n,!0);if(i)throw new A.ErrnoError(i);if(!t.node_ops.rmdir)throw new A.ErrnoError(63);if(A.isMountpoint(r))throw new A.ErrnoError(10);t.node_ops.rmdir(t,n),A.destroyNode(r)},readdir(e){var t=A.lookupPath(e,{follow:!0}).node;return A.checkOpExists(t.node_ops.readdir,54)(t)},unlink(e){var t=A.lookupPath(e,{parent:!0}).node;if(!t)throw new A.ErrnoError(44);var n=w.basename(e),r=A.lookupNode(t,n),i=A.mayDelete(t,n,!1);if(i)throw new A.ErrnoError(i);if(!t.node_ops.unlink)throw new A.ErrnoError(63);if(A.isMountpoint(r))throw new A.ErrnoError(10);t.node_ops.unlink(t,n),A.destroyNode(r)},readlink(e){var t=A.lookupPath(e).node;if(!t)throw new A.ErrnoError(44);if(!t.node_ops.readlink)throw new A.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,t=!1){var n=A.lookupPath(e,{follow:!t}).node;return A.checkOpExists(n.node_ops.getattr,63)(n)},fstat(e){var t=A.getStreamChecked(e),n=t.node,r=t.stream_ops.getattr,i=r?t:n;return r??=n.node_ops.getattr,A.checkOpExists(r,63),r(i)},lstat(e){return A.stat(e,!0)},doChmod(e,t,n,r=!1){A.doSetAttr(e,t,{mode:n&4095|t.mode&-4096,ctime:Date.now(),dontFollow:r})},chmod(e,t,n=!1){var r=typeof e==`string`?A.lookupPath(e,{follow:!n}).node:e;A.doChmod(null,r,t,n)},lchmod(e,t){A.chmod(e,t,!0)},fchmod(e,t){var n=A.getStreamChecked(e);A.doChmod(n,n.node,t,!1)},doChown(e,t,n=!1){A.doSetAttr(e,t,{timestamp:Date.now(),dontFollow:n})},chown(e,t,n,r=!1){var i=typeof e==`string`?A.lookupPath(e,{follow:!r}).node:e;A.doChown(null,i,r)},lchown(e,t,n){A.chown(e,t,n,!0)},fchown(e,t,n){var r=A.getStreamChecked(e);A.doChown(r,r.node,!1)},doTruncate(e,t,n){if(A.isDir(t.mode))throw new A.ErrnoError(31);if(!A.isFile(t.mode))throw new A.ErrnoError(28);var r=A.nodePermissions(t,`w`);if(r)throw new A.ErrnoError(r);A.doSetAttr(e,t,{size:n,timestamp:Date.now()})},truncate(e,t){if(t<0)throw new A.ErrnoError(28);var n=typeof e==`string`?A.lookupPath(e,{follow:!0}).node:e;A.doTruncate(null,n,t)},ftruncate(e,t){var n=A.getStreamChecked(e);if(t<0||!(n.flags&2097155))throw new A.ErrnoError(28);A.doTruncate(n,n.node,t)},utime(e,t,n,r=!1){var i=A.lookupPath(e,{follow:!r});A.doSetAttr(null,i.node,{atime:t,mtime:n,dontFollow:r})},open(e,t,n=438){if(e===``)throw new A.ErrnoError(44);t=ke(t),n=t&64?n&4095|32768:0;var r,i;if(typeof e==`object`)r=e;else{i=e.endsWith(`/`);var a=A.lookupPath(e,{follow:!(t&131072),noent_okay:!0});r=a.node,e=a.path}var o=!1;if(t&64){if(r){if(t&128)throw new A.ErrnoError(20)}else if(i)throw new A.ErrnoError(31);else r=A.mknod(e,n|511,0),o=!0}if(!r)throw new A.ErrnoError(44);if(A.isChrdev(r.mode)&&(t&=-513),t&65536&&!A.isDir(r.mode))throw new A.ErrnoError(54);if(!o){var s=A.mayOpen(r,t);if(s)throw new A.ErrnoError(s)}t&512&&!o&&A.truncate(r,0),t&=-131713;var c=A.createStream({node:r,path:A.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return c.stream_ops.open&&c.stream_ops.open(c),o&&A.chmod(r,n&511),c},close(e){if(A.isClosed(e))throw new A.ErrnoError(8);e.getdents&&=null,e.node?.notifyListeners(32);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{A.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(A.isClosed(e))throw new A.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new A.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new A.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,i){if(r<0||i<0)throw new A.ErrnoError(28);if(A.isClosed(e)||(e.flags&2097155)==1)throw new A.ErrnoError(8);if(A.isDir(e.node.mode))throw new A.ErrnoError(31);if(!e.stream_ops.read)throw new A.ErrnoError(28);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new A.ErrnoError(70);var o=e.stream_ops.read(e,t,n,r,i);return a||(e.position+=o),o},write(e,t,n,r,i,a){if(r<0||i<0)throw new A.ErrnoError(28);if(A.isClosed(e)||!(e.flags&2097155))throw new A.ErrnoError(8);if(A.isDir(e.node.mode))throw new A.ErrnoError(31);if(!e.stream_ops.write)throw new A.ErrnoError(28);e.seekable&&e.flags&1024&&A.llseek(e,0,2);var o=i!==void 0;if(!o)i=e.position;else if(!e.seekable)throw new A.ErrnoError(70);var s=e.stream_ops.write(e,t,n,r,i,a);return o||(e.position+=s),s},mmap(e,t,n,r,i){if(r&2&&!(i&2)&&(e.flags&2097155)!=2||(e.flags&2097155)==1)throw new A.ErrnoError(2);if(!e.stream_ops.mmap)throw new A.ErrnoError(43);if(!t)throw new A.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,i)},msync(e,t,n,r,i){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new A.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){t.flags??=0,t.encoding??=`binary`,t.encoding!==`utf8`&&t.encoding!==`binary`&&g(`Invalid encoding type "${t.encoding}"`);var n=A.open(e,t.flags),r=A.stat(e).size,i=new Uint8Array(r);return A.read(n,i,0,r,0),t.encoding===`utf8`&&(i=E(i)),A.close(n),i},writeFile(e,t,n={}){n.flags??=577;var r=A.open(e,n.flags,n.mode);t=Ae(t),A.write(r,t,0,t.byteLength,void 0,n.canOwn),A.close(r)},cwd:()=>A.currentPath,chdir(e){var t=A.lookupPath(e,{follow:!0});if(t.node===null)throw new A.ErrnoError(44);if(!A.isDir(t.node.mode))throw new A.ErrnoError(54);var n=A.nodePermissions(t.node,`x`);if(n)throw new A.ErrnoError(n);A.currentPath=t.path},createDefaultDirectories(){A.mkdir(`/tmp`),A.mkdir(`/home`),A.mkdir(`/home/web_user`)},createDefaultDevices(){A.mkdir(`/dev`),A.registerDevice(A.makedev(1,3),{read:()=>0,write:(e,t,n,r)=>r,llseek:()=>0}),A.mkdev(`/dev/null`,A.makedev(1,3)),D.register(A.makedev(5,0),D.default_tty_ops),D.register(A.makedev(6,0),D.default_tty1_ops),A.mkdev(`/dev/tty`,A.makedev(5,0)),A.mkdev(`/dev/tty1`,A.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t||=(be(e),e.byteLength),e[--t]);A.createDevice(`/dev`,`random`,n),A.createDevice(`/dev`,`urandom`,n),A.mkdir(`/dev/shm`),A.mkdir(`/dev/shm/tmp`)},createSpecialDirectories(){A.mkdir(`/proc`);var e=A.mkdir(`/proc/self`);A.mkdir(`/proc/self/fd`),A.mount({mount(){var t=A.createNode(e,`fd`,16895,73);return t.stream_ops={llseek:O.stream_ops.llseek},t.node_ops={lookup(e,t){var n=+t,r=A.getStreamChecked(n),i={parent:null,mount:{mountpoint:`fake`},node_ops:{readlink:()=>r.path},id:n+1};return i.parent=i,i},readdir(){return Array.from(A.streams.entries()).filter(([e,t])=>t).map(([e,t])=>e.toString())}},t}},{},`/proc/self/fd`)},createStandardStreams(e,t,n){e?A.createDevice(`/dev`,`stdin`,e):A.symlink(`/dev/tty`,`/dev/stdin`),t?A.createDevice(`/dev`,`stdout`,null,t):A.symlink(`/dev/tty`,`/dev/stdout`),n?A.createDevice(`/dev`,`stderr`,null,n):A.symlink(`/dev/tty1`,`/dev/stderr`),A.open(`/dev/stdin`,0),A.open(`/dev/stdout`,1),A.open(`/dev/stderr`,1)},staticInit(){A.nameTable.length=4096,A.mount(O,{},`/`),A.createDefaultDirectories(),A.createDefaultDevices(),A.createSpecialDirectories()},init(e,n,r){A.initialized=!0,e??=t.stdin,n??=t.stdout,r??=t.stderr,A.createStandardStreams(e,n,r)},quit(){A.initialized=!1;for(var e of A.streams)e&&A.close(e)},analyzePath(e,t=!1){try{var n=A.lookupPath(e,{follow:!t});e=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{n=A.lookupPath(e,{parent:!0}),r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=w.basename(e),n=A.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path===`/`}catch(e){r.error=e.errno}return r},createPath(e,t,n,r){e=typeof e==`string`?e:A.getPath(e);for(var i=t.split(`/`).reverse();i.length;){var a=i.pop();if(a){var o=w.join2(e,a);try{A.mkdir(o)}catch(e){if(e.errno!=20)throw e}e=o}}return o},createFile(e,t,n,r,i){var a=w.join2(typeof e==`string`?e:A.getPath(e),t),o=je(r,i);return A.create(a,o)},createDataFile(e,t,n,r,i,a){var o=t;e&&(e=typeof e==`string`?e:A.getPath(e),o=t?w.join2(e,t):e);var s=je(r,i),c=A.create(o,s);if(n){n=Ae(n),A.chmod(c,s|146);var l=A.open(c,577);A.write(l,n,0,n.length,0,a),A.close(l),A.chmod(c,s)}},createDevice(e,t,n,r){var i=w.join2(typeof e==`string`?e:A.getPath(e),t),a=je(!!n,!!r);A.createDevice.major??=64;var o=A.makedev(A.createDevice.major++,0);return A.registerDevice(o,{open(e){e.seekable=!1},close(e){r?.buffer?.length&&r(10)},read(e,t,r,i,a){for(var o=0,s=0;s<i;s++){var c;try{c=n()}catch{throw new A.ErrnoError(29)}if(c===void 0&&!o)throw new A.ErrnoError(6);if(c==null)break;o++,t[r+s]=c}return o&&(e.node.atime=Date.now()),o},write(e,t,n,i,a){for(var o=0;o<i;o++)try{r(t[n+o])}catch{throw new A.ErrnoError(29)}return i&&(e.node.mtime=e.node.ctime=Date.now()),o}}),A.mkdev(i,a,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)g(`Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.`);else try{e.contents=u(e.url)}catch{throw new A.ErrnoError(29)}},createLazyFile(e,t,n,i,a){class o{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;e.open(`HEAD`,n,!1),e.send(null),e.status>=200&&e.status<300||e.status===304||g(`Couldn't load ${n}. Status: ${e.status}`);var t=Number(e.getResponseHeader(`Content-length`)),r,i=(r=e.getResponseHeader(`Accept-Ranges`))&&r===`bytes`,a=(r=e.getResponseHeader(`Content-Encoding`))&&r===`gzip`,o=1048576;i||(o=t);var s=(e,r)=>{e>r&&g(`invalid range (${e}, ${r}) or no bytes requested!`),r>t-1&&g(`only ${t} bytes available! programmer error!`);var i=new XMLHttpRequest;return i.open(`GET`,n,!1),t!==o&&i.setRequestHeader(`Range`,`bytes=${e}-${r}`),i.responseType=`arraybuffer`,i.overrideMimeType&&i.overrideMimeType(`text/plain; charset=x-user-defined`),i.send(null),i.status>=200&&i.status<300||i.status===304||g(`Couldn't load ${n}. Status: ${i.status}`),i.response===void 0?Ee(i.responseText??``):new Uint8Array(i.response||[])},c=this;c.setDataGetter(e=>{var n=e*o,r=(e+1)*o-1;return r=Math.min(r,t-1),c.chunks[e]===void 0&&(c.chunks[e]=s(n,r)),c.chunks[e]===void 0&&g(`doXHR failed!`),c.chunks[e]}),(a||!t)&&(o=t=1,t=this.getter(0).length,o=t,d(`LazyFiles on gzip forces download of the whole file when length is accessed`)),this._length=t,this._chunkSize=o,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){r||g(`Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc`);var s={isDevice:!1,contents:new o}}else s={isDevice:!1,url:n};var c=A.createFile(e,t,s,i,a);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};for(let[e,t]of Object.entries(c.stream_ops))l[e]=(...e)=>(A.forceLoadFile(c),t(...e));function u(e,t,n,r,i){var a=e.node.contents;if(i>=a.length)return 0;var o=Math.min(a.length-i,r);if(a.slice)for(var s=0;s<o;s++)t[n+s]=a[i+s];else for(s=0;s<o;s++)t[n+s]=a.get(i+s);return o}return l.read=(e,t,n,r,i)=>(A.forceLoadFile(c),u(e,t,n,r,i)),l.mmap=(e,t,n)=>{A.forceLoadFile(c);var r=Oe();if(!r)throw new A.ErrnoError(48);return u(e,_,r,t,n),{ptr:r,allocated:!0}},c.stream_ops=l,c}},j,M=(e,t,n)=>e?E(j,e,t,n):``,N,P={currentUmask:18,calculateAt(e,t,n=!1){if(w.isAbs(t))return t;var r=e===-100?A.cwd():P.getStreamFromFD(e).path;if(t.length==0){if(!n)throw new A.ErrnoError(44);return r}return r+`/`+t},writeStat(e,t){b[e>>2]=t.dev,b[e+4>>2]=t.mode,b[e+8>>2]=t.nlink,b[e+12>>2]=t.uid,b[e+16>>2]=t.gid,b[e+20>>2]=t.rdev,N[e+24>>3]=BigInt(t.size),x[e+32>>2]=4096,x[e+36>>2]=t.blocks;var n=t.atime.getTime(),r=t.mtime.getTime(),i=t.ctime.getTime();return N[e+40>>3]=BigInt(Math.floor(n/1e3)),b[e+48>>2]=n%1e3*1e3*1e3,N[e+56>>3]=BigInt(Math.floor(r/1e3)),b[e+64>>2]=r%1e3*1e3*1e3,N[e+72>>3]=BigInt(Math.floor(i/1e3)),b[e+80>>2]=i%1e3*1e3*1e3,N[e+88>>3]=BigInt(t.ino),0},writeStatFs(e,t){b[e+4>>2]=t.bsize,b[e+60>>2]=t.bsize,N[e+8>>3]=BigInt(t.blocks),N[e+16>>3]=BigInt(t.bfree),N[e+24>>3]=BigInt(t.bavail),N[e+32>>3]=BigInt(t.files),N[e+40>>3]=BigInt(t.ffree),b[e+48>>2]=t.fsid,b[e+64>>2]=t.flags,b[e+56>>2]=t.namelen},doMsync(e,t,n,r,i){if(!A.isFile(t.node.mode))throw new A.ErrnoError(43);if(r&2)return 0;var a=j.subarray(e,e+n);A.msync(t,a,i,n,r)},getStreamFromFD(e){return A.getStreamChecked(e)},varargs:void 0,getStr(e){return M(e)}},F,He={},Ue=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function We(e){return this.fromWireType(b[e>>2])}var I={},L={},Ge={};class Ke extends Error{constructor(e){super(e),this.name=`InternalError`}}var qe=e=>{throw new Ke(e)},Je=(e,t,n)=>{e.forEach(e=>Ge[e]=t);function r(t){var r=n(t);r.length!==e.length&&qe(`Mismatched type converter count`);for(var i=0;i<e.length;++i)B(e[i],r[i])}var i=Array(t.length),a=[],o=0;for(let[e,n]of t.entries())L.hasOwnProperty(n)?i[e]=L[n]:(a.push(n),I.hasOwnProperty(n)||(I[n]=[]),I[n].push(()=>{i[e]=L[n],++o,o===a.length&&r(i)}));a.length===0&&r(i)},Ye=e=>rn(e),Xe=(e,t)=>j.fill(0,e,e+t),R=e=>{for(var t=``;;){var n=j[e++];if(!n)return t;t+=String.fromCharCode(n)}};class Ze extends Error{constructor(e){super(e),this.name=`BindingError`}}var z=e=>{throw new Ze(e)};function Qe(e,t,n={}){var r=t.name;if(e||z(`type "${r}" must have a positive integer typeid pointer`),L.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;z(`Cannot register type '${r}' twice`)}if(L[e]=t,delete Ge[e],I.hasOwnProperty(e)){var i=I[e];delete I[e],i.forEach(e=>e())}}function B(e,t,n={}){return Qe(e,t,n)}var V,$e,et=(e,t,n)=>{switch(t){case 1:return n?e=>_[e]:e=>j[e];case 2:return n?e=>F[e>>1]:e=>V[e>>1];case 4:return n?e=>x[e>>2]:e=>b[e>>2];case 8:return n?e=>N[e>>3]:e=>$e[e>>3];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},tt=[],H=[0,1,,1,null,1,!0,1,!1,1],nt=e=>{e>9&&--H[e+1]===0&&(H[e],H[e]=void 0,tt.push(e))},U={toValue:e=>(e||z(`Cannot use deleted val. handle = ${e}`),H[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=tt.pop()||H.length;return H[t]=e,H[t+1]=1,t}}}},rt={name:`emscripten::val`,fromWireType:e=>{var t=U.toValue(e);return nt(e),t},toWireType:(e,t)=>U.toHandle(t),readValueFromPointer:We,destructorFunction:null},it,at,ot=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(it[e>>2])};case 8:return function(e){return this.fromWireType(at[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},st=(e,t)=>Object.defineProperty(t,"name",{value:e});function ct(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function lt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].argStackAlloc)return!0;return!1}function ut(e,t,n,r,i,a){var o=t.length;o<2&&z(`argTypes array size mismatch! Must at least get return value and receiver (this) types!`);var s=t[1]!==null&&n!==null,c=ct(t),l=lt(t),u=l&&!a&&!c;l&&!u&&(c=!0);var d=!t[0].isVoid,f=o-2,p=Array(f),m=[],h=[];return st(e,function(...e){h.length=0;var n;u&&(n=y());var a,o;try{m.length=s?2:1,m[0]=i;for(var l=0;l<f;++l){var ee=t[l+2];p[l]=ee.toWireType(u&&ee.argStackAlloc?null:h,e[l]),m.push(p[l])}o=r(...m)}finally{u&&v(n)}return function(e){if(c)Ue(h);else for(var n=2;n<t.length;n++){var r=n===1?a:p[n-2];t[n].destructorFunction!==null&&t[n].destructorFunction(r)}if(d)return t[0].fromWireType(e)}(o)})}var dt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(...r){return e[t].overloadTable.hasOwnProperty(r.length)||z(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},ft=(e,n,r)=>{t.hasOwnProperty(e)?((r===void 0||t[e].overloadTable!==void 0&&t[e].overloadTable[r]!==void 0)&&z(`Cannot register public name '${e}' twice`),dt(t,e,e),t[e].overloadTable.hasOwnProperty(r)&&z(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),t[e].overloadTable[r]=n):(t[e]=n,t[e].argCount=r)},pt=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(b[t+r*4>>2]);return n},mt=(e,n,r)=>{t.hasOwnProperty(e)||qe(`Replacing nonexistent public symbol`),t[e].overloadTable!==void 0&&r!==void 0?t[e].overloadTable[r]=n:(t[e]=n,t[e].argCount=r)},ht=[],W=e=>{var t=ht[e];return t||(ht[e]=t=Q.get(e)),t},G=(e,t)=>{e=R(e);var n=function(){return W(t)}();return typeof n!=`function`&&z(`unknown function pointer with signature ${e}: ${t}`),n};class gt extends Error{}var _t=e=>{var t=en(e),n=R(t);return X(t),n},vt=(e,t)=>{var n=[],r={};throw t.forEach(function e(t){r[t]||L[t]||(Ge[t]?Ge[t].forEach(e):(n.push(t),r[t]=!0))}),new gt(`${e}: `+n.map(_t).join([`, `]))},yt=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},K=(e,t,n)=>Te(e,j,t,n),bt=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,xt=(e,t,n)=>{var r=e>>1,i=Se(V,r,t/2,n);if(i-r>16&&bt)return bt.decode(V.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=V[o];a+=String.fromCharCode(s)}return a},St=(e,t,n=2147483647)=>{if(n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);F[t>>1]=o,t+=2}return F[t>>1]=0,t-r},Ct=e=>e.length*2,wt=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=b[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},Tt=(e,t,n=2147483647)=>{if(n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,x[t>>2]=o,t+=4,t+4>i)break}return x[t>>2]=0,t-r},Et=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},Dt=[],Ot=e=>{var t=Dt.length;return Dt.push(e),t},kt=(e,t)=>{var n=L[e];return n===void 0&&z(`${t} has unknown type ${_t(e)}`),n},At=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=kt(b[t+r*4>>2],`parameter ${r}`);return n},jt=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(b[t>>2]=U.toHandle(r)),i},Mt={},Nt=e=>{var t=Mt[e];return t===void 0?R(e):t},Pt=()=>2147483648,Ft=(e,t)=>Math.ceil(e/t)*t,It=e=>{var t=(e-on.buffer.byteLength+65535)/65536|0;try{return on.grow(t),te(),1}catch{}},Lt={},Rt=()=>i,q=()=>{if(!q.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(globalThis.navigator?.language??`C`).replace(`-`,`_`)+`.UTF-8`,_:Rt()};for(var t in Lt)Lt[t]===void 0?delete e[t]:e[t]=Lt[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);q.strings=n}return q.strings},zt=()=>ge||!1,Bt=e=>{zt()||(t.onExit?.(e),p=!0),a(0,new fe(e))},Vt=e=>{Bt(e)},Ht=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=b[t>>2],s=b[t+4>>2];t+=8;try{var c=A.read(e,_,o,s,r)}catch(e){if(i>0&&e instanceof A.ErrnoError&&(e.errno==6||e.errno==6))break;throw e}if(c<0)return-1;if(i+=c,c<s)break}return i},Ut=e=>e<-9007199254740992||e>9007199254740992?NaN:Number(e),Wt=(e,t,n,r)=>{if(n==1)return A.write(e,_,b[t>>2],b[t+4>>2],r);for(var i=0,a=0,o=t;a<n;a++,o+=8)i+=b[o+4>>2];var s=new Uint8Array(i),c=0;for(a=0;a<n;a++,t+=8){var l=b[t>>2],u=b[t+4>>2];s.set(j.subarray(l,l+u),c),c+=u}return A.write(e,s,0,i,r)},Gt=(e,t)=>{if(J)for(var n=e;n<e+t;n++){var r=W(n);r&&J.set(r,n)}},J,Kt=e=>(J||(J=new WeakMap,Gt(0,Q.length)),J.get(e)||0),qt=[],Jt=()=>qt.length?qt.pop():Q.grow(1),Yt=(e,t)=>{Q.set(e,t),ht[e]=Q.get(e)},Xt=e=>{let t=e.length;return[t%128|128,t>>7,...e]},Zt={i:127,p:127,j:126,f:125,d:124,e:111},Qt=e=>Xt(Array.from(e,e=>Zt[e])),$t=(e,t)=>{var n=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Xt([1,96,...Qt(t.slice(1)),...Qt(t[0]===`v`?``:t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(n);return new WebAssembly.Instance(r,{e:{f:e}}).exports.f};A.createPreloadedFile=(e,t,n,r,i,a,o,s,c,l)=>{Ve(e,t,n,r,i,s,c,l).then(a).catch(o)},A.preloadFile=Ve,A.staticInit(),t.noExitRuntime&&(ge=t.noExitRuntime),t.print&&(d=t.print),t.printErr&&(f=t.printErr),t.arguments&&t.arguments,t.thisProgram&&(i=t.thisProgram);var Y=t.preInit;if(Y)for(typeof Y==`function`&&(t.preInit=Y=[Y]);Y.length>0;)Y.shift()();t.addRunDependency=Re,t.removeRunDependency=Le,t.addFunction=(e,t)=>{var n=Kt(e);if(n)return n;var r=Jt();try{Yt(r,e)}catch(n){if(!(n instanceof TypeError))throw n;Yt(r,$t(e,t))}return J.set(e,r),r},t.UTF8ToString=M,t.FS_preloadFile=Ve,t.FS_unlink=(...e)=>A.unlink(...e),t.FS_createPath=(...e)=>A.createPath(...e),t.FS_createDevice=(...e)=>A.createDevice(...e),t.FS_createDataFile=Ne,t.FS_createLazyFile=(...e)=>A.createLazyFile(...e),t.Emval=U;var en,tn,X,Z,nn,rn,an,on,Q;function sn(e){en=e._,tn=t._malloc=e.aa,X=t._free=e.ba,Z=e.ca,nn=e.da,rn=e.ea,an=e.fa,on=e.Y,Q=e.$}var cn={n:(e,t,n)=>{new _e(e).init(t,n),ve()},x:function(e,t,n){P.varargs=n;try{var r=P.getStreamFromFD(e);switch(t){case 0:var i=S();if(i<0)return-28;for(;A.streams[i];)i++;return A.dupStream(r,i).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:return i=S(),r.flags=r.flags&-289793|i&289792,0;case 12:return i=C(),F[i+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}},M:function(e,t,n){P.varargs=n;try{var r=P.getStreamFromFD(e);switch(t){case 21509:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var i=r.tty.ops.ioctl_tcgets(r),a=C();x[a>>2]=i.c_iflag||0,x[a+4>>2]=i.c_oflag||0,x[a+8>>2]=i.c_cflag||0,x[a+12>>2]=i.c_lflag||0;for(var o=0;o<32;o++)_[a+o+17]=i.c_cc[o]||0;return 0}return 0;case 21510:case 21511:case 21512:return r.tty?0:-59;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){a=C();var s=x[a>>2],c=x[a+4>>2],l=x[a+8>>2],u=x[a+12>>2],d=[];for(o=0;o<32;o++)d.push(_[a+o+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:c,c_cflag:l,c_lflag:u,c_cc:d})}return 0;case 21519:return r.tty?(a=C(),x[a>>2]=0,0):-59;case 21520:return r.tty?-28:-59;case 21537:case 21531:return a=C(),A.ioctl(r,t,a);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var f=r.tty.ops.ioctl_tiocgwinsz(r.tty);a=C(),F[a>>1]=f[0],F[a+2>>1]=f[1]}return 0;case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}},N:function(e,t,n,r){P.varargs=r;try{t=P.getStr(t),t=P.calculateAt(e,t);var i=r?S():0;return n&64&&(i&=~P.currentUmask),A.open(t,n,i).fd}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}},O:()=>g(``),A:e=>{var t=He[e];delete He[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.valueSize,a=t.isTrivial,o=t.fields,s=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));Je([e],s,e=>{var s={};for(var[c,l]of o.entries()){let t=e[c],n=l.getter,r=l.getterContext,i=e[c+o.length],a=l.setter,d=l.setterContext;var u=i.destructorFunction===null&&!i.argStackAlloc?(e,t)=>a(d,e,i.toWireType(null,t)):(e,t)=>{var n=[];a(d,e,i.toWireType(n,t)),Ue(n)};s[l.fieldName]={read:e=>t.fromWireType(n(r,e)),write:u,optional:t.optional}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in s)t[n]=s[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var o in s)if(!(o in t)&&!s[o].optional)throw TypeError(`Missing field: "${o}"`);var c;for(o in a&&!e?(c=Ye(i),Xe(c,i)):(c=n(),e&&e.push(r,c)),s)s[o].write(c,t[o]);return c},readValueFromPointer:We,destructorFunction:a?null:r,argStackAlloc:a}]})},z:(e,t,n,r,i)=>{t=R(t);let a=r===0n,o=e=>e;if(a){let e=n*8;o=t=>BigInt.asUintN(e,t),i=o(i)}B(e,{name:t,fromWireType:o,toWireType:(e,t)=>(typeof t==`number`&&(t=BigInt(t)),t),readValueFromPointer:et(t,n,!a),destructorFunction:null})},T:(e,t,n,r)=>{t=R(t),B(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(j[e])},destructorFunction:null})},R:e=>B(e,rt),y:(e,t,n)=>{t=R(t),B(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:ot(t,n),destructorFunction:null})},o:(e,t,n,r,i,a,o)=>{var s=pt(t,n);e=R(e),e=yt(e),i=G(r,i),ft(e,function(){vt(`Cannot call ${e} due to unbound types`,s)},t-1),Je([],s,n=>{var r=[n[0],null].concat(n.slice(1));return mt(e,ut(e,r,null,i,a,o),t-1),[]})},d:(e,t,n,r,i)=>{t=R(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}B(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:et(t,n,r!==0),destructorFunction:null})},b:(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];function i(e){var t=b[e>>2],n=b[e+4>>2];return new r(_.buffer,n,t)}n=R(n),B(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},S:(e,t)=>{t=R(t),B(e,{name:t,fromWireType(e){var t=b[e>>2],n=M(e+4,t,!0);return X(e),n},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n,r=typeof t==`string`;r||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||z(`Cannot pass non-string to std::string`),n=r?we(t):t.length;var i=tn(4+n+1),a=i+4;return b[i>>2]=n,r?K(t,a,n+1):j.set(t,a),e!==null&&e.push(X,i),i},readValueFromPointer:We,destructorFunction(e){X(e)}})},t:(e,t,n)=>{n=R(n);var r,i,a;t===2?(r=xt,i=St,a=Ct):(r=wt,i=Tt,a=Et),B(e,{name:n,fromWireType:e=>{var n=b[e>>2],i=r(e+4,n*t,!0);return X(e),i},toWireType:(e,r)=>{typeof r!=`string`&&z(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=tn(4+o+t);return b[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(X,s),s},readValueFromPointer:We,destructorFunction(e){X(e)}})},B:(e,t,n,r,i,a,o,s)=>{He[e]={name:R(t),rawConstructor:G(n,r),rawDestructor:G(i,a),valueSize:o,isTrivial:!!s,fields:[]}},c:(e,t,n,r,i,a,o,s,c,l)=>{He[e].fields.push({fieldName:R(t),getterReturnType:n,getter:G(r,i),getterContext:a,setterArgumentType:o,setter:G(s,c),setterContext:l})},U:(e,t)=>{t=R(t),B(e,{isVoid:!0,name:t,fromWireType:()=>{},toWireType:()=>{}})},Q:e=>{do{var t=b[e>>2];e+=4;var n=b[e>>2];e+=4;var r=b[e>>2];e+=4;var i=M(t);A.createPath(`/`,w.dirname(i)),A.createDataFile(i,null,_.subarray(r,r+n),!0,!0,!0)}while(b[e>>2])},F:()=>{throw new h},W:(e,t)=>{e=U.toValue(e),t=U.toValue(t),e.set(t)},k:(e,t,n)=>{var[r,...i]=At(e,t),a=r.toWireType.bind(r),o=i.map(e=>e.readValueFromPointer.bind(e));e--;var s=Array(e);return Ot(st(`methodCaller<(${i.map(e=>e.name)}) => ${r.name}>`,(t,r,i,c)=>{for(var l=0,u=0;u<e;++u)s[u]=o[u](c+l),l+=8;var d;switch(n){case 0:d=U.toValue(t).apply(null,s);break;case 2:d=Reflect.construct(U.toValue(t),s);break;case 3:d=s[0];break;case 1:d=U.toValue(t)[Nt(r)](...s)}return jt(a,i,d)}))},a:nt,X:e=>e?(e=Nt(e),U.toHandle(globalThis[e])):U.toHandle(globalThis),p:(e,t)=>(e=U.toValue(e),t=U.toValue(t),U.toHandle(e[t])),j:e=>{e>9&&(H[e+1]+=1)},i:(e,t,n,r,i)=>Dt[e](t,n,r,i),C:()=>U.toHandle([]),m:e=>U.toHandle(Nt(e)),h:e=>{Ue(U.toValue(e)),nt(e)},V:(e,t,n)=>{e=U.toValue(e),t=U.toValue(t),n=U.toValue(n),e[t]=n},H:(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);b[e>>2]=l*60,x[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(K(d,n,17),K(f,r,17)):(K(d,r,17),K(f,n,17))},G:e=>{var t=j.length;e>>>=0;var n=Pt();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),It(Math.min(n,Ft(Math.max(e,i),65536))))return!0}return!1},J:(e,t)=>{var n=0,r=0;for(var i of q()){var a=t+n;b[e+r>>2]=a,n+=K(i,a,1/0)+1,r+=4}return 0},K:(e,t)=>{var n=q();b[e>>2]=n.length;var r=0;for(var i of n)r+=we(i)+1;return b[t>>2]=r,0},P:Vt,v:function(e){try{var t=P.getStreamFromFD(e);return A.close(t),0}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return e.errno}},L:function(e,t,n,r){try{var i=Ht(P.getStreamFromFD(e),t,n);return b[r>>2]=i,0}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return e.errno}},I:function(e,t,n,r){t=Ut(t);try{if(isNaN(t))return 22;var i=P.getStreamFromFD(e);return A.llseek(i,t,n),N[r>>3]=BigInt(i.position),i.getdents&&!t&&n===0&&(i.getdents=null),0}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return e.errno}},w:function(e,t,n,r){try{var i=Wt(P.getStreamFromFD(e),t,n);return b[r>>2]=i,0}catch(e){if(A===void 0||e.name!==`ErrnoError`)throw e;return e.errno}},q:function(e,t){var n=y();try{return W(e)(t)}catch(e){if(v(n),!(e instanceof m))throw e;Z(1,0)}},l:function(e,t,n){var r=y();try{return W(e)(t,n)}catch(e){if(v(r),!(e instanceof m))throw e;Z(1,0)}},r:function(e,t,n,r){var i=y();try{return W(e)(t,n,r)}catch(e){if(v(i),!(e instanceof m))throw e;Z(1,0)}},u:function(e,t,n,r,i){var a=y();try{return W(e)(t,n,r,i)}catch(e){if(v(a),!(e instanceof m))throw e;Z(1,0)}},E:function(e,t,n,r,i,a,o,s,c,l){var u=y();try{return W(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(v(u),!(e instanceof m))throw e;Z(1,0)}},s:function(e){var t=y();try{W(e)()}catch(e){if(v(t),!(e instanceof m))throw e;Z(1,0)}},g:function(e,t){var n=y();try{W(e)(t)}catch(e){if(v(n),!(e instanceof m))throw e;Z(1,0)}},D:function(e,t,n,r){var i=y();try{W(e)(t,n,r)}catch(e){if(v(i),!(e instanceof m))throw e;Z(1,0)}},e:function(e,t,n){var r=y();try{W(e)(t,n)}catch(e){if(v(r),!(e instanceof m))throw e;Z(1,0)}},f:function(e,t,n,r){var i=y();try{W(e)(t,n,r)}catch(e){if(v(i),!(e instanceof m))throw e;Z(1,0)}}},$=await async function(){function e(e){return $=e.exports,sn($),te(),$}var n=de(),r=t.instantiateWasm;return r?new Promise(t=>{r(n,n=>t(e(n)))}):(ae??=oe(),function(t){return e(t.instance)}(await ue(void 0,ae,n)))}();return await async function(){ne(),k&&await Fe();var e=t.setStatus;e&&(e(`Running...`),await new Promise(e=>setTimeout(e,1)),setTimeout(e,1,``)),!p&&(re(),t.onRuntimeInitialized?.(),ie())}(),t}export{e as default};
|
package/chunks/portal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{convertJsonValueToImmutableArcadeValue as e}from"../arcade/containerUtils.js";import t from"../arcade/Dictionary.js";import{StringEnum as n}from"../arcade/enum.js";import{ArcadeExecutionError as r}from"../arcade/executionError.js";import{E as
|
|
2
|
+
import{convertJsonValueToImmutableArcadeValue as e}from"../arcade/containerUtils.js";import t from"../arcade/Dictionary.js";import{StringEnum as n}from"../arcade/enum.js";import{ArcadeExecutionError as r}from"../arcade/executionError.js";import i from"../arcade/ImmutableArray.js";import{E as a,n as o,l as s}from"./languageUtils.js";import{getPortal as c}from"../arcade/portalUtils.js";import l from"../core/Logger.js";import{isString as u}from"../support/guards.js";const d=new n([`title`,`owner`,`created`,`modified`]),f=new n([`asc`,`desc`]),p=new n([`groupMember`]);function m(n){n.mode===`async`&&(n.functions.getgroups=function(m,h){return n.standardFunctionAsync(m,h,async(n,m,h)=>{if(a(h,0,2,m),h[0]!=null&&!o(h[0]))throw new r(`InvalidParameter`,m);let g=c(n,h[0]??null),_={start:1,num:100},v=h[1];if(v==null)_.searchUserAccess=`groupMember`,_.sortField=`title`,_.sortOrder=`asc`;else if(s(v)){let e=v.hasField(`q`)?v.field(`q`):null;if(u(e))_.q=e;else if(e!=null)throw new r(`InvalidParameter`,m);let t=v.hasField(`filter`)?v.field(`filter`):null;if(u(t))_.filter=t;else if(t!=null)throw new r(`InvalidParameter`,m);let n=v.hasField(`sortField`)?v.field(`sortField`):null;if(n!=null&&!u(n))throw new r(`InvalidParameter`,m);let i=n==null?`title`:d.get(n),a=v.hasField(`sortOrder`)?v.field(`sortOrder`):null;if(a!=null&&!u(a))throw new r(`InvalidParameter`,m);let o=a==null?`asc`:f.get(a);_.sortField=i,_.sortOrder=o;let s=v.hasField(`searchUserAccess`)?v.field(`searchUserAccess`):null;if(u(s))_.searchUserAccess=p.get(s);else if(s!=null)throw new r(`InvalidParameter`,m);if(_.q==null&&_.filter==null&&_.searchUserAccess==null)throw new r(`InvalidParameter`,m)}else throw new r(`InvalidParameter`,m);let y=[];for(;;){let i;try{i=await g.request(g.restUrl+`/community/groups`,{query:_,authMode:`no-prompt`})}catch(e){return typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`&&n.console(`GetGroups error: ${e.message}`),l.getLogger(`esri.arcade.functions.portal`).error(e),null}if(n.abortSignal.aborted)throw new r(`Cancelled`,m);for(let n of i.results)y.push(new t({__proto__:null,id:e(n.id),title:e(n.title),owner:e(n.owner),description:e(n.description),snippet:e(n.snippet),tags:e(n.tags),typeKeywords:e(n.typeKeywords),phone:e(n.phone),created:e(n.created),modified:e(n.modified),orgId:e(n.orgId)}));if(i.nextStart==null||i.nextStart<=_.start)break;_.start=i.nextStart}return i.from(y)})})}const h=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:m},Symbol.toStringTag,{value:`Module`}));export{h as P,m as r};
|
package/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={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}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.
|
|
2
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const t={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}};globalThis.esriConfig&&(e(t,globalThis.esriConfig,!0),delete t.has),!t.assetsPath&&(t.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@6.0.0-next.14/assets`,t.defaultAssetsPath=t.assetsPath);export{t as default};
|
|
@@ -26,7 +26,9 @@ export function simplifyOGCExecute(geometry: GeometryUnion): GeometryWithoutMesh
|
|
|
26
26
|
/**
|
|
27
27
|
* Performs OGC simplification on a single geometry.
|
|
28
28
|
*
|
|
29
|
-
* @deprecated
|
|
29
|
+
* @deprecated
|
|
30
|
+
* since 5.2. Refactor using \@arcgis/codemod or manually replace usages
|
|
31
|
+
* with [simplifyOGCExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOGCOperator/#simplifyOGCExecute).
|
|
30
32
|
* @param geometry - The geometry to simplify.
|
|
31
33
|
* @returns The simplified geometry, or `null` if the input contains non-finite x- or y-values, or infinite z-values.
|
|
32
34
|
* NaN z-values are set to 0.
|
|
@@ -52,7 +54,9 @@ export function simplifyOGCExecuteMany(geometries: GeometryUnion[]): (GeometryWi
|
|
|
52
54
|
/**
|
|
53
55
|
* Performs OGC simplification on a collection of geometries.
|
|
54
56
|
*
|
|
55
|
-
* @deprecated
|
|
57
|
+
* @deprecated
|
|
58
|
+
* since 5.2. Refactor using \@arcgis/codemod or manually replace usages
|
|
59
|
+
* with [simplifyOGCExecuteMany()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOGCOperator/#simplifyOGCExecuteMany).
|
|
56
60
|
* @param geometries - The geometries to simplify. All geometries must have the same spatial reference.
|
|
57
61
|
* @returns An array of simplified geometries. Geometries with non-finite x- or y-values, or infinite z-values return `null`.
|
|
58
62
|
* NaN z-values are set to 0.
|
|
@@ -120,7 +124,7 @@ export function simplifyOGCIsSimple(geometry: GeometryUnion): boolean;
|
|
|
120
124
|
*
|
|
121
125
|
* @deprecated
|
|
122
126
|
* since 5.2. Refactor using \@arcgis/codemod or manually replace usages
|
|
123
|
-
* with [
|
|
127
|
+
* with [simplifyOGCIsSimple()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOGCOperator/#simplifyOGCIsSimple).
|
|
124
128
|
* @param geometry - The input geometry.
|
|
125
129
|
* @returns Returns whether the geometry is simple.
|
|
126
130
|
* @example
|
|
@@ -142,6 +146,8 @@ export const simplifyOGCSupportsCurves: boolean;
|
|
|
142
146
|
* Indicates if the operator supports input geometries that contain curves.
|
|
143
147
|
* The value will always be `true`.
|
|
144
148
|
*
|
|
145
|
-
* @deprecated
|
|
149
|
+
* @deprecated
|
|
150
|
+
* since 5.2. Refactor using \@arcgis/codemod or manually replace usages
|
|
151
|
+
* with [simplifyOGCSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOGCOperator/#simplifyOGCSupportsCurves).
|
|
146
152
|
*/
|
|
147
153
|
export const supportsCurves: ReturnType<typeof Boolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
class e{constructor(e,t){this.x=e,this.y=t}static fromArray(t){return new e(t[0],t[1])}clone(){return new e(this.x,this.y)}equals(e,t){return e===this.x&&t===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,t){return this.x=e,this.y=t,this}normalize(){let e=this.x,t=this.y,n=Math.sqrt(e*e+t*t);return this.x/=n,this.y/=n,this}rightPerpendicular(){let e=this.x;return this.x=this.y,this.y=-e,this}leftPerpendicular(){let e=this.x;return this.x=-this.y,this.y=e,this}move(e,t){return this.x+=e,this.y+=t,this}assign(e){return this.x=e.x,this.y=e.y,this}assignAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}assignSub(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}rotate(e,t){let n=this.x,r=this.y;return this.x=n*e-r*t,this.y=n*t+r*e,this}rotateReverse(e,t){let n=this.x,r=this.y;return this.x=n*e+r*t,this.y=-n*t+r*e,this}scale(e){return this.x*=e,this.y*=e,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}sub(e){return this.x-=e.x,this.y-=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}static distance(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}static add(t,n){return new e(t.x+n.x,t.y+n.y)}static sub(t,n){return new e(t.x-n.x,t.y-n.y)}}class t{constructor(e,t,n){this.ratio=e,this.x=t,this.y=n}}class n{constructor(e,t,n,r=8,i=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=r,this._pixelMargin=i,this._tileSize=512*r,this._dz=e,this._yPos=t,this._xPos=n}setPixelMargin(e){e!==this._pixelMargin&&(this._pixelMargin=e,this.setExtent(this._extent))}setExtent(e){this._extent=e,this._finalRatio=this._tileSize/e*(1<<this._dz);let t=this._pixelRatio*this._pixelMargin;t/=this._finalRatio;let n=e>>this._dz;t>n&&(t=n),this._margin=t,this._xmin=n*this._xPos-t,this._ymin=n*this._yPos-t,this._xmax=this._xmin+n+2*t,this._ymax=this._ymin+n+2*t}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,n){this._pushLine(),this._prevIsIn=this._isIn(t,n),this._moveTo(t,n,this._prevIsIn),this._prevPt=new e(t,n),this._firstPt=new e(t,n),this._dist=0}lineTo(n,r){let i=this._isIn(n,r),a=new e(n,r),o=e.distance(this._prevPt,a),s,c,l,u,d,f,p,m;if(i)this._prevIsIn?this._lineTo(n,r,!0):(s=this._prevPt,c=a,l=this._intersect(c,s),this._start=this._dist+o*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(c.x,c.y,!0));else if(this._prevIsIn)c=this._prevPt,s=a,l=this._intersect(c,s),this._lineTo(l.x,l.y,!0),this._lineTo(s.x,s.y,!1);else{let e=this._prevPt,n=a;if(e.x<=this._xmin&&n.x<=this._xmin||e.x>=this._xmax&&n.x>=this._xmax||e.y<=this._ymin&&n.y<=this._ymin||e.y>=this._ymax&&n.y>=this._ymax)this._lineTo(n.x,n.y,!1);else{let r=[];if((e.x<this._xmin&&n.x>this._xmin||e.x>this._xmin&&n.x<this._xmin)&&(u=(this._xmin-e.x)/(n.x-e.x),m=e.y+u*(n.y-e.y),m
|
|
2
|
+
class e{constructor(e,t){this.x=e,this.y=t}static fromArray(t){return new e(t[0],t[1])}clone(){return new e(this.x,this.y)}equals(e,t){return e===this.x&&t===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,t){return this.x=e,this.y=t,this}normalize(){let e=this.x,t=this.y,n=Math.sqrt(e*e+t*t);return this.x/=n,this.y/=n,this}rightPerpendicular(){let e=this.x;return this.x=this.y,this.y=-e,this}leftPerpendicular(){let e=this.x;return this.x=-this.y,this.y=e,this}move(e,t){return this.x+=e,this.y+=t,this}assign(e){return this.x=e.x,this.y=e.y,this}assignAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}assignSub(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}rotate(e,t){let n=this.x,r=this.y;return this.x=n*e-r*t,this.y=n*t+r*e,this}rotateReverse(e,t){let n=this.x,r=this.y;return this.x=n*e+r*t,this.y=-n*t+r*e,this}scale(e){return this.x*=e,this.y*=e,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}sub(e){return this.x-=e.x,this.y-=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}static distance(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}static add(t,n){return new e(t.x+n.x,t.y+n.y)}static sub(t,n){return new e(t.x-n.x,t.y-n.y)}}class t{constructor(e,t,n){this.ratio=e,this.x=t,this.y=n}}class n{constructor(e,t,n,r=8,i=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=r,this._pixelMargin=i,this._tileSize=512*r,this._dz=e,this._yPos=t,this._xPos=n}setPixelMargin(e){e!==this._pixelMargin&&(this._pixelMargin=e,this.setExtent(this._extent))}setExtent(e){this._extent=e,this._finalRatio=this._tileSize/e*(1<<this._dz);let t=this._pixelRatio*this._pixelMargin;t/=this._finalRatio;let n=e>>this._dz;t>n&&(t=n),this._margin=t,this._xmin=n*this._xPos-t,this._ymin=n*this._yPos-t,this._xmax=this._xmin+n+2*t,this._ymax=this._ymin+n+2*t}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,n){this._pushLine(),this._prevIsIn=this._isIn(t,n),this._moveTo(t,n,this._prevIsIn),this._prevPt=new e(t,n),this._firstPt=new e(t,n),this._dist=0}lineTo(n,r){let i=this._isIn(n,r),a=new e(n,r),o=e.distance(this._prevPt,a),s,c,l,u,d,f,p,m;if(i)this._prevIsIn?this._lineTo(n,r,!0):(s=this._prevPt,c=a,l=this._intersect(c,s),this._start=this._dist+o*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(c.x,c.y,!0));else if(this._prevIsIn)c=this._prevPt,s=a,l=this._intersect(c,s),this._lineTo(l.x,l.y,!0),this._lineTo(s.x,s.y,!1);else{let e=this._prevPt,n=a;if(e.x<=this._xmin&&n.x<=this._xmin||e.x>=this._xmax&&n.x>=this._xmax||e.y<=this._ymin&&n.y<=this._ymin||e.y>=this._ymax&&n.y>=this._ymax)this._lineTo(n.x,n.y,!1);else{let r=[];if((e.x<this._xmin&&n.x>this._xmin||e.x>this._xmin&&n.x<this._xmin)&&(u=(this._xmin-e.x)/(n.x-e.x),m=e.y+u*(n.y-e.y),m<this._ymin?f=!1:m>this._ymax?f=!0:r.push(new t(u,this._xmin,m))),(e.x<this._xmax&&n.x>this._xmax||e.x>this._xmax&&n.x<this._xmax)&&(u=(this._xmax-e.x)/(n.x-e.x),m=e.y+u*(n.y-e.y),m<this._ymin?f=!1:m>this._ymax?f=!0:r.push(new t(u,this._xmax,m))),(e.y<this._ymin&&n.y>this._ymin||e.y>this._ymin&&n.y<this._ymin)&&(u=(this._ymin-e.y)/(n.y-e.y),p=e.x+u*(n.x-e.x),p<=this._xmin?d=!1:p>=this._xmax?d=!0:r.push(new t(u,p,this._ymin))),(e.y<this._ymax&&n.y>this._ymax||e.y>this._ymax&&n.y<this._ymax)&&(u=(this._ymax-e.y)/(n.y-e.y),p=e.x+u*(n.x-e.x),p<=this._xmin?d=!1:p>=this._xmax?d=!0:r.push(new t(u,p,this._ymax))),r.length===0)d?f?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):f?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(r.length>1&&r[0].ratio>r[1].ratio)this._start=this._dist+o*r[1].ratio,this._lineTo(r[1].x,r[1].y,!0),this._lineTo(r[0].x,r[0].y,!0);else{this._start=this._dist+o*r[0].ratio;for(let e=0;e<r.length;e++)this._lineTo(r[e].x,r[e].y,!0)}this._lineTo(n.x,n.y,!1)}}this._dist+=o,this._prevIsIn=i,this._prevPt=a}close(){if(this._line.length>2){let e=this._firstPt,t=this._prevPt;(e.x!==t.x||e.y!==t.y)&&this.lineTo(e.x,e.y);let n=this._line,r=n.length;for(;r>=4&&(n[0].x===n[1].x&&n[0].x===n[r-2].x||n[0].y===n[1].y&&n[0].y===n[r-2].y);)n.pop(),n[0].x=n[r-2].x,n[0].y=n[r-2].y,--r}}result(e=!0){return this._pushLine(),this._lines.length===0?null:(this._type===3&&e&&i.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==2)throw Error(`Only valid for lines`);this._pushLine();let e=this._lines,t=e.length;if(t===0)return null;let n=[];for(let r=0;r<t;r++)n.push({line:e[r],start:this._starts[r]||0});return n}_isIn(e,t){return e>=this._xmin&&e<=this._xmax&&t>=this._ymin&&t<=this._ymax}_intersect(t,n){let r,i,a;if(n.x>=this._xmin&&n.x<=this._xmax)i=n.y<=this._ymin?this._ymin:this._ymax,a=(i-t.y)/(n.y-t.y),r=t.x+a*(n.x-t.x);else if(n.y>=this._ymin&&n.y<=this._ymax)r=n.x<=this._xmin?this._xmin:this._xmax,a=(r-t.x)/(n.x-t.x),i=t.y+a*(n.y-t.y);else{i=n.y<=this._ymin?this._ymin:this._ymax,r=n.x<=this._xmin?this._xmin:this._xmax;let e=(r-t.x)/(n.x-t.x),o=(i-t.y)/(n.y-t.y);e<o?(a=e,i=t.y+e*(n.y-t.y)):(a=o,r=t.x+o*(n.x-t.x))}return this._r=a,new e(r,i)}_pushLine(){this._line&&(this._type===1?this._line.length>0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===2?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===3&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,n,r){this._type===3?(r||(t<this._xmin&&(t=this._xmin),t>this._xmax&&(t=this._xmax),n<this._ymin&&(n=this._ymin),n>this._ymax&&(n=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),n=Math.round((n-(this._ymin+this._margin))*this._finalRatio),this._line.push(new e(t,n)),this._isH=!1,this._isV=!1):r&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),n=Math.round((n-(this._ymin+this._margin))*this._finalRatio),this._line.push(new e(t,n)))}_lineTo(t,n,r){let i,a;if(this._type!==3){if(r){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),n=Math.round((n-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(i=this._line[this._line.length-1],i.equals(t,n)))return;this._line.push(new e(t,n))}else this._line&&this._line.length>0&&this._pushLine()}else if(r||(t<this._xmin&&(t=this._xmin),t>this._xmax&&(t=this._xmax),n<this._ymin&&(n=this._ymin),n>this._ymax&&(n=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),n=Math.round((n-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){i=this._line[this._line.length-1];let r=i.x===t,o=i.y===n;if(r&&o)return;this._isH&&r||this._isV&&o?(i.x=t,i.y=n,a=this._line[this._line.length-2],a.x===t&&a.y===n?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(a=this._line[this._line.length-2],this._isH=a.x===t,this._isV=a.y===n)):(this._isH=a.x===t,this._isV=a.y===n)):(this._line.push(new e(t,n)),this._isH=r,this._isV=o)}else this._line.push(new e(t,n))}}class r{setExtent(e){this._ratio=e===4096?1:4096/e}get validateTessellation(){return this._ratio<1}reset(e){this._lines=[],this._line=null}moveTo(t,n){this._line&&this._lines.push(this._line),this._line=[];let r=this._ratio;this._line.push(new e(t*r,n*r))}lineTo(t,n){let r=this._ratio;this._line.push(new e(t*r,n*r))}close(){let e=this._line;e&&!e[0].isEqual(e[e.length-1])&&e.push(e[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}class i{static simplify(e,t,n){if(!n)return;let r=-t,a=e+t,o=-t,s=e+t,c=[],l=[],u=n.length;for(let e=0;e<u;++e){let t=n[e];if(!t||t.length<2)continue;let i=t[0],u,d=t.length;for(let n=1;n<d;++n)u=t[n],i.x===u.x&&(i.x<=r&&(i.y>u.y?(c.push(e),c.push(n),c.push(0),c.push(-1)):(l.push(e),l.push(n),l.push(0),l.push(-1))),i.x>=a&&(i.y<u.y?(c.push(e),c.push(n),c.push(1),c.push(-1)):(l.push(e),l.push(n),l.push(1),l.push(-1)))),i.y===u.y&&(i.y<=o&&(i.x<u.x?(c.push(e),c.push(n),c.push(2),c.push(-1)):(l.push(e),l.push(n),l.push(2),l.push(-1))),i.y>=s&&(i.x>u.x?(c.push(e),c.push(n),c.push(3),c.push(-1)):(l.push(e),l.push(n),l.push(3),l.push(-1)))),i=u}if(c.length===0||l.length===0)return;i.fillParent(n,l,c),i.fillParent(n,c,l);let d=[];i.calcDeltas(d,l,c),i.calcDeltas(d,c,l),i.addDeltas(d,n)}static fillParent(e,t,n){let r=n.length,i=t.length;for(let o=0;o<i;o+=4){let i=t[o],s=t[o+1],c=t[o+2],l=e[i][s-1],u=e[i][s],d=8092,f=-1;for(let t=0;t<r;t+=4){if(n[t+2]!==c)continue;let r=n[t],i=n[t+1],o=e[r][i-1],s=e[r][i];switch(c){case 0:case 1:if(a(l.y,o.y,s.y)&&a(u.y,o.y,s.y)){let e=Math.abs(s.y-o.y);e<d&&(d=e,f=t)}break;case 2:case 3:if(a(l.x,o.x,s.x)&&a(u.x,o.x,s.x)){let e=Math.abs(s.x-o.x);e<d&&(d=e,f=t)}}}t[o+3]=f}}static calcDeltas(e,t,n){let r=t.length;for(let a=0;a<r;a+=4){let r=i.calcDelta(a,t,n,[]);e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]),e.push(r)}}static calcDelta(e,t,n,r){let a=t[e+3];if(a===-1)return 0;let o=r.length;return o>1&&r[o-2]===a?0:(r.push(a),i.calcDelta(a,n,t,r)+1)}static addDeltas(e,t){let n=e.length,r=0;for(let t=0;t<n;t+=4){let n=e[t+3];n>r&&(r=n)}for(let i=0;i<n;i+=4){let n=t[e[i]],a=e[i+1],o=r-e[i+3];switch(e[i+2]){case 0:n[a-1].x-=o,n[a].x-=o,a===1&&(n[n.length-1].x-=o),a===n.length-1&&(n[0].x-=o);break;case 1:n[a-1].x+=o,n[a].x+=o,a===1&&(n[n.length-1].x+=o),a===n.length-1&&(n[0].x+=o);break;case 2:n[a-1].y-=o,n[a].y-=o,a===1&&(n[n.length-1].y-=o),a===n.length-1&&(n[0].y-=o);break;case 3:n[a-1].y+=o,n[a].y+=o,a===1&&(n[n.length-1].y+=o),a===n.length-1&&(n[0].y+=o)}}}}const a=(e,t,n)=>e>=t&&e<=n||e>=n&&e<=t;export{e as Point,r as SimpleBuilder,n as TileClipper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{set as e,invert as t,transpose as n,multiply as r}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{transformMat3 as a,exactEquals as o,normalize as s,add as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{expandPointInPlace as l}from"../aaBoundingRect.js";import{cloneCurve as u}from"./curveUtils.js";import{angularRangeWrap as d,angularRangeOriented as f,angularRange as p,wrapAtan2 as m,distance2 as h,intersectLineLine as g,findClosestAndFurthestCurveParametersToPoint as _}from"./mathUtils.js";class
|
|
2
|
+
import{set as e,invert as t,transpose as n,multiply as r}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{transformMat3 as a,exactEquals as o,normalize as s,add as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{expandPointInPlace as l}from"../aaBoundingRect.js";import{cloneCurve as u}from"./curveUtils.js";import{angularRangeWrap as d,angularRangeOriented as f,angularRange as p,wrapAtan2 as m,distance2 as h,intersectLineLine as g,findClosestAndFurthestCurveParametersToPoint as _,angularDistanceAlongOrientedArc as v}from"./mathUtils.js";class y{constructor(e,t,n,r,i,a,o,s,c){this.cx=e,this.cy=t,this.a=n,this.b=r,this.cosR=i,this.sinR=a,this.u1=o,this.u2=s,this.isInvalid=c}}function b(e,t){let[n,r,i,a,o,s,c]=t.a,[l,u]=e,[d,p]=n,[h,g]=r,_=s*c,v=Math.cos(o),b=Math.sin(o),[x,S]=f(m(1/_*(u-g)*v-1/_*(l-h)*b,1/s*(u-g)*b+1/s*(l-h)*v),Math.atan2(1/_*(p-g)*v-1/_*(d-h)*b,1/s*(p-g)*b+1/s*(d-h)*v),i,a);return new y(h,g,s,_,v,b,x,S,s===0||_===0)}function x(e,t){let{a:n,b:r,cosR:i,sinR:a,cx:o,cy:s}=e,c=Math.cos(t),l=Math.sin(t);return[n*c*i-r*l*a+o,n*c*a+r*l*i+s]}function S(e,t){let{u1:n,u2:r}=e;return x(e,n*(1-t)+r*t)}function C(e,t){let[n,r]=t.a[0],{a:i,b:a,cx:l,cy:u,cosR:d,sinR:f,isInvalid:p,u1:m,u2:h}=b(e,t);if(p){let[t,i]=e;return o([t,i],[n,r])?null:[n-t,r-i]}let g=Math.sqrt(i*i-a*a),_=[l+g*d,u+g*f],v=[l-g*d,u-g*f],y=[n-_[0],r-_[1]],x=[n-v[0],r-v[1]];s(y,y),s(x,x);let[S,C]=c(y,y,x);return h>m?[-C,S]:[C,S]}function w(e,t,n){if(n<0||n>1)return[];if(n===0||n===1)return[u(t)];let[r,[i,a],o,s,c,l,d]=t.a,{u1:f,u2:p}=e,m=S(e,n),h=f*(1-n)+p*n,g=+(Math.abs(h-f)<Math.PI),_=+(Math.abs(p-h)<Math.PI);return[{a:[[...m],[i,a],g,s,c,l,d]},{a:[[...r],[i,a],_,s,c,l,d]}]}function T(e,t){let{a:n,b:r,cosR:i,sinR:a,u1:o,u2:s}=e,c=Math.PI/6,l=[1*c,2*c,4*c,5*c,7*c,8*c,10*c,11*c],u=_(t,l,t=>{let o=Math.cos(t),s=Math.sin(t),[c,l]=x(e,t);return[c,l,-n*i*s-r*a*o,-n*a*s+r*i*o,-n*i*o+r*a*s,-n*a*o-r*i*s]}),f=p(o,s),m=new Set(u.map(e=>d(f,e)).filter(e=>e>f.min&&e<f.max));m.add(o),m.add(s);let h=1/0,g,v;for(let n of m){let r=x(e,n),[i,a]=r,c=t[0]-i,l=t[1]-a,u=c*c+l*l;u<h&&(g=(n-o)/(s-o),v=r,h=u)}return{t:g,curvePoint:v,distance:Math.sqrt(h)}}function E(e,t,n){let r=b(t,n),{a:i,b:a,u1:o,u2:s,cosR:c,sinR:u,isInvalid:f}=r,m=n.a[0];if(l(e,t),l(e,m),f)return e;let h=Math.atan2(-a*u,i*c),g=h+Math.PI,_=Math.atan2(a*c,i*u),v=_+Math.PI,y=p(o,s);for(let t of[h,g,_,v].map(e=>d(y,e)))t>y.min&&t<y.max&&l(e,x(r,t));return e}function D(e,t,n){let[r,i,a,o,s,c,l]=t.a,u=b(e,t),{u1:d,u2:f,isInvalid:p}=u,m=f-d;if(p)return Math.sqrt(h(e,r));let _=[0,0],v=0,y=[S(u,0),S(u,.25),S(u,.5),S(u,.75),S(u,1)];for(let e=0;e<14;e++){let e=y.length-1,t=m/(e*2),r=[];for(let n=0;n<e;n++)r.push(y[n]),r.push(x(u,d+(n*2+1)*t));r.push(y[y.length-1]),y=r,v=0;let a=0;for(let e=1;e<y.length;e++){let t=y[e-1],n=y[e];if(v+=Math.sqrt(h(t,n)),e>1){let r=y[e-2],o=g(_,r,t,i,n);a+=o?Math.sqrt(h(t,o)):Math.abs(n[0]-t[0])+Math.abs(n[1]-t[1])}else a+=v}if(a-v<n)return v}return v}const O=i(),k=i(),A=i(),j=i();function M(i,o,s){let[c,l,u,d,f,p,g]=o.a,{cosR:_,sinR:v,a:y,b:x,cx:S,cy:C}=b(i,o),w=a([0,0],c,s),T=a([0,0],l,s),E=s[0]*s[4]<0?1-d:d;{let t=y*y*v*v+x*x*_*_,n=2*(x*x-y*y)*v*_,r=y*y*_*_+x*x*v*v,i=-2*t*S-n*C,a=-n*S-2*r*C,o=t*S*S+n*S*C+r*C*C-y*y*x*x;e(O,t,n/2,i/2,n/2,r,a/2,i/2,a/2,o)}if(t(k,s),k==null){let e=a([0,0],i,s);return{a:[w,T,u,d,m(w[1],w[0]),Math.sqrt(h(w,e))/2,0]}}n(A,k),r(j,r(j,A,O),k);{let e=j[0],t=2*j[1],n=j[4],r=2*j[2],i=2*j[5],a=j[8],o=t*t-4*e*n,s=2*(e*i*i+n*r*r-t*r*i+o*a),c=Math.sqrt((e-n)**2+t*t),l=-Math.sqrt(s*(e+n+c))/o,d=-Math.sqrt(s*(e+n-c))/o;return{a:[w,T,u,E,.5*m(-t,n-e),l,d/l]}}}function N(e,t){let[n,r]=e,[i,[a,o],s,c,l,u,d]=t.a,[f,p]=i;if(d<1e-8||u===0){t.a=[i,[0,0],0,0,0,0,0];return}let m=u*d,h=Math.cos(l),g=Math.sin(l);function _(e,t){let n=(e*h+t*g)/u,r=(t*h-e*g)/m;return n*n+r*r}let y=_(n-a,r-o),b=_(f-a,p-o);if(y===1&&b===1)return;if(Math.hypot(f-n,p-r)<1e-8){s?t.a=[i,[0,0],0,0,0,0,0]:t.a[5]=u*Math.sqrt(y);return}let x=(h*(n-f)+g*(r-p))/2,S=(-g*(n-f)+h*(r-p))/2,C=x*x,w=S*S,T=C/(u*u)+w/(m*m);if(T>1){let e=Math.sqrt(T);u*=e,m*=e}let E=u*u,D=m*m,O=E*w+D*C,k=Math.sqrt((E*D-O)/O);isFinite(k)||(k=0),!s==!c&&(k=-k);let A=k*S*u/m,j=-(k*x*m)/u;a=h*A-g*j+(n+f)/2,o=g*A+h*j+(r+p)/2;let M=Math.atan2(r-o,n-a),N=Math.atan2(p-o,f-a);s=+(v(M,N,c)<=Math.PI),t.a[1].splice(0,2,a,o),t.a[2]=s,t.a.splice(5,2,u,m/u)}export{y as DerivedEllipse,C as calculateEllipticArc7Tangent,T as closestPointOnEllipse,b as deriveEllipse,E as ellipticArcExtent,D as ellipticArcLength,S as interpolateEllipse,N as normalizeEllipticArcAfterEndpointChange,w as splitEllipticArc7,M as transformEllipticArc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{floatEqualAbsolute as e}from"../../../core/mathUtils.js";import{squaredDistance as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";function n(e,t,n,r){return e[0]=t[0]*(1-r)+n[0]*r,e[1]=t[1]*(1-r)+n[1]*r,e}function r(e,n){return t(e,n)}function i(e,t,n){let i=r(t,n);if(i===0)return r(t,e);let a=(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]);return a*a/i}function a(e,t,n,r,i){let[a,o]=t,[s,c]=n,[l,u]=r,[d,f]=i,p=(a-s)*(u-f)-(o-c)*(l-d);if(p===0)return null;let m=(a*c-o*s)*(l-d)-(a-s)*(l*f-u*d),h=(a*c-o*s)*(u-f)-(o-c)*(l*f-u*d);return e[0]=m/p,e[1]=h/p,e}const o=Math.PI*2;function s(e,t){let n=Math.atan2(e,t);return n<0?n+o:n}function c(e){return Math.abs(e)%o}function l(e){let t=c(e);return t<Math.PI?t:o-t}function u(e,t){return{min:Math.min(e,t),max:Math.max(e,t)}}function
|
|
2
|
+
import{floatEqualAbsolute as e}from"../../../core/mathUtils.js";import{squaredDistance as t}from"../../../core/libs/gl-matrix-2/math/vec2.js";function n(e,t,n,r){return e[0]=t[0]*(1-r)+n[0]*r,e[1]=t[1]*(1-r)+n[1]*r,e}function r(e,n){return t(e,n)}function i(e,t,n){let i=r(t,n);if(i===0)return r(t,e);let a=(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0]);return a*a/i}function a(e,t,n,r,i){let[a,o]=t,[s,c]=n,[l,u]=r,[d,f]=i,p=(a-s)*(u-f)-(o-c)*(l-d);if(p===0)return null;let m=(a*c-o*s)*(l-d)-(a-s)*(l*f-u*d),h=(a*c-o*s)*(u-f)-(o-c)*(l*f-u*d);return e[0]=m/p,e[1]=h/p,e}const o=Math.PI*2;function s(e,t){let n=Math.atan2(e,t);return n<0?n+o:n}function c(e){return Math.abs(e)%o}function l(e){let t=c(e);return t<Math.PI?t:o-t}function u(e,t,n){if(n)return u(t,e,!n);for(;t<e;)t+=o;return t-e}function d(e,t){return{min:Math.min(e,t),max:Math.max(e,t)}}function f(t,n,r,i){if(e(c(t-n),0))return r?[t,t]:[t,i?t-o:t+o];let[a,s]=i?[t-o,t]:[t,t+o];return[t,p({min:a,max:s},n)]}function p({min:e,max:t},n){let r;return r=t-n,r>=o?(r-=r%o,n+r):(r=n-e,r>=o?(r-=r%o,n-r):n)}function m(e,t){let n=p(e,t);return n>e.min&&n<e.max?n:l(n-e.min)<l(n-e.max)?e.min:e.max}function h(e,t,n,r=10){return t.map(t=>{let i=t;for(let t=0;t<r;t++){let[t,r,a,o,s,c]=n(i),l=e[0]-t,u=e[1]-r,d=-a,f=-o,p=-s,m=-c,h=2*l*d+2*u*f,g=2*d*d+2*l*p+2*f*f+2*u*m,_=-h/(g||1e-6);i+=_}return i})}export{c as angularDistance,l as angularDistanceAlongMinorArc,u as angularDistanceAlongOrientedArc,d as angularRange,m as angularRangeClamp,f as angularRangeOriented,p as angularRangeWrap,r as distance2,h as findClosestAndFurthestCurveParametersToPoint,n as interpolateSegment,a as intersectLineLine,i as pointToSegmentDistance2,s as wrapAtan2};
|
package/interfaces.d.ts
CHANGED
|
@@ -5618,7 +5618,7 @@ declare namespace __esri {
|
|
|
5618
5618
|
export const TimeInfo: typeof import("./layers/support/TimeInfo.js").default;
|
|
5619
5619
|
|
|
5620
5620
|
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
5621
|
-
export type
|
|
5621
|
+
export type TimeSeriesCalculationMethodProperties = import("./layers/support/TimeSeriesCalculationMethod.js").TimeSeriesCalculationMethodProperties;
|
|
5622
5622
|
|
|
5623
5623
|
/** @deprecated since 5.0. Refactor using \@arcgis/codemod */
|
|
5624
5624
|
export type TimeSeriesFieldTimeMappingProperties = import("./layers/support/TimeSeriesFieldTimeMapping.js").TimeSeriesFieldTimeMappingProperties;
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`6.0.0-next.14`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
|
package/layers/CSVLayer.d.ts
CHANGED
|
@@ -927,7 +927,7 @@ export default class CSVLayer extends CSVLayerSuperclass {
|
|
|
927
927
|
*/
|
|
928
928
|
createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
|
|
929
929
|
/**
|
|
930
|
-
* Creates query parameter object that can be used to fetch features from feature-based layers or
|
|
930
|
+
* Creates a query parameter object that can be used to fetch features from feature-based layers or
|
|
931
931
|
* image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/#definitionExpression).
|
|
932
932
|
* It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/#capabilities).
|
|
933
933
|
* It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
package/layers/CatalogLayer.d.ts
CHANGED
|
@@ -425,7 +425,7 @@ export default class CatalogLayer extends CatalogLayerSuperclass {
|
|
|
425
425
|
*/
|
|
426
426
|
createLayerFromFootprint(footprint: Graphic): Promise<Layer>;
|
|
427
427
|
/**
|
|
428
|
-
* Creates query parameter object that can be used to fetch features from feature-based layers or
|
|
428
|
+
* Creates a query parameter object that can be used to fetch features from feature-based layers or
|
|
429
429
|
* image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#definitionExpression).
|
|
430
430
|
* It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/CatalogLayer/#capabilities).
|
|
431
431
|
* It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
package/layers/FeatureLayer.d.ts
CHANGED
|
@@ -1486,7 +1486,7 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
|
|
|
1486
1486
|
*/
|
|
1487
1487
|
createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
|
|
1488
1488
|
/**
|
|
1489
|
-
* Creates query parameter object that can be used to fetch features from feature-based layers or
|
|
1489
|
+
* Creates a query parameter object that can be used to fetch features from feature-based layers or
|
|
1490
1490
|
* image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#definitionExpression).
|
|
1491
1491
|
* It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#capabilities).
|
|
1492
1492
|
* It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
package/layers/GeoJSONLayer.d.ts
CHANGED
|
@@ -1456,7 +1456,7 @@ export default class GeoJSONLayer extends GeoJSONLayerSuperclass {
|
|
|
1456
1456
|
*/
|
|
1457
1457
|
createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
|
|
1458
1458
|
/**
|
|
1459
|
-
* Creates query parameter object that can be used to fetch features from feature-based layers or
|
|
1459
|
+
* Creates a query parameter object that can be used to fetch features from feature-based layers or
|
|
1460
1460
|
* image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/#definitionExpression).
|
|
1461
1461
|
* It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/#capabilities).
|
|
1462
1462
|
* It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
package/layers/ParquetLayer.d.ts
CHANGED
|
@@ -717,7 +717,7 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
|
|
|
717
717
|
*/
|
|
718
718
|
createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
|
|
719
719
|
/**
|
|
720
|
-
* Creates query parameter object that can be used to fetch features from feature-based layers or
|
|
720
|
+
* Creates a query parameter object that can be used to fetch features from feature-based layers or
|
|
721
721
|
* image footprints from ImageryLayer that satisfy the layer's configurations such as [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#definitionExpression).
|
|
722
722
|
* It will return `Z` and `M` values based on the layer's [data capabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/#capabilities).
|
|
723
723
|
* It sets the query parameter's [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
package/layers/SceneLayer.d.ts
CHANGED
|
@@ -1191,12 +1191,11 @@ export default class SceneLayer extends SceneLayerSuperclass {
|
|
|
1191
1191
|
*/
|
|
1192
1192
|
createPopupTemplate(options?: CreatePopupTemplateOptions): PopupTemplate | null | undefined;
|
|
1193
1193
|
/**
|
|
1194
|
-
* Creates a query object that can be used to fetch features that
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1194
|
+
* Creates a query parameter object that can be used to fetch features that satisfy the layer's configurations such as
|
|
1195
|
+
* [definitionExpression](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/#definitionExpression). It sets the query parameter's
|
|
1196
|
+
* [Query.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outFields) property to `["*"]`.
|
|
1197
1197
|
*
|
|
1198
|
-
* @returns The query object representing the layer's
|
|
1199
|
-
* definition expression.
|
|
1198
|
+
* @returns The query parameter object representing the layer's definition expression and other configurations.
|
|
1200
1199
|
* @since 4.3
|
|
1201
1200
|
*/
|
|
1202
1201
|
createQuery(): Query;
|